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