Factur-X/ZUGFeRD: neues Feld »Unsere Leitweg-ID beim Kunden« in Kundenstammdaten
[kivitendo-erp.git] / templates / webpages / customer_vendor / tabs / billing.html
index f666b5a..861298a 100644 (file)
@@ -2,13 +2,14 @@
 [%- USE HTML %]
 [%- USE LxERP %]
 [%- USE L %]
+[%- USE JavaScript -%]
 
 <div id="billing">
   <table width="100%">
 
     <tr height="5"></tr>
 
-    [% IF ( conf_vertreter ) %]<!-- == $::lx_office_conf{features}->{vertreter}; -->
+    [% IF ( INSTANCE_CONF.get_vertreter ) %]
       <tr>
         <th align="right">
           [% IF SELF.is_vendor() %]
@@ -29,8 +30,7 @@
         </th>
 
         <td>
-          <!-- TODO: ALL_SALESMAN_CUSTOMERS -->
-          [% L.select_tag('cv.salesman_id', SELF.all_employees, value_key = 'id', title_key = 'safe_name', with_empty = 1) %]
+          [% L.select_tag('cv.salesman_id', SELF.all_salesman_customers, default = SELF.cv.salesman_id, value_key = 'id', title_key = 'name', with_empty = 1) %]
         </td>
       </tr>
 
       <th align="right" nowrap>[% 'Greeting' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('cv.greeting', SELF.cv.greeting) %]
-        [% L.select_tag('cv_greeting_select', SELF.all_greetings, default = SELF.cv.greeting, with_empty = 1, onchange = '$("#cv_greeting").val(this.value);') %]
+        [%- IF INSTANCE_CONF.get_vc_greetings_use_textfield -%]
+          [% L.input_tag('cv.greeting', SELF.cv.greeting) %]
+          [% L.select_tag('cv_greeting_select', SELF.all_greetings, default = SELF.cv.greeting, value_key = 'description', title_key = 'description', with_empty = 1, onchange = '$("#cv_greeting").val(this.value);') %]
+        [%- ELSE -%]
+          [% L.select_tag('cv.greeting', SELF.all_greetings, default = SELF.cv.greeting, value_key = 'description', title_key = 'description', with_empty = 1) %]
+        [%- END -%]
       </td>
     </tr>
 
@@ -70,6 +74,8 @@
 
       <td>
         [% L.input_tag('cv.name', SELF.cv.name) %]
+        <label for="cv_natural_person">[% 'natural person' | $T8 %]</label>
+        [% L.checkbox_tag('cv.natural_person', checked = SELF.cv.natural_person, for_submit=1) %]
       </td>
     </tr>
 
@@ -77,8 +83,8 @@
       <th align="right" nowrap>[% 'Department' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('cv.department_1', SELF.cv.department_1, size = 16, maxlength = 75) %]
-        [% L.input_tag('cv.department_2', SELF.cv.department_2, size = 16, maxlength = 75) %]
+        [% L.input_tag('cv.department_1', SELF.cv.department_1, size = 16) %]
+        [% L.input_tag('cv.department_2', SELF.cv.department_2, size = 16) %]
       </td>
     </tr>
 
       <th align="right" nowrap>[% 'Street' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('cv.street', SELF.cv.street) %]
-        <a href="#" onclick="namespace('kivi.CustomerVendor').showMap('cv_');" title="[% 'Map' | $T8 %]">
-          <img src="image/map.png" alt="[% 'Map' | $T8 %]" />
-        </a>
+        [% L.input_tag('cv.street', SELF.cv.street, size = 35) %]
+        <span id="billing_map"></span>
+        <script type="text/javascript">
+          billingMapWidget = new kivi.CustomerVendor.MapWidget('cv_', '[% JavaScript.escape(SELF.home_address_for_google_maps) %]');
+          $(function() {
+            billingMapWidget.render($('#billing_map'));
+          });
+        </script>
       </td>
     </tr>
 
       <th align="right" nowrap>[% 'Zipcode' | $T8 %]/[% 'City' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('cv.zipcode', SELF.cv.zipcode, size = 5 maxlength = 10) %]
-        [% L.input_tag('cv.city', SELF.cv.city, size = 30 maxlength = 75) %]
+        [% L.input_tag('cv.zipcode', SELF.cv.zipcode, size = 5) %]
+        [% L.input_tag('cv.city', SELF.cv.city, size = 30) %]
       </td>
     </tr>
 
       <th align="right" nowrap>[% 'Country' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('cv.country', SELF.cv.country, size = 30 maxlength = 75) %]
+        [% L.input_tag('cv.country', SELF.cv.country, size = 30) %]
+      </td>
+    </tr>
+
+    <tr>
+      <th align="right" nowrap>[% 'GLN' | $T8 %]</th>
+
+      <td>
+        [% L.input_tag('cv.gln', SELF.cv.gln, size = 30) %]
       </td>
     </tr>
 
       <th align="right" nowrap>[% 'Contact' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('cv.contact', SELF.cv.contact, size = 28 maxlength = 75) %]
+        [% L.input_tag('cv.contact', SELF.cv.contact, size = 28) %]
       </td>
     </tr>
 
       <th align="right" nowrap>[% 'Fax' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('cv.fax', SELF.cv.fax, size = 30 maxlength = 30) %]
+        [% L.input_tag('cv.fax', SELF.cv.fax, size = 30) %]
       </td>
     </tr>
 
       </td>
     </tr>
 
+    <tr>
+      <th align="right">[% 'Cc E-mail' | $T8 %]</th>
+
+      <td>
+        [% L.input_tag('cv.cc', SELF.cv.cc, size = 45) %]
+      </td>
+    </tr>
+
+    <tr>
+      <th align="right">[% 'Bcc E-mail' | $T8 %]</th>
+
+      <td>
+        [% L.input_tag('cv.bcc', SELF.cv.bcc, size = 45) %]
+      </td>
+    </tr>
+    [% IF ( SELF.is_customer() ) %]
+    <tr>
+      <th align="right">[% 'Email of the invoice recipient' | $T8 %]</th>
+      <td>[% L.input_tag('cv.invoice_mail', SELF.cv.invoice_mail, size = 45) %]</td>
+    </tr>
+    <tr>
+      <th align="right">[% 'Email of the delivery order recipient' | $T8 %]</th>
+      <td>[% L.input_tag('cv.delivery_order_mail', SELF.cv.delivery_order_mail, size = 45) %]</td>
+    </tr>
+    [% END %]
     <tr>
       <th align="right" nowrap>
-        [% IF homepage %]
+        [% IF SELF.cv.homepage %]
           <a href="[% HTML.escape(SELF.cv.homepage) %]" title="[% 'Open this Website' | $T8 %]" target="_blank">[% 'Homepage' | $T8 %]</a>
         [% ELSE %]
           [% 'Homepage' | $T8 %]
       <th align="right">[% 'Discount' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('cv.discount_as_percent', SELF.cv.discount_as_percent, size = 4) %]
+        [% L.input_tag('cv.discount_as_percent', SELF.cv.discount_as_percent, size = 4) %]%
       </td>
     </tr>
 
     <tr>
+      [% IF ( SELF.all_currencies.size ) %]
+        <th align="right">[% 'Currency' | $T8 %]</th>
+        <td>
+          [% L.select_tag('cv.currency_id', SELF.all_currencies, title_key = 'name', value_key = 'id', default = SELF.cv.currency_id) %]
+        </td>
+      [% END %]
+
       <th align="right">[% 'Tax Number / SSN' | $T8 %]</th>
 
       <td>
       <th align="right">[% 'sales tax identification number' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('cv.ustid', SELF.cv.ustid, maxlength = 14 size = 20 ) %]
+        [% L.input_tag('cv.ustid', SELF.cv.ustid, size = 20 ) %]
       </td>
+    </tr>
 
-
-      [%- IF ( SELF.is_vendor() ) %]
-        <th align="right">[% 'Customer Number' | $T8 %]</th>
+    <tr>
+      [% IF ( SELF.is_customer() ) %]
+        <th align="right">[% 'Commercial court' | $T8 %]</th>
         <td>
-          [% L.input_tag('cv.v_customer_id', SELF.cv.v_customer_id, size = 10) %]
+          [% L.input_tag('cv.commercial_court', SELF.cv.commercial_court, size = 20) %]
         </td>
-      [%- ELSE %]
+
         <th align="right">[% 'our vendor number at customer' | $T8 %]</th>
         <td>
-          [% L.input_tag('cv.c_vendor_id', SELF.cv.c_vendor_id, size = 10) %]
+          [% L.input_tag('cv.c_vendor_id', SELF.cv.c_vendor_id, size = 20) %]
         </td>
-      [%- END %]
-    </tr>
-
-    <tr>
-      <th align="right">[% 'Account Number' | $T8 %]</th>
-
-      <td>
-        [% L.input_tag('cv.account_number', SELF.cv.account_number, size = 10, maxlength = 100) %]
-      </td>
-
-
-      <th align="right">[% 'Bank Code Number' | $T8 %]</th>
-
-      <td>
-        [% L.input_tag('cv.bank_code', SELF.cv.bank_code, size = 10, maxlength = 100) %]
-      </td>
-
-
-      <th align="right">[% 'Bank' | $T8 %]</th>
 
-      <td>
-        [% L.input_tag('cv.bank', SELF.cv.bank, size = 20) %]
-      </td>
-    </tr>
-
-    <tr>
-      <th align="right">[% 'IBAN' | $T8 %]</th>
-
-      <td>
-        [% L.input_tag('cv.iban', SELF.cv.iban, size = 10, maxlength = 100) %]
-      </td>
-
-
-      <th align="right">[% 'BIC' | $T8 %]</th>
-      <td>
-        [% L.input_tag('cv.bic', SELF.cv.bic, size = 10, maxlength = 100) %]
-      </td>
-
-
-      [% IF ( SELF.all_currencies.size ) %]
-        <th align="right">[% 'Currency' | $T8 %]</th>
+        <th align="right">[% 'Our routing id at customer' | $T8 %]</th>
+        <td>
+          [% L.input_tag('cv.c_vendor_routing_id', SELF.cv.c_vendor_routing_id, size = 20) %]
+        </td>
 
+      [%- ELSE %]
+        <th align="right">[% 'Customer Number' | $T8 %]</th>
         <td>
-          [% L.select_tag('cv.currency_id', SELF.all_currencies, title_key = 'name', value_key = 'id', default = SELF.cv.currency_id, with_empty = 1) %]
+          [% L.input_tag('cv.v_customer_id', SELF.cv.v_customer_id, size = 20) %]
         </td>
-      [% END %]
+      [%- END %]
     </tr>
-
     <tr>
-      [% IF ( !conf_vertreter ) %]
+      [% IF ( !INSTANCE_CONF.get_vertreter ) %]
         <th align="right">
           [% IF ( SELF.is_vendor() ) %]
             [% 'Type of Vendor' | $T8 %]
         [% L.select_tag('cv.language_id', SELF.all_languages, default = SELF.cv.language_id, value_key = 'id', title_key = 'description', with_empty = 1) %]
       </td>
 
-
-      <th align="right">[% 'Bcc' | $T8 %]</th>
+      <th align="right">[% 'Delivery Terms' | $T8 %]</th>
 
       <td>
-        [% L.input_tag('cv.bcc', SELF.cv.bcc, size = 40) %]
+        [% L.select_tag('cv.delivery_term_id', SELF.all_delivery_terms, default = SELF.cv.delivery_term_id, value_key = 'id', title_key = 'description', with_empty = 1) %]
       </td>
 
-
-      [% IF ( SELF.is_customer() ) %]
-        <th align="right">[% 'Preisklasse' | $T8 %]</th>
-
-        <td>
-          [% L.select_tag('cv.klass', SELF.all_pricegroups, default = SELF.cv.klass, value_key = 'id', title_key = 'pricegroup', with_empty = 1) %]
-        </td>
-      [% END  %]
     </tr>
 
     <tr>
       </td>
 
       <td>
-        [% L.checkbox_tag('cv.obsolete', checked = SELF.cv.obsolete) %]
+        [% L.checkbox_tag('cv.obsolete', checked = SELF.cv.obsolete, for_submit=1) %]
       </td>
 
 
       </td>
 
       <td>
-        [% L.checkbox_tag('cv.direct_debit', checked = SELF.cv.direct_debit) %]
+        [% L.checkbox_tag('cv.direct_debit', checked = SELF.cv.direct_debit, for_submit=1) %]
       </td>
+
+      [% IF ( SELF.is_customer() ) %]
+        <th align="right">[% 'Price group' | $T8 %]</th>
+
+        <td>
+          [% L.select_tag('cv.pricegroup_id', SELF.all_pricegroups, default = SELF.cv.pricegroup_id, value_key = 'id', title_key = 'pricegroup', with_empty = 1) %]
+        </td>
+      [% END  %]
+
     </tr>
 
     <tr>
-      <th align="right">[% 'Steuersatz' | $T8 %]</th>
+      <th align="right">[% 'Tax rate' | $T8 %]</th>
 
       <td>
         [% L.select_tag('cv.taxzone_id', SELF.all_taxzones, default = SELF.cv.taxzone_id, value_key = 'id', title_key = 'description') %]
       </td>
 
 
-      [% IF ( SELF.is_customer() && !conf_vertreter ) %]
+      [% IF ( SELF.is_customer() && !INSTANCE_CONF.get_vertreter ) %]
         <th align="right">[% 'Salesman' | $T8 %]</th>
 
         <td>
-          <!-- TODO: ALL_SALESMAN -->
-          [% L.select_tag('cv.salesman_id', SELF.all_employees, default = salesman_id, value_key = 'id', title_key = 'safe_name', with_empty = 1) %]
+          [% L.select_tag('cv.salesman_id', SELF.all_salesmen, default = SELF.cv.salesman_id, value_key = 'id', title_key = 'safe_name', with_empty = 1) %]
         </td>
+      [%- END %]
 
+      [% IF ( SELF.is_customer() ) %]
         <td>[% 'taxincluded checked' | $T8 %]</td>
 
         <td>
           [% L.select_tag('cv.taxincluded_checked', [[undef, LxERP.t8('use user config')], ['1', LxERP.t8('Yes')], ['0', LxERP.t8('No')]], default = SELF.cv.taxincluded_checked) %]
         </td>
-      [%- END %]
+      [% END %]
+
     </tr>
+
+    [% IF ( SELF.is_customer() ) %]
+     <tr>
+      <th align="right">[%- LxERP.t8("Hourly rate") %]</th>
+      <td>[% L.input_tag("cv.hourly_rate_as_number", SELF.cv.hourly_rate_as_number) %]</td>
+      <th align="right" valign="top" nowrap>[% 'Shoporderlock' | $T8 %]</th>
+      <td>
+        [% L.checkbox_tag('cv.order_lock', checked = SELF.cv.order_lock, for_submit=1) %]
+      </td>
+      <th align="right">[% LxERP.t8("Create sales invoices with ZUGFeRD data") %]</th>
+      <td>[% L.select_tag("cv.create_zugferd_invoices",
+                          [ [ -1, LxERP.t8('Use settings from client configuration') ],
+                            [ 0, LxERP.t8('Do not create ZUGFeRD invoices') ],
+                            [ 1, LxERP.t8('Create ZUGFeRD invoices') ],
+                            [ 2, LxERP.t8('Create ZUGFeRD invoices in test mode') ] ],
+                          default=SELF.cv.create_zugferd_invoices) %]</td>
+     </tr>
+    [% END %]
   </table>
 
   <table>
     <tr>
       <th align="left" nowrap>[% 'Internal Notes' | $T8 %]</th>
+    [% IF ( SELF.is_customer() ) %]
+      <th align="left">[% 'Origin of personal data' | $T8 %]</th>
+    [% END %]
     </tr>
-
     <tr>
       <td>
         [% L.textarea_tag('cv.notes', SELF.cv.notes, rows = 3 cols = 60 wrap = soft) %]
       </td>
+    [% IF ( SELF.is_customer() ) %]
+      <td>
+        [% L.textarea_tag('cv.contact_origin', SELF.cv.contact_origin,  rows = 3 cols = 60 wrap = soft) %]
+      </td>
+    [% END %]
     </tr>
   </table>
 </div>