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