From e9dd44fa390cc51d60472366940e70914ecf3d9d Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 30 Dec 2016 07:52:56 -0600 Subject: [PATCH] Tweak the "create" screen for purchase batches, for more customization Also add some fields to the batch row fieldset --- tailbone/templates/purchases/batches/create.mako | 2 +- tailbone/views/purchases/batch.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tailbone/templates/purchases/batches/create.mako b/tailbone/templates/purchases/batches/create.mako index a26bb954..0cea8c6a 100644 --- a/tailbone/templates/purchases/batches/create.mako +++ b/tailbone/templates/purchases/batches/create.mako @@ -48,7 +48,7 @@ alert(data.error); } else { $.each(data.purchases, function(i, purchase) { - purchases.append($('')); + purchases.append($('')); }); } }); diff --git a/tailbone/views/purchases/batch.py b/tailbone/views/purchases/batch.py index 8fe32e11..85099900 100644 --- a/tailbone/views/purchases/batch.py +++ b/tailbone/views/purchases/batch.py @@ -253,7 +253,7 @@ class PurchaseBatchView(BatchMasterView): purchases = purchases.filter(model.Purchase.status == self.enum.PURCHASE_STATUS_RECEIVED)\ .order_by(model.Purchase.date_received, model.Purchase.created) - return {'purchases': [{'uuid': p.uuid, 'display': self.render_eligible_purchase(p)} + return {'purchases': [{'key': p.uuid, 'display': self.render_eligible_purchase(p)} for p in purchases]} def render_eligible_purchase(self, purchase): @@ -395,6 +395,7 @@ class PurchaseBatchView(BatchMasterView): fs.units_expired.set(renderer=forms.renderers.QuantityFieldRenderer) fs.cases_mispick.set(renderer=forms.renderers.QuantityFieldRenderer) fs.units_mispick.set(renderer=forms.renderers.QuantityFieldRenderer) + fs.po_line_number.set(label="PO Line Number") fs.po_unit_cost.set(label="PO Unit Cost", renderer=forms.renderers.CurrencyFieldRenderer) fs.po_total.set(label="PO Total", renderer=forms.renderers.CurrencyFieldRenderer) fs.invoice_unit_cost.set(renderer=forms.renderers.CurrencyFieldRenderer) @@ -447,8 +448,10 @@ class PurchaseBatchView(BatchMasterView): fs.units_expired, fs.cases_mispick, fs.units_mispick, + fs.po_line_number, fs.po_unit_cost, fs.po_total, + fs.invoice_line_number, fs.invoice_unit_cost, fs.invoice_total, fs.status_code,