5 <h1>[% FORM.title %] [% IF SELF.cv.id %] - [% HTML.escape(SELF.cv.displayable_name) %][% END %]</h1>
7 [% L.hidden_tag('_cti_enabled', !!LXCONFIG.cti.dial_command) %]
9 [% cv_cvars = SELF.cv.cvars_by_config %]
11 <form method="post" action="controller.pl">
13 [% L.hidden_tag('db', FORM.db) %]
14 [% L.hidden_tag('callback', FORM.callback) %]
15 [% L.hidden_tag('cv.id', SELF.cv.id) %]
17 [%- INCLUDE 'common/flash.html' %]
19 <div class="tabwidget" id="customer_vendor_tabs">
21 <li><a href="#billing">[% 'Billing Address' | $T8 %]</a></li>
22 <li><a href="#bank">[% 'Bank account' | $T8 %]</a></li>
23 <li><a href="#shipto">[% 'Shipping Address' | $T8 %]</a></li>
24 <li><a href="#contacts">[% 'Contacts' | $T8 %]</a></li>
25 [% IF ( SELF.cv.id && AUTH.assert('sales_all_edit', 1) ) %]
26 <li><a href="#deliveries">[% 'Supplies' | $T8 %]</a></li>
28 <li><a href="#vcnotes">[% 'Notes' | $T8 %]</a></li>
30 [% IF ( cv_cvars.size ) %]
31 <li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
34 <li><a href="#price_rules">[% 'Price Rules' | $T8 %]</a></li>
38 [% PROCESS "customer_vendor/tabs/billing.html" %]
39 [% PROCESS "customer_vendor/tabs/bank.html" %]
40 [% PROCESS "customer_vendor/tabs/shipto.html" %]
41 [% PROCESS "customer_vendor/tabs/contacts.html" %]
42 [% IF ( SELF.cv.id && AUTH.assert('sales_all_edit', 1) ) %]
43 [% PROCESS "customer_vendor/tabs/deliveries.html" %]
45 [% PROCESS "customer_vendor/tabs/vcnotes.html" %]
46 [% IF ( cv_cvars.size ) %]
47 [% PROCESS "customer_vendor/tabs/custom_variables.html" %]
50 [% PROCESS "customer_vendor/tabs/price_rules.html" %]
56 [% L.hidden_tag('action', 'CustomerVendor/dispatch') %]
58 [% L.submit_tag('action_save', LxERP.t8('Save'), onclick = "return check_taxzone_and_ustid()", accesskey = "s") %]
59 [% L.submit_tag('action_save_and_close', LxERP.t8('Save and Close'), onclick = "return check_taxzone_and_ustid()") %]
61 [%- IF ( SELF.is_vendor ) %]
62 [% L.submit_tag('action_save_and_ap_transaction', LxERP.t8('Save and AP Transaction'), onclick = "return check_taxzone_and_ustid()") %]
64 [% L.submit_tag('action_save_and_ar_transaction', LxERP.t8('Save and AR Transaction'), onclick = "return check_taxzone_and_ustid()") %]
67 [% L.submit_tag('action_save_and_invoice', LxERP.t8('Save and Invoice'), onclick = "return check_taxzone_and_ustid()") %]
68 [% L.submit_tag('action_save_and_order', LxERP.t8('Save and Order'), onclick = "return check_taxzone_and_ustid()") %]
70 [%- IF ( SELF.is_vendor ) %]
71 [% L.submit_tag('action_save_and_rfq', LxERP.t8('Save and RFQ'), onclick = "return check_taxzone_and_ustid()") %]
73 [% L.submit_tag('action_save_and_quotation', LxERP.t8('Save and Quotation'), onclick = "return check_taxzone_and_ustid()") %]
76 [%- IF ( SELF.cv.id && SELF.is_orphaned ) %]
77 [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm => LxERP.t8('Do you really want to delete this object?')) %]
80 [%- IF ( SELF.cv.id ) %]
81 <input type="button" class="submit" onclick="kivi.CustomerVendor.showHistoryWindow([% SELF.cv.id %]);" name="history" id="history" value="[% 'history' | $T8 %]">
86 <script type="text/javascript">
88 function submitInputButton(button)
90 var hidden = document.createElement("input");
91 hidden.setAttribute("type", "hidden");
93 if ( button.hasAttribute("name") )
94 hidden.setAttribute("name", button.getAttribute("name"));
96 if ( button.hasAttribute("value") )
97 hidden.setAttribute("value", button.getAttribute("value"));
100 button.form.appendChild(hidden);
102 button.disabled = true;
104 button.form.submit();
107 function check_taxzone_and_ustid() {
108 if ( ($('#cv_taxzone_id').val() == '1') && ($('#cv_ustid').val() == '') ) {
109 alert('[% LxERP.t8('Please enter the sales tax identification number.') %]');