Update some enum references, render all purchase batch cases/units fields as quantity
This commit is contained in:
parent
feef8a5ecc
commit
0b10021942
|
@ -6,7 +6,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function show_mode(mode) {
|
function show_mode(mode) {
|
||||||
if (mode == ${enum.PURCHASE_BATCH_MODE_NEW}) {
|
if (mode == ${enum.PURCHASE_BATCH_MODE_ORDERING}) {
|
||||||
$('.field-wrapper.store_uuid').show();
|
$('.field-wrapper.store_uuid').show();
|
||||||
$('.field-wrapper.purchase_uuid').hide();
|
$('.field-wrapper.purchase_uuid').hide();
|
||||||
$('.field-wrapper.department_uuid').show();
|
$('.field-wrapper.department_uuid').show();
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
$('.field-wrapper.purchase_uuid select').selectmenu();
|
$('.field-wrapper.purchase_uuid select').selectmenu();
|
||||||
$('.field-wrapper.department_uuid select').selectmenu();
|
$('.field-wrapper.department_uuid select').selectmenu();
|
||||||
|
|
||||||
show_mode(${form.fieldset.model.mode or enum.PURCHASE_BATCH_MODE_NEW});
|
show_mode(${form.fieldset.model.mode or enum.PURCHASE_BATCH_MODE_ORDERING});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
<%def name="leading_buttons()">
|
<%def name="leading_buttons()">
|
||||||
% if batch.mode == enum.PURCHASE_BATCH_MODE_NEW and not batch.complete and not batch.executed and request.has_perm('purchases.batch.order_form'):
|
% if batch.mode == enum.PURCHASE_BATCH_MODE_ORDERING and not batch.complete and not batch.executed and request.has_perm('purchases.batch.order_form'):
|
||||||
<button type="button" id="order-form">Ordering Form</button>
|
<button type="button" id="order-form">Ordering Form</button>
|
||||||
% elif batch.mode == enum.PURCHASE_BATCH_MODE_RECEIVING and not batch.complete and not batch.executed and request.has_perm('purchases.batch.receiving_form'):
|
% elif batch.mode == enum.PURCHASE_BATCH_MODE_RECEIVING and not batch.complete and not batch.executed and request.has_perm('purchases.batch.receiving_form'):
|
||||||
<button type="button" id="receive-form">Receiving Form</button>
|
<button type="button" id="receive-form">Receiving Form</button>
|
||||||
|
|
|
@ -280,7 +280,7 @@ class PurchaseBatchView(BatchMasterView):
|
||||||
kwargs['buyer_uuid'] = batch.buyer_uuid
|
kwargs['buyer_uuid'] = batch.buyer_uuid
|
||||||
kwargs['po_number'] = batch.po_number
|
kwargs['po_number'] = batch.po_number
|
||||||
|
|
||||||
if batch.mode == self.enum.PURCHASE_BATCH_MODE_NEW:
|
if batch.mode == self.enum.PURCHASE_BATCH_MODE_ORDERING:
|
||||||
kwargs['date_ordered'] = batch.date_ordered
|
kwargs['date_ordered'] = batch.date_ordered
|
||||||
|
|
||||||
elif batch.mode == self.enum.PURCHASE_BATCH_MODE_RECEIVING:
|
elif batch.mode == self.enum.PURCHASE_BATCH_MODE_RECEIVING:
|
||||||
|
@ -354,7 +354,7 @@ class PurchaseBatchView(BatchMasterView):
|
||||||
],
|
],
|
||||||
readonly=True)
|
readonly=True)
|
||||||
|
|
||||||
if batch.mode == self.enum.PURCHASE_BATCH_MODE_NEW:
|
if batch.mode == self.enum.PURCHASE_BATCH_MODE_ORDERING:
|
||||||
del g.cases_received
|
del g.cases_received
|
||||||
del g.units_received
|
del g.units_received
|
||||||
del g.invoice_total
|
del g.invoice_total
|
||||||
|
@ -378,7 +378,17 @@ class PurchaseBatchView(BatchMasterView):
|
||||||
super(PurchaseBatchView, self)._preconfigure_row_fieldset(fs)
|
super(PurchaseBatchView, self)._preconfigure_row_fieldset(fs)
|
||||||
fs.upc.set(label="UPC")
|
fs.upc.set(label="UPC")
|
||||||
fs.brand_name.set(label="Brand")
|
fs.brand_name.set(label="Brand")
|
||||||
fs.case_quantity.set(readonly=True)
|
fs.case_quantity.set(renderer=forms.renderers.QuantityFieldRenderer, readonly=True)
|
||||||
|
fs.cases_ordered.set(renderer=forms.renderers.QuantityFieldRenderer)
|
||||||
|
fs.units_ordered.set(renderer=forms.renderers.QuantityFieldRenderer)
|
||||||
|
fs.cases_received.set(renderer=forms.renderers.QuantityFieldRenderer)
|
||||||
|
fs.units_received.set(renderer=forms.renderers.QuantityFieldRenderer)
|
||||||
|
fs.cases_damaged.set(renderer=forms.renderers.QuantityFieldRenderer)
|
||||||
|
fs.units_damaged.set(renderer=forms.renderers.QuantityFieldRenderer)
|
||||||
|
fs.cases_expired.set(renderer=forms.renderers.QuantityFieldRenderer)
|
||||||
|
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_unit_cost.set(label="PO Unit Cost", renderer=forms.renderers.CurrencyFieldRenderer)
|
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.po_total.set(label="PO Total", renderer=forms.renderers.CurrencyFieldRenderer)
|
||||||
fs.invoice_unit_cost.set(renderer=forms.renderers.CurrencyFieldRenderer)
|
fs.invoice_unit_cost.set(renderer=forms.renderers.CurrencyFieldRenderer)
|
||||||
|
@ -444,7 +454,7 @@ class PurchaseBatchView(BatchMasterView):
|
||||||
del fs.product
|
del fs.product
|
||||||
del fs.po_total
|
del fs.po_total
|
||||||
del fs.invoice_total
|
del fs.invoice_total
|
||||||
if batch.mode == self.enum.PURCHASE_BATCH_MODE_NEW:
|
if batch.mode == self.enum.PURCHASE_BATCH_MODE_ORDERING:
|
||||||
del fs.cases_received
|
del fs.cases_received
|
||||||
del fs.units_received
|
del fs.units_received
|
||||||
elif batch.mode == self.enum.PURCHASE_BATCH_MODE_RECEIVING:
|
elif batch.mode == self.enum.PURCHASE_BATCH_MODE_RECEIVING:
|
||||||
|
@ -482,7 +492,7 @@ class PurchaseBatchView(BatchMasterView):
|
||||||
batch = row.batch
|
batch = row.batch
|
||||||
|
|
||||||
# first undo any totals previously in effect for the row
|
# first undo any totals previously in effect for the row
|
||||||
if batch.mode == self.enum.PURCHASE_BATCH_MODE_NEW and row.po_total:
|
if batch.mode == self.enum.PURCHASE_BATCH_MODE_ORDERING and row.po_total:
|
||||||
batch.po_total -= row.po_total
|
batch.po_total -= row.po_total
|
||||||
elif batch.mode == self.enum.PURCHASE_BATCH_MODE_RECEIVING and row.invoice_total:
|
elif batch.mode == self.enum.PURCHASE_BATCH_MODE_RECEIVING and row.invoice_total:
|
||||||
batch.invoice_total -= row.invoice_total
|
batch.invoice_total -= row.invoice_total
|
||||||
|
|
Loading…
Reference in a new issue