Tweaks to improve handling of "missing" items for receiving
This commit is contained in:
parent
e894d1d1f4
commit
70956a2c47
|
@ -280,6 +280,15 @@ class ReceivingBatchRowViews(APIBatchRowView):
|
||||||
]},
|
]},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# is_missing
|
||||||
|
elif filtr['field'] == 'is_missing' and filtr['op'] == 'eq' and filtr['value'] is True:
|
||||||
|
filters.extend([
|
||||||
|
{'or': [
|
||||||
|
{'field': 'cases_missing', 'op': '!=', 'value': 0},
|
||||||
|
{'field': 'units_missing', 'op': '!=', 'value': 0},
|
||||||
|
]},
|
||||||
|
])
|
||||||
|
|
||||||
else: # just some filter, use as-is
|
else: # just some filter, use as-is
|
||||||
filters.append(filtr)
|
filters.append(filtr)
|
||||||
|
|
||||||
|
@ -326,6 +335,9 @@ class ReceivingBatchRowViews(APIBatchRowView):
|
||||||
data['cases_expired'] = row.cases_expired
|
data['cases_expired'] = row.cases_expired
|
||||||
data['units_expired'] = row.units_expired
|
data['units_expired'] = row.units_expired
|
||||||
|
|
||||||
|
data['cases_missing'] = row.cases_missing
|
||||||
|
data['units_missing'] = row.units_missing
|
||||||
|
|
||||||
cases, units = self.batch_handler.get_unconfirmed_counts(row)
|
cases, units = self.batch_handler.get_unconfirmed_counts(row)
|
||||||
data['cases_unconfirmed'] = cases
|
data['cases_unconfirmed'] = cases
|
||||||
data['units_unconfirmed'] = units
|
data['units_unconfirmed'] = units
|
||||||
|
|
|
@ -151,6 +151,15 @@
|
||||||
</b-checkbox>
|
</b-checkbox>
|
||||||
</b-field>
|
</b-field>
|
||||||
|
|
||||||
|
<b-field>
|
||||||
|
<b-checkbox name="rattail.batch.purchase.receiving.auto_missing_credits"
|
||||||
|
v-model="simpleSettings['rattail.batch.purchase.receiving.auto_missing_credits']"
|
||||||
|
native-value="true"
|
||||||
|
@input="settingsNeedSaved = true">
|
||||||
|
Auto-generate "missing" (DNR) credits for items not accounted for
|
||||||
|
</b-checkbox>
|
||||||
|
</b-field>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="block is-size-3">Mobile Interface</h3>
|
<h3 class="block is-size-3">Mobile Interface</h3>
|
||||||
|
|
|
@ -96,10 +96,12 @@ class PurchaseCreditView(MasterView):
|
||||||
]
|
]
|
||||||
|
|
||||||
def configure_grid(self, g):
|
def configure_grid(self, g):
|
||||||
super(PurchaseCreditView, self).configure_grid(g)
|
super().configure_grid(g)
|
||||||
|
|
||||||
|
# vendor
|
||||||
g.set_joiner('vendor', lambda q: q.outerjoin(model.Vendor))
|
g.set_joiner('vendor', lambda q: q.outerjoin(model.Vendor))
|
||||||
g.set_sorter('vendor', model.Vendor.name)
|
g.set_sorter('vendor', model.Vendor.name)
|
||||||
|
g.set_filter('vendor', model.Vendor.name, label="Vendor Name")
|
||||||
|
|
||||||
g.set_sort_defaults('date_received', 'desc')
|
g.set_sort_defaults('date_received', 'desc')
|
||||||
|
|
||||||
|
|
|
@ -1935,6 +1935,9 @@ class ReceivingBatchView(PurchasingBatchView):
|
||||||
{'section': 'rattail.batch',
|
{'section': 'rattail.batch',
|
||||||
'option': 'purchase.receiving.allow_edit_invoice_unit_cost',
|
'option': 'purchase.receiving.allow_edit_invoice_unit_cost',
|
||||||
'type': bool},
|
'type': bool},
|
||||||
|
{'section': 'rattail.batch',
|
||||||
|
'option': 'purchase.receiving.auto_missing_credits',
|
||||||
|
'type': bool},
|
||||||
|
|
||||||
# mobile interface
|
# mobile interface
|
||||||
{'section': 'rattail.batch',
|
{'section': 'rattail.batch',
|
||||||
|
|
Loading…
Reference in a new issue