Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / customer_vendor / tabs / shipto.html
index b4fbb28..c47d272 100644 (file)
@@ -3,7 +3,7 @@
 [%- USE L %]
 
 <div id="shipto">
-  <table width="100%" id="shipto_table">
+  <table id="shipto_table">
     <tr>
       <th align="right">[% 'Shipping Address' | $T8 %]</th>
 
@@ -16,7 +16,7 @@
              title_key = 'displayable_id',
              with_empty = 1,
              empty_title = LxERP.t8('New shipto'),
-             onchange = "kivi.CustomerVendor.selectShipto({onFormSet: function(){shiptoMapWidget.testInputs();}});",
+             onchange = "kivi.CustomerVendor.selectShipto({onFormSet: function(){ shiptoMapWidget.testInputs(); kivi.reinit_widgets(); }});",
            )
         %]
       </td>
       <th align="right" nowrap>[% 'Name' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('shipto.shiptoname', SELF.shipto.shiptoname,  size = 35, maxlength = 75) %]
+        [% L.input_tag('shipto.shiptoname', SELF.shipto.shiptoname,  size = 35) %]
       </td>
     </tr>
 
     <tr>
-      <th align="right" nowrap>[% 'Abteilung' | $T8 %]</th>
+      <th align="right" nowrap>[% 'Department' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('shipto.shiptodepartment_1', SELF.shipto.shiptodepartment_1,  size = 16, maxlength = 75) %]
-        [% L.input_tag('shipto.shiptodepartment_2', SELF.shipto.shiptodepartment_2,  size = 16, maxlength = 75) %]
+        [% L.input_tag('shipto.shiptodepartment_1', SELF.shipto.shiptodepartment_1,  size = 16) %]
+        [% L.input_tag('shipto.shiptodepartment_2', SELF.shipto.shiptodepartment_2,  size = 16) %]
       </td>
     </tr>
 
       <th align="right" nowrap>[% 'Street' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('shipto.shiptostreet', SELF.shipto.shiptostreet,  size = 35, maxlength = 75) %]
+        [% L.input_tag('shipto.shiptostreet', SELF.shipto.shiptostreet,  size = 35) %]
 
         <span id="shipto_map"></span>
         <script type="text/javascript">
-          var shiptoMapWidget = kivi.CustomerVendor.showMapWidget('shipto_shipto', $('#shipto_map'));
+          shiptoMapWidget = new kivi.CustomerVendor.MapWidget('shipto_shipto');
+          $(function() {
+            shiptoMapWidget.render($('#shipto_map'));
+          });
         </script>
       </td>
     </tr>
@@ -56,8 +59,8 @@
       <th align="right" nowrap>[% 'Zipcode' | $T8 %]/[% 'City' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('shipto.shiptozipcode', SELF.shipto.shiptostreet,  size = 5, maxlength = 75) %]
-        [% L.input_tag('shipto.shiptocity', SELF.shipto.shiptocity,  size = 30, maxlength = 75) %]
+        [% L.input_tag('shipto.shiptozipcode', SELF.shipto.shiptozipcode,  size = 5) %]
+        [% L.input_tag('shipto.shiptocity', SELF.shipto.shiptocity,  size = 30) %]
       </td>
     </tr>
 
       <th align="right" nowrap>[% 'Country' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('shipto.shiptocountry', SELF.shipto.shiptocountry,  size = 35, maxlength = 75) %]
+        [% L.input_tag('shipto.shiptocountry', SELF.shipto.shiptocountry,  size = 35) %]
+      </td>
+    </tr>
+
+    <tr>
+      <th align="right" nowrap>[% 'GLN' | $T8 %]</th>
+
+      <td>
+        [% L.input_tag('shipto.shiptogln', SELF.shipto.shiptogln,  size = 35) %]
       </td>
     </tr>
 
@@ -73,7 +84,7 @@
       <th align="right" nowrap>[% 'Contact' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('shipto.shiptocontact', SELF.shipto.shiptocontact,  size = 30, maxlength = 75) %]
+        [% L.input_tag('shipto.shiptocontact', SELF.shipto.shiptocontact,  size = 30) %]
       </td>
     </tr>
 
@@ -81,7 +92,7 @@
       <th align="right" nowrap>[% 'Phone' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('shipto.shiptophone', SELF.shipto.shiptophone,  size = 30, maxlength = 30) %]
+        [% L.input_tag('shipto.shiptophone', SELF.shipto.shiptophone,  size = 30) %]
       </td>
     </tr>
 
       <th align="right" nowrap>[% 'Fax' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('shipto.shiptofax', SELF.shipto.shiptofax,  size = 30, maxlength = 30) %]
+        [% L.input_tag('shipto.shiptofax', SELF.shipto.shiptofax,  size = 30) %]
       </td>
     </tr>
 
         [% L.input_tag('shipto.shiptoemail', SELF.shipto.shiptoemail,  size = 45) %]
       </td>
     </tr>
+
+    [% shipto_cvars = SELF.shipto.cvars_by_config %]
+
+    [% IF ( shipto_cvars.size ) %]
+      <tr>
+        <td colspan="2">
+          <hr>
+        </td>
+      </tr>
+
+      [% FOREACH var = shipto_cvars %]
+        <tr>
+          <th align="right" valign="top" nowrap>[% var.config.description | html %]</th>
+
+          <td valign="top">
+            [% INCLUDE 'common/render_cvar_input.html'
+                       cvar_name_prefix = 'shipto_cvars.'
+            %]
+          </td>
+        </tr>
+      [% END %]
+    [% END %]
   </table>
 
-  [% L.button_tag('submitInputButton(this);', LxERP.t8('Delete Shipto'), name = 'action_delete_shipto', class = 'submit') %]
+  [% L.button_tag('submitInputButton("delete_shipto");', LxERP.t8('Delete Shipto'), class = 'submit') %]
   [% IF ( !SELF.shipto.shipto_id ) %]
     <script type="text/javascript">
       $('#action_delete_shipto').hide();