Add config for showing ordered vs. shipped amounts when receiving
This commit is contained in:
parent
86a42064ea
commit
0ead06106c
|
@ -53,6 +53,29 @@
|
|||
|
||||
</div>
|
||||
|
||||
<h3 class="block is-size-3">Display</h3>
|
||||
<div class="block" style="padding-left: 2rem;">
|
||||
|
||||
<b-field>
|
||||
<b-checkbox name="rattail.batch.purchase.receiving.show_ordered_column_in_grid"
|
||||
v-model="simpleSettings['rattail.batch.purchase.receiving.show_ordered_column_in_grid']"
|
||||
native-value="true"
|
||||
@input="settingsNeedSaved = true">
|
||||
Show "ordered" quantities in row grid
|
||||
</b-checkbox>
|
||||
</b-field>
|
||||
|
||||
<b-field>
|
||||
<b-checkbox name="rattail.batch.purchase.receiving.show_shipped_column_in_grid"
|
||||
v-model="simpleSettings['rattail.batch.purchase.receiving.show_shipped_column_in_grid']"
|
||||
native-value="true"
|
||||
@input="settingsNeedSaved = true">
|
||||
Show "shipped" quantities in row grid
|
||||
</b-checkbox>
|
||||
</b-field>
|
||||
|
||||
</div>
|
||||
|
||||
<h3 class="block is-size-3">Product Handling</h3>
|
||||
<div class="block" style="padding-left: 2rem;">
|
||||
|
||||
|
|
|
@ -159,6 +159,8 @@ class ReceivingBatchView(PurchasingBatchView):
|
|||
'description',
|
||||
'size',
|
||||
'department_name',
|
||||
'cases_ordered',
|
||||
'units_ordered',
|
||||
'cases_shipped',
|
||||
'units_shipped',
|
||||
'cases_received',
|
||||
|
@ -904,6 +906,20 @@ class ReceivingBatchView(PurchasingBatchView):
|
|||
g.set_joiner('credits', lambda q: q.outerjoin(Credits))
|
||||
g.sorters['credits'] = lambda q, d: q.order_by(getattr(Credits.c.credit_count, d)())
|
||||
|
||||
show_ordered = self.rattail_config.getbool(
|
||||
'rattail.batch', 'purchase.receiving.show_ordered_column_in_grid',
|
||||
default=False)
|
||||
if not show_ordered:
|
||||
g.remove('cases_ordered',
|
||||
'units_ordered')
|
||||
|
||||
show_shipped = self.rattail_config.getbool(
|
||||
'rattail.batch', 'purchase.receiving.show_shipped_column_in_grid',
|
||||
default=False)
|
||||
if not show_shipped:
|
||||
g.remove('cases_shipped',
|
||||
'units_shipped')
|
||||
|
||||
# hide 'ordered' columns for truck dump parent, if its "children first"
|
||||
# flag is set, since that batch type is only concerned with receiving
|
||||
if batch.is_truck_dump_parent() and not batch.truck_dump_children_first:
|
||||
|
@ -1851,6 +1867,14 @@ class ReceivingBatchView(PurchasingBatchView):
|
|||
'option': 'purchase.allow_truck_dump_receiving',
|
||||
'type': bool},
|
||||
|
||||
# display
|
||||
{'section': 'rattail.batch',
|
||||
'option': 'purchase.receiving.show_ordered_column_in_grid',
|
||||
'type': bool},
|
||||
{'section': 'rattail.batch',
|
||||
'option': 'purchase.receiving.show_shipped_column_in_grid',
|
||||
'type': bool},
|
||||
|
||||
# product handling
|
||||
{'section': 'rattail.batch',
|
||||
'option': 'purchase.allow_cases',
|
||||
|
|
Loading…
Reference in a new issue