Use upload time as default filter/sort for Trainwreck transactions

also show end time, upload time as grid columns
This commit is contained in:
Lance Edgar 2018-07-11 13:30:48 -05:00
parent 9caf0e2e1f
commit aa6e540abd

View file

@ -54,6 +54,8 @@ class TransactionView(MasterView):
grid_columns = [
'start_time',
'end_time',
'upload_time',
'system',
'terminal_id',
'receipt_number',
@ -127,10 +129,10 @@ class TransactionView(MasterView):
super(TransactionView, self).configure_grid(g)
g.filters['receipt_number'].default_active = True
g.filters['receipt_number'].default_verb = 'equal'
g.filters['start_time'].default_active = True
g.filters['start_time'].default_verb = 'equal'
g.filters['start_time'].default_value = six.text_type(localtime(self.rattail_config).date())
g.set_sort_defaults('start_time', 'desc')
g.filters['upload_time'].default_active = True
g.filters['upload_time'].default_verb = 'equal'
g.filters['upload_time'].default_value = six.text_type(localtime(self.rattail_config).date())
g.set_sort_defaults('upload_time', 'desc')
g.set_enum('system', self.enum.TRAINWRECK_SYSTEM)
g.set_type('total', 'currency')
@ -139,6 +141,8 @@ class TransactionView(MasterView):
g.set_label('customer_id', "Customer ID")
g.set_link('start_time')
g.set_link('end_time')
g.set_link('upload_time')
g.set_link('receipt_number')
g.set_link('customer_id')
g.set_link('customer_name')