Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / ar / form_header.html
index 2c9870f..d42d70c 100644 (file)
@@ -1,9 +1,13 @@
 [%- USE HTML %]
 [%- USE L %]
 [%- USE T8 %]
-[%- USE LxERP %]
+[%- USE LxERP %][%- USE P -%]
 
-<form method=post name="arledger" action="[% script %]">
+<h1>[% title | html %]</h1>
+
+[%- INCLUDE 'common/flash.html' %]
+
+<form method=post name="arledger" action="[% script %]" id="form">
 
 [% L.hidden_tag('id', id) %]
 [% L.hidden_tag('sort', sort) %]
 [% L.hidden_tag('follow_up_rowcount', 1) %]
 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
 
-<h1>[% title | html %]</h1>
-
 [%- IF saved_message %]<p>[% saved_message | html  %]</p>[% END %]
 
 <div class="tabwidget">
  <ul>
   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
 [%- IF id %]
+  [%- IF INSTANCE_CONF.get_doc_storage %]
+  <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
+  [%- END %]
+  [% IF AUTH.assert('record_links', 1) %]
   <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
+  [%- END %]
   <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
 [%- END %]
  </ul>
               <tr>
                 <th align="right" nowrap>[% 'Customer' | $T8 %]</th>
                 <td colspan=3>
-[%- IF selectcustomer %]
-    <select id='customer' name="customer" onchange="document.getElementById('update_button').click();" class="initial_focus">[% selectcustomer %]</select>
-[%- ELSE %]
-    <input id='customer' name=customer value="[% customer | html %]" size=35 class="initial_focus">
-[%- END %]
-                <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('customer')"></td>
-                [% L.hidden_tag('selectcustomer', selectcustomer) %]
-                [% L.hidden_tag('oldcustomer', oldcustomer) %]
-                [% L.hidden_tag('customer_id', customer_id) %]
-                [% L.hidden_tag('terms', terms) %]
+                 [% P.customer_vendor.picker("customer_id", customer_id, type="customer", style="width: 330px", class=(initial_focus == 'customer_id' ? "initial_focus" : ""), onchange="\$('#update_button').click()") %]
+                 [% L.button_tag("show_vc_details('customer')", LxERP.t8('Details (one letter abbreviation)')) %]
+                 [% L.hidden_tag("previous_customer_id", customer_id) %]
+                 [% L.hidden_tag('terms', terms) %]
+               </td>
               </tr>
 [%- IF max_dunning_level || invoice_obj.dunning_config_id  %]
               <tr>
@@ -90,8 +92,7 @@
 [%- END %]
               <tr>
                 <th align=right>[% 'Currency' | $T8 %]</th>
-                <td><select name=currency>[% selectcurrency %]</select></td>
-                [% L.hidden_tag('selectcurrency', selectcurrency) %]
+                <td>[% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]</td>
                 [% L.hidden_tag('defaultcurrency', defaultcurrency) %]
                 [% L.hidden_tag('fxgain_accno', fxgain_accno) %]
                 [% L.hidden_tag('fxloss_accno', fxloss_accno) %]
                 [% L.hidden_tag('forex', forex) %]
                 [% IF show_exch %]
                    <th align=right>[% 'Exchangerate' | $T8 %]</th>
-                   <td>[%- IF forex %][% L.hidden_tag('exchangerate', LxERP.format_amount(exchangerate, 2)) %][% LxERP.format_amount(exchangerate, 2) %][%- ELSE %][% L.input_tag('exchangerate', LxERP.format_amount(exchangerate, 2), size=10) %][%- END %]</td>
+                   <td>[%- IF forex %][% L.hidden_tag('exchangerate', LxERP.format_amount(exchangerate, 5, 1)) %][% LxERP.format_amount(exchangerate, 5, 1) %][%- ELSE %][% L.input_tag('exchangerate', LxERP.format_amount(exchangerate, 5, 1), size=10) %][%- END %]</td>
                 [% END %]
               </tr>
-              [% department_html %]
-              [%- IF selectdepartment %]
+              [% IF ALL_DEPARTMENTS %]
+                <tr>
+                  <th align="right" nowrap>[% 'Department' | $T8 %]</th>
+                  <td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = 'width:334px') %]</td>
+                </tr>
+              [% END %]
               <tr>
-                <th align="right" nowrap>[% 'Department' | $T8 %]</th>
-                <td colspan=3><select name=department>[% selectdepartment %]</select>
-                <input type=hidden name=selectdepartment value="[% selectdepartment | html %]">
-                </td>
+                <th align="right">[% 'Transaction description' | $T8 %]</th>
+                <td colspan="3">[% L.input_tag("transaction_description", transaction_description, style="width:330px", "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
               </tr>
-              [%- END %]
               <tr>
                 <td align=right>[% L.checkbox_tag('taxincluded', checked=taxincluded) %]</td>
                 <th align="left" nowrap><label for="taxincluded">[% 'Tax Included' | $T8 %]</label></th>
           </td>
           <td align=right>
             <table>
-[%- IF selectemployee %]
               <tr>
                 <th align=right nowrap>[% 'Salesperson' | $T8 %]</th>
-                <td  colspan=2><select name=employee>[% selectemployee %]</select>[% L.hidden_tag('selectemployee', selectemployee) %]</td>
+                <td  colspan=2>[% P.select_tag("employee_id", employees, default=employee_id, title_key='safe_name') %]</td>
               </tr>
-[%- ELSE %]
-                [% L.hidden_tag('employee', employee) %]
-[%- END %]
               <tr>
                 <th align=right nowrap>[% 'Invoice Number' | $T8 %]</th>
                 <td><input name=invnumber size=11 value="[% invnumber | html %]"></td>
                 <th align=right nowrap>[% 'Due Date' | $T8 %]</th>
                 <td>[% L.date_tag('duedate', duedate) %]</td>
               </tr>
+              <tr>
+                <th align="right" nowrap>[% LxERP.t8('Tax point') %]</th>
+                <td>[% L.date_tag('tax_point', tax_point, id='tax_point') %]</td>
+              </tr>
+              <tr>
+                <th align=right nowrap>[% 'Delivery Date' | $T8 %]</th>
+                <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
+              </tr>
               <tr>
                 <th align=right nowrap>[% 'Project Number' | $T8 %]</th>
-                <td>[% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = 1) %]</td>
+                <td>[% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = 1, onChange = "document.getElementById('update_button').click();") %]</td>
               </tr>
      </table>
           </td>
           </td>
         </tr>
         <tr>
-          <td>[% ARselected %]</td>
+          <td>[% P.chart.picker("AR_chart_id", AR_chart_id, style="width: 400px", type="AR") %]</td>
           <th align=left>[% LxERP.format_amount(invtotal, 2) | html %]</th>
 
           <input type=hidden name=oldinvtotal value='[% oldinvtotal %]'>
          </td>
          <td align=center>
   [%- IF row.changeable %]
-          <input name="paid_[% loop.count %]" size=11 value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]" onBlur="check_right_number_format(this)">
+          <input name="paid_[% loop.count %]" size=11 data-validate="number" class="numeric" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]">
   [%- ELSE %]
          [% row.paid | html %]<input type=hidden name="paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]">
   [%- END %]
 [%- IF show_exch %]
          <td align=center>
     [%- IF row.forex || !row.changeable%]
-          <input type=hidden name="exchangerate_[% loop.count %]" value='[% row.exchangerate | html %]'>[% row.exchangerate | html %]
+          <input type=hidden name="exchangerate_[% loop.count %]" value="[%- LxERP.format_amount(row.exchangerate, 5, 1) -%]">[%- LxERP.format_amount(row.exchangerate, 5, 1) -%]
     [%- ELSE %]
-          <input name="exchangerate_[% loop.count %]" size=10 value='[% row.exchangerate | html %]'>
+          <input name="exchangerate_[% loop.count %]" size=10 value="[%- LxERP.format_amount(row.exchangerate, 5, 1) -%]">
     [%- END %]
           <input type=hidden name="forex_[% loop.count %]" value='[% row.forex | html %]'>
          </td>
 </div>
 
 <script type='text/javascript'>
- $('#ar_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });
+ $('#ar_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });
 </script>