Add initial support for receiving truck dump batch via mobile

i.e. just the initial truck dump, but secondary invoice batches are not yet
supported.  also this maybe breaks other things..we'll see
This commit is contained in:
Lance Edgar 2018-05-16 09:15:52 -05:00
parent b515331e48
commit 9ed501a8cc
9 changed files with 214 additions and 62 deletions

View file

@ -75,7 +75,7 @@
${rows_grid|n}
% if not batch.executed:
% if master.handler.executable(batch) and not batch.executed:
<div id="execution-options-dialog" style="display: none;">
${execute_form.render_deform(form_kwargs={'name': 'batch-execution'}, buttons=False)|n}
</div>

View file

@ -10,6 +10,7 @@
${h.javascript_link('https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js')}
${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.mobile.js'))}
${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.js'))}
${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.receiving.js'))}
${self.extra_javascript()}
## since jquery mobile will "utterly cache" the first page which is loaded

View file

@ -20,8 +20,25 @@ ${h.csrf_token(request)}
</div>
<br />
${h.submit('submit', "Find purchase orders")}
## <button type="button">New receiving from scratch</button>
<div id="new-receiving-types" style="display: none;">
${h.hidden('workflow')}
% if master.allow_from_po:
## ${h.submit('submit', "Find purchase orders")}
<button type="button">Receive from PO</button>
% endif
% if master.allow_from_scratch:
<button type="button">Receive from Scratch</button>
% endif
% if master.allow_truck_dump:
<button type="button" id="receive-truck-dump">Receive Truck Dump</button>
% endif
</div>
% else: ## vendor is known

View file

@ -2,9 +2,9 @@
<%inherit file="/mobile/master/view_row.mako" />
<%namespace file="/mobile/keypad.mako" import="keypad" />
<%def name="title()">Receiving &raquo; ${instance.batch.id_str} &raquo; ${row.upc.pretty()}</%def>
<%def name="title()">Receiving &raquo; ${batch.id_str} &raquo; ${row.upc.pretty()}</%def>
<%def name="page_title()">${h.link_to("Receiving", url('mobile.receiving'))} &raquo; ${h.link_to(instance.batch.id_str, url('mobile.receiving.view', uuid=instance.batch_uuid))} &raquo; ${row.upc.pretty()}</%def>
<%def name="page_title()">${h.link_to("Receiving", url('mobile.receiving'))} &raquo; ${h.link_to(batch.id_str, url('mobile.receiving.view', uuid=batch.uuid))} &raquo; ${row.upc.pretty()}</%def>
<%
unit_uom = 'LB' if row.product and row.product.weighed else 'EA'
@ -20,7 +20,7 @@
% if instance.product:
<h3>${instance.brand_name or ""}</h3>
<h3>${instance.description} ${instance.size}</h3>
<h3>${h.pretty_quantity(row.case_quantity)} ${unit_uom} per CS</h3>
<h3>1 CS = ${h.pretty_quantity(row.case_quantity)} ${unit_uom}</h3>
% else:
<h3>${instance.description}</h3>
% endif
@ -32,10 +32,12 @@
<table>
<tbody>
<tr>
<td>ordered</td>
<td>${h.pretty_quantity(row.cases_ordered or 0)} / ${h.pretty_quantity(row.units_ordered or 0)}</td>
</tr>
% if not batch.truck_dump:
<tr>
<td>ordered</td>
<td>${h.pretty_quantity(row.cases_ordered or 0)} / ${h.pretty_quantity(row.units_ordered or 0)}</td>
</tr>
% endif
<tr>
<td>received</td>
<td>${h.pretty_quantity(row.cases_received or 0)} / ${h.pretty_quantity(row.units_received or 0)}</td>
@ -57,7 +59,7 @@
% endfor
% endif
% if not instance.batch.executed and not instance.batch.complete:
% if not batch.executed and not batch.complete:
${h.form(request.current_route_url(), class_='receiving-update')}
${h.csrf_token(request)}
@ -98,5 +100,10 @@
</tbody>
</table>
${h.hidden('delete_row', value='false')}
% if request.has_perm('{}.delete_row'.format(permission_prefix)):
<button type="button" id="delete-receiving-row">Delete this Row</button>
% endif
${h.end_form()}
% endif