]> wagnertech.de Git - mfinanz.git/blob - templates/webpages/wh/create_assembly_chargenumbers.html
date error in mapping
[mfinanz.git] / templates / webpages / wh / create_assembly_chargenumbers.html
1 [%- USE P -%]
2 [%- USE T8 %]
3 [%- USE HTML %]
4 [%- USE LxERP %]
5
6 <h1>[% HTML.escape(title) %]</h1>
7
8 [%- INCLUDE 'common/flash.html' %]
9
10 <form name="Form" method="post" action="wh.pl" id="form">
11   [%
12     FOREACH key = hidden_vars.keys;
13       P.hidden_tag(key, HTML.escape(hidden_vars.$key));
14     END
15   %]
16
17   <p>
18     [% 'The following assembly items are ambigious. Please check the selection.' | $T8 %]
19   </p>
20
21   <table>
22     <thead>
23       <tr class="listheading">
24         <th>[% 'Partnumber'   | $T8%]</th>
25         <th>[% 'Description'  | $T8%]</th>
26         <th>[% 'Chargenumber' | $T8%]</th>
27         <th>[% 'Warehouse'    | $T8%]</th>
28         <th>[% 'Bin'          | $T8%]</th>
29         <th>[% 'Onhand'       | $T8%]</th>
30         <th>[% 'Qty'          | $T8%]</th>
31         <th>[% 'Unit'         | $T8%]</th>
32       </tr>
33     </thead>
34     <tbody>
35       [% FOREACH part_id = stocked_by_parts_id.keys.sort -%]
36         [% NEXT UNLESS stocked_by_parts_id.$part_id.size > 1 %]
37         <tr class="listheading">
38           <td colspan="6">[% 'needed qty' | $T8 %]</td>
39           <td class="numeric">[% LxERP.format_amount(needed_by_parts_id.$part_id, -2) %]</td>
40           <td>[% stocked_by_parts_id.$part_id.0.part.unit | html %]</td>
41         </tr>
42         [% FOREACH part = stocked_by_parts_id.$part_id -%]
43           <tr class="listrow">
44             [% SET alloc_qty = '';
45                FOREACH alloc = allocated_by_parts_id.$part_id;
46                  IF (alloc.warehouse_id == part.warehouse.id && alloc.bin_id == part.bin_id && HTML.escape(alloc.chargenumber) == HTML.escape(part.chargenumber));
47                    SET alloc_qty = alloc.qty;
48                  END;
49                END
50             -%]
51             <td>
52               [% P.hidden_tag('allocations[+].parts_id', part_id )%]
53               [% P.hidden_tag('allocations[].chargenumber', part.chargenumber )%]
54               [% P.hidden_tag('allocations[].warehouse_id', part.warehouse_id )%]
55               [% P.hidden_tag('allocations[].bin_id', part.bin_id )%]
56               [% part.part.partnumber | html %]
57             </td>
58             <td>[% part.part.description      | html                 %]</td>
59             <td>[% part.chargenumber          | html                 %]</td>
60             <td>[% part.warehouse.description | html                 %]</td>
61             <td>[% part.bin.description       | html                 %]</td>
62             <td class="numeric">[% LxERP.format_amount(part.qty, -2) %]</td>
63             <td>[% P.input_number_tag('allocations[].qty', alloc_qty, precision => -2, size => 8) %]</td>
64             <td>[% part.part.unit             | html                 %]</td>
65           </tr>
66         [% END %]
67         <tr></tr>
68         <tr></tr>
69       [% END %]
70     </tbody>
71   </table>
72
73   <p>
74     [% 'The following assembly items are unambigious and will be used for production.' | $T8 %]
75   </p>
76
77   <table>
78     <thead>
79       <tr class="listheading">
80         <th>[% 'Partnumber'   | $T8%]</th>
81         <th>[% 'Description'  | $T8%]</th>
82         <th>[% 'Chargenumber' | $T8%]</th>
83         <th>[% 'Warehouse'    | $T8%]</th>
84         <th>[% 'Bin'          | $T8%]</th>
85         <th>[% 'Onhand'       | $T8%]</th>
86         <th>[% 'Qty'          | $T8%]</th>
87         <th>[% 'Unit'         | $T8%]</th>
88       </tr>
89     </thead>
90     <tbody>
91       [% FOREACH part_id = stocked_by_parts_id.keys.sort -%]
92         [% NEXT UNLESS stocked_by_parts_id.$part_id.size <= 1 %]
93         [% FOREACH part = stocked_by_parts_id.$part_id -%]
94           <tr class="listrow">
95             [% SET alloc_qty = '';
96                FOREACH alloc = allocated_by_parts_id.$part_id;
97                  IF (alloc.warehouse_id == part.warehouse.id && alloc.bin_id == part.bin_id && HTML.escape(alloc.chargenumber) == HTML.escape(part.chargenumber));
98                    SET alloc_qty = alloc.qty;
99                  END;
100                END
101               -%]
102             <td>
103               [% P.hidden_tag('allocations[+].parts_id', part_id )%]
104               [% P.hidden_tag('allocations[].chargenumber', part.chargenumber )%]
105               [% P.hidden_tag('allocations[].warehouse_id', part.warehouse_id )%]
106               [% P.hidden_tag('allocations[].bin_id', part.bin_id )%]
107               [% part.part.partnumber | html %]
108             </td>
109             <td>[% part.part.description      | html                 %]</td>
110             <td>[% part.chargenumber          | html                 %]</td>
111             <td>[% part.warehouse.description | html                 %]</td>
112             <td>[% part.bin.description       | html                 %]</td>
113             <td class="numeric">[% LxERP.format_amount(part.qty, -2) %]</td>
114             <td class="numeric">
115               [% P.hidden_tag('allocations[].qty', LxERP.format_amount(alloc_qty, -2)) %]
116               [% LxERP.format_amount(alloc_qty, -2) %]
117             </td>
118             <td>[% part.part.unit             | html                 %]</td>
119           </tr>
120         [% END %]
121       [% END %]
122     </tbody>
123   </table>
124
125 </form>