Expose "discount type" for Trainwrewck line items

This commit is contained in:
Lance Edgar 2022-02-24 10:39:11 -06:00
parent 3553f23eab
commit 2290d9f990

View file

@ -254,7 +254,8 @@ class TransactionView(MasterView):
g = factory(
key='{}.discounts'.format(route_prefix),
data=[] if use_buefy else item.discounts,
columns=['description', 'amount'],
columns=['discount_type', 'description', 'amount'],
labels={'discount_type': "Type"},
request=self.request)
if use_buefy:
@ -273,6 +274,7 @@ class TransactionView(MasterView):
discounts_data = []
for discount in item.discounts:
discounts_data.append({
'discount_type': discount.discount_type,
'description': discount.description,
'amount': app.render_currency(discount.amount),
})