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