6 <script type="text/javascript">
8 function setTaxkey(accno, row) {
9 var taxkey = accno.options[accno.selectedIndex].value;
10 var reg = /--([0-9]*)/;
11 var found = reg.exec(taxkey);
13 index = parseInt(index);
14 var tax = 'taxchart_' + row;
15 for (var i = 0; i < document.getElementById(tax).options.length; ++i) {
16 var reg2 = new RegExp("^"+ index, "");
17 if (reg2.exec(document.getElementById(tax).options[i].value)) {
18 document.getElementById(tax).options[i].selected = true;
26 <script type="text/javascript" src="js/show_history.js"></script>
28 <form method="post" action="[% script | html %]">
30 <input type="hidden" name="selectvendor" value="[% selectvendor | html %]">
31 <input type="hidden" name="selectdepartment" value="[% selectdepartment | html %]">
32 <input type="hidden" name="selectcurrency" value="[% selectcurrency | html %]">
34 <input type="hidden" name="oldvendor" value="[% oldvendor | html %]">
35 <input type="hidden" name="vendor_id" value="[% vendor_id | html %]">
36 <input type="hidden" name="terms" value="[% terms | html %]">
38 <input type="hidden" name="creditlimit" value="[% creditlimit | html %]">
39 <input type="hidden" name="creditremaining" value="[% creditremaining | html %]">
41 <input type="hidden" name="forex" value="[% forex | html %]">
42 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
44 <input type="hidden" name="id" value="[% id | html %]">
45 <input type="hidden" name="sort" value="[% sort | html %]">
46 <input type="hidden" name="closedto" value="[% closedto | html %]">
47 <input type="hidden" name="locked" value="[% locked | html %]">
48 <input type="hidden" name="title" value="[% title_ | html %]">
50 <input type="hidden" name="follow_up_trans_id_1" value="[% id | html %]">
51 <input type="hidden" name="follow_up_trans_type_1" value="ap_transaction">
52 <input type="hidden" name="follow_up_trans_info_1" value="[% follow_up_trans_info | html %]">
53 <input type="hidden" name="follow_up_rowcount" value="1">
55 <input type="hidden" name="defaultcurrency" value="[% defaultcurrency | html %]">
56 <input type="hidden" name="fxgain_accno" value="[% fxgain_accno | html %]">
57 <input type="hidden" name="fxloss_accno" value="[% fxloss_accno | html %]">
59 <input type="hidden" name="oldinvtotal" value="[% oldinvtotal | html %]">
60 <input type="hidden" name="oldtotalpaid" value="[% oldtotalpaid | html %]">
62 <input type="hidden" name="taxaccounts" value="[% taxaccounts | html %]">
64 <input type="hidden" name="rowcount" value="[% rowcount | html %]">
66 <input type="hidden" name="paidaccounts" value="[% paidaccounts | html %]">
68 [% FOREACH i IN [1..paidaccounts] %]
69 [% temp = "acc_trans_id_"_ i %]
70 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
72 [% temp = "gldate_"_ i %]
73 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
76 <h1>[% title | html %]</h1>
78 [% IF ( saved_message ) %]
79 <p>[% saved_message | html %]</p>
82 <div class="tabwidget">
84 <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
86 <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
87 <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
91 <div id="ui-tabs-basic-data">
100 <th align="right" nowrap>[% 'Vendor' | $T8 %]</th>
102 [% IF ( selectvendor ) %]
103 <select name="vendor" onchange="document.getElementById('update_button').click();">[% selectvendor %]</select>
105 <input name=vendor value="[% vendor | html %]" size="35">
107 <input type="button" value="D" onclick="show_vc_details('vendor')">
112 <th align="right" valign="top">[% LxERP.t8("Credit Limit") %]</th>
114 [% creditlimit | html %];
115 [% LxERP.t8("Remaining") %]
116 <span class="plus[% creditremaining_plus %]">[% creditremaining | html %]</span>
120 [%- IF invoice_obj.sepa_exports.as_list.size %]
122 <th align="right">[% LxERP.t8("SEPA exports") %]</th>
124 [% FOREACH export = invoice_obj.sepa_exports.as_list %]
125 <a href="sepa.pl?action=bank_transfer_edit&vc=vendor&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
126 [% UNLESS loop.last %], [% END %]
133 <th align="right" nowrap>[% 'Currency' | $T8 %]</th>
134 <td><select name="currency">[% selectcurrency %]</select></td>
136 [% IF ( defaultcurrency && (currency != defaultcurrency) ) %]
137 <th align=right>[% 'Exchangerate' | $T8 %]</th>
139 <td><input type="hidden" name="exchangerate" value="[% exchangerate | html %]">[% exchangerate | html %]</td>
141 <td><input type="text" name="exchangerate" size="10" value="[% exchangerate | html %]"></td>
147 [% IF ( selectdepartment ) %]
149 <th align="right" nowrap>[% 'Department' | $T8 %]</th>
151 <select name="department">[% selectdepartment %]</select>
157 <td align="right"><input name="taxincluded" class="checkbox" type="checkbox" value="1" [% IF ( taxincluded ) %]checked[% END %]></td>
158 <th align=left nowrap>[% 'Tax Included' | $T8 %]</th>
161 <td align="right"><input name="direct_debit" class="checkbox" type="checkbox" value="1" [% IF direct_debit %]checked[% END %]></td>
162 <th align="left" nowrap>[% 'direct debit' | $T8 %]</th>
170 <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
171 <td><input name="invnumber" size="11" value="[% invnumber | html %]" [% readonly %]></td>
174 <th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
175 <td><input name="ordnumber" size="11" value="[% ordnumber | html %]" [% readonly %]></td>
178 <th align="right" nowrap>[% 'Invoice Date' | $T8 %]</th>
179 <td>[% L.date_tag('transdate', transdate) %]</td>
182 <th align="right" nowrap>[% 'Due Date' | $T8 %]</th>
183 <td>[% L.date_tag('duedate', duedate) %]</td>
186 <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
188 [% L.select_tag('globalproject_id', ALL_PROJECTS, with_empty = 1, default = globalproject_id, value_key = 'id', title_key = 'projectnumber') %]
201 <tr class=listheading>
202 <th class=listheading style="width:15%">[% 'Account' | $T8 %]</th>
203 <th class=listheading style="width:10%">[% 'Amount' | $T8 %]</th>
204 <th class=listheading style="width:10%">[% 'Tax' | $T8 %]</th>
205 <th class=listheading style="width:10%">[% 'Taxkey' | $T8 %]</th>
206 <th class=listheading style="width:10%">[% 'Project' | $T8 %]</th>
209 [% FOREACH i IN [1..rowcount] %]
212 [% selected_accno_full = "selected_accno_full_"_ i %]
213 [% L.select_tag('AP_amount_'_ i, ALL_CHARTS_AP_amount, value_title_sub = \AP_amount_value_title_sub, onchange = 'setTaxkey(this, '_ i _')', default = $selected_accno_full) %]
215 <input type="hidden" name="previous_AP_amount_[% i %]" value="[% $selected_accno_full %]">
216 <input type="hidden" name="tax_[% i %]" value="[% temp = "tax"_ i %][% $temp | html %]">
219 <input name="amount_[% i %]" size="10" value="[% temp = "amount_"_ i %][% $temp | html %]">
222 [% temp = "tax_"_ i %][% $temp | html %]
225 [% temp = 'selected_taxchart_'_ i %]
226 [% L.select_tag('taxchart_'_ i, ALL_TAXCHARTS, value_title_sub = \taxchart_value_title_sub, default = $temp) %]
229 [% temp = "project_id_"_ i %]
230 [% L.select_tag(temp, ALL_PROJECTS, with_empty = 1, default = loop.last ? globalproject_id : $temp, value_key = 'id', title_key = 'projectnumber') %]
242 [% L.select_tag('APselected', ALL_CHARTS_AP, value_title_sub = \APselected_value_title_sub, default = APselected) %]
244 <th align="left">[% invtotal | html %]</th>
245 <td colspan="4"></td>
254 <th align="left" width="1%">[% 'Notes' | $T8 %]</th>
256 <textarea name="notes" rows="[% textarea_rows %]" cols="50" wrap="soft" [% readonly %]>[% notes | html %]</textarea>
259 <th align="left" width=1%>[% 'Notes for vendor' | $T8 %]</th>
261 <textarea name="intnotes" rows="[% textarea_rows %]" cols="50" wrap="soft" readonly>[% intnotes | html %]</textarea>
270 <tr class="listheading">
271 <th class="listheading" colspan="7">[% 'Payments' | $T8 %]</th>
275 <th>[% 'Date' | $T8 %]</th>
276 <th>[% 'Source' | $T8 %]</th>
277 <th>[% 'Memo' | $T8 %]</th>
278 <th>[% 'Amount' | $T8 %]</th>
280 [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
281 <th>[% 'Exch' | $T8 %]</th>
283 <th>[% 'Account' | $T8 %]</th>
284 <th>[% 'Project Number' | $T8 %]</th>
287 [% FOREACH i IN [1..paidaccounts] %]
288 [% temp = "paidaccount_changeable_"_ i %]
289 [% changeable = $temp %]
292 [% temp = "datepaid_"_ i %]
294 [% IF( changeable ) %]
295 [% L.date_tag(temp, $temp ? $temp : today) %]
298 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
302 [% temp = "source_"_ i %]
304 [% IF( changeable ) %]
305 <input name="[% temp %]" size="11" value="[% $temp | html %]">
308 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
312 [% temp = "memo_"_ i %]
314 [% IF( changeable ) %]
315 <input name="[% temp %]" size="11" value="[% $temp | html %]">
318 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
322 [% temp = "paid_"_ i %]
324 [% IF( changeable ) %]
325 <input name="[% temp %]" size="11" value="[% $temp | html %]" onBlur="check_right_number_format(this);">
328 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
333 [% IF changeable && loop.last && paid_missing > 0 %]
334 <input type="button" id="ap_set_to_paid_missing" value="[% "Set to paid missing" | $T8 %]">
338 [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
340 [% temp = "exchangerate_"_ i %]
341 [% temp_forex = "forex_"_ i %]
343 [% IF( $temp_forex || !changeable ) %]
345 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
347 <input name="[% temp %]" size="11" value="[% $temp | html %]">
350 <input type=hidden name="[% temp_forex %]" value="[% $temp_forex | html %]">
354 [% temp = "AP_paid_"_ i %]
356 [% IF( changeable ) %]
357 [% L.select_tag(temp, ALL_CHARTS_AP_paid, value_title_sub = \AP_paid_value_title_sub, default = ($temp || accno_arap)) %]
360 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
365 [% temp = "paid_project_id_"_ i %]
366 [% IF( changeable ) %]
367 [% L.select_tag(temp, ALL_PROJECTS, with_empty = 1, default = $temp, value_key = 'id', title_key = 'projectnumber') %]
369 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
370 [% temp = "label"_ temp %]
380 <td align="center">[% 'Total' | $T8 %]</td>
381 <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
386 <td align="center">[% 'Missing amount' | $T8 %]</td>
387 <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
396 <script type='text/javascript'>
397 $('#ap_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });