style='width: 300px') %]</td>
</tr>
- <tr id='shipto_row' [%- IF !SELF.order.${SELF.cv}.shipto.size %]style='display:none'[%- END %]>
+ <tr>
<th align="right">[% 'Shipping Address' | $T8 %]</th>
- <td>[% L.select_tag('order.shipto_id',
- SELF.order.${SELF.cv}.shipto,
- default=SELF.order.shipto_id,
- title_key='displayable_id',
- value_key='shipto_id',
- with_empty=1,
- style='width: 300px') %]</td>
+ <td>
+ <span id='shipto_selection' [%- IF !SELF.order.${SELF.cv}.shipto.size %]style='display:none'[%- END %]>
+ [% shiptos = [ { shipto_id => "", displayable_id => LxERP.t8("No/individual shipping address") } ] ;
+ FOREACH s = SELF.order.${SELF.cv}.shipto ;
+ shiptos.push(s) ;
+ END ;
+ L.select_tag('order.shipto_id',
+ shiptos,
+ default=SELF.order.shipto_id,
+ title_key='displayable_id',
+ value_key='shipto_id',
+ with_empty=0,
+ style='width: 300px') %]
+ </span>
+ [% L.button_tag("kivi.Order.edit_custom_shipto()", LxERP.t8("Custom shipto")) %]
+ </td>
</tr>
[%- PROCESS order/tabs/_business_info_row.html SELF=SELF %]
<td>[% L.select_tag('order.taxzone_id', SELF.all_taxzones, default=SELF.order.taxzone_id, title_key='description', style='width: 300px', class='recalc') %]</td>
</tr>
+ [% SET currency_id = SELF.order.currency_id || INSTANCE_CONF.get_currency_id # use default currency for new order %]
<tr id="currency_settings">
<th align="right">[% 'Currency' | $T8 %]</th>
- <td>[% L.select_tag('order.currency_id', SELF.all_currencies, default=SELF.order.currency_id, value_key='id', title_key='name') %]</td>
+ <td>[% L.select_tag('order.currency_id', SELF.all_currencies, default=currency_id, value_key='id', title_key='name') %]</td>
</tr>
- <tr id="exchangerate_settings" [%- IF !SELF.order.currency_id || SELF.order.currency_id==INSTANCE_CONF.get_currency_id %]style='display:none'[%- END %]>
+ <tr id="exchangerate_settings" [%- IF SELF.order.currency_id==INSTANCE_CONF.get_currency_id %]style='display:none'[%- END %]>
<th align="right">[% 'Exchangerate' | $T8 %]</th>
<td> 1 <span id="currency_name">[% SELF.order.currency.name %]</span> =
- <span id="exchangerate_text">
- [% IF SELF.order.exchangerate %]
- [% HTML.escape(SELF.order.exchangerate_as_number) %]
- [% END %]
- </span>
- [% IF !SELF.order.currency_id || SELF.order.currency_id==INSTANCE_CONF.get_currency_id || SELF.order.exchangerate %]
- [% L.input_tag('', '', size="15", id='order_exchangerate_as_number', 'data-name'='order.exchangerate_as_number', style='display:none') %]
- [% ELSE %]
- [% L.input_tag('order.exchangerate_as_number', 0, size="15") %]
- [% END %]
+ [% L.input_tag('order.exchangerate_as_null_number', SELF.order.exchangerate_as_null_number, size="15", class="reformat_number_as_null_number numeric") %]
[% INSTANCE_CONF.default_currency %]
- [% L.hidden_tag('old_currency_id', SELF.order.currency_id) %]
- [% L.hidden_tag('old_exchangerate', SELF.order.exchangerate_as_number) %]
+ [% L.hidden_tag('old_currency_id', currency_id) %]
+ [% L.hidden_tag('old_exchangerate', SELF.order.exchangerate_as_null_number) %]
+ </td>
+ </tr>
+
+[%- IF SELF.all_languages.size %]
+ <tr>
+ <th align="right">[% 'Language' | $T8 %]</th>
+ <td>
+ [% L.select_tag('order.language_id', SELF.all_languages, default=SELF.order.language_id, title_key='description', with_empty=1, style='width:300px') %]
</td>
</tr>
+[%- END %]
[%- IF SELF.all_departments.size %]
<tr>
<tr>
<th align="right">[% 'Transaction description' | $T8 %]</th>
- <td>[% L.input_tag('order.transaction_description', SELF.order.transaction_description, style='width: 300px') %]</td>
+ <td>[% L.input_tag('order.transaction_description', SELF.order.transaction_description, 'data-validate'=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '', style='width: 300px') %]</td>
</tr>
<tr>
<td>[% L.date_tag('order.transdate_as_date', SELF.order.transdate_as_date) %]</td>
</tr>
+ <tr>
+ <th width="70%" align="right" nowrap>[% 'Tax point' | $T8 %]</th>
+ <td>[% L.date_tag('order.tax_point_as_date', SELF.order.tax_point_as_date, class="recalc") %]</td>
+ </tr>
+
[%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
- [%- SET reqdate_txt = 'Reqdate' -%]
+ [%- SET reqdate_txt = 'Reqdate'; SET reqdate_class = 'recalc' -%]
[%- ELSIF SELF.type == "sales_quotation" -%]
- [%- SET reqdate_txt = 'Valid until' -%]
+ [%- SET reqdate_txt = 'Valid until'; SET reqdate_class = '' -%]
[%- ELSE -%]
- [%- SET reqdate_txt = 'Required by' -%]
+ [%- SET reqdate_txt = 'Required by'; SET reqdate_class = 'recalc' -%]
[%- END -%]
<tr>
<th width="70%" align="right" nowrap>[% reqdate_txt | $T8 %]</th>
- <td>[% L.date_tag('order.reqdate_as_date', SELF.order.reqdate_as_date) %]</td>
+ <td>[% L.date_tag('order.reqdate_as_date', SELF.order.reqdate_as_date, class=reqdate_class) %]</td>
</tr>
[%- IF SELF.type == "sales_quotation" -%]
</tr>
<tr>
<th width="70%" align="right" nowrap>[% 'Expected billing date' | $T8 %]</th>
- <td>[%- L.date_tag('order.expected_billing_date_as_date', SELF.order.expected_billing_date_sa_date) %]</td>
+ <td>[%- L.date_tag('order.expected_billing_date_as_date', SELF.order.expected_billing_date_as_date) %]</td>
</tr>
[%- END %]