5 [%- SET follow_up_trans_info = invnumber _ ' (' _ customer_name _ ')' %]
 
   6 <script type="text/javascript" src="js/common.js"></script>
 
   7 <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
 
   8 <script type="text/javascript" src="js/vendor_selection.js"></script>
 
   9 <script type="text/javascript" src="js/calculate_qty.js"></script>
 
  10 <script type="text/javascript" src="js/follow_up.js"></script>
 
  11 <script type="text/javascript" src="js/customer_or_vendor_selection.js"></script>
 
  13 <form method="post" name="invoice" action="[% script %]">
 
  15 [%- FOREACH key = HIDDENS %]
 
  16 <input type="hidden" name="[% HTML.escape(key) %]" value="[% HTML.escape($key)  %]">
 
  18 <input type="hidden" name="follow_up_trans_id_1" value="[% id %]">
 
  19 <input type="hidden" name="follow_up_trans_type_1" value="sales_invoice">
 
  20 <input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
 
  21 <input type="hidden" name="follow_up_rowcount" value="1">
 
  25 <p>[% saved_message %]</p>
 
  27 [%- PROCESS 'common/flash.html' %]
 
  28 [%- INCLUDE 'generic/set_longdescription.html' %]
 
  30 <div id="is_tabs" class="tabwidget">
 
  32   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
 
  33 [%- IF INSTANCE_CONF.get_webdav %]
 
  34   <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
 
  37   <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
 
  41 <div id="ui-tabs-basic-data">
 
  47           <th align="right">[% 'Customer' | $T8 %]</th>
 
  49             [%- INCLUDE 'generic/multibox.html'
 
  52                  style         = 'width: 250px',
 
  53                  class         = 'initial_focus',
 
  60                  onChange      = "document.getElementById('update_button').click();" -%]
 
  61             <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% HTML.escape(vc) %]')">
 
  62           <input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
 
  63           <input type="hidden" name="customer_id" value="[% HTML.escape(customer_id) %]">
 
  64           <input type="hidden" name="oldcustomer" value="[% HTML.escape(oldcustomer) %]">
 
  65           <input type="hidden" name="selectcustomer" value="[% HTML.escape(selectcustomer) %]">
 
  68 [%- IF ALL_CONTACTS.size %]
 
  70           <th align="right">[% 'Contact Person' | $T8 %]</th>
 
  72             [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value_key = 'cp_id', title_key = 'full_name_dep', with_empty = 1, style = 'width: 250px') %]
 
  76 [%- IF ALL_SHIPTO.size %]
 
  78           <th align="right">[% 'Shipping Address' | $T8 %]</th>
 
  80             [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ;
 
  81                L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', style='width: 250px') %]
 
  86           <td align="right">[% 'Credit Limit' | $T8 %]</td>
 
  88             [% LxERP.format_amount(creditlimit, 0, '0') %]; [% 'Remaining' | $T8 %]
 
  89             <span class="plus[% IF is_credit_remaining_negativ %]0[% ELSE %]1[% END %]">[% LxERP.format_amount(creditremaining,0 ,'0') %]</span>
 
  92 [%- IF max_dunning_level %]
 
  94           <th align="right">[% 'Max. Dunning Level' | $T8 %]:</th>
 
  96             <b>[% max_dunning_level %]</b>; [% 'Dunning Amount' | $T8 %]: <b>[% LxERP.format_amount(dunning_amount,2) %]</b>
 
 102           <th align="right">[% 'Customer type' | $T8 %]</th>
 
 103           <td>[% business %]; [% 'Trade Discount' | $T8 %] [% LxERP.format_amount(tradediscount * 100) %] %</td>
 
 107           <th align="right" nowrap>[% 'Record in' | $T8 %]</th>
 
 109             <select name="AR" style="width:250px;">[% selectAR %]</select>
 
 110             <input type="hidden" name="selectAR" value="[% selectAR | html %]">
 
 114           <th align="right">[% 'Steuersatz' | $T8 %]</th>
 
 116             [% L.select_tag('taxzone_id', ( id ? ALL_TAXZONES : ALL_ACTIVE_TAXZONES) , default = taxzone_id, title_key = 'description', disabled = (id ? 1 : 0), style='width: 250px', onchange = "document.getElementById('update_button').click();") %]
 
 118           <input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
 
 122 [%- IF all_departments %]
 
 124           <th align="right" nowrap>[% 'Department' | $T8 %]</th>
 
 126             [% L.select_tag('department_id', all_departments, default = department_id, title_sub = \department_labels, with_empty = 1, style = 'width:250px') %]
 
 132           <th align="right">[% 'Currency' | $T8 %]</th>
 
 133           <td>[% currencies %]</td>
 
 136         <tr style='display:none'>
 
 138             <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
 
 139             <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
 
 142 [%- IF show_exchangerate %]
 
 144           <th align="right">[% 'Exchangerate' | $T8 %]</th>
 
 147             [% LxERP.format_amount(exchangerate, 2) %]
 
 149             <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
 
 155           <th align="right" nowrap>[% 'Shipping Point' | $T8 %]</th>
 
 156           <td colspan="3"><input size='35' name="shippingpoint" value="[% HTML.escape(shippingpoint) %]"></td>
 
 159           <th align="right" nowrap>[% 'Ship via' | $T8 %]</th>
 
 160           <td colspan="3"><input size='35' name="shipvia" value="[% HTML.escape(shipvia) %]"></td>
 
 163           <th align="right">[% 'Transaction description' | $T8 %]</th>
 
 164           <td colspan="3"><input size='35' name="transaction_description" id="transaction_description" value="[% HTML.escape(transaction_description) %]"></td>
 
 168     <td align="right" valign="top">
 
 171           <th align="right">[% 'Employee' | $T8 %]</th>
 
 173             [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name') %]
 
 176 [%- IF ALL_SALESMEN.size %]
 
 178           <th align="right">[% 'Salesman' | $T8 %]</th>
 
 180             [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name') %]
 
 185 [%- IF is_type_credit_note %]
 
 187           <th align="right" nowrap>[% 'Credit Note Number' | $T8 %]</th>
 
 188           <td colspan="3"><input size='11' name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
 
 191           <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
 
 192           <td colspan="3"><input size='11' name="invnumber_for_credit_note" value="[% HTML.escape(invnumber_for_credit_note) %]"></td>
 
 195           <th align="right">[% 'Credit Note Date' | $T8 %]</th>
 
 196           <td>[% L.date_tag('invdate', invdate, onchange='set_duedate()') %]</td>
 
 200           <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
 
 201           <td colspan="3"><input size='11' name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
 
 204           <th align="right">[% 'Invoice Date' | $T8 %]</th>
 
 205           <td>[% L.date_tag('invdate', invdate, onchange='set_duedate()') %]</td>
 
 208           <th align="right">[% 'Due Date' | $T8 %]</th>
 
 209           <td>[% L.date_tag('duedate', duedate) %]</td>
 
 212         <th align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
 
 213           <td colspan="3"><input size='11' name="donumber" value="[% HTML.escape(donumber) %]"></td>
 
 217           <th align="right">[% 'Delivery Date' | $T8 %]</th>
 
 218           <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
 
 221           <th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
 
 222           <td colspan="3"><input size='11' name="ordnumber" value="[% HTML.escape(ordnumber) %]"></td>
 
 225           <th align="right" nowrap>[% 'Order Date' | $T8 %]</th>
 
 226           <td>[% L.date_tag('orddate', orddate) %]</td>
 
 229           <th align="right" nowrap>[% 'Quotation Number' | $T8 %]</th>
 
 230           <td colspan="3"><input size='11' name="quonumber" value="[% HTML.escape(quonumber) %]"></td>
 
 233           <th align="right" nowrap>[% 'Quotation Date' | $T8 %]</th>
 
 234           <td>[% L.date_tag('quodate', quodate) %]</td>
 
 237           <th align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
 
 238           <td colspan="3"><input size='11' name="cusordnumber" value="[% HTML.escape(cusordnumber) %]"></td>
 
 241           <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
 
 243             [%- L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = '1', onChange = "document.getElementById('update_button').click();") %]
 
 249   <tr style='display:none'>
 
 251       <input type="hidden" name="webdav" value="[% webdav %]">
 
 256   <script type="text/javascript" src="js/show_form_details.js"></script>
 
 257   <script type="text/javascript" src="js/show_vc_details.js"></script>
 
 258   <script type="text/javascript" src="js/show_history.js"></script>
 
 259   <script type="text/javascript">
 
 261      $('document').ready(function(){
 
 262 [% IF resubmit && is_format_html %]
 
 263        window.open('about:blank','Beleg');
 
 264        document.invoice.target = 'Beleg';
 
 265        document.invoice.submit();
 
 267        document.invoice.submit();
 
 268 [% ELSIF creditwarning != '' %]
 
 269        alert('[% 'Credit Limit exceeded!!!' | $T8 %]');
 
 273      function set_duedate() {
 
 274        setTimeout(function() {
 
 276            url: 'is.pl?action=set_duedate',
 
 278              invdate: $('#invdate').val(),
 
 279              payment_id: $('#payment_id').val(),
 
 282            success: function (data) {
 
 283              $('#duedate').val(data);