Various improvements to batch worksheets, index links etc.

This commit is contained in:
Lance Edgar 2017-08-01 14:42:32 -05:00
parent 00027b09f6
commit 0171f3ebba
7 changed files with 13 additions and 29 deletions

View file

@ -7,6 +7,10 @@
## ##############################################################################
<%inherit file="/mobile/base.mako" />
<%def name="title()">${model_title_plural}</%def>
<%def name="title()">${index_title}</%def>
% if master.mobile_creatable and request.has_perm('{}.create'.format(permission_prefix)):
${h.link_to("New {}".format(model_title), url('mobile.{}.create'.format(route_prefix)), class_='ui-btn ui-corner-all')}
% endif
${grid.render_complete()|n}

View file

@ -1,10 +0,0 @@
## -*- coding: utf-8; -*-
<%inherit file="/mobile/master/index.mako" />
<%def name="title()">Receiving</%def>
% if request.has_perm('receiving.create'):
${h.link_to("New Receiving Batch", url('mobile.receiving.create'), class_='ui-btn ui-corner-all')}
% endif
${parent.body()}

View file

@ -1,7 +1,7 @@
## -*- coding: utf-8; -*-
<%inherit file="/base.mako" />
<%def name="title()">Purchase Order Form</%def>
<%def name="title()">Ordering Worksheet</%def>
<%def name="extra_javascript()">
${parent.extra_javascript()}
@ -237,8 +237,8 @@ ${h.end_form()}
</tr>
</thead>
<tbody>
% for cost in subdepartment._order_costs:
<tr data-uuid="${cost.product_uuid}">
% for i, cost in enumerate(subdepartment._order_costs, 1):
<tr data-uuid="${cost.product_uuid}" class="${'even' if i % 2 == 0 else 'odd'}">
${self.order_form_row(cost)}
% for data in history:
<td class="scratch_pad">
@ -270,7 +270,7 @@ ${h.end_form()}
<td class="current-order">
${h.text('units_ordered_{}'.format(cost.uuid), value=int(cost._batchrow.units_ordered or 0) if cost._batchrow else None)}
</td>
<td class="po-total">${'${:0,.2f}'.format(cost._batchrow.po_total) if cost._batchrow else ''}</td>
<td class="po-total">${'${:0,.2f}'.format(cost._batchrow.po_total or 0) if cost._batchrow else ''}</td>
${self.extra_td(cost)}
</tr>
% endfor

View file

@ -36,7 +36,7 @@
<%def name="leading_buttons()">
% if not batch.complete and not batch.executed and request.has_perm('ordering.order_form'):
<button type="button" id="order-form">Ordering Form</button>
<button type="button" id="order-form">Edit as Worksheet</button>
% endif
</%def>

View file

@ -1,11 +0,0 @@
## -*- coding: utf-8; -*-
<%inherit file="/master/index.mako" />
<%def name="context_menu_items()">
${parent.context_menu_items()}
% if request.has_perm('purchases.batch.list'):
<li>${h.link_to("Go to Purchasing Batches", url('purchases.batch'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -50,6 +50,7 @@ class OrderingBatchView(PurchasingBatchView):
url_prefix = '/ordering'
model_title = "Ordering Batch"
model_title_plural = "Ordering Batches"
index_title = "Ordering"
row_grid_columns = [
'sequence',
@ -144,8 +145,7 @@ class OrderingBatchView(PurchasingBatchView):
'batch': batch,
'instance': batch,
'instance_title': title,
'index_title': "{}: {}".format(self.get_model_title(), title),
'index_url': self.get_action_url('view', batch),
'instance_url': self.get_action_url('view', batch),
'vendor': batch.vendor,
'departments': departments,
'history': history,

View file

@ -88,6 +88,7 @@ class ReceivingBatchView(PurchasingBatchView):
url_prefix = '/receiving'
model_title = "Receiving Batch"
model_title_plural = "Receiving Batches"
index_title = "Receiving"
creatable = False
rows_deletable = False
mobile_creatable = True