6 <form method=post name="arledger" action="[% script %]">
8 [% L.hidden_tag('id', id) %]
9 [% L.hidden_tag('sort', sort) %]
10 [% L.hidden_tag('closedto', closedto) %]
11 [% L.hidden_tag('locked', locked) %]
12 [% L.hidden_tag('title', title_str) %]
13 [% L.hidden_tag('follow_up_trans_id_1', id) %]
14 [% L.hidden_tag('follow_up_trans_type_1', 'ar_transaction') %]
15 [% L.hidden_tag('follow_up_trans_info_1', follow_up_trans_info) %]
16 [% L.hidden_tag('follow_up_rowcount', 1) %]
17 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
19 <h1>[% title | html %]</h1>
21 [%- IF saved_message %]<p>[% saved_message | html %]</p>[% END %]
23 <div class="tabwidget">
25 <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
27 [% IF AUTH.assert('record_links', 1) %]
28 <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
30 <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
34 <div id="ui-tabs-basic-data">
43 <th align="right" nowrap>[% 'Customer' | $T8 %]</th>
45 [%- IF selectcustomer %]
46 <select id='customer' name="customer" onchange="document.getElementById('update_button').click();" class="initial_focus">[% selectcustomer %]</select>
48 <input id='customer' name=customer value="[% customer | html %]" size=35 class="initial_focus">
50 <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('customer')"></td>
51 [% L.hidden_tag('selectcustomer', selectcustomer) %]
52 [% L.hidden_tag('oldcustomer', oldcustomer) %]
53 [% L.hidden_tag('customer_id', customer_id) %]
54 [% L.hidden_tag('terms', terms) %]
56 [%- IF max_dunning_level || invoice_obj.dunning_config_id %]
58 <th align="right" valign="top">[% LxERP.t8("Dunning status") %]</th>
60 [% IF invoice_obj.dunning_config_id %]
61 <span class="dunned_invoice">[% LxERP.t8("This invoice's dunning level: #1", invoice_obj.dunning_config.dunning_description) %]</span>
62 [% IF max_dunning_level %]<br>[% END %]
64 [% IF max_dunning_level %]
65 <span class="customer_dunning_level">
66 [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %]
68 [% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
75 <th align="right" valign="top">[% LxERP.t8("Credit Limit") %]</th>
77 [% LxERP.format_amount(creditlimit, 0) %][% L.hidden_tag('creditlimit', LxERP.format_amount(creditlimit, 0)) %];
78 [% LxERP.t8("Remaining") %]
79 <span class="plus[% creditremaining < 0 ? 0 : 1 %]">[% LxERP.format_amount(creditremaining, 0) %][% L.hidden_tag('creditremaining', LxERP.format_amount(creditremaining, 0)) %]</span>
82 [%- IF invoice_obj.sepa_exports.as_list.size %]
84 <th align="right">[% LxERP.t8("SEPA exports") %]</th>
86 [% FOREACH export = invoice_obj.sepa_exports.as_list %]
87 <a href="sepa.pl?action=bank_transfer_edit&vc=customer&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
88 [% UNLESS loop.last %], [% END %]
94 <th align=right>[% 'Currency' | $T8 %]</th>
95 <td><select name=currency>[% selectcurrency %]</select></td>
96 [% L.hidden_tag('selectcurrency', selectcurrency) %]
97 [% L.hidden_tag('defaultcurrency', defaultcurrency) %]
98 [% L.hidden_tag('fxgain_accno', fxgain_accno) %]
99 [% L.hidden_tag('fxloss_accno', fxloss_accno) %]
101 [% L.hidden_tag('forex', forex) %]
103 <th align=right>[% 'Exchangerate' | $T8 %]</th>
104 <td>[%- IF forex %][% L.hidden_tag('exchangerate', LxERP.format_amount(exchangerate, 5)) %][% LxERP.format_amount(exchangerate, 5) %][%- ELSE %][% L.input_tag('exchangerate', LxERP.format_amount(exchangerate, 5), size=10) %][%- END %]</td>
107 [% department_html %]
108 [%- IF selectdepartment %]
110 <th align="right" nowrap>[% 'Department' | $T8 %]</th>
111 <td colspan=3><select name=department>[% selectdepartment %]</select>
112 <input type=hidden name=selectdepartment value="[% selectdepartment | html %]">
117 <td align=right>[% L.checkbox_tag('taxincluded', checked=taxincluded) %]</td>
118 <th align="left" nowrap><label for="taxincluded">[% 'Tax Included' | $T8 %]</label></th>
121 <td align="right">[% L.checkbox_tag('direct_debit', checked=direct_debit) %]</td>
122 <th align="left" nowrap><label for="direct_debit">[% 'direct debit' | $T8 %]</label></th>
128 [%- IF selectemployee %]
130 <th align=right nowrap>[% 'Salesperson' | $T8 %]</th>
131 <td colspan=2><select name=employee>[% selectemployee %]</select>[% L.hidden_tag('selectemployee', selectemployee) %]</td>
134 [% L.hidden_tag('employee', employee) %]
137 <th align=right nowrap>[% 'Invoice Number' | $T8 %]</th>
138 <td><input name=invnumber size=11 value="[% invnumber | html %]"></td>
141 <th align=right nowrap>[% 'Order Number' | $T8 %]</th>
142 <td><input name=ordnumber size=11 value="[% ordnumber | html %]"></td>
145 <th align=right nowrap>[% 'Invoice Date' | $T8 %]</th>
146 <td>[% L.date_tag('transdate', transdate) %]</td>
149 <th align=right nowrap>[% 'Due Date' | $T8 %]</th>
150 <td>[% L.date_tag('duedate', duedate) %]</td>
153 <th align=right nowrap>[% 'Project Number' | $T8 %]</th>
154 <td>[% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = 1) %]</td>
163 [% L.hidden_tag('rowcount', rowcount) %]
167 <tr class=listheading>
168 <th class=listheading style="width:15%">[% 'Account' | $T8 %]</th>
169 <th class=listheading style="width:10%">[% 'Amount' | $T8 %]</th>
170 <th class=listheading style="width:10%">[% 'Tax' | $T8 %]</th>
171 <th class=listheading style="width:5%">[% 'Taxkey' | $T8 %]</th>
172 <th class=listheading style="width:10%">[% 'Project' | $T8 %]</th>
176 [%- FOREACH row IN transactions %]
178 <td>[% row.selectAR_amount %]</td>
179 <td>[% L.input_tag('amount_' _ loop.count, LxERP.format_amount(row.amount, 2)) %]</td>
180 <td>[% L.hidden_tag('tax_' _ loop.count, LxERP.format_tax(row.tax, 2)) %][% LxERP.format_amount(row.tax, 2) | html %]</td>
181 <td>[% row.taxchart %]</td>
182 <td>[% L.select_tag('project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.project_id, with_empty = 1) %]</td>
192 <td>[% ARselected %]</td>
193 <th align=left>[% LxERP.format_amount(invtotal, 2) | html %]</th>
195 <input type=hidden name=oldinvtotal value='[% oldinvtotal %]'>
196 <input type=hidden name=oldtotalpaid value='[% oldtotalpaid %]'>
198 <input type=hidden name=taxaccounts value="[% taxaccounts | html %]">
211 <th align=left width=1%>[% 'Notes' | $T8 %]</th>
212 <td align=left><textarea name=notes rows="[% rows %]" cols=50 wrap=soft>[% notes | html %]</textarea></td>
214 <th align=left width=1%>[% 'Notes for customer' | $T8 %]</th>
215 <td align=left><textarea name=intnotes rows="[% rows %]" cols=50 wrap=soft readonly>[% intnotes | html %]</textarea></td>
223 <tr class=listheading>
224 <th colspan=7 class=listheading>[% 'Incoming Payments' | $T8 %]</th>
228 <th>[% 'Date' | $T8 %]</th>
229 <th>[% 'Source' | $T8 %]</th>
230 <th>[% 'Memo' | $T8 %]</th>
231 <th>[% 'Amount' | $T8 %]</th>
234 <th>[% 'Exch' | $T8 %]</th>
236 <th>[% 'Account' | $T8 %]</th>
237 <th>[% 'Project Number' | $T8 %]</th>
240 [%- FOREACH row IN payments %]
243 [%- IF row.changeable %]
244 [% L.date_tag('datepaid_' _ loop.count, row.datepaid ? row.datepaid : today) %]
246 [% row.datepaid | html %][% L.hidden_tag('datepaid_' _ loop.count, row.datepaid) %]
250 [%- IF row.changeable %]
251 <input name="source_[% loop.count %]" size=11 value="[% row.source | html %]">
253 [% row.source | html %]<input type=hidden name="source_[% loop.count %]" value="[% row.source | html %]">
257 [%- IF row.changeable %]
258 <input name="memo_[% loop.count %]" size=11 value="[% row.memo | html %]">
260 [% row.memo | html %]<input type=hidden name="memo_[% loop.count %]" value="[% row.memo | html %]">
264 [%- IF row.changeable %]
265 <input name="paid_[% loop.count %]" size=11 value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]" onBlur="check_right_number_format(this)">
267 [% row.paid | html %]<input type=hidden name="paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]">
271 [% IF row.changeable && loop.last && paid_missing > 0 %]
272 <input type="button" id="ar_set_to_paid_missing" value="[% "Set to paid missing" | $T8 %]">
277 [%- IF row.forex || !row.changeable%]
278 <input type=hidden name="exchangerate_[% loop.count %]" value='[% row.exchangerate | html %]'>[% row.exchangerate | html %]
280 <input name="exchangerate_[% loop.count %]" size=10 value='[% row.exchangerate | html %]'>
282 <input type=hidden name="forex_[% loop.count %]" value='[% row.forex | html %]'>
286 [%- IF row.changeable %]
287 [% row.selectAR_paid %]
289 [% row.AR_paid | html %]<input type=hidden name="AR_paid_[% loop.count %]" value='[% row.AR_paid | html %]'>
293 [%- IF row.changeable %]
294 [% L.select_tag('paid_project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.paid_project_id, with_empty=1) %]
296 [% project_labels.${row.paid_project_id} | html %]
297 <input type=hidden name="paid_project_id_[% loop.count %]" value='[% row.paid_project_id %]'>
301 <input type=hidden name="acc_trans_id_[% loop.count %]" value='[% row.acc_trans_id | html %]'>
302 <input type=hidden name="gldate_[% loop.count %]" value='[% row.gldate | html %]'>
308 <td align="center">[% 'Total' | $T8 %]</td>
309 <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
314 <td align="center">[% 'Missing amount' | $T8 %]</td>
315 <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
317 <input type=hidden name=paidaccounts value='[% paidaccounts %]'>
326 <script type='text/javascript'>
327 $('#ar_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });