Lieferschein: Kunden-/Lieferantenpicker nutzen
[kivitendo-erp.git] / templates / webpages / do / form_header.html
index 5af79be..326db49 100644 (file)
@@ -1,16 +1,17 @@
 [%- USE T8 %]
 [%- USE HTML %]
 [%- USE LxERP %]
-[%- USE L %]
+[%- USE L %][%- USE P -%]
+<h1>[% title %]</h1>
+
  <script type="text/javascript" src="js/show_form_details.js"></script>
  <script type="text/javascript" src="js/show_history.js"></script>
  <script type="text/javascript" src="js/show_vc_details.js"></script>
- <script type="text/javascript" src="js/common.js"></script>
  <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
- <script type="text/javascript" src="js/vendor_selection.js"></script>
  <script type="text/javascript" src="js/calculate_qty.js"></script>
  <script type="text/javascript" src="js/stock_in_out.js"></script>
  <script type="text/javascript" src="js/follow_up.js"></script>
+ <script type="text/javascript" src="js/kivi.SalesPurchase.js"></script>
 
  <style type="text/css">
   .fixed_width {
  </style>
 
  [%- IF vc == 'customer' %]
- [%- SET vc = 'customer' %]
- [%- SET the_vc_id = customer_id %]
- [%- SET the_vc = customer %]
- [%- SET the_oldvc = oldcustomer %]
  [%- SET is_customer = '1' %]
  [%- ELSE %]
  [%- SET vc = 'vendor' %]
- [%- SET the_vc_id = vendor_id %]
- [%- SET the_vc = vendor %]
- [%- SET the_oldvc = oldvendor %]
  [%- SET is_customer = '0' %]
  [%- END %]
+ [%- SET vc_id = vc _ "_id" %]
  [%- IF delivered %]
  [%- SET DISABLED = ' disabled' %]
  [%- END %]
 
- <div class="listtop">[% title %]</div>
-
 [%- INCLUDE 'common/flash.html' %]
+[%- INCLUDE 'generic/set_longdescription.html' %]
 
  [%- IF ERRORS && ERRORS.size %]
  <p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p>
 
  <form method="post" name="do" action="do.pl">
 
- <div class="tabwidget">
+ <div id="do_tabs" class="tabwidget">
   <ul>
    <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
 [%- IF INSTANCE_CONF.get_webdav %]
    <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
 [%- END %]
-[%- IF id %]
+[%- IF id AND AUTH.assert('record_links', 1) %]
    <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=DeliveryOrder&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
 [%- END %]
   </ul>
@@ -71,7 +65,7 @@
   <input type="hidden" name="closed" value="[% HTML.escape(closed) %]">
   <input type="hidden" name="convert_from_oe_ids" value="[% HTML.escape(convert_from_oe_ids) %]">
   <input type="hidden" name="currency" value="[% HTML.escape(currency) %]">
-  <input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
+  <input type="hidden" name="customer_pricegroup_id" value="[% HTML.escape(customer_pricegroup_id) %]">
   <input type="hidden" name="discount" value="[% HTML.escape(discount) %]">
   <input type="hidden" name="dunning_amount" value="[% HTML.escape(dunning_amount) %]">
   <input type="hidden" name="email" value="[% HTML.escape(email) %]">
@@ -90,6 +84,7 @@
   <input type="hidden" name="shiptocontact" value="[% HTML.escape(shiptocontact) %]">
   <input type="hidden" name="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
   <input type="hidden" name="shiptocountry" value="[% HTML.escape(shiptocountry) %]">
+  <input type="hidden" name="shiptogln" value="[% HTML.escape(shiptogln) %]">
   <input type="hidden" name="shiptodepartment_1" value="[% HTML.escape(shiptodepartment_1) %]">
   <input type="hidden" name="shiptodepartment_2" value="[% HTML.escape(shiptodepartment_2) %]">
   <input type="hidden" name="shiptoemail" value="[% HTML.escape(shiptoemail) %]">
   <input type="hidden" name="subject" value="[% HTML.escape(subject) %]">
   <input type="hidden" name="taxincluded" value="[% HTML.escape(taxincluded) %]">
   <input type="hidden" name="taxzone_id" value="[% HTML.escape(taxzone_id) %]">
-  <input type="hidden" name="terms" value="[% HTML.escape(terms) %]">
   <input type="hidden" name="title" value="[% HTML.escape(title) %]">
   <input type="hidden" name="type" value="[% HTML.escape(type) %]">
   <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
+  <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
+[%- FOREACH row = HIDDENS %]
+   [% L.hidden_tag(row.name, row.value) %]
+[%- END %]
 
   <p>
    <table width="100%">
      <td>
       <table width="100%">
        <tr>
-        <input type="hidden" name="[% vc %]_id" value="[% HTML.escape(the_vc_id) %]">
-        <input type="hidden" name="old[% vc %]" value="[% HTML.escape(the_oldvc) %]">
         <th align="right">[% IF is_customer %][% 'Customer' | $T8 %][% ELSE %][% 'Vendor' | $T8 %][% END %]</th>
         <td>
-         [%- UNLESS !delivered && SHOW_VC_DROP_DOWN %]
-         <input type="text" value="[% HTML.escape(oldvcname) %]" name="[% HTML.escape(vc) %]"[% RO %]>
-         [%- ELSE %]
-         <select name="[% vc %]" class="fixed_width" onchange="document.do.update_button.click();"[% RO %]>
-          [%- FOREACH row = ALL_VC %]
-          <option value="[% HTML.escape(row.value) %]" [% IF the_oldvc == row.value %] selected[% END %]>[% HTML.escape(row.name) %]</option>
-          [%- END %]
-         </select>
-         <input type="hidden" name="select[% vc %]" value="1">
-         [%- END %]
-         <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% vc %]')">
+         [% IF RO %]
+          [% P.hidden_tag(vc_id, $vc_id) %]
+          [% HTML.escape(VC_OBJ.name) %]
+         [% ELSE %]
+          [% P.customer_vendor_picker(vc_id, $vc_id, type=vc, class="fixed_width") %]
+         [% END %]
+         [% P.hidden_tag("previous_" _ vc_id, $vc_id) %]
+         [% P.button_tag("show_vc_details('" _ HTML.escape(vc) _ "')", LxERP.t8("Details (one letter abbreviation)")) %]
         </td>
 
         [%- IF ALL_CONTACTS.size %]
           [%- END %]
 
           [%- ELSE %]
-            [% L.select_tag('shipto_id', ALL_SHIPTO, default = shipto_id, value_key = 'shipto_id', title_key = 'displayable_id', with_empty = 1, class = 'fixed_width') %]
+            [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ;
+               L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', style='width: 250px') %]
           [%- END %]
          </td>
         </tr>
         <td colspan="3">
           [% IF ( delivered ) %]
             [% L.hidden_tag('department_id', department_id) %]
+          [% ELSE %]
+            [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = 'width: 250px', disabled = delivered )%]
           [% END %]
-          [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = 'width: 250px', disabled = delivered )%]
        </td>
        </tr>
        [%- END %]
 
        <tr>
         <th align="right">[% 'Transaction description' | $T8 %]</th>
-        <td colspan="3"><input name="transaction_description" size="35" value="[% HTML.escape(transaction_description) %]"[% RO %]></td>
+        <td colspan="3"><input name="transaction_description" id="transaction_description" size="35" value="[% HTML.escape(transaction_description) %]"[% RO %]></td>
        </tr>
 
       </table>
         </td>
        </tr>
 
+       [%- IF is_customer %]
+       <tr>
+        <th align="right" nowrap>[% 'Insert Date' | $T8 %]</th>
+        <td>[% insertdate %]</td>
+       </tr>
+       [%- END %]
+
        <tr>
         <th width="70%" align="right" nowrap>[% 'Project Number' | $T8 %]</th>
         <td>