Use 'today' as fallback date for ordering worksheet

This commit is contained in:
Lance Edgar 2018-03-21 10:42:50 -05:00
parent 79b1502920
commit fde5398455
2 changed files with 6 additions and 2 deletions

View file

@ -224,12 +224,12 @@ ${h.end_form()}
% endfor
% if not ignore_cases:
<th>
${batch.date_ordered.strftime('%m/%d')}<br />
${order_date.strftime('%m/%d')}<br />
Cases
</th>
% endif
<th>
${batch.date_ordered.strftime('%m/%d')}<br />
${order_date.strftime('%m/%d')}<br />
Units
</th>
<th>PO Total</th>

View file

@ -170,8 +170,12 @@ class OrderingBatchView(PurchasingBatchView):
history = list(reversed(history))
title = self.get_instance_title(batch)
order_date = batch.date_ordered
if not order_date:
order_date = localtime(self.rattail_config).date()
return self.render_to_response('worksheet', {
'batch': batch,
'order_date': order_date,
'instance': batch,
'instance_title': title,
'instance_url': self.get_action_url('view', batch),