4 [%- USE LxERP %][%- USE P -%]
7 [% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %]
11 [%- INCLUDE 'common/flash.html' %]
13 <form method=post name="arledger" action="[% script %]" id="form">
15 [% L.hidden_tag('id', id) %]
16 [% L.hidden_tag('sort', sort) %]
17 [% L.hidden_tag('closedto', closedto) %]
18 [% L.hidden_tag('locked', locked) %]
19 [% L.hidden_tag('title', title_str) %]
20 [% L.hidden_tag('follow_up_trans_id_1', id) %]
21 [% L.hidden_tag('follow_up_trans_type_1', 'ar_transaction') %]
22 [% L.hidden_tag('follow_up_trans_info_1', follow_up_trans_info) %]
23 [% L.hidden_tag('follow_up_rowcount', 1) %]
24 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
27 [% L.hidden_tag('form_validity_token', form_validity_token) %]
29 [% L.hidden_tag('email_journal_id', email_journal_id) %]
30 [% L.hidden_tag('email_attachment_id', email_attachment_id) %]
31 [% L.hidden_tag('workflow_email_journal_id', workflow_email_journal_id) %]
32 [% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %]
33 [% L.hidden_tag('workflow_email_callback', workflow_email_callback) %]
35 [%- IF saved_message %]<p>[% saved_message | html %]</p>[% END %]
37 <div class="tabwidget">
39 <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
40 [% IF email_attachment_id || workflow_email_attachment_id %]
41 <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>
44 [%- IF INSTANCE_CONF.get_doc_storage %]
45 <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
47 [% IF AUTH.assert('record_links', 1) %]
48 <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
50 <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
54 <div id="ui-tabs-basic-data">
63 <th align="right" nowrap>[% 'Customer' | $T8 %]</th>
65 [% P.customer_vendor.picker("customer_id", customer_id, type="customer",
66 show_details="1", style="width: 330px", class=(initial_focus == 'customer_id' ? "initial_focus" : "")) %]
67 [% L.hidden_tag("previous_customer_id", customer_id) %]
68 [% L.hidden_tag('terms', terms) %]
71 [%- IF max_dunning_level || invoice_obj.dunning_config_id %]
73 <th align="right" valign="top">[% LxERP.t8("Dunning status") %]</th>
75 [% IF invoice_obj.dunning_config_id %]
76 <span class="dunned_invoice">[% LxERP.t8("This invoice's dunning level: #1", invoice_obj.dunning_config.dunning_description) %]</span>
77 [% IF max_dunning_level %]<br>[% END %]
79 [% IF max_dunning_level %]
80 <span class="customer_dunning_level">
81 [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %]
83 [% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
90 <th align="right" valign="top">[% LxERP.t8("Credit Limit") %]</th>
92 [% LxERP.format_amount(creditlimit, 0) %][% L.hidden_tag('creditlimit', LxERP.format_amount(creditlimit, 0)) %];
93 [% LxERP.t8("Remaining") %]
94 <span class="plus[% creditremaining < 0 ? 0 : 1 %]">[% LxERP.format_amount(creditremaining, 0) %][% L.hidden_tag('creditremaining', LxERP.format_amount(creditremaining, 0)) %]</span>
97 [%- IF invoice_obj.sepa_exports.as_list.size %]
99 <th align="right">[% LxERP.t8("SEPA exports") %]</th>
101 [% FOREACH export = invoice_obj.sepa_exports.as_list %]
102 <a href="sepa.pl?action=bank_transfer_edit&vc=customer&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
103 [% UNLESS loop.last %], [% END %]
109 <th align=right>[% 'Currency' | $T8 %]</th>
112 [% HTML.escape(currency) %]
113 [% L.hidden_tag("currency", currency) %]
115 [% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]
118 [% L.hidden_tag('defaultcurrency', defaultcurrency) %]
119 [% L.hidden_tag('fxgain_accno', fxgain_accno) %]
120 [% L.hidden_tag('fxloss_accno', fxloss_accno) %]
122 [% L.hidden_tag('forex', forex) %]
124 <th align=right>[% 'Exchangerate' | $T8 %]</th>
127 [% LxERP.format_amount(exchangerate, 5) %]
128 [% L.hidden_tag("exchangerate", LxERP.format_amount(exchangerate, 5)) %]
130 <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
132 [% IF record_forex %][% 'record exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
136 [% IF ALL_DEPARTMENTS %]
138 <th align="right" nowrap>[% 'Department' | $T8 %]</th>
139 <td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = 'width:334px') %]</td>
143 <th align="right">[% 'Transaction description' | $T8 %]</th>
144 <td colspan="3">[% L.input_tag("transaction_description", transaction_description, style="width:330px", "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
147 <td align=right>[% L.checkbox_tag('taxincluded', checked=taxincluded) %]</td>
148 <th align="left" nowrap><label for="taxincluded">[% 'Tax Included' | $T8 %]</label></th>
151 <td align="right">[% L.checkbox_tag('direct_debit', checked=direct_debit) %]</td>
152 <th align="left" nowrap><label for="direct_debit">[% 'direct debit' | $T8 %]</label></th>
159 <th align=right nowrap>[% 'Salesperson' | $T8 %]</th>
160 <td colspan=2>[% P.select_tag("employee_id", employees, default=employee_id, title_key='safe_name') %]</td>
163 <th align=right nowrap>[% 'Invoice Number' | $T8 %]</th>
164 <td><input name=invnumber size=11 value="[% invnumber | html %]"></td>
167 <th align=right nowrap>[% 'Order Number' | $T8 %]</th>
168 <td><input name=ordnumber size=11 value="[% ordnumber | html %]"></td>
171 <th align=right nowrap>[% 'Invoice Date' | $T8 %]</th>
172 <td>[% L.date_tag('transdate', transdate) %]</td>
175 <th align=right nowrap>[% 'Due Date' | $T8 %]</th>
176 <td>[% L.date_tag('duedate', duedate) %]</td>
179 <th align="right" nowrap>[% LxERP.t8('Tax point') %]</th>
180 <td>[% L.date_tag('tax_point', tax_point, id='tax_point') %]</td>
183 <th align=right nowrap>[% 'Delivery Date' | $T8 %]</th>
184 <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
187 <th align=right nowrap>[% 'Project Number' | $T8 %]</th>
188 <td>[% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = 1, onChange = "document.getElementById('update_button').click();") %]</td>
197 [% L.hidden_tag('rowcount', rowcount) %]
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:5%">[% 'Taxkey' | $T8 %]</th>
206 <th class=listheading style="width:10%">[% 'Project' | $T8 %]</th>
210 [%- FOREACH row IN transactions %]
212 <td>[% row.selectAR_amount %]</td>
213 <td>[% L.input_tag('amount_' _ loop.count, LxERP.format_amount(row.amount, 2)) %]</td>
214 <td>[% L.hidden_tag('tax_' _ loop.count, LxERP.format_tax(row.tax, 2)) %][% LxERP.format_amount(row.tax, 2) | html %]</td>
215 <td>[% row.taxchart %]</td>
216 <td>[% L.select_tag('project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.project_id, with_empty = 1) %]</td>
226 <td>[% P.chart.picker("AR_chart_id", AR_chart_id, style="width: 400px", type="AR") %]</td>
227 <th align=left>[% LxERP.format_amount(invtotal, 2) | html %]</th>
229 <input type=hidden name=oldinvtotal value='[% oldinvtotal %]'>
230 <input type=hidden name=oldtotalpaid value='[% oldtotalpaid %]'>
232 <input type=hidden name=taxaccounts value="[% taxaccounts | html %]">
245 <th align=left width=1%>[% 'Notes' | $T8 %]</th>
246 <td align=left><textarea name=notes rows="[% rows %]" cols=50 wrap=soft>[% notes | html %]</textarea></td>
248 <th align=left width=1%>[% 'Notes for customer' | $T8 %]</th>
249 <td align=left><textarea name=intnotes rows="[% rows %]" cols=50 wrap=soft readonly>[% intnotes | html %]</textarea></td>
257 <tr class=listheading>
258 <th colspan=7 class=listheading>[% 'Incoming Payments' | $T8 %]</th>
262 <th>[% 'Date' | $T8 %]</th>
263 <th>[% 'Source' | $T8 %]</th>
264 <th>[% 'Memo' | $T8 %]</th>
265 <th>[% 'Amount' | $T8 %]</th>
268 <th>[% 'Exch' | $T8 %]</th>
270 <th>[% 'Account' | $T8 %]</th>
271 <th>[% 'Project Number' | $T8 %]</th>
274 [%- FOREACH row IN payments %]
277 [%- IF row.changeable %]
278 [% L.date_tag('datepaid_' _ loop.count, row.datepaid ? row.datepaid : today) %]
280 [% row.datepaid | html %][% L.hidden_tag('datepaid_' _ loop.count, row.datepaid) %]
284 [%- IF row.changeable %]
285 <input name="source_[% loop.count %]" size=11 value="[% row.source | html %]">
287 [% row.source | html %]<input type=hidden name="source_[% loop.count %]" value="[% row.source | html %]">
291 [%- IF row.changeable %]
292 <input name="memo_[% loop.count %]" size=11 value="[% row.memo | html %]">
294 [% row.memo | html %]<input type=hidden name="memo_[% loop.count %]" value="[% row.memo | html %]">
298 [%- IF row.changeable %]
299 <input name="paid_[% loop.count %]" size=11 data-validate="number" class="numeric" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]">
301 [% row.paid | html %]<input type=hidden name="paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]"> [% defaultcurrency %]
305 [% IF row.changeable && loop.last && paid_missing > 0 %]
306 <input type="button" id="ar_set_to_paid_missing" value="[% "Set to paid missing" | $T8 %]">
311 <input type="hidden" name="fx_transaction_[% loop.count %]" value="1">
312 [%- IF row.forex || !row.changeable%]
313 <input type=hidden name="exchangerate_[% loop.count %]" value="[%- LxERP.format_amount(row.exchangerate, 5, 1) -%]">
314 [%- LxERP.format_amount(row.exchangerate, 5, 0) -%] = [% LxERP.format_amount(row.defaultcurrency_paid, 2) %] [% defaultcurrency %]</br>
315 [% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
317 <input name="exchangerate_[% loop.count %]" size=10 value="[%- LxERP.format_amount(row.exchangerate, 5, 1) -%]">
319 <input type=hidden name="forex_[% loop.count %]" value='[% row.forex | html %]'>
323 [%- IF row.changeable %]
324 [% row.selectAR_paid %]
326 [% row.AR_paid | html %]<input type=hidden name="AR_paid_[% loop.count %]" value='[% row.AR_paid | html %]'>
330 [%- IF row.changeable %]
331 [% L.select_tag('paid_project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.paid_project_id, with_empty=1) %]
333 [% project_labels.${row.paid_project_id} | html %]
334 <input type=hidden name="paid_project_id_[% loop.count %]" value='[% row.paid_project_id %]'>
338 <input type=hidden name="acc_trans_id_[% loop.count %]" value='[% row.acc_trans_id | html %]'>
339 <input type=hidden name="gldate_[% loop.count %]" value='[% row.gldate | html %]'>
345 <td align="center">[% 'Total' | $T8 %]</td>
346 <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %] [% currency %] </td>
349 <td align="center">[% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]</td>
350 <input type="hidden" name="defaultcurrency_totalpaid" value="[% defaultcurrency_totalpaid %]">
351 <input type="hidden" name="is_linked_bank_transaction" value="[% is_linked_bank_transaction %]">
357 <td align="center">[% 'Missing amount' | $T8 %]</td>
358 <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %] [% currency %]</td>
360 <input type=hidden name=paidaccounts value='[% paidaccounts %]'>
369 <script type='text/javascript'>
370 $('#ar_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });