[%- USE T8 %]
[%- USE HTML %]
[%- USE LxERP %]
-[%- SET follow_up_trans_info = invnumber _ ' (' _ customer_name _ ')' %]
-<body>
+[%- USE L %][%- USE P -%]
+[%- SET follow_up_trans_info = invnumber _ ' (' _ customer_obj.name _ ')' %]
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/delivery_customer_selection.js"></script>
-<script type="text/javascript" src="js/vendor_selection.js"></script>
<script type="text/javascript" src="js/calculate_qty.js"></script>
<script type="text/javascript" src="js/follow_up.js"></script>
-<script type="text/javascript" src="js/customer_or_vendor_selection.js"></script>
-<form method="post" name="invoice" action="[% script %]">
-
-<p>[% saved_message %]</p>
+<form method="post" id='form' name="invoice" action="[% script %]">
[%- FOREACH key = HIDDENS %]
-<input type="hidden" name="[% HTML.escape(key) %]" value="[% HTML.escape($key) %]">
+<input type="hidden" name="[% HTML.escape(key) %]" id="[% HTML.escape(key) %]" value="[% HTML.escape($key) %]">
[%- END %]
-<input type="hidden" name="follow_up_trans_id_1" value="[% id %]">
-<input type="hidden" name="follow_up_trans_type_1" value="sales_invoice">
-<input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
-<input type="hidden" name="follow_up_rowcount" value="1">
+<input type="hidden" name="follow_up_trans_id_1" id="follow_up_trans_id_1" value="[% id %]">
+<input type="hidden" name="follow_up_trans_type_1" id="follow_up_trans_type_1" value="sales_invoice">
+<input type="hidden" name="follow_up_trans_info_1" id="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
+<input type="hidden" name="follow_up_rowcount" id="follow_up_rowcount" value="1">
+<input type="hidden" name="lastmtime" id="lastmtime" value="[% HTML.escape(lastmtime) %]">
-<input type="hidden" name="lizenzen" value="[% lizenzen %]">
+<h1>[% title %]</h1>
+
+<p>[% saved_message %]</p>
-<p><div class="listtop" width="100%">[% title %]</div></p>
+[%- INCLUDE 'common/flash.html' %]
+[%- INCLUDE 'generic/set_longdescription.html' %]
+<div id="is_tabs" class="tabwidget">
+ <ul>
+ <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
+[%- IF INSTANCE_CONF.get_webdav %]
+ <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
+[%- END %]
+[%- IF id %]
+ [%- IF INSTANCE_CONF.get_doc_storage %]
+ <li><a href="controller.pl?action=File/list&file_type=document&object_type=invoice&object_id=[% HTML.url(id) %]">[% 'Documents' | $T8 %]</a></li>
+ <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
+ [%- END %]
+ [%- IF AUTH.assert('record_links', 1) %]
+ <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
+ [%- END %]
+ [%- IF AUTH.assert('invoice_edit', 1) %]
+ <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
+ [%- END %]
+[%- END %]
+ </ul>
+
+<div id="ui-tabs-basic-data">
<table width="100%">
<tr>
<td valign="top">
<tr>
<th align="right">[% 'Customer' | $T8 %]</th>
<td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'customer',
- style = 'width: 250px',
- DATA = ALL_CUSTOMERS,
- id_sub = 'vc_keys',
- label_key = 'name',
- select = vc_select,
- limit = vclimit,
- allow_textbox = 1,
- onChange = "document.getElementById('update_button').click();" -%]
- <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% HTML.escape(vc) %]')">
+ [% P.customer_vendor.picker("customer_id", customer_id, type="customer", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
+ [% L.button_tag("show_vc_details('customer')", LxERP.t8('Details (one letter abbreviation)')) %]
+ [% L.hidden_tag("previous_customer_id", customer_id) %]
+ [% L.hidden_tag("customer_pricegroup_id", customer_pricegroup_id) %]
</td>
- <input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
- <input type="hidden" name="customer_id" value="[% HTML.escape(customer_id) %]">
- <input type="hidden" name="oldcustomer" value="[% HTML.escape(oldcustomer) %]">
- <input type="hidden" name="selectcustomer" value="[% HTML.escape(selectcustomer) %]">
</tr>
[%- IF ALL_CONTACTS.size %]
<tr>
<th align="right">[% 'Contact Person' | $T8 %]</th>
<td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'cp_id',
- style = 'width: 250px',
- DATA = ALL_CONTACTS,
- id_key = 'cp_id',
- label_sub = 'contact_labels',
- show_empty = 1 -%]
+ [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value_key = 'cp_id', title_key = 'full_name_dep', with_empty = 1, style = 'width: 250px') %]
</td>
</tr>
[%- END %]
-[%- IF ALL_SHIPTO.size %]
<tr>
<th align="right">[% 'Shipping Address' | $T8 %]</th>
<td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'shipto_id',
- style = 'width: 250px',
- DATA = ALL_SHIPTO,
- id_key = 'shipto_id',
- label_sub = 'shipto_labels',
- show_empty = 1,
- onChange = "document.getElementById('update_button').click();" -%]
+ [%- IF ALL_SHIPTO.size %]
+ [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ;
+ L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', style='width: 250px') %]
+ [%- END %]
+ [% L.button_tag("kivi.SalesPurchase.edit_custom_shipto()", LxERP.t8("Custom shipto")) %]
</td>
</tr>
-[%- END %]
<tr>
<td align="right">[% 'Credit Limit' | $T8 %]</td>
<td>
<span class="plus[% IF is_credit_remaining_negativ %]0[% ELSE %]1[% END %]">[% LxERP.format_amount(creditremaining,0 ,'0') %]</span>
</td>
</tr>
-[%- IF max_dunning_level %]
+[%- IF max_dunning_level || dunning_description %]
<tr>
- <th align="right">[% 'Max. Dunning Level' | $T8 %]:</th>
+ <th align="right" valign="top">[% LxERP.t8("Dunning status") %]</th>
+ <td valign="top">
+ [% IF dunning_description %]
+ <span class="dunned_invoice">[% LxERP.t8("This invoice's dunning level: #1", dunning_description) %]</span>
+ [% IF max_dunning_level %]<br>[% END %]
+ [% END %]
+ [% IF max_dunning_level %]
+ <span class="customer_dunning_level">
+ [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %]
+ <br>
+ [% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
+ </span>
+ [% END %]
+ </td>
+ </tr>
+[%- END %]
+[%- IF invoice_obj.sepa_exports.as_list.size %]
+ <tr>
+ <th align="right">[% LxERP.t8("SEPA exports") %]</th>
<td>
- <b>[% max_dunning_level %]</b>; [% 'Dunning Amount' | $T8 %]: <b>[% LxERP.format_amount(dunning_amount,2) %]</b>
+ [% FOREACH export = invoice_obj.sepa_exports.as_list %]
+ <a href="sepa.pl?action=bank_transfer_edit&vc=customer&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
+ [% UNLESS loop.last %], [% END %]
+ [% END %]
</td>
</tr>
[%- END %]
[%- END %]
<tr>
<th align="right" nowrap>[% 'Record in' | $T8 %]</th>
- <td colspan="3"><select name="AR" style="width:250px;">[% selectAR %]</select></td>
- <input type="hidden" name="selectAR" value="[% selectAR %]">
+ <td colspan="3">
+ <select name="AR" style="width:250px;">[% selectAR %]</select>
+ <input type="hidden" name="selectAR" value="[% selectAR | html %]">
+ </td>
</tr>
<tr>
<th align="right">[% 'Steuersatz' | $T8 %]</th>
<td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'taxzone_id'
- stype = '250px'
- DATA = ALL_TAXZONES
- id_key = 'id'
- readonly = (id ? 1 : 0)
- label_key = 'description' -%]
- </td>
+ [% L.select_tag('taxzone_id', ( id ? ALL_TAXZONES : ALL_ACTIVE_TAXZONES) , default = taxzone_id, title_key = 'description', disabled = (id ? 1 : 0), style='width: 250px', onchange = "document.getElementById('update_button').click();") %]
[%- IF id %]
<input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
[%- END %]
+ </td>
+ </tr>
+[%- IF ALL_LANGUAGES %]
+ <tr>
+ <th align="right" nowrap>[% 'Language' | $T8 %]</th>
+ <td colspan="3">
+ [% L.select_tag('language_id', ALL_LANGUAGES, default = language_id, title_key = 'description', with_empty = 1, style = 'width:250px') %]
+ </td>
</tr>
-[%- IF all_departments %]
+[%- END %]
+[%- IF ALL_DEPARTMENTS %]
<tr>
<th align="right" nowrap>[% 'Department' | $T8 %]</th>
<td colspan="3">
- [%- INCLUDE 'generic/multibox.html'
- name = 'department_id',
- style = 'width: 250px',
- DATA = all_departments,
- id_key = 'id',
- label_sub = 'department_labels',
- show_empty = 1 -%]
+ [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = 'width:250px') %]
</td>
</tr>
[%- END %]
<td>[% currencies %]</td>
</tr>
[%- END %]
- <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
- <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
+ <tr style='display:none'>
+ <td>
+ <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
+ <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
+ <input type="hidden" name="rndgain_accno" value="[% rndgain_accno %]">
+ <input type="hidden" name="rndloss_accno" value="[% rndloss_accno %]">
+ </td>
+ </tr>
[%- IF show_exchangerate %]
<tr>
<th align="right">[% 'Exchangerate' | $T8 %]</th>
<td>
[%- IF forex %]
- [% LxERP.format_amount(exchangerate, 2) %]
+ [% LxERP.format_amount(exchangerate, 5) %]
[%- ELSE %]
<input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
[%- END %]
</tr>
<tr>
<th align="right">[% 'Transaction description' | $T8 %]</th>
- <td colspan="3"><input size='35' name="transaction_description" value="[% HTML.escape(transaction_description) %]"></td>
+ <td colspan="3">[% L.input_tag("transaction_description", transaction_description, size=35, "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
</tr>
</table>
</td>
<tr>
<th align="right">[% 'Employee' | $T8 %]</th>
<td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'employee_id',
- DATA = ALL_EMPLOYEES,
- id_key = 'id',
- label_sub = 'sales_employee_labels' -%]
+ [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name') %]
</td>
</tr>
[%- IF ALL_SALESMEN.size %]
<tr>
<th align="right">[% 'Salesman' | $T8 %]</th>
<td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'salesman_id',
- default = salesman_id ? salesman_id : employee_id,
- DATA = ALL_SALESMEN,
- id_key = 'id',
- label_sub = 'sales_employee_labels' -%]
+ [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name') %]
</td>
</tr>
[%- END %]
[%- IF is_type_credit_note %]
<tr>
<th align="right" nowrap>[% 'Credit Note Number' | $T8 %]</th>
- <td colspan="3"><input size='11' name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
+ <td colspan="3"><input size='11' name="invnumber" id="invnumber" value="[% HTML.escape(invnumber) %]"></td>
+ </tr>
+ <tr>
+ <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
+ <td colspan="3"><input size='11' name="invnumber_for_credit_note" id="invnumber_for_credit_note" value="[% HTML.escape(invnumber_for_credit_note) %]"></td>
</tr>
<tr>
<th align="right">[% 'Credit Note Date' | $T8 %]</th>
- <td nowrap>
- <input name="invdate" id="invdate" size="11" title="[% dateformat %]" value="[% invdate %]" onBlur="check_right_date_format(this)">
- <input type="button" name="invdate_button" id="trigger1" value="[% 'button' | $T8 %]">
- </td>
+ <td>[% L.date_tag('invdate', invdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")') %]</td>
</tr>
[%- ELSE %]
<tr>
<th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
- <td colspan="3"><input size='11' name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
+ <td colspan="3"><input size='11' name="invnumber" id="invnumber" value="[% HTML.escape(invnumber) %]"></td>
</tr>
<tr>
<th align="right">[% 'Invoice Date' | $T8 %]</th>
- <td nowrap>
- <input name="invdate" id="invdate" size="11" title="[% dateformat %]" value="[% invdate %]" onBlur="check_right_date_format(this)">
- <input type="button" name="invdate_button" id="trigger1" value="[% 'button' | $T8 %]">
- </td>
+ <td>[% L.date_tag('invdate', invdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")') %]</td>
</tr>
<tr>
<th align="right">[% 'Due Date' | $T8 %]</th>
- <td width="13">
- <input name="duedate" id="duedate" size="11" title="[% dateformat %]" value="[% duedate %]" onBlur="check_right_date_format(this)">
- <input type="button" name="duedate_button" id="trigger2" value="[% 'button' | $T8 %]">
+ <td>
+ <span id="duedate_container"[% IF payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% L.date_tag('duedate', duedate) %]</span>
+ <span id="duedate_fixed"[% IF !payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% HTML.escape(duedate) %]</span>
</td>
</tr>
+[%- END %]
<tr>
- <th align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
- <td colspan="3"><input size='11' name="donumber" value="[% HTML.escape(donumber) %]"></td>
+ <th align="right" nowrap>[% LxERP.t8('Tax point') %]</th>
+ <td nowrap>[% L.date_tag('tax_point', tax_point, id='tax_point') %]</td>
</tr>
+[%- IF !is_type_credit_note %]
<tr>
- <th align="right">[% 'Delivery Date' | $T8 %]</th>
- <td width="13">
- <input name="deliverydate" id="deliverydate" size="11" title="[% dateformat %]" value="[% deliverydate %]" onBlur="check_right_date_format(this)">
- <input type="button" name="deliverydate_button" id="trigger3" value="[% 'button' | $T8 %]">
- </td>
+ <th align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
+ <td colspan="3"><input size='11' name="donumber" id="donumber" value="[% HTML.escape(donumber) %]"></td>
</tr>
[%- END %]
-
+ <tr>
+ <th align="right">[% 'Delivery Date' | $T8 %]</th>
+ <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
+ </tr>
<tr>
<th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
- <td colspan="3"><input size='11' name="ordnumber" value="[% HTML.escape(ordnumber) %]"></td>
+ <td colspan="3"><input size='11' name="ordnumber" id="ordnumber" value="[% HTML.escape(ordnumber) %]"></td>
</tr>
<tr>
<th align="right" nowrap>[% 'Order Date' | $T8 %]</th>
- <td><input name="orddate" id="orddate" size="11" title="[% dateformat %]" value="[% orddate %]" onBlur="check_right_date_format(this)">
- <input type="button" name="b_orddate" id="trigger_orddate" value="?"></td>
+ <td>[% L.date_tag('orddate', orddate) %]</td>
</tr>
<tr>
<th align="right" nowrap>[% 'Quotation Number' | $T8 %]</th>
- <td colspan="3"><input size='11' name="quonumber" value="[% HTML.escape(quonumber) %]"></td>
+ <td colspan="3"><input size='11' name="quonumber" id="quonumber" value="[% HTML.escape(quonumber) %]"></td>
</tr>
<tr>
<th align="right" nowrap>[% 'Quotation Date' | $T8 %]</th>
- <td><input name="quodate" id="quodate" size="11" title="[% dateformat %]" value="[% quodate %]" onBlur="check_right_date_format(this)">
- <input type="button" name="b_quodate" id="trigger_quodate" value="?"></td>
+ <td>[% L.date_tag('quodate', quodate) %]</td>
</tr>
<tr>
<th align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
- <td colspan="3"><input size='11' name="cusordnumber" value="[% HTML.escape(cusordnumber) %]"></td>
+ <td colspan="3"><input size='11' name="cusordnumber" id="cusordnumber" value="[% HTML.escape(cusordnumber) %]"></td>
</tr>
<tr>
<th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
<td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'globalproject_id',
- DATA = ALL_PROJECTS,
- id_key = 'id',
- label_key = 'projectnumber',
- show_empty = 1,
- onChange = "document.getElementById('update_button').click();" -%]
+ [%- L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = '1', onChange = "document.getElementById('update_button').click();") %]
</td>
</tr>
</table>
</td>
</tr>
-</table>
- </td>
- </tr>
- <tr>
+ <tr style='display:none'>
<td>
+ <input type="hidden" name="webdav" value="[% webdav %]">
</td>
</tr>
+</table>
+
<script type="text/javascript" src="js/show_form_details.js"></script>
<script type="text/javascript" src="js/show_vc_details.js"></script>
<script type="text/javascript" src="js/show_history.js"></script>
<script type="text/javascript">
<!--
- Calendar.setup({ inputField : "invdate", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger1" });
-[% IF !is_type_credit_note %]
- Calendar.setup({ inputField : "duedate", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger2" });
- Calendar.setup({ inputField : "deliverydate", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger3" });
-[% END %]
- Calendar.setup({ inputField : "orddate", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger_orddate" });
- Calendar.setup({ inputField : "quodate", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger_quodate" });
$('document').ready(function(){
[% IF resubmit && is_format_html %]
window.open('about:blank','Beleg');
document.invoice.target = 'Beleg';
- document.invoice.submit();
+ kivi.SalesPurchase.show_print_dialog();
+ kivi.SalesPurchase.print_record();
[% ELSIF resubmit %]
- document.invoice.submit();
+ kivi.SalesPurchase.show_print_dialog();
+ kivi.SalesPurchase.print_record();
[% ELSIF creditwarning != '' %]
alert('[% 'Credit Limit exceeded!!!' | $T8 %]');
[% ELSE %]
- focus();
[% END %]
- setupDateFormat('[% dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
- setupPoints('[% numberformat %]', '[% 'wrongformat' | $T8 %]');
});
//-->
</script>
-
- <input type="hidden" name="webdav" value="[% webdav %]">
+<table width="100%">