Clean up some purchasing views

This commit is contained in:
Lance Edgar 2020-03-19 14:36:43 -05:00
parent 3223a77cb1
commit ad9c193061
2 changed files with 9 additions and 1 deletions

View file

@ -54,7 +54,9 @@ class PurchaseView(MasterView):
'department', 'department',
'buyer', 'buyer',
'date_ordered', 'date_ordered',
'po_total',
'date_received', 'date_received',
'invoice_total',
'invoice_number', 'invoice_number',
'status', 'status',
] ]
@ -177,7 +179,13 @@ class PurchaseView(MasterView):
g.filters['status'].verbs = ['equal', 'not_equal', 'is_any'] g.filters['status'].verbs = ['equal', 'not_equal', 'is_any']
g.filters['status'].default_verb = 'is_any' g.filters['status'].default_verb = 'is_any'
g.set_type('po_total', 'currency')
g.set_type('invoice_total', 'currency')
g.set_label('invoice_number', "Invoice No.") g.set_label('invoice_number', "Invoice No.")
g.set_link('date_ordered')
g.set_link('po_total')
g.set_link('date_received')
g.set_link('invoice_total')
def configure_form(self, f): def configure_form(self, f):
super(PurchaseView, self).configure_form(f) super(PurchaseView, self).configure_form(f)

View file

@ -520,7 +520,7 @@ class PurchasingBatchView(BatchMasterView):
elif purchase.status == self.enum.PURCHASE_STATUS_RECEIVED: elif purchase.status == self.enum.PURCHASE_STATUS_RECEIVED:
date = purchase.date_received date = purchase.date_received
total = purchase.invoice_total total = purchase.invoice_total
return '{} for ${:0,.2f} ({})'.format(date, total, purchase.department or purchase.buyer) return '{} for ${:0,.2f} ({})'.format(date, total or 0, purchase.department or purchase.buyer)
def get_batch_kwargs(self, batch, mobile=False): def get_batch_kwargs(self, batch, mobile=False):
kwargs = super(PurchasingBatchView, self).get_batch_kwargs(batch, mobile=mobile) kwargs = super(PurchasingBatchView, self).get_batch_kwargs(batch, mobile=mobile)