13f26db5ffde7e01d21125c602e927fe9128c49c
[kivitendo-erp.git] / templates / webpages / customer_vendor / form.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 <h1>[% FORM.title %] [% IF SELF.cv.id %] - [% HTML.escape(SELF.cv.displayable_name) %][% END %]</h1>
6
7 [% L.hidden_tag('_cti_enabled', !!LXCONFIG.cti.dial_command) %]
8
9 [% cv_cvars = SELF.cv.cvars_by_config %]
10
11 <form method="post" action="controller.pl">
12
13   [% L.hidden_tag('db', FORM.db) %]
14   [% L.hidden_tag('callback', FORM.callback) %]
15   [% L.hidden_tag('cv.id', SELF.cv.id) %]
16
17   [%- INCLUDE 'common/flash.html' %]
18
19   <div class="tabwidget" id="customer_vendor_tabs">
20     <ul>
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>
27 [%- IF INSTANCE_CONF.get_doc_storage %]
28       <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=[% FORM.db == 'vendor' ? 'vendor' : 'customer' %]&object_id=[% SELF.cv.id %]">[% 'Attachments' | $T8 %]</a></li>
29 [%- END %]
30       [% END %]
31       <li><a href="#vcnotes">[% 'Notes' | $T8 %]</a></li>
32
33       [% IF ( cv_cvars.size ) %]
34         <li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
35       [% END %]
36       [% IF SELF.cv.id %]
37         <li><a href="#price_rules">[% 'Price Rules' | $T8 %]</a></li>
38       [% END %]
39     </ul>
40
41     [% PROCESS "customer_vendor/tabs/billing.html" %]
42     [% PROCESS "customer_vendor/tabs/bank.html" %]
43     [% PROCESS "customer_vendor/tabs/shipto.html" %]
44     [% PROCESS "customer_vendor/tabs/contacts.html" %]
45     [% IF ( SELF.cv.id && AUTH.assert('sales_all_edit', 1) ) %]
46       [% PROCESS "customer_vendor/tabs/deliveries.html" %]
47     [% END %]
48     [% PROCESS "customer_vendor/tabs/vcnotes.html" %]
49     [% IF ( cv_cvars.size ) %]
50       [% PROCESS "customer_vendor/tabs/custom_variables.html" %]
51     [% END %]
52     [% IF SELF.cv.id %]
53       [% PROCESS "customer_vendor/tabs/price_rules.html" %]
54     [% END %]
55   </div>
56
57   <br>
58
59   [% L.hidden_tag('action', 'CustomerVendor/dispatch') %]
60
61   [% L.submit_tag('action_save', LxERP.t8('Save'), onclick = "return check_taxzone_and_ustid()", accesskey = "s") %]
62   [% L.submit_tag('action_save_and_close', LxERP.t8('Save and Close'), onclick = "return check_taxzone_and_ustid()") %]
63
64   [%- IF ( SELF.is_vendor ) %]
65     [% L.submit_tag('action_save_and_ap_transaction', LxERP.t8('Save and AP Transaction'), onclick = "return check_taxzone_and_ustid()") %]
66   [%- ELSE %]
67     [% L.submit_tag('action_save_and_ar_transaction', LxERP.t8('Save and AR Transaction'), onclick = "return check_taxzone_and_ustid()") %]
68   [%- END %]
69
70   [% L.submit_tag('action_save_and_invoice', LxERP.t8('Save and Invoice'), onclick = "return check_taxzone_and_ustid()") %]
71   [% L.submit_tag('action_save_and_order', LxERP.t8('Save and Order'), onclick = "return check_taxzone_and_ustid()") %]
72
73   [%- IF ( SELF.is_vendor ) %]
74     [% L.submit_tag('action_save_and_rfq', LxERP.t8('Save and RFQ'), onclick = "return check_taxzone_and_ustid()") %]
75   [%- ELSE %]
76     [% L.submit_tag('action_save_and_quotation', LxERP.t8('Save and Quotation'), onclick = "return check_taxzone_and_ustid()") %]
77   [%- END %]
78
79   [%- IF ( SELF.cv.id && SELF.is_orphaned ) %]
80     [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm => LxERP.t8('Do you really want to delete this object?')) %]
81   [%- END %]
82
83   [%- IF ( SELF.cv.id ) %]
84     <input type="button" class="submit" onclick="kivi.CustomerVendor.showHistoryWindow([% SELF.cv.id %]);" name="history" id="history" value="[% 'history' | $T8 %]">
85   [%- END %]
86
87 </form>
88
89 <script type="text/javascript">
90 <!--
91   function submitInputButton(button)
92   {
93     var hidden = document.createElement("input");
94     hidden.setAttribute("type", "hidden");
95
96     if ( button.hasAttribute("name") )
97       hidden.setAttribute("name", button.getAttribute("name"));
98
99     if ( button.hasAttribute("value") )
100       hidden.setAttribute("value", button.getAttribute("value"));
101
102
103     button.form.appendChild(hidden);
104
105     button.disabled = true;
106
107     button.form.submit();
108   }
109
110   function check_taxzone_and_ustid() {
111     if ( ($('#cv_taxzone_id').val() == '1') && ($('#cv_ustid').val() == '') ) {
112       alert('[% LxERP.t8('Please enter the sales tax identification number.') %]');
113       return false;
114     }
115     return true;
116   }
117 -->
118 </script>