Tweaks for cost editing within a receiving batch

never show PO Cost column in row grid, since Invoice Cost is what
receiving is most concerned with

add "zig-zag" entry behavior when both catalog and invoice costs are editable
This commit is contained in:
Lance Edgar 2023-09-02 11:39:49 -05:00
parent 75caface6b
commit bd7e6f9f8a
2 changed files with 44 additions and 47 deletions

View file

@ -162,7 +162,6 @@ class ReceivingBatchView(PurchasingBatchView):
'cases_received',
'units_received',
'catalog_unit_cost',
'po_unit_cost',
'invoice_unit_cost',
'invoice_total_calculated',
'credits',
@ -979,14 +978,6 @@ class ReceivingBatchView(PurchasingBatchView):
g.set_click_handler('invoice_unit_cost',
'this.invoiceUnitCostClicked')
# nb. only show PO *or* invoice cost; prefer the latter unless
# we have a PO and no invoice
if (self.batch_handler.has_purchase_order(batch)
and not self.batch_handler.has_invoice_file(batch)):
g.remove('invoice_unit_cost')
else:
g.remove('po_unit_cost')
# credits
# note that sorting by credits involves a subquery with group by clause.
# seems likely there may be a better way? but this seems to work fine