8 [% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %]
12 [% SET follow_up_trans_info = invnumber _ ' (' _ vendor_obj.name _ ')' %]
13 <script type="text/javascript" src="js/common.js"></script>
14 <script type="text/javascript" src="js/calculate_qty.js"></script>
15 <script type="text/javascript" src="js/follow_up.js"></script>
17 <form id='form' method="post" name="invoice" action="[% script %]">
19 <p>[% saved_message %]</p>
21 [% FOREACH key = HIDDENS %]
22 [% L.hidden_tag(key, $key) %]
24 <input type="hidden" name="follow_up_trans_id_1" value="[% id %]">
25 <input type="hidden" name="follow_up_trans_type_1" value="purchase_invoice">
26 <input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
27 <input type="hidden" name="follow_up_rowcount" value="1">
28 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
30 [% L.hidden_tag('form_validity_token', form_validity_token) %]
32 [% L.hidden_tag('email_journal_id', email_journal_id) %]
33 [% L.hidden_tag('email_attachment_id', email_attachment_id) %]
34 [% L.hidden_tag('workflow_email_journal_id', workflow_email_journal_id) %]
35 [% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %]
36 [% L.hidden_tag('workflow_email_callback', workflow_email_callback) %]
38 [% INCLUDE 'common/flash.html' %]
39 [% INCLUDE 'generic/set_longdescription.html' %]
41 <div id="ir_tabs" class="tabwidget">
44 <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
45 [% IF email_attachment_id || workflow_email_attachment_id %]
46 <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>
48 [% IF INSTANCE_CONF.get_webdav %]
49 <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
52 [% IF INSTANCE_CONF.get_doc_storage %]
53 <li><a href="#ui-tabs-docs">[% 'Documents' | $T8 %]</a></li>
54 <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
56 [% IF AUTH.assert('record_links', 1) %]
57 <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
59 <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
63 [%- IF INSTANCE_CONF.get_doc_storage %]
64 <div id="ui-tabs-docs"></div>
67 <div id="ui-tabs-basic-data">
69 [% IF email_attachment_id || workflow_email_attachment_id%]
70 <div class="wrapper" id="email_attachment_wrapper">
73 P.email_journal.attachment_preview(
74 email_attachment_id || workflow_email_attachment_id,
78 INCLUDE 'common/toggle_panel.html'
80 button_closed = LxERP.t8('Show Attachment')
81 button_open = LxERP.t8('Hide Attachment')
87 <div class="wrapper" id="wrapper-1">
88 [% INCLUDE 'generic/toggle_wrapper.html' %]
90 <table class="tbl-horizontal col">
91 <caption>[% 'Vendor & Transaction' | $T8 %]</caption>
92 <colgroup> <col class="wi-small"><col class="wi-wide"> </colgroup>
95 <th>[% 'Vendor' | $T8 %]</th>
97 [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", class="initial_focus", show_details="1") %]
98 [% P.hidden_tag("previous_vendor_id", vendor_id) %]
101 [% IF ALL_CONTACTS.size %]
103 <th>[% 'Contact Person' | $T8 %]</th>
104 <td>[% 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') %]</td>
109 <th>[% 'Vendor type' | $T8 %]</th>
110 <td>[% business %]; [% 'Trade Discount' | $T8 %] [% LxERP.format_amount(tradediscount * 100) %] %</td>
113 [% IF ALL_DEPARTMENTS.as_list.size %]
115 <th>[% 'Department' | $T8 %]</th>
116 <td>[% P.select_tag("department_id", ALL_DEPARTMENTS, with_empty=1, default=department_id, title_key="description", class="wi-wide") %]</td>
120 <th>[% 'Credit Limit' | $T8 %]</th>
122 <span class="data wi-wide">
123 [% LxERP.format_amount(creditlimit, 0, '0') %]; [% 'Remaining' | $T8 %]
124 <span class="plus[% IF is_credit_remaining_negativ %]0[% ELSE %]1[% END %]">[% LxERP.format_amount(creditremaining,0 ,'0') %]</span>
128 [% IF invoice_obj.sepa_exports.as_list.size %]
130 <th>[% LxERP.t8("SEPA exports") %]</th>
132 [% FOREACH export = invoice_obj.sepa_exports.as_list %]
133 <a href="sepa.pl?action=bank_transfer_edit&vc=vendor&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
134 [% UNLESS loop.last %], [% END %] [% END %]
139 <th>[% 'Record in' | $T8 %]</th>
140 <td>[% P.chart.picker("AP_chart_id", AP_chart_id, class="wi-wide", type="AP", "data-validate"="required") %]</td>
143 <th>[% 'Steuersatz' | $T8 %]</th>
145 [% L.select_tag('taxzone_id',
146 ( id ? ALL_TAXZONES : ALL_ACTIVE_TAXZONES) ,
147 default = taxzone_id,
148 title_key = 'description',
149 disabled = (id ? 1 : 0),
151 onchange = "kivi.io.update_taxzone()"
154 <input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
160 <th>[% 'Currency' | $T8 %]</th>
161 <td class="wi-small">
163 [% HTML.escape(currency) %]
164 [% L.hidden_tag("currency", currency) %]
171 <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
172 <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
173 [% IF show_exchangerate %]
175 <th>[% 'Exchangerate' | $T8 %]</th>
176 <td class="wi-small">
178 [% LxERP.format_amount(exchangerate, 5) %]
179 [% L.hidden_tag("exchangerate", LxERP.format_amount(exchangerate, 5)) %]
181 <input type="text" name="exchangerate" class="wi-small" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
183 [% IF record_forex %][% 'record exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
188 <th>[% 'Transaction description' | $T8 %]</th>
189 <td class="wi-wide">[% L.input_tag("transaction_description", transaction_description, "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
194 <table class="tbl-horizontal col">
195 <caption>[% 'Payment / Delivery Options' | $T8 %]</caption>
196 <colgroup><col class="wi-wider"> </colgroup>
200 <span class="label-above">[% 'Payment Terms' | $T8 %]</span>
201 [% L.select_tag('payment_id', payment_terms, default = payment_id, title_key = 'description', with_empty = 1, style="width: 250px") %]
202 <script type='text/javascript'>$('#payment_id').change(function(){ kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate"); })</script>
207 <span class="label-above">[% 'Delivery Terms' | $T8 %]</span>
208 [% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default=delivery_term_id, with_empty=1, title_key='description', class='wi-wider') %]
212 <td>[% L.checkbox_tag('direct_debit', 'checked', direct_debit) %] <label for="direct_debit">[% 'direct debit' | $T8 %]</label></td>
215 <th class="caption">[% 'Notes' | $T8 %]</th>
218 <td class="wi-wider">[% L.textarea_tag("notes", notes, style="height:150px", class="texteditor wi-wider") %]</td>
222 <span class="label-above">[% 'Internal Notes' | $T8 %]</span>
223 [% L.textarea_tag("intnotes", intnotes, class="wi-wider") %]
226 [% IF id && follow_ups.size %]
228 <td>[% LxERP.t8('There are #1 unfinished follow-ups of which #2 are due.', follow_ups.size, follow_ups_unfinished) | html %]</td>
234 <table class="tbl-horizontal col">
235 <caption>[% 'Handling, Numbers & Dates' | $T8 %]</caption>
236 <colgroup> <col class="wi-mediumsmall"><col class="wi-wide"> </colgroup>
239 <th>[% 'Employee' | $T8 %]</th>
240 <td>[% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name', class='wi-wide') %]</td>
243 <th>[% 'Order Number' | $T8 %]</th>
244 <td><input type="text" class="wi-mediumsmall" name="ordnumber" value="[% HTML.escape(ordnumber) %]"></td>
246 [% IF is_type_credit_note %]
248 <th>[% 'Credit Note Number' | $T8 %]</th>
249 <td><input type="text" class="wi-mediumsmall" name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
253 <th>[% 'Invoice Number' | $T8 %]</th>
254 <td>[% L.input_tag('invnumber', invnumber, class='wi-mediumsmall') %]</td>
258 <th>[% 'Project Number' | $T8 %]</th>
259 <td>[% P.project.picker('globalproject_id', globalproject_id, onchange="document.getElementById('update_button').click();", class='wi-mediumsmall') %]</td>
262 <th>[% 'Quotation Date' | $T8 %]</th>
263 <td>[% L.date_tag('quodate', quodate, class='wi-small') %]</td>
266 <th>[% 'Order Date' | $T8 %]</th>
267 <td>[% L.date_tag('orddate', orddate, class='wi-small') %]</td>
269 [% IF is_type_credit_note %]
271 <th>[% 'Credit Note Date' | $T8 %]</th>
272 <td>[% L.date_tag('invdate', invdate, class='wi-small') %]</td>
276 <th>[% 'Invoice Date' | $T8 %]</th>
277 <td>[% L.date_tag('invdate', invdate, onChange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")', class='wi-small') %]</td>
280 <th>[% 'Due Date' | $T8 %]</th>
281 <td><span id="duedate_container"[% IF payment_terms_obj.auto_calculation %] style="display:none"[% END %] class="condensed">[% L.date_tag('duedate', duedate, class='wi-small') %]</span> <span id="duedate_fixed" [% IF !payment_terms_obj.auto_calculation %] style="display:none" [% END %]>[% HTML.escape(duedate) %]</span> </td>
285 <th>[% 'Tax point' | $T8 %]</th>
286 <td>[% L.date_tag('tax_point', tax_point, id='tax_point', class='wi-small') %]</td>
289 <th>[% 'Delivery Date' | $T8 %]</th>
290 <td>[% L.date_tag('deliverydate', deliverydate, class='wi-small') %]</td>
297 </div><!-- /.wrapper -->
299 <script type="text/javascript" src="js/show_form_details.js"></script>
300 <script type="text/javascript" src="js/show_history.js"></script>
301 <script type="text/javascript"><!--
302 $('document').ready(function(){
303 [% IF creditwarning != '' %]
304 alert('[% 'Credit Limit exceeded!!!' | $T8 %]');
306 kivi.File.doc_tab_init('ir_tabs', 'ui-tabs-docs', $('#id').val(), 'purchase_invoice');
310 <input type="hidden" name="webdav" value="[% webdav | html %]">
312 <div class="list-table-with-separate-total-table">