6 <div id="ui-tabs-basic-data">
12 <th align="right">[% SELF.cv | $T8 %]</th>
13 [% SET cv_id = SELF.cv _ '_id' %]
14 <td>[% L.customer_vendor_picker("order.${SELF.cv}" _ '_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %]</td>
17 <tr id='cp_row' [%- IF !SELF.order.${SELF.cv}.contacts.size %]style='display:none;'[%- END %]>
18 <th align="right">[% 'Contact Person' | $T8 %]</th>
19 <td>[% L.select_tag('order.cp_id',
20 SELF.order.${SELF.cv}.contacts,
21 default=SELF.order.cp_id,
22 title_key='full_name_dep',
25 style='width: 300px') %]</td>
28 <tr id='shipto_row' [%- IF !SELF.order.${SELF.cv}.shipto.size %]style='display:none;'[%- END %]>
29 <th align="right">[% 'Shipping Address' | $T8 %]</th>
30 <td>[% L.select_tag('order.shipto_id',
31 SELF.order.${SELF.cv}.shipto,
32 default=SELF.order.shipto_id,
33 title_key='displayable_id',
34 value_key='shipto_id',
36 style='width: 300px') %]</td>
40 <th align="right">[% 'Steuersatz' | $T8 %]</th>
41 <td>[% L.select_tag('order.taxzone_id', SELF.all_taxzones, default=SELF.order.taxzone_id, title_key='description', style='width: 300px') %]</td>
45 <th align="right">[% 'Shipping Point' | $T8 %]</th>
46 <td>[% L.input_tag('order.shippingpoint', SELF.order.shippingpoint, style='width: 300px') %]</td>
50 <th align="right">[% 'Ship via' | $T8 %]</th>
51 <td>[% L.input_tag('order.shipvia', SELF.order.shipvia, style='width: 300px') %]</td>
55 <th align="right">[% 'Transaction description' | $T8 %]</th>
56 <td>[% L.input_tag('order.transaction_description', SELF.order.transaction_description, style='width: 300px') %]</td>
66 <td colspan="2" align="center">
67 [%- IF SELF.order.closed %] [% 'Closed' | $T8 %] [%- ELSE %] [% 'Open' | $T8 %] [%- END %]
72 <th align="right">[% 'Employee' | $T8 %]</th>
73 <td>[% L.select_tag('order.employee_id',
75 default=(SELF.order.employee_id ? SELF.order.employee_id : SELF.current_employee_id),
76 title_key='safe_name') %]</td>
80 <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
81 <td>[% L.input_tag('order.ordnumber', SELF.order.ordnumber, size = 11) %]</td>
85 <th width="70%" align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
86 <td>[% L.input_tag('order.cusordnumber', SELF.order.cusordnumber, size = 11) %]</td>
90 <th width="70%" align="right" nowrap>[% 'Order Date' | $T8 %]</th>
91 <td>[% L.date_tag('order.transdate', SELF.order.transdate) %]</td>
95 <th width="70%" align="right" nowrap>[% 'Project Number' | $T8 %]</th>
96 <td>[%- L.select_tag('order.globalproject_id', SELF.all_projects, default=SELF.order.globalproject_id, title_key='projectnumber', with_empty = 1) %]</td>
108 <table id="row_table_id" width="100%">
110 <tr class="listheading">
111 <th class="listheading" style='display:none'></th>
112 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
113 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
114 <th class="listheading" nowrap >[%- 'Part' | $T8 %] </th>
115 <th class="listheading" nowrap width="5" >[%- 'Qty' | $T8 %] </th>
116 <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
117 <th class="listheading" nowrap width="5" >[%- 'Unit' | $T8 %] </th>
118 <th class="listheading" nowrap width="15">[%- 'Price' | $T8 %] </th>
119 <th class="listheading" nowrap width="5" >[%- 'Discount' | $T8 %] </th>
120 <th class="listheading" nowrap width="10">[%- 'Extended' | $T8 %] </th>
125 [%- FOREACH item = SELF.order.items_sorted %]
126 [%- PROCESS order/tabs/_row.html ITEM=item %]
128 [%- IF !SELF.order.items.size %]
129 [%- PROCESS order/tabs/_row.html ITEM='' %]
141 <td>[%- L.button_tag('add_order_item_row()', LxERP.t8("Add Row")) -%]</td>
147 [%- IF NOT taxincluded %]
149 <th align="right">[%- 'Subtotal' | $T8 %]</th>
151 [%- L.div_tag(SELF.order.netamount_as_number, id='netamount_id') %]
155 [%- FOREACH tax = SELF.taxes %]
156 [%- PROCESS order/tabs/_tax_row.html TAX=tax %]
158 <tr id="amount_row_id">
159 <th align="right">[%- 'Total' | $T8 %]</th>
161 [%- L.div_tag(SELF.order.amount_as_number, id='amount_id') %]
176 [% L.sortable_element('#row_table_id tbody') %]
178 <script type='text/javascript'>
179 function reload_cv_dependend_selections() {
180 $.post("controller.pl", { 'action': 'Order/customer_vendor_changed',
181 'cv_id': function(){ return $('#order_[%- cv_id%]').val() },
182 'type': function(){ return $('#type').val() },
183 }, kivi.eval_json_result);
186 function add_order_item_row() {
187 $.post("controller.pl", { 'action': 'Order/add_item_row',
188 'type' : function(){ return $('#type').val() }
189 }, kivi.eval_json_result);
192 function delete_order_item_row(clicked) {
193 var row = $(clicked).parents("tr").first();
197 function set_item_values(event) {
198 var cv_id = $('#order_[%- cv_id %]').val();
199 var parts_id = $(event.target).val();
200 var row = $(event.target).parents("tr").first();
202 var item_id_dom = $(row).find('[name="order.orderitems[+].id"]');
203 var qty_dom = $(row).find('[id^="order_orderitems"][id$="qty_as_number"]');
204 var unit_dom = $(row).find('[id^="order_orderitems"][id$="unit"]');
205 var sellprice_dom = $(row).find('[id^="order_orderitems"][id$="sellprice_as_number"]');
206 var discount_dom = $(row).find('[id^="order_orderitems"][id$="discount_as_percent"]');
208 var data = $('#order_form').serialize();
209 data += '&action=Order/set_item_values';
210 data += '&type=' + $('#type').val();
211 data += '&item_id=' + item_id_dom.val();
212 data += '&qty_dom_id=' + qty_dom.attr("id");
213 data += '&unit_dom_id=' + unit_dom.attr("id");
214 data += '&sellprice_dom_id=' + sellprice_dom.attr("id");
215 data += '&discount_dom_id=' + discount_dom.attr("id");
217 $.post("controller.pl", data, kivi.eval_json_result);
220 function display_linetotal(item_id, amount) {
221 $('#item_' + item_id).parents("tr").first().find('[name="linetotal"]').html(amount);
226 $('#order_[%- cv_id %]').change(reload_cv_dependend_selections);
227 $('[id^="order_orderitems"][id$="parts_id"]').change(set_item_values);