source: tailbone/tailbone/templates/mobile/receiving/receive_row.mako @ bf189bb7

Last change on this file since bf189bb7 was bf189bb7, checked in by Lance Edgar <ledgar@…>, 11 months ago

Use shipped instead of ordered, for receiving authority

i.e. compare receiving quantities to shipped quantities instead of ordered

  • Property mode set to 100644
File size: 5.6 KB
Line 
1## -*- coding: utf-8; -*-
2<%inherit file="/mobile/master/view_row.mako" />
3<%namespace file="/mobile/keypad.mako" import="keypad" />
4
5<%def name="title()">Receiving &raquo; ${batch.id_str} &raquo; ${master.render_product_key_value(row)}</%def>
6
7<%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; ${master.render_product_key_value(row)}</%def>
8
9
10<div${' class="ui-grid-a"' if product_image_url else ''|n}>
11  <div class="ui-block-a"${'' if instance.product else ' style="background-color: red;"'|n}>
12    % if instance.product:
13        <h3>${instance.brand_name or ""}</h3>
14        <h3>${instance.description} ${instance.size or ''}</h3>
15        % if allow_cases:
16            <h3>1 CS = ${h.pretty_quantity(row.case_quantity or 1)} ${unit_uom}</h3>
17        % endif
18    % else:
19        <h3>${instance.description}</h3>
20    % endif
21  </div>
22  % if product_image_url:
23    <div class="ui-block-b">
24      ${h.image(product_image_url, "product image")}
25    </div>
26  % endif
27</div>
28
29<table${'' if instance.product else ' style="background-color: red;"'|n}>
30  <tbody>
31    % if batch.order_quantities_known:
32        <tr>
33          <td>shipped</td>
34          <td>
35            % if allow_cases:
36                ${h.pretty_quantity(row.cases_shipped or 0)} /
37            % endif
38            ${h.pretty_quantity(row.units_shipped or 0)}
39          </td>
40        </tr>
41    % endif
42    <tr>
43      <td>received</td>
44      <td>
45        % if allow_cases:
46            ${h.pretty_quantity(row.cases_received or 0)} /
47        % endif
48        ${h.pretty_quantity(row.units_received or 0)}
49      </td>
50    </tr>
51    <tr>
52      <td>damaged</td>
53      <td>
54        % if allow_cases:
55            ${h.pretty_quantity(row.cases_damaged or 0)} /
56        % endif
57        ${h.pretty_quantity(row.units_damaged or 0)}
58      </td>
59    </tr>
60    % if allow_expired:
61        <tr>
62          <td>expired</td>
63          <td>
64            % if allow_cases:
65                ${h.pretty_quantity(row.cases_expired or 0)} /
66            % endif
67            ${h.pretty_quantity(row.units_expired or 0)}
68          </td>
69        </tr>
70    % endif
71  </tbody>
72</table>
73
74% if request.session.peek_flash('receiving-warning'):
75    % for error in request.session.pop_flash('receiving-warning'):
76        <div class="receiving-warning">${error}</div>
77    % endfor
78% endif
79
80% if not batch.executed and not batch.complete:
81
82    ${h.form(request.current_route_url(), class_='receiving-update')}
83    ${h.csrf_token(request)}
84    ${h.hidden('row', value=row.uuid)}
85    ${h.hidden('cases')}
86    ${h.hidden('units')}
87
88    ## only show quick-receive if we have an identifiable product
89    % if quick_receive and instance.product:
90        % if quick_receive_all:
91            <button type="button" class="quick-receive" data-quantity="${quick_receive_quantity}" data-uom="${quick_receive_uom}">${quick_receive_text}</button>
92        % elif allow_cases:
93            <button type="button" class="quick-receive" data-quantity="1" data-uom="CS">Receive 1 CS</button>
94            <div>
95              ## TODO: probably should make these optional / configurable
96              <button type="button" class="quick-receive ui-btn ui-btn-inline ui-corner-all" data-quantity="1" data-uom="EA">1 EA</button>
97              <button type="button" class="quick-receive ui-btn ui-btn-inline ui-corner-all" data-quantity="3" data-uom="EA">3 EA</button>
98              <button type="button" class="quick-receive ui-btn ui-btn-inline ui-corner-all" data-quantity="6" data-uom="EA">6 EA</button>
99            </div>
100            <br />
101        % else:
102            <button type="button" class="quick-receive" data-quantity="1" data-uom="${unit_uom}">Receive 1 ${unit_uom}</button>
103        % endif
104    % endif
105
106    ${keypad(unit_uom, uom, allow_cases=allow_cases)}
107
108    <table>
109      <tbody>
110        <tr>
111          <td>
112            <fieldset data-role="controlgroup" data-type="horizontal" class="receiving-mode">
113              ${h.radio('mode', value='received', label="received", checked=True)}
114              ${h.radio('mode', value='damaged', label="damaged")}
115              % if allow_expired:
116                  ${h.radio('mode', value='expired', label="expired")}
117              % endif
118            </fieldset>
119          </td>
120        </tr>
121        <tr id="expiration-row" style="display: none;">
122          <td>
123            <div style="padding:10px 20px;">
124              <label for="expiration_date">Expiration Date</label>
125              <input name="expiration_date" type="date" value="" placeholder="YYYY-MM-DD" />
126            </div>
127          </td>
128        </tr>
129        <tr>
130          <td>
131            <fieldset data-role="controlgroup" data-type="horizontal" class="receiving-actions">
132              <button type="button" data-action="add" class="ui-btn-inline ui-corner-all">Add</button>
133              <button type="button" data-action="subtract" class="ui-btn-inline ui-corner-all">Subtract</button>
134              ## <button type="button" data-action="clear" class="ui-btn-inline ui-corner-all ui-state-disabled">Clear</button>
135            </fieldset>
136          </td>
137        </tr>
138      </tbody>
139    </table>
140
141    ${h.hidden('quick_receive', value='false')}
142    ${h.end_form()}
143
144    % if master.mobile_rows_deletable and master.row_deletable(row) and request.has_perm('{}.delete_row'.format(permission_prefix)):
145        ${h.form(url('mobile.{}.delete_row'.format(route_prefix), uuid=batch.uuid, row_uuid=row.uuid), class_='receiving-update')}
146        ${h.csrf_token(request)}
147        ${h.submit('submit', "Delete this Row")}
148        ${h.end_form()}
149    % endif
150
151% endif
Note: See TracBrowser for help on using the repository browser.