6 [% SET follow_up_trans_info = invnumber _ ' (' _ customer_obj.name _ ')' %]
7 <script type="text/javascript" src="js/common.js"></script>
8 <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
9 <script type="text/javascript" src="js/calculate_qty.js"></script>
10 <script type="text/javascript" src="js/follow_up.js"></script>
13 [% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %]
14 [% title %] [% invnumber %]
17 <form method="post" id='form' name="invoice" action="[% script %]">
19 [% FOREACH key = HIDDENS %]
20 <input type="hidden" name="[% HTML.escape(key) %]" id="[% HTML.escape(key) %]" value="[% HTML.escape($key) %]">
22 <input type="hidden" name="follow_up_trans_id_1" id="follow_up_trans_id_1" value="[% id %]">
23 <input type="hidden" name="follow_up_trans_type_1" id="follow_up_trans_type_1" value="sales_invoice">
24 <input type="hidden" name="follow_up_trans_info_1" id="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
25 <input type="hidden" name="follow_up_rowcount" id="follow_up_rowcount" value="1">
26 <input type="hidden" name="lastmtime" id="lastmtime" value="[% HTML.escape(lastmtime) %]">
27 <input type="hidden" name="already_printed_flag" id="already_printed_flag" value="0">
28 <input type="hidden" name="has_qr_reference" id="has_qr_reference" value="[% has_qr_reference %]">
29 [%- IF qr_reference %]
30 [% L.hidden_tag("qr_reference", qr_reference) %]
33 [% L.hidden_tag('form_validity_token', form_validity_token) %]
35 [% L.hidden_tag('email_journal_id', email_journal_id) %]
36 [% L.hidden_tag('email_attachment_id', email_attachment_id) %]
37 [% L.hidden_tag('workflow_email_journal_id', workflow_email_journal_id) %]
38 [% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %]
39 [% L.hidden_tag('workflow_email_callback', workflow_email_callback) %]
41 [% IF saved_message != '' %]<p>[% saved_message %]</p>[% END %]
43 [% INCLUDE 'common/flash.html' %]
44 [% INCLUDE 'generic/set_longdescription.html' %]
46 <div id="is_tabs" class="tabwidget">
47 <ul class="ui-tabs-nav">
48 <li><a href="#ui-tabs-basic-data" class="ui-tabs">[% 'Basic Data' | $T8 %]</a></li>
49 [% IF email_attachment_id || workflow_email_attachment_id %]
50 <li><a href="controller.pl?action=EmailJournal/attachment_preview&attachment_id=[% HTML.url(email_attachment_id || workflow_email_attachment_id) %]">[% 'Email Attachment Preview' | $T8 %]</a></li>
52 [% IF INSTANCE_CONF.get_webdav %]
53 <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
56 [% IF INSTANCE_CONF.get_doc_storage %]
57 <li><a href="controller.pl?action=File/list&file_type=document&object_type=[% type %]&object_id=[% HTML.url(id) %]">[% 'Documents' | $T8 %]</a></li>
58 <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=[% type %]&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
60 [% IF AUTH.assert('record_links', 1) %]
61 <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
63 [% IF AUTH.assert('invoice_edit', 1) %]
64 <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
70 <div id="ui-tabs-basic-data" class="ui-tabs-panel">
72 [% IF email_attachment_id || workflow_email_attachment_id%]
73 <div class="wrapper" id="email_attachment_wrapper">
76 P.email_journal.attachment_preview(
77 email_attachment_id || workflow_email_attachment_id,
81 INCLUDE 'common/toggle_panel.html'
83 button_closed = LxERP.t8('Show Attachment')
84 button_open = LxERP.t8('Hide Attachment')
90 <div class="wrapper" id="wrapper-1">
91 [% INCLUDE 'generic/toggle_wrapper.html' %]
92 <table class="tbl-horizontal">
93 <caption>[% 'Customer & Order' | $T8 %]</caption>
94 <colgroup><col class="wi-mediumsmall"><col class="wi-wide"></colgroup>
97 <th>[% 'Customer' | $T8 %]</th>
98 <td><!-- PENDENT: Type sollte text und nicht customer sein. Ueberall bei customer_vendor.picker aendern, auf allen Seiten -->
99 [% P.customer_vendor.picker("customer_id", customer_id, type="customer", class="wi-wide initial_focus",
101 [% L.hidden_tag("previous_customer_id", customer_id) %]
102 [% L.hidden_tag("customer_pricegroup_id", customer_pricegroup_id) %]
105 [% IF ALL_CONTACTS.size %]
107 <th>[% 'Contact Person' | $T8 %]</th>
109 [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value_key = 'cp_id', title_key = 'full_name_dep', with_empty = 1, class="wi-wide") %]
114 <th>[% 'Shipping Address' | $T8 %]</th>
116 [% IF ALL_SHIPTO.size %]
117 [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ;
118 L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', class="wi-wide") %]
120 [% L.button_tag("kivi.SalesPurchase.edit_custom_shipto()", LxERP.t8("Custom shipto"), class="wi-wide neutral below") %]
123 [% IF customer_obj.additional_billing_addresses.as_list.size %]
125 <th>[% 'Custom Billing Address' | $T8 %]</th>
127 [% L.select_tag('billing_address_id', customer_obj.additional_billing_addresses,
128 with_empty=1, default=billing_address_id, value_key='id', title_key='displayable_id', class="wi-wide") %]
133 <th>[% 'Credit Limit' | $T8 %]</th>
135 <span class="data wi-wide">[% LxERP.format_amount(creditlimit, 0, '0') %], [% 'Remaining' | $T8 %] <span class="plus[% IF is_credit_remaining_negativ %]0[% ELSE %]1[% END %]">[% LxERP.format_amount(creditremaining,0 ,'0') %]</span> </span>
138 [% IF max_dunning_level || dunning_description %]
140 <th>[% LxERP.t8("Dunning status") %]</th>
142 [% IF dunning_description %]
143 <span class="dunned_invoice data wi-wide">[% LxERP.t8("This invoice's dunning level: #1", dunning_description) %]</span>
144 [% IF max_dunning_level %]<br>[% END %]
146 [% IF max_dunning_level %]
147 <span class="customer_dunning_level data wi-wide">
148 [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %]<br>
149 [% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
155 [% IF invoice_obj.sepa_exports.as_list.size %]
157 <th>[% LxERP.t8("SEPA exports") %]</th>
159 [% FOREACH export = invoice_obj.sepa_exports.as_list %]
160 <a href="sepa.pl?action=bank_transfer_edit&vc=customer&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
161 [% UNLESS loop.last %], [% END %]
168 <th>[% 'Customer type' | $T8 %]</th>
169 <td><span class="data wi-wide">[% business %] ([% 'Trade Discount' | $T8 %] [% LxERP.format_amount(tradediscount * 100) %]%)</span></td>
173 <th>[% 'Record in' | $T8 %]</th>
174 <td>[% P.chart.picker("AR_chart_id", AR_chart_id, class="wi-wide", type="AR", "data-validate"="required") %]</td>
178 <th>[% 'Currency' | $T8 %]</th>
181 [% HTML.escape(currency) %]
182 [% L.hidden_tag("currency", currency) %]
189 [% IF show_exchangerate %]
191 <th>[% 'Exchangerate' | $T8 %]</th>
194 [% LxERP.format_amount(exchangerate, 5) %]
195 [% L.hidden_tag("exchangerate", LxERP.format_amount(exchangerate, 5)) %]
197 <input type="text" name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
199 [% IF record_forex %][% 'record exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
204 <th>[% 'Steuersatz' | $T8 %]</th>
206 [% L.select_tag('taxzone_id', ( id ? ALL_TAXZONES : ALL_ACTIVE_TAXZONES) , default = taxzone_id, title_key = 'description', disabled = (id ? 1 : 0), class='wi-wide', onchange = "document.getElementById('update_button').click();") %]
208 <input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
214 <th>[% 'Tax Included' | $T8 %]</th>
216 <input type="hidden" name="taxincluded_changed_by_user" id="taxincluded_changed_by_user" value="[% taxincluded_changed_by_user ? '1' : '0' %]">
217 <input name="taxincluded" onclick="document.getElementById('taxincluded_changed_by_user').value = '1';" type="checkbox" [% IF taxincluded %]checked[% END %]>
221 [% IF ALL_LANGUAGES %]
223 <th>[% 'Language' | $T8 %]</th>
225 [% L.select_tag('language_id', ALL_LANGUAGES, default = language_id, title_key = 'description', with_empty = 1, style = 'width:250px') %]
229 [% IF ALL_DEPARTMENTS %]
231 <th>[% 'Department' | $T8 %]</th>
232 <td>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, class='wi-wide') %]</td>
235 <tr style='display:none'>
237 <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
238 <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
239 <input type="hidden" name="rndgain_accno" value="[% rndgain_accno %]">
240 <input type="hidden" name="rndloss_accno" value="[% rndloss_accno %]">
244 <th>[% 'Shipping Point' | $T8 %]</th>
245 <td><input type="text" class="wi-wide" name="shippingpoint" value="[% HTML.escape(shippingpoint) %]"></td>
248 <th>[% 'Ship via' | $T8 %]</th>
249 <td><input type="text" class="wi-wide" name="shipvia" value="[% HTML.escape(shipvia) %]"></td>
252 <th>[% 'Transaction description' | $T8 %]</th>
253 <td>[% L.input_tag("transaction_description", transaction_description, class="wi-wide", "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
258 <table class="tbl-horizontal">
259 <caption>[% 'Payment / Delivery Options' | $T8 %]</caption>
260 <colgroup> <col class="wi-wide"> </colgroup>
263 <th class="single-col">
264 <span class="label above">[% 'Payment Terms' | $T8 %]</span>
265 [% L.select_tag('payment_id', payment_terms, default = payment_id, title_key = 'description', with_empty = 1, class="wi-wide") %]
266 <script type='text/javascript'>$('#payment_id').change(function(){ kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate"); })</script>
270 <th class="single-col">
271 <span class="label above">[% 'Delivery Terms' | $T8 %]</span>
272 [% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default = delivery_term_id, with_empty = 1, title_key = 'description', class="wi-wide") %]
276 <th>[% L.checkbox_tag('direct_debit', 'checked', direct_debit, label=LxERP.t8('direct debit')) %]</th>
278 [%- IF INSTANCE_CONF.get_create_qrbill_invoices > 0 %]
280 <th>[% L.checkbox_tag('qrbill_without_amount', 'checked', qrbill_without_amount, label=LxERP.t8('QR bill without amount')) %]</th>
283 <th>[% 'QR bill unstructured message' | $T8 %]</th>
286 <th>[% L.input_tag('qr_unstructured_message', qr_unstructured_message, class="wi-wide") %]</th>
290 <th class="caption">[% 'Notes (will appear on hard copy)' | $T8 %]</th>
294 [% L.textarea_tag("notes", notes, class="wi-wide texteditor") %]
299 <span class="label above">[% 'Internal Notes' | $T8 %]</span>
300 [% L.textarea_tag("intnotes", intnotes, class="wi-wide") %]
306 <table class="tbl-horizontal">
307 <caption>[% 'Numbers & Dates' | $T8 %]</caption>
308 <colgroup> <col class="wi-small"><col class="wi-small"><col class="wi-small"> </colgroup>
311 <th>[% 'Employee' | $T8 %]</th>
313 [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name', class="wi-lightwide") %]
316 [% IF ALL_SALESMEN.size %]
318 <th>[% 'Salesman' | $T8 %]</th>
320 [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name', class="wi-lightwide") %]
326 <th>[% 'Date' | $T8 %]</th>
327 <th>[% 'Number' | $T8 %]</th>
329 [% IF is_type_credit_note %]
331 <th>[% 'Credit Note' | $T8 %]</th>
332 <!-- <th>[% 'Credit Note Number' | $T8 %]</th> -->
333 <td>[% L.date_tag('invdate', invdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")', class='wi-date') %]</td>
335 [%- IF INSTANCE_CONF.get_sales_purchase_record_numbers_changeable %]
336 [% L.input_tag("invnumber", invnumber, size="11", class="wi-small") %]
338 [% L.hidden_tag("invnumber", invnumber) %]
339 [% HTML.escape(invnumber) %]
341 [% LxERP.t8("will be set upon posting") %]
346 <th>[% 'Invoice' | $T8 %]</th>
348 <td><input type="text" name="invnumber_for_credit_note" id="invnumber_for_credit_note" value="[% HTML.escape(invnumber_for_credit_note) %]" class="wi-small"></td>
354 <th>[% 'Invoice' | $T8 %]</th>
355 <td>[% L.date_tag('invdate', invdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")', class='wi-date') %]</td>
357 [%- IF INSTANCE_CONF.get_sales_purchase_record_numbers_changeable %]
358 [% L.input_tag("invnumber", invnumber, size="11", class="wi-small") %]
360 [% L.hidden_tag("invnumber", invnumber) %]
361 [% HTML.escape(invnumber) %]
363 [% LxERP.t8("will be set upon posting") %]
368 <th>[% 'Due Date' | $T8 %]</th>
370 <span class="condensed" id="duedate_container"[% IF payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% L.date_tag('duedate', duedate, class='wi-date') %]</span>
371 <span class="condensed" id="duedate_fixed"[% IF !payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% HTML.escape(duedate, class='wi-date') %]</span>
377 <th>[% 'Tax point' | $T8 %]</th>
378 <td>[% L.date_tag('tax_point', tax_point, id='tax_point', class='wi-date') %]</td>
381 <th>[% 'Order' | $T8 %]</th>
382 <td>[% L.date_tag('orddate', orddate, class='wi-date') %]</td>
383 <td><input type="text" name="ordnumber" id="ordnumber" value="[% HTML.escape(ordnumber) %]" class="wi-small"></td>
388 <th>[% 'Quotation' | $T8 %]</th>
389 <td>[% L.date_tag('quodate', quodate, class='wi-date') %]</td>
390 <td><input type="text" name="quonumber" id="quonumber" value="[% HTML.escape(quonumber) %]" class="wi-small"></td>
393 <th>[% 'Delivery Date' | $T8 %]</th>
394 <td>[% L.date_tag('deliverydate', deliverydate, class='wi-date') %]</td>
397 [% UNLESS is_type_credit_note %]
399 <th>[% 'Delivery Order Number' | $T8 %]</th>
401 <td><input type="text" name="donumber" id="donumber" value="[% HTML.escape(donumber) %]" class="wi-small"></td>
405 <th>[% 'Customer Order Number' | $T8 %]</th>
407 <td><input type="text" name="cusordnumber" id="cusordnumber" value="[% HTML.escape(cusordnumber) %]" class="wi-small"></td>
410 <th>[% 'Project Number' | $T8 %]</th>
412 <td>[% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = '1', onChange = "document.getElementById('update_button').click();", class="wi-small") %]</td>
414 [%- IF has_qr_reference %]
416 <th>[% 'QR reference' | $T8 %]</th>
418 [%- IF qr_reference %]
419 [% HTML.escape(qr_reference_formatted) %]
421 [% LxERP.t8("will be set upon posting") %]
429 </div> <!-- /.wrapper -->
431 <input type="hidden" name="webdav" value="[% webdav %]">
433 <script type="text/javascript" src="js/show_form_details.js"></script>
434 <script type="text/javascript" src="js/show_history.js"></script>
435 [% IF (resubmit && is_format_html) || resubmit || creditwarning != '' %]
436 <script type="text/javascript"><!--
437 $('document').ready(function(){
438 [% IF resubmit && is_format_html %]
439 window.open('about:blank','Beleg');
440 document.invoice.target = 'Beleg';
441 kivi.SalesPurchase.show_print_dialog();
442 kivi.SalesPurchase.print_record();
444 if ($('#already_printed_flag').val() === "0") {
445 kivi.SalesPurchase.show_print_dialog();
446 kivi.SalesPurchase.print_record();
447 $('#already_printed_flag').val("1");
449 [% ELSIF creditwarning != '' %]
450 alert('[% 'Credit Limit exceeded!!!' | $T8 %]');