5 [%- USE LxERP %][%- USE P -%]
8 [% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %]
12 [%- INCLUDE 'common/flash.html' %]
14 <form method="post" action="[% script | html %]" id="form">
16 <input type="hidden" name="terms" value="[% terms | html %]">
18 <input type="hidden" name="creditlimit" value="[% creditlimit | html %]">
19 <input type="hidden" name="creditremaining" value="[% creditremaining | html %]">
21 <input type="hidden" name="forex" value="[% forex | html %]">
22 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
24 <input id="id" type="hidden" name="id" value="[% id | html %]">
25 <input type="hidden" name="sort" value="[% sort | html %]">
26 <input type="hidden" name="closedto" value="[% closedto | html %]">
27 <input type="hidden" name="locked" value="[% locked | html %]">
28 <input type="hidden" name="title" value="[% title_ | html %]">
30 <input type="hidden" name="follow_up_trans_id_1" value="[% id | html %]">
31 <input type="hidden" name="follow_up_trans_type_1" value="ap_transaction">
32 <input type="hidden" name="follow_up_trans_info_1" value="[% follow_up_trans_info | html %]">
33 <input type="hidden" name="follow_up_rowcount" value="1">
35 <input type="hidden" name="defaultcurrency" value="[% defaultcurrency | html %]">
36 <input type="hidden" name="fxgain_accno" value="[% fxgain_accno | html %]">
37 <input type="hidden" name="fxloss_accno" value="[% fxloss_accno | html %]">
39 <input type="hidden" name="oldinvtotal" value="[% oldinvtotal | html %]">
40 <input type="hidden" name="oldtotalpaid" value="[% oldtotalpaid | html %]">
42 <input type="hidden" name="taxaccounts" value="[% taxaccounts | html %]">
44 <input type="hidden" name="rowcount" value="[% rowcount | html %]">
46 <input type="hidden" name="paidaccounts" value="[% paidaccounts | html %]">
47 [% L.hidden_tag('zugferd_session_file', zugferd_session_file) %]
49 [%- P.hidden_tag('convert_from_oe_id', convert_from_oe_id) -%]
52 [% L.hidden_tag('form_validity_token', form_validity_token) %]
54 [% L.hidden_tag('email_journal_id', email_journal_id) %]
55 [% L.hidden_tag('email_attachment_id', email_attachment_id) %]
56 [% L.hidden_tag('workflow_email_journal_id', workflow_email_journal_id) %]
57 [% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %]
58 [% L.hidden_tag('workflow_email_callback', workflow_email_callback) %]
60 [% FOREACH i IN [1..paidaccounts] %]
61 [% temp = "acc_trans_id_"_ i %]
62 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
64 [% temp = "gldate_"_ i %]
65 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
68 [% IF ( saved_message ) %]
69 <p>[% saved_message | html %]</p>
72 <div id="ap_tabs" class="tabwidget">
74 <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
75 [% IF email_attachment_id || workflow_email_attachment_id %]
76 <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>
78 [%- IF INSTANCE_CONF.get_webdav %]
79 <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
81 [%- IF id AND INSTANCE_CONF.get_doc_storage %]
82 <li><a href="#ui-tabs-docs">[% 'Documents' | $T8 %]</a></li>
83 <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
86 [%- IF AUTH.assert('record_links', 1) %]
87 <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
89 <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
93 [%- IF id AND INSTANCE_CONF.get_doc_storage %]
94 <div id="ui-tabs-docs"></div>
97 <div id="ui-tabs-basic-data">
106 <th align="right" nowrap>[% 'Vendor' | $T8 %]</th>
108 [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", show_details="1",
109 style="width: 330px", class=(initial_focus == 'vendor_id' ? "initial_focus" : "")) %]
110 [% L.hidden_tag("previous_vendor_id", vendor_id) %]
115 <th align="right" valign="top">[% LxERP.t8("Credit Limit") %]</th>
117 [% creditlimit | html %];
118 [% LxERP.t8("Remaining") %]
119 <span class="plus[% creditremaining_plus %]">[% creditremaining | html %]</span>
122 [%- IF invoice_obj.sepa_exports.as_list.size %]
124 <th align="right">[% LxERP.t8("SEPA exports") %]</th>
126 [% FOREACH export = invoice_obj.sepa_exports.as_list %]
127 <a href="sepa.pl?action=bank_transfer_edit&vc=vendor&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
128 [% UNLESS loop.last %], [% END %]
134 <th align="right" nowrap>[% 'Currency' | $T8 %]</th>
137 [% HTML.escape(currency) %]
138 [% L.hidden_tag("currency", currency) %]
140 [% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]
143 [% IF ( defaultcurrency && (currency != defaultcurrency) ) %]
144 <th align=right>[% 'Exchangerate' | $T8 %]</th>
147 [% LxERP.format_amount(exchangerate, 5) %]
148 [% L.hidden_tag("exchangerate", LxERP.format_amount(exchangerate, 5)) %]
150 <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
152 [% IF record_forex %][% 'record exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
153 [% L.hidden_tag("record_forex", record_forex) %]
157 [% IF ALL_DEPARTMENTS %]
159 <th align="right" nowrap>[% 'Department' | $T8 %]</th>
160 <td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = "width:334px") %]</td>
165 <th align="right">[% 'Transaction description' | $T8 %]</th>
166 <td colspan="3">[% L.input_tag("transaction_description", transaction_description, style="width:330px", "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
169 <td align="right"><input name="taxincluded" class="checkbox" type="checkbox" value="1" [% IF ( taxincluded ) %]checked[% END %]></td>
170 <th align=left nowrap>[% 'Tax Included' | $T8 %]</th>
173 <td align="right"><input name="direct_debit" class="checkbox" type="checkbox" value="1" [% IF direct_debit %]checked[% END %]></td>
174 <th align="left" nowrap>[% 'direct debit' | $T8 %]</th>
182 <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
183 <td>[% L.input_tag("invnumber", invnumber, size="11", readonly=readonly) %]</td>
186 <th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
187 <td>[% L.input_tag("ordnumber", ordnumber, size="11", readonly=readonly) %]</td>
190 <th align="right" nowrap>[% 'Invoice Date' | $T8 %]</th>
191 <td>[% L.date_tag('transdate', transdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("transdate")') %]</td>
194 <th align="right" nowrap>[% 'Due Date' | $T8 %]</th>
195 <td>[% L.date_tag('duedate', duedate) %]</td>
198 <th align="right" nowrap>[% LxERP.t8('Tax point') %]</th>
199 <td>[% L.date_tag('tax_point', tax_point, id='tax_point') %]</td>
202 <th align=right nowrap>[% 'Delivery Date' | $T8 %]</th>
203 <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
206 <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
208 [% P.project.picker('globalproject_id', globalproject_id, onchange="document.getElementById('update_button').click();") %]
221 <tr class=listheading>
222 <th class=listheading style="width:15%">[% 'Account' | $T8 %]</th>
223 <th class=listheading style="width:10%">[% 'Amount' | $T8 %]</th>
224 <th class=listheading style="width:10%">[% 'Tax' | $T8 %]</th>
225 <th class=listheading style="width:10%">[% 'Taxkey' | $T8 %]</th>
226 <th class=listheading style="width:10%">[% 'Project' | $T8 %]</th>
229 [% FOREACH i IN [1..rowcount] %]
232 [% SET selected_chart_id = "AP_amount_chart_id_"_ i %]
233 [% P.chart.picker("AP_amount_chart_id_" _ i, $selected_chart_id, style="width: 400px", type="AP_amount", invalid=0, disabled=readonly, class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %]
234 [% L.hidden_tag("previous_AP_amount_chart_id_" _ i, $selected_chart_id) %]
235 <input type="hidden" name="tax_[% i %]" value="[% temp = "tax"_ i %][% $temp | html %]">
238 <input name="amount_[% i %]" size="10" [% readonly ? 'readonly' : '' %] value="[% temp = "amount_"_ i %][% $temp | html %]">
241 [% temp_r = "tax_reverse_"_ i %]
245 [% temp_c = "tax_charge_"_ i %][% $temp_c | html %]
247 [% temp = "tax_"_ i %][% $temp | html %]
251 [% temp = 'selected_taxchart_'_ i %]
252 [% taxcharts = 'taxcharts_' _ i %]
253 [% L.select_tag('taxchart_'_ i, $taxcharts, value_title_sub = \taxchart_value_title_sub, default = $temp, style="width: 250px") %]
256 [% temp = "project_id_"_ i %]
257 [% P.project.picker(temp, loop.last ? globalproject_id : $temp) %]
269 [% P.chart.picker('AP_chart_id', AP_chart_id, style="width: 400px", type="AP") %]
271 <th align="left">[% invtotal | html %]</th>
272 <td colspan="4"></td>
281 <th align="left">[% 'Notes' | $T8 %]</th>
282 <th align="left">[% 'Internal Notes' | $T8 %]</th>
283 <th align="left">[% 'Payment Terms' | $T8 %]</th>
287 [% L.textarea_tag("notes", notes, wrap="soft", rows=textarea_rows, cols=50, readonly=readonly) %]
290 [% L.textarea_tag("intnotes", intnotes, wrap="soft", rows=textarea_rows, cols=50, readonly=readonly) %]
293 [% L.select_tag('payment_id', payment_terms, default=payment_id, title_key='description', with_empty=1, style="width: 250px", onchange="kivi.SalesPurchase.set_duedate_on_reference_date_change('transdate')") %]
301 [% UNLESS no_payment_bookings %]
303 <tr class="listheading">
304 <th class="listheading" colspan="7">[% 'Payments' | $T8 %]</th>
308 <th>[% 'Date' | $T8 %]</th>
309 <th>[% 'Source' | $T8 %]</th>
310 <th>[% 'Memo' | $T8 %]</th>
311 <th>[% 'Amount' | $T8 %]</th>
313 [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
314 <th>[% 'Exch' | $T8 %]</th>
316 <th>[% 'Account' | $T8 %]</th>
317 <th>[% 'Project Number' | $T8 %]</th>
320 [% FOREACH i IN [1..paidaccounts] %]
321 [% temp = "paidaccount_changeable_"_ i %]
322 [% changeable = $temp %]
325 [% temp = "datepaid_"_ i %]
327 [% IF( changeable ) %]
328 [% L.date_tag(temp, $temp ? $temp : today) %]
331 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
335 [% temp = "source_"_ i %]
337 [% IF( changeable ) %]
338 <input name="[% temp %]" size="11" value="[% $temp | html %]">
341 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
345 [% temp = "memo_"_ i %]
347 [% IF( changeable ) %]
348 <input name="[% temp %]" size="11" value="[% $temp | html %]">
351 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
355 [% temp = "paid_"_ i %]
357 [% IF( changeable ) %]
358 <input name="[% temp %]" size="11" data-validate="number" class="numeric" value="[% $temp | html %]" id="[%- 'payment_' _ temp -%]">
361 <input type="hidden" name="[% temp %]" value="[% $temp | html %]"> [% defaultcurrency %]
366 [% IF changeable && loop.last && paid_missing > 0 %]
367 <input type="button" id="ap_set_to_paid_missing" value="[% "Set to paid missing" | $T8 %]">
371 [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
373 [% temp = "exchangerate_"_ i %]
374 [% temp_forex = "forex_"_ i %]
375 [% SET defaultcurrency_paid = 'defaultcurrency_paid_' _ i %]
376 [% SET record_forex = 'record_forex_' _ i %]
377 [% SET fx_transaction = 'fx_transaction_' _ i %]
379 [% IF( $temp_forex || !changeable ) %]
380 [% $temp | html %] = [% LxERP.format_amount($defaultcurrency_paid,2) %] [% defaultcurrency %] </br>
381 [% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
383 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
385 <input name="[% temp %]" size="11" value="[% $temp | html %]">
387 <input type=hidden name="[% temp_forex %]" value="[% $temp_forex | html %]">
388 <input type="hidden" name="[% fx_transaction %]" value="1">
392 [% temp = "AP_paid_"_ i %]
393 [% readonly = "AP_paid_readonly_desc_"_ i %]
395 [% IF( changeable ) %]
396 [% L.select_tag(temp, ALL_CHARTS_AP_paid, value_title_sub = \AP_paid_value_title_sub, default = ($temp || accno_arap)) %]
398 [% $readonly | html %]
399 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
404 [% temp = "paid_project_id_"_ i %]
405 [% IF( changeable ) %]
406 [% P.project.picker(temp, $temp) %]
408 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
409 [% temp = "label"_ temp %]
419 <td align="center">[% 'Total' | $T8 %]</td>
420 <td align="right">[% LxERP.format_amount(totalpaid, 2) | html %] [% currency %]</td>
421 [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
423 <td align="center">[% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]</td>
424 <input type="hidden" name="defaultcurrency_totalpaid" value="[% defaultcurrency_totalpaid %]">
425 <input type="hidden" name="is_linked_bank_transaction" value="[% is_linked_bank_transaction %]">
432 <td align="center">[% 'Missing amount' | $T8 %]</td>
433 <td align="right">[% LxERP.format_amount(paid_missing, 2) | html %] [% currency %]</td>
441 [% PROCESS 'webdav/_list.html' %]
443 [% LxERP.t8('Loading...') %]
447 <hr size="3" noshade>
449 <script type='text/javascript'>
450 $('#ap_set_to_paid_missing').click(function(){ $('input[id^="payment_paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });