Tweak the "create" screen for purchase batches, for more customization

Also add some fields to the batch row fieldset
This commit is contained in:
Lance Edgar 2016-12-30 07:52:56 -06:00
parent 01ed68a3fe
commit e9dd44fa39
2 changed files with 5 additions and 2 deletions

View file

@ -48,7 +48,7 @@
alert(data.error);
} else {
$.each(data.purchases, function(i, purchase) {
purchases.append($('<option value="' + purchase.uuid + '">' + purchase.display + '</option>'));
purchases.append($('<option value="' + purchase.key + '">' + purchase.display + '</option>'));
});
}
});

View file

@ -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,