Misc. improvements for desktop receiving views
- don't expose "cases" if config says not to - don't expose "expired" if config says not to - use `numeric-input` for quantity fields - add `product_key_field` to global-ish template context
This commit is contained in:
parent
92a52133de
commit
17810d9cae
7 changed files with 125 additions and 84 deletions
|
@ -803,7 +803,9 @@ class PurchasingBatchView(BatchMasterView):
|
|||
app = self.get_rattail_app()
|
||||
cases = getattr(row, 'cases_{}'.format(field))
|
||||
units = getattr(row, 'units_{}'.format(field))
|
||||
return app.render_cases_units(cases, units)
|
||||
# nb. do not render anything if empty quantities
|
||||
if cases or units:
|
||||
return app.render_cases_units(cases, units)
|
||||
|
||||
def make_row_credits_grid(self, row):
|
||||
use_buefy = self.get_use_buefy()
|
||||
|
@ -815,8 +817,6 @@ class PurchasingBatchView(BatchMasterView):
|
|||
data=[] if use_buefy else row.credits,
|
||||
columns=[
|
||||
'credit_type',
|
||||
# 'cases_shorted',
|
||||
# 'units_shorted',
|
||||
'shorted',
|
||||
'credit_total',
|
||||
'expiration_date',
|
||||
|
@ -827,20 +827,19 @@ class PurchasingBatchView(BatchMasterView):
|
|||
],
|
||||
labels={
|
||||
'credit_type': "Type",
|
||||
'cases_shorted': "Cases",
|
||||
'units_shorted': "Units",
|
||||
'shorted': "Quantity",
|
||||
'credit_total': "Total",
|
||||
'mispick_upc': "Mispick UPC",
|
||||
'mispick_brand_name': "MP Brand",
|
||||
'mispick_description': "MP Description",
|
||||
'mispick_size': "MP Size",
|
||||
# 'mispick_upc': "Mispick UPC",
|
||||
# 'mispick_brand_name': "MP Brand",
|
||||
# 'mispick_description': "MP Description",
|
||||
# 'mispick_size': "MP Size",
|
||||
})
|
||||
|
||||
g.set_type('cases_shorted', 'quantity')
|
||||
g.set_type('units_shorted', 'quantity')
|
||||
g.set_type('credit_total', 'currency')
|
||||
|
||||
if not self.batch_handler.allow_expired_credits():
|
||||
g.remove('expiration_date')
|
||||
|
||||
return g
|
||||
|
||||
def render_row_credits(self, row, field):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue