diff --git a/tailbone/templates/mobile/receiving/view.mako b/tailbone/templates/mobile/receiving/view.mako index 1ae3691f..25c560f1 100644 --- a/tailbone/templates/mobile/receiving/view.mako +++ b/tailbone/templates/mobile/receiving/view.mako @@ -6,8 +6,10 @@ ${form.render()|n}
-${h.text('upc-search', class_='receiving-upc-search', placeholder="Enter UPC", autocomplete='off', **{'data-type': 'search', 'data-url': url('mobile.receiving.lookup', uuid=batch.uuid)})} -
+% if not instance.executed and not instance.complete: + ${h.text('upc-search', class_='receiving-upc-search', placeholder="Enter UPC", autocomplete='off', **{'data-type': 'search', 'data-url': url('mobile.receiving.lookup', uuid=batch.uuid)})} +
+% endif ${grid.render_complete()|n} diff --git a/tailbone/templates/mobile/receiving/view_row.mako b/tailbone/templates/mobile/receiving/view_row.mako index 6ff114d5..7c68574d 100644 --- a/tailbone/templates/mobile/receiving/view_row.mako +++ b/tailbone/templates/mobile/receiving/view_row.mako @@ -48,80 +48,82 @@ % endfor % endif - - - - - - - - - - - - - - - - - - - - - - - -
${h.link_to("7", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("8", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("9", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}
${h.link_to("4", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("5", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("6", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}
${h.link_to("1", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("2", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("3", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}
${h.link_to("0", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to(".", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("Del", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}
+% if not instance.batch.executed and not instance.batch.complete: + + + + + + + + + + + + + + + + + + + + + + + +
${h.link_to("7", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("8", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("9", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}
${h.link_to("4", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("5", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("6", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}
${h.link_to("1", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("2", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("3", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}
${h.link_to("0", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to(".", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}${h.link_to("Del", '#', class_='keypad-button ui-btn ui-btn-inline ui-corner-all')}
-${h.form(request.current_route_url(), class_='receiving-update')} -${h.csrf_token(request)} -${h.hidden('row', value=row.uuid)} -${h.hidden('cases')} -${h.hidden('units')} -${h.hidden('expiration_date')} + ${h.form(request.current_route_url(), class_='receiving-update')} + ${h.csrf_token(request)} + ${h.hidden('row', value=row.uuid)} + ${h.hidden('cases')} + ${h.hidden('units')} + ${h.hidden('expiration_date')} -<% - uom = 'CS' - if row.units_ordered and not row.cases_ordered: - uom = 'EA' -%> -
- - - ${h.radio('receiving-uom', value='CS', checked=uom == 'CS', label="CS")} - ${h.radio('receiving-uom', value=unit_uom, checked=uom == unit_uom, label=unit_uom)} -
+ <% + uom = 'CS' + if row.units_ordered and not row.cases_ordered: + uom = 'EA' + %> +
+ + + ${h.radio('receiving-uom', value='CS', checked=uom == 'CS', label="CS")} + ${h.radio('receiving-uom', value=unit_uom, checked=uom == unit_uom, label=unit_uom)} +
- - - - - - - - - -
-
- ${h.radio('mode', value='received', label="received", checked=True)} - ${h.radio('mode', value='damaged', label="damaged")} - ${h.radio('mode', value='expired', label="expired")} -
-
-
- - - ## -
-
+ + + + + + + + + +
+
+ ${h.radio('mode', value='received', label="received", checked=True)} + ${h.radio('mode', value='damaged', label="damaged")} + ${h.radio('mode', value='expired', label="expired")} +
+
+
+ + + ## +
+
- + -${h.end_form()} + ${h.end_form()} +% endif diff --git a/tailbone/views/purchasing/receiving.py b/tailbone/views/purchasing/receiving.py index ed78a5bd..f8ec7388 100644 --- a/tailbone/views/purchasing/receiving.py +++ b/tailbone/views/purchasing/receiving.py @@ -208,7 +208,17 @@ class ReceivingBatchView(PurchasingBatchView): fs.configure(include=[ fs.vendor.with_renderer(fa.TextFieldRenderer), fs.department.with_renderer(fa.TextFieldRenderer), + fs.complete, + fs.executed, + fs.executed_by, ]) + batch = fs.model + if not batch.executed: + del [fs.executed, fs.executed_by] + if not batch.complete: + del fs.complete + else: + del fs.complete def get_mobile_row_data(self, batch): return super(ReceivingBatchView, self).get_mobile_row_data(batch)\