Use currency formatting for costs in vendor catalog batch

and related tweaks
This commit is contained in:
Lance Edgar 2019-12-04 16:51:55 -06:00
parent 7b5ac7eba4
commit a96c5712ab

View file

@ -59,12 +59,12 @@ class VendorCatalogsView(FileBatchMasterView):
grid_columns = [
'id',
'created',
'created_by',
'vendor',
'effective',
'filename',
'rowcount',
'created',
'created_by',
'executed',
]
@ -138,6 +138,9 @@ class VendorCatalogsView(FileBatchMasterView):
default_active=True, default_verb='contains')
g.sorters['vendor'] = g.make_sorter(model.Vendor.name)
g.set_link('vendor')
g.set_link('filename')
def get_instance_title(self, batch):
return six.text_type(batch.vendor)
@ -209,6 +212,10 @@ class VendorCatalogsView(FileBatchMasterView):
if not batch.future:
g.hide_column('starts')
g.set_type('old_unit_cost', 'currency')
g.set_type('unit_cost', 'currency')
g.set_type('unit_cost_diff', 'currency')
g.set_type('unit_cost_diff_percent', 'percent')
g.set_label('unit_cost_diff_percent', "Diff. %")