Lieferadressen, gelöschte aber ausgewählte weiterhin einblenden.
[kivitendo-erp.git] / templates / webpages / is / form_header.html
index 50d8f57..80dd758 100644 (file)
@@ -21,9 +21,7 @@
 <input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
 <input type="hidden" name="follow_up_rowcount" value="1">
 
-<input type="hidden" name="lizenzen" value="[% lizenzen %]">
-
-<p><div class="listtop" width="100%">[% title %]</div></p>
+<h1>[% title %]</h1>
 
 <p>[% saved_message %]</p>
 
                  allow_textbox = 1,
                  onChange      = "document.getElementById('update_button').click();" -%]
             <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% HTML.escape(vc) %]')">
-          </td>
           <input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
           <input type="hidden" name="customer_id" value="[% HTML.escape(customer_id) %]">
           <input type="hidden" name="oldcustomer" value="[% HTML.escape(oldcustomer) %]">
           <input type="hidden" name="selectcustomer" value="[% HTML.escape(selectcustomer) %]">
+          </td>
         </tr>
 [%- IF ALL_CONTACTS.size %]
         <tr>
           <th align="right">[% 'Contact Person' | $T8 %]</th>
           <td>
-            [% L.select_tag('cp_id', L.options_for_select(ALL_CONTACTS, default=cp_id, value='cp_id', title_sub=\contact_labels, with_empty=1), style='width: 250px') %]
+            [% L.select_tag('cp_id', L.options_for_select(ALL_CONTACTS, default=cp_id, value='cp_id', title='full_name_dep', with_empty=1), style='width: 250px') %]
           </td>
         </tr>
 [%- END %]
@@ -65,7 +63,7 @@
         <tr>
           <th align="right">[% 'Shipping Address' | $T8 %]</th>
           <td>
-            [% L.select_tag('shipto_id', L.options_for_select(ALL_SHIPTO, default=shipto_id, value='shipto_id', title_sub=\shipto_labels, with_empty=1), style='width: 250px', onChange="document.getElementById('update_button').click();") %]
+            [% L.select_tag('shipto_id', L.options_for_select(ALL_SHIPTO, default=shipto_id, value='shipto_id', title='displayable_id', with_empty=1), style='width: 250px', onChange="document.getElementById('update_button').click();") %]
           </td>
         </tr>
 [%- END %]
 [%- END %]
         <tr>
           <th align="right" nowrap>[% 'Record in' | $T8 %]</th>
-          <td colspan="3"><select name="AR" style="width:250px;">[% selectAR %]</select></td>
-          <input type="hidden" name="selectAR" value="[% selectAR %]">
+          <td colspan="3">
+            <select name="AR" style="width:250px;">[% selectAR %]</select>
+            <input type="hidden" name="selectAR" value="[% selectAR | html %]">
+          </td>
         </tr>
         <tr>
           <th align="right">[% 'Steuersatz' | $T8 %]</th>
           <td>
-            [% L.select_tag('taxzone_id', L.options_for_select(ALL_TAXZONES, default=taxzone_id, title='description'), readonly=(id ? 1 : 0), style='width: 250px') %]
-          </td>
+            [% L.select_tag('taxzone_id', L.options_for_select(ALL_TAXZONES, default=taxzone_id, title='description'), disabled=(id ? 1 : 0), style='width: 250px', onchange="document.getElementById('update_button').click();") %]
   [%- IF id %]
           <input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
   [%- END %]
+          </td>
         </tr>
 [%- IF all_departments %]
         <tr>
           <td>[% currencies %]</td>
         </tr>
 [%- END %]
-        <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
-        <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
+        <tr style='display:none'>
+          <td>
+            <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
+            <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
+          </td>
+        </tr>
 [%- IF show_exchangerate %]
         <tr>
           <th align="right">[% 'Exchangerate' | $T8 %]</th>
         <tr>
           <th align="right">[% 'Employee' | $T8 %]</th>
           <td>
-            [% L.select_tag('employee_id', L.options_for_select(ALL_EMPLOYEES, default=employee_id, title_sub=\sales_employee_labels)) %]
+            [% L.select_tag('employee_id', L.options_for_select(ALL_EMPLOYEES, default=employee_id, title='safe_name')) %]
           </td>
         </tr>
 [%- IF ALL_SALESMEN.size %]
         <tr>
           <th align="right">[% 'Salesman' | $T8 %]</th>
           <td>
-            [% L.select_tag('salesman_id', L.options_for_select(ALL_SALESMEN, default=(salesman_id ? salesman_id : employee_id), title_sub=\sales_employee_labels)) %]
+            [% L.select_tag('salesman_id', L.options_for_select(ALL_SALESMEN, default=(salesman_id ? salesman_id : employee_id), title='safe_name')) %]
           </td>
         </tr>
 [%- END %]
         </tr>
         <tr>
           <th align="right">[% 'Credit Note Date' | $T8 %]</th>
-          <td nowrap>
-            <input name="invdate" id="invdate" size="11" title="[% dateformat %]" value="[% invdate %]" onBlur="check_right_date_format(this)">
-            <input type="button" name="invdate_button" id="trigger1" value="[% 'button' | $T8 %]">
-          </td>
+          <td>[% L.date_tag('invdate', invdate, cal_align='BL', onchange='set_duedate()') %]</td>
         </tr>
 [%- ELSE %]
         <tr>
         </tr>
         <tr>
           <th align="right">[% 'Invoice Date' | $T8 %]</th>
-          <td nowrap>
-            <input name="invdate" id="invdate" size="11" title="[% dateformat %]" value="[% invdate %]" onBlur="check_right_date_format(this)">
-            <input type="button" name="invdate_button" id="trigger1" value="[% 'button' | $T8 %]">
-          </td>
+          <td>[% L.date_tag('invdate', invdate, cal_align='BL', onchange='set_duedate()') %]</td>
         </tr>
         <tr>
           <th align="right">[% 'Due Date' | $T8 %]</th>
-          <td width="13">
-            <input name="duedate" id="duedate" size="11" title="[% dateformat %]" value="[% duedate %]" onBlur="check_right_date_format(this)">
-            <input type="button" name="duedate_button" id="trigger2" value="[% 'button' | $T8 %]">
-          </td>
+          <td>[% L.date_tag('duedate', duedate, cal_align='BL') %]</td>
         </tr>
         <tr>
         <th align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
         </tr>
         <tr>
           <th align="right">[% 'Delivery Date' | $T8 %]</th>
-            <td width="13">
-              <input name="deliverydate" id="deliverydate" size="11" title="[% dateformat %]" value="[% deliverydate %]" onBlur="check_right_date_format(this)">
-              <input type="button" name="deliverydate_button" id="trigger3" value="[% 'button' | $T8 %]">
-            </td>
+          <td>[% L.date_tag('deliverydate', deliverydate, cal_align='BL') %]</td>
         </tr>
 [%- END %]
 
         </tr>
         <tr>
           <th align="right" nowrap>[% 'Order Date' | $T8 %]</th>
-          <td><input name="orddate" id="orddate" size="11" title="[% dateformat %]" value="[% orddate %]" onBlur="check_right_date_format(this)">
-          <input type="button" name="b_orddate" id="trigger_orddate" value="?"></td>
+          <td>[% L.date_tag('orddate', orddate, cal_align='BL') %]</td>
         </tr>
         <tr>
           <th align="right" nowrap>[% 'Quotation Number' | $T8 %]</th>
         </tr>
         <tr>
           <th align="right" nowrap>[% 'Quotation Date' | $T8 %]</th>
-          <td><input name="quodate" id="quodate" size="11" title="[% dateformat %]" value="[% quodate %]" onBlur="check_right_date_format(this)">
-           <input type="button" name="b_quodate" id="trigger_quodate" value="?"></td>
+          <td>[% L.date_tag('quodate', quodate, cal_align='BL') %]</td>
         </tr>
         <tr>
           <th align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
       </table>
     </td>
   </tr>
-</table>
-    </td>
-  </tr>
-  <tr>
+  <tr style='display:none'>
     <td>
+      <input type="hidden" name="webdav" value="[% webdav %]">
     </td>
   </tr>
+</table>
+
   <script type="text/javascript" src="js/show_form_details.js"></script>
   <script type="text/javascript" src="js/show_vc_details.js"></script>
   <script type="text/javascript" src="js/show_history.js"></script>
   <script type="text/javascript">
    <!--
-     Calendar.setup({ inputField : "invdate",      ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger1" });
-[% IF !is_type_credit_note %]
-     Calendar.setup({ inputField : "duedate",      ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger2" });
-     Calendar.setup({ inputField : "deliverydate", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger3" });
-[% END %]
-     Calendar.setup({ inputField : "orddate", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger_orddate" });
-     Calendar.setup({ inputField : "quodate", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger_quodate" });
      $('document').ready(function(){
 [% IF resubmit && is_format_html %]
        window.open('about:blank','Beleg');
        setupDateFormat('[% dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
        setupPoints('[% numberformat %]', '[% 'wrongformat' | $T8 %]');
      });
+     function set_duedate() {
+       $.ajax({
+         url: 'is.pl?action=set_duedate',
+         data: {
+           invdate: $('#invdate').val(),
+           payment_id: $('#payment_id').val(),
+         },
+         dataType: 'text',
+         success: function (data) { $('#duedate').val(data); }
+       })
+     }
    //-->
   </script>
-
-  <input type="hidden" name="webdav" value="[% webdav %]">
+<table width="100%">