[%- USE T8 %]
+[%- USE HTML %]
[%- USE LxERP %]
[%- USE L %]
+[%- USE Dumper %]
+<h1>[% FORM.title %] [% IF SELF.cv.id %] - [% HTML.escape(SELF.cv.displayable_name) %][% END %]</h1>
+[% L.hidden_tag('_cti_enabled', !!LXCONFIG.cti.dial_command) %]
[% cv_cvars = SELF.cv.cvars_by_config %]
-<form method="post" action="controller.pl">
- <div class="listtop">[% FORM.title %]</div>
+<form id='form' method="post" action="controller.pl">
[% L.hidden_tag('db', FORM.db) %]
[% L.hidden_tag('callback', FORM.callback) %]
[%- INCLUDE 'common/flash.html' %]
+ [%- SET show_deliveries = ( SELF.cv.id && ((SELF.is_customer && AUTH.assert('sales_all_edit', 1)) || (SELF.is_vendor && AUTH.assert('purchase_all_edit', 1))) ) -%]
<div class="tabwidget" id="customer_vendor_tabs">
<ul>
<li><a href="#billing">[% 'Billing Address' | $T8 %]</a></li>
+ [% IF SELF.is_customer %]
+ <li><a href="#additional_billing_addresses">[% 'Additional Billing Addresses' | $T8 %]</a></li>
+ [% END %]
<li><a href="#bank">[% 'Bank account' | $T8 %]</a></li>
<li><a href="#shipto">[% 'Shipping Address' | $T8 %]</a></li>
<li><a href="#contacts">[% 'Contacts' | $T8 %]</a></li>
- [% IF ( SELF.cv.id && AUTH.assert('sales_all_edit', 1) ) %]
+ [% IF show_deliveries %]
<li><a href="#deliveries">[% 'Supplies' | $T8 %]</a></li>
[% END %]
+ [%- IF INSTANCE_CONF.get_webdav %]
+ <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
+ [%- END %]
+ [%- IF INSTANCE_CONF.get_doc_storage %]
+ <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>
+ [%- END %]
<li><a href="#vcnotes">[% 'Notes' | $T8 %]</a></li>
[% IF ( cv_cvars.size ) %]
<li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
[% END %]
+ [% IF SELF.cv.id %]
+ <li><a href="#price_rules">[% 'Price Rules' | $T8 %]</a></li>
+ [% END %]
+
+ [% IF ( SELF.cv.id && SELF.cv.pricegroup_id && AUTH.assert('part_service_assembly_details', 1) ) %]
+ <li><a href="#price_list">[% 'Price List' | $T8 %]</a></li>
+ [% END %]
+
+ [% IF SELF.cv.id %]
+ [% IF ( FORM.db == 'customer' && AUTH.assert('show_extra_record_tab_customer',1) ) %]
+ <li><a href="[% 'controller.pl?action=CustomerVendorTurnover/list_turnover&id=' _ SELF.cv.id _ '&db=' _ FORM.db %]">[% LxERP.t8('Records') %]
+ [%- IF SELF.open_items > 0 %] <span style="color:red;"> $</span>[% END %] [%- IF SELF.open_orders > 0 %] <span style="color:red;"> !</span>[% END %]</a>
+ </li>
+ [% END %]
+ [% IF ( FORM.db == 'vendor' && AUTH.assert('show_extra_record_tab_vendor',1) ) %]
+ <li><a href="[% 'controller.pl?action=CustomerVendorTurnover/list_turnover&id=' _ SELF.cv.id _ '&db=' _ FORM.db %]">[% LxERP.t8('Records') %]
+ [%- IF SELF.open_items > 0 %] <span style="color:red;"> $</span>[% END %] [%- IF SELF.open_orders > 0 %] <span style="color:red;"> !</span>[% END %]</a>
+ </li>
+ [% END %]
+ [% END %]
+
</ul>
[% PROCESS "customer_vendor/tabs/billing.html" %]
+ [% IF SELF.is_customer %]
+ [% PROCESS "customer_vendor/tabs/additional_billing_addresses.html" %]
+ [% END %]
[% PROCESS "customer_vendor/tabs/bank.html" %]
[% PROCESS "customer_vendor/tabs/shipto.html" %]
[% PROCESS "customer_vendor/tabs/contacts.html" %]
- [% IF ( SELF.cv.id && AUTH.assert('sales_all_edit', 1) ) %]
+ [% IF show_deliveries %]
[% PROCESS "customer_vendor/tabs/deliveries.html" %]
[% END %]
+ [% PROCESS 'webdav/_list.html' %]
[% PROCESS "customer_vendor/tabs/vcnotes.html" %]
[% IF ( cv_cvars.size ) %]
[% PROCESS "customer_vendor/tabs/custom_variables.html" %]
[% END %]
+ [% IF SELF.cv.id %]
+ [% PROCESS "customer_vendor/tabs/price_rules.html" %]
+ [% END %]
+ [% IF ( SELF.cv.id && SELF.cv.pricegroup_id && AUTH.assert('part_service_assembly_details', 1) ) %]
+ [% PROCESS "customer_vendor/tabs/price_list.html" %]
+ [% END %]
</div>
-
- <br>
-
- [% L.hidden_tag('action', 'CustomerVendor/dispatch') %]
-
- [% L.submit_tag('action_save', LxERP.t8('Save'), onclick = "return check_taxzone_and_ustid()", accesskey = "s") %]
- [% L.submit_tag('action_save_and_close', LxERP.t8('Save and Close'), onclick = "return check_taxzone_and_ustid()") %]
-
- [%- IF ( SELF.is_vendor ) %]
- [% L.submit_tag('action_save_and_ap_transaction', LxERP.t8('Save and AP Transaction'), onclick = "return check_taxzone_and_ustid()") %]
- [%- ELSE %]
- [% L.submit_tag('action_save_and_ar_transaction', LxERP.t8('Save and AR Transaction'), onclick = "return check_taxzone_and_ustid()") %]
- [%- END %]
-
- [% L.submit_tag('action_save_and_invoice', LxERP.t8('Save and Invoice'), onclick = "return check_taxzone_and_ustid()") %]
- [% L.submit_tag('action_save_and_order', LxERP.t8('Save and Order'), onclick = "return check_taxzone_and_ustid()") %]
-
- [%- IF ( SELF.is_vendor ) %]
- [% L.submit_tag('action_save_and_rfq', LxERP.t8('Save and RFQ'), onclick = "return check_taxzone_and_ustid()") %]
- [%- ELSE %]
- [% L.submit_tag('action_save_and_quotation', LxERP.t8('Save and Quotation'), onclick = "return check_taxzone_and_ustid()") %]
- [%- END %]
-
- [%- IF ( SELF.cv.id && SELF.is_orphaned ) %]
- [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm => LxERP.t8('Do you really want to delete this object?')) %]
- [%- END %]
-
- [%- IF ( SELF.cv.id ) %]
- <input type="button" class="submit" onclick="kivi.CustomerVendor.showHistoryWindow([% SELF.cv.id %]);" name="history" id="history" value="[% 'history' | $T8 %]">
- [%- END %]
-
</form>
<script type="text/javascript">
<!--
- function submitInputButton(button)
+ function submitInputButton(action)
{
- var hidden = document.createElement("input");
- hidden.setAttribute("type", "hidden");
-
- if ( button.hasAttribute("name") )
- hidden.setAttribute("name", button.getAttribute("name"));
-
- if ( button.hasAttribute("value") )
- hidden.setAttribute("value", button.getAttribute("value"));
-
-
- button.form.appendChild(hidden);
-
- button.disabled = true;
+ var $hidden = $("<input type='hidden' name='action' value='CustomerVendor/" + action + "'>"),
+ $form = $('#form');
- button.form.submit();
+ $form.append($hidden);
+ $form.submit();
}
function check_taxzone_and_ustid() {