From ad9c193061d38039cb36d91dbe079fc4a38e198b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 19 Mar 2020 14:36:43 -0500 Subject: [PATCH] Clean up some purchasing views --- tailbone/views/purchases/core.py | 8 ++++++++ tailbone/views/purchasing/batch.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tailbone/views/purchases/core.py b/tailbone/views/purchases/core.py index bc39fc3e..fbb77bc9 100644 --- a/tailbone/views/purchases/core.py +++ b/tailbone/views/purchases/core.py @@ -54,7 +54,9 @@ class PurchaseView(MasterView): 'department', 'buyer', 'date_ordered', + 'po_total', 'date_received', + 'invoice_total', 'invoice_number', 'status', ] @@ -177,7 +179,13 @@ class PurchaseView(MasterView): g.filters['status'].verbs = ['equal', 'not_equal', '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_link('date_ordered') + g.set_link('po_total') + g.set_link('date_received') + g.set_link('invoice_total') def configure_form(self, f): super(PurchaseView, self).configure_form(f) diff --git a/tailbone/views/purchasing/batch.py b/tailbone/views/purchasing/batch.py index 8b557188..96f0d18c 100644 --- a/tailbone/views/purchasing/batch.py +++ b/tailbone/views/purchasing/batch.py @@ -520,7 +520,7 @@ class PurchasingBatchView(BatchMasterView): elif purchase.status == self.enum.PURCHASE_STATUS_RECEIVED: date = purchase.date_received 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): kwargs = super(PurchasingBatchView, self).get_batch_kwargs(batch, mobile=mobile)