Expose new "calculated" invoice totals for receiving batch, rows

This commit is contained in:
Lance Edgar 2019-03-07 17:05:25 -06:00
parent 3760c3239f
commit d337defb09
2 changed files with 44 additions and 4 deletions

View file

@ -144,6 +144,7 @@ class PurchasingBatchView(BatchMasterView):
'invoice_line_number',
'invoice_unit_cost',
'invoice_total',
'invoice_total_calculated',
'status_code',
'credits',
]
@ -205,6 +206,14 @@ class PurchasingBatchView(BatchMasterView):
g.filters['complete'].default_active = True
g.filters['complete'].default_verb = 'is_true'
# invoice_total
g.set_type('invoice_total', 'currency')
g.set_label('invoice_total', "Total")
# invoice_total_calculated
g.set_type('invoice_total_calculated', 'currency')
g.set_label('invoice_total_calculated', "Total")
g.set_label('date_ordered', "Ordered")
g.set_label('date_received', "Received")
@ -347,6 +356,10 @@ class PurchasingBatchView(BatchMasterView):
f.set_readonly('invoice_total')
f.set_type('invoice_total', 'currency')
# invoice_total_calculated
f.set_readonly('invoice_total_calculated')
f.set_type('invoice_total_calculated', 'currency')
# vendor_email
f.set_readonly('vendor_email')
f.set_renderer('vendor_email', self.render_vendor_email)
@ -603,7 +616,6 @@ class PurchasingBatchView(BatchMasterView):
g.set_type('cases_received', 'quantity')
g.set_type('units_received', 'quantity')
g.set_type('po_total', 'currency')
g.set_type('invoice_total', 'currency')
g.set_type('credits', 'boolean')
# we only want the grid column to have abbreviated label, but *not* the filter
@ -617,8 +629,15 @@ class PurchasingBatchView(BatchMasterView):
g.set_label('units_received', "Units Rec.")
g.filters['units_received'].label = "Units Received"
g.set_label('po_total', "Total")
# invoice_total
g.set_type('invoice_total', 'currency')
g.set_label('invoice_total', "Total")
# invoice_total_calculated
g.set_type('invoice_total_calculated', 'currency')
g.set_label('invoice_total_calculated', "Total")
g.set_label('po_total', "Total")
g.set_label('credits', "Credits?")
def make_row_grid_tools(self, batch):
@ -664,11 +683,20 @@ class PurchasingBatchView(BatchMasterView):
f.set_type('po_unit_cost', 'currency')
f.set_type('po_total', 'currency')
f.set_type('invoice_unit_cost', 'currency')
f.set_type('invoice_total', 'currency')
# upc
f.set_type('upc', 'gpc')
# invoice total
f.set_readonly('invoice_total')
f.set_type('invoice_total', 'currency')
f.set_label('invoice_total', "Invoice Total (Orig.)")
# invoice total_calculated
f.set_readonly('invoice_total_calculated')
f.set_type('invoice_total_calculated', 'currency')
f.set_label('invoice_total_calculated', "Invoice Total (Calc.)")
# credits
f.set_readonly('credits')
f.set_renderer('credits', self.render_row_credits)