Declare row fields for vendor catalog batches

also exposes new "allowance" fields
This commit is contained in:
Lance Edgar 2019-04-18 17:02:24 -05:00
parent 95fb78f645
commit a66ea53743

View file

@ -95,6 +95,35 @@ class VendorCatalogsView(FileBatchMasterView):
'status_code',
]
row_form_fields = [
'sequence',
'item_entry',
'product',
'upc',
'brand_name',
'description',
'size',
'old_vendor_code',
'vendor_code',
'old_case_size',
'case_size',
'old_case_cost',
'case_cost',
'case_cost_diff',
'old_unit_cost',
'unit_cost',
'unit_cost_diff',
'suggested_retail',
'starts',
'ends',
'discount_starts',
'discount_ends',
'discount_amount',
'discount_percent',
'status_code',
'status_text',
]
def get_parsers(self):
if not hasattr(self, 'parsers'):
self.parsers = sorted(iter_catalog_parsers(), key=lambda p: p.display)
@ -197,6 +226,7 @@ class VendorCatalogsView(FileBatchMasterView):
def configure_row_form(self, f):
super(VendorCatalogsView, self).configure_row_form(f)
f.set_renderer('product', self.render_product)
f.set_type('discount_percent', 'percent')
def template_kwargs_create(self, **kwargs):
parsers = self.get_parsers()