8 [% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %]
12 [% INCLUDE 'common/flash.html' %]
14 <form method="post" name="arledger" action="[% script %]" id="form">
16 [% L.hidden_tag('id', id) %]
17 [% L.hidden_tag('sort', sort) %]
18 [% L.hidden_tag('closedto', closedto) %]
19 [% L.hidden_tag('locked', locked) %]
20 [% L.hidden_tag('title', title_str) %]
21 [% L.hidden_tag('follow_up_trans_id_1', id) %]
22 [% L.hidden_tag('follow_up_trans_type_1', 'ar_transaction') %]
23 [% L.hidden_tag('follow_up_trans_info_1', follow_up_trans_info) %]
24 [% L.hidden_tag('follow_up_rowcount', 1) %]
25 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
28 [% L.hidden_tag('form_validity_token', form_validity_token) %]
30 [% L.hidden_tag('email_journal_id', email_journal_id) %]
31 [% L.hidden_tag('email_attachment_id', email_attachment_id) %]
32 [% L.hidden_tag('workflow_email_journal_id', workflow_email_journal_id) %]
33 [% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %]
34 [% L.hidden_tag('workflow_email_callback', workflow_email_callback) %]
36 [% IF saved_message %]<p class="message message_info">[% saved_message | html %]</p>[% END %]
38 <div class="tabwidget">
41 <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
42 [% IF email_attachment_id || workflow_email_attachment_id %]
43 <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>
46 [% IF INSTANCE_CONF.get_doc_storage %]
47 <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
49 [% IF AUTH.assert('record_links', 1) %]
50 <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
52 <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
57 <div id="ui-tabs-basic-data">
59 [% IF email_attachment_id || workflow_email_attachment_id %]
60 <div class="wrapper" id="email_attachment_wrapper">
63 P.email_journal.attachment_preview(
64 email_attachment_id || workflow_email_attachment_id,
68 INCLUDE 'common/toggle_panel.html'
70 button_closed = LxERP.t8('Show Attachment')
71 button_open = LxERP.t8('Hide Attachment')
79 <table class="tbl-horizontal">
80 <caption>[% 'Customer & Order' | $T8 %]</caption>
81 <colgroup><col class="wi-mediumsmall"><col class="wi-lightwide"></colgroup>
84 <th>[% 'Customer' | $T8 %]</th>
85 <td class="wi-lightwide">
86 [% P.customer_vendor.picker("customer_id", customer_id, type="customer", show_details="1") %]
87 [% L.hidden_tag("previous_customer_id", customer_id) %]
88 [% L.hidden_tag('terms', terms) %]
91 [% IF max_dunning_level || invoice_obj.dunning_config_id %]
93 <th>[% LxERP.t8("Dunning status") %]</th>
95 [% IF invoice_obj.dunning_config_id %]
96 <span class="dunned_invoice">[% LxERP.t8("This invoice's dunning level: #1", invoice_obj.dunning_config.dunning_description) %]</span>
97 [% IF max_dunning_level %]<br>[% END %]
99 [% IF max_dunning_level %]
100 <span class="customer_dunning_level">
101 [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %] <br>
102 [% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
109 <th>[% LxERP.t8("Credit Limit") %]</th>
111 <span class="data wi-lightwide">
112 [% LxERP.format_amount(creditlimit, 0) %][% L.hidden_tag('creditlimit', LxERP.format_amount(creditlimit, 0)) %],
113 [% LxERP.t8("Remaining") %]
114 <span class="plus[% creditremaining < 0 ? 0 : 1 %]">[% LxERP.format_amount(creditremaining, 0) %][% L.hidden_tag('creditremaining', LxERP.format_amount(creditremaining, 0)) %]</span>
118 [% IF invoice_obj.sepa_exports.as_list.size %]
120 <th>[% LxERP.t8("SEPA exports") %]</th>
122 [% FOREACH export = invoice_obj.sepa_exports.as_list %]
123 <a href="sepa.pl?action=bank_transfer_edit&vc=customer&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
124 [% UNLESS loop.last %], [% END %]
130 <th>[% 'Currency' | $T8 %]</th>
133 [% HTML.escape(currency) %]
134 [% L.hidden_tag("currency", currency) %]
136 [% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name", class="wi-lightwide") %]
139 [% L.hidden_tag('defaultcurrency', defaultcurrency) %]
140 [% L.hidden_tag('fxgain_accno', fxgain_accno) %]
141 [% L.hidden_tag('fxloss_accno', fxloss_accno) %]
142 [% L.hidden_tag('forex', forex) %]
146 <th>[% 'Exchangerate' | $T8 %]</th>
149 [% LxERP.format_amount(exchangerate, 5) %]
150 [% L.hidden_tag("exchangerate", LxERP.format_amount(exchangerate, 5)) %]
152 [% L.input_tag("exchangerate", LxERP.format_amount(exchangerate), class="wi-lightwide") %]
154 [% IF record_forex %][% 'record exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
159 [% IF ALL_DEPARTMENTS %]
161 <th>[% 'Department' | $T8 %]</th>
162 <td>[% L.select_tag('department_id', ALL_DEPARTMENTS, default=department_id, title_key='description', with_empty=1, class="wi-lightwide") %]</td>
166 <th>[% 'Transaction description' | $T8 %]</th>
167 <td>[% L.input_tag("transaction_description", transaction_description, "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '', class="wi-lightwide") %]</td>
171 <td>[% L.checkbox_tag('taxincluded', checked=taxincluded, label=LxERP.t8('Tax Included')) %]</td>
175 <td>[% L.checkbox_tag('direct_debit', checked=direct_debit, label=LxERP.t8('direct debit')) %]</td>
180 <table class="tbl-horizontal">
181 <caption>[% 'Notes' | $T8 %]</caption>
182 <colgroup><col class="wi-wide"></colgroup>
186 [% L.textarea_tag("notes", HTML.escape(notes), rows=rows, class="wi-wide") %]
191 <span class="label above">[% 'Notes for customer' | $T8 %]</span>
192 [% L.textarea_tag("intnotes", HTML.escape(intnotes), rows=rows, readonly=readonly, class="wi-wide") %]
198 <table class="tbl-horizontal">
199 <caption>[% 'Numbers & Dates' | $T8 %]</caption>
200 <colgroup><col class="wi-mediumsmall"><col class="wi-lightwide"></colgroup>
203 <th>[% 'Salesperson' | $T8 %]</th>
204 <td>[% P.select_tag("employee_id", employees, default=employee_id, title_key='safe_name') %]</td>
207 <th>[% 'Invoice Number' | $T8 %]</th>
208 <td>[% L.input_tag("invnumber", invnumber, size="11") %]</td>
211 <th>[% 'Order Number' | $T8 %]</th>
212 <td>[% L.input_tag("ordnumber", ordnumber, size="11") %]</td>
215 <th>[% 'Invoice Date' | $T8 %]</th>
216 <td>[% L.date_tag('transdate', transdate) %]</td>
219 <th>[% 'Due Date' | $T8 %]</th>
220 <td>[% L.date_tag('duedate', duedate) %]</td>
223 <th>[% LxERP.t8('Tax point') %]</th>
224 <td>[% L.date_tag('tax_point', tax_point, id='tax_point') %]</td>
227 <th>[% 'Delivery Date' | $T8 %]</th>
228 <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
231 <th>[% 'Project Number' | $T8 %]</th>
232 <td>[% P.project.picker('globalproject_id', globalproject_id, onchange="document.getElementById('update_button').click();") %]</td>
237 </div><!-- /.wrapper -->
239 [% L.hidden_tag('rowcount', rowcount) %]
241 <div class="wrapper">
243 <table class="tbl-list">
244 <caption>[% 'Transactions' | $T8 %]</caption>
247 <th>[% 'Account' | $T8 %]</th>
248 <th class="right">[% 'Amount' | $T8 %]</th>
249 <th class="right">[% 'Tax' | $T8 %]</th>
250 <th>[% 'Taxkey' | $T8 %]</th>
251 <th>[% 'Project' | $T8 %]</th>
255 [% FOREACH row IN transactions %]
257 <td class="wi-wider">[% row.selectAR_amount %]</td>
258 <td class="numeric">[% L.input_tag('amount_' _ loop.count, LxERP.format_amount(row.amount, 2), class='wi-small numeric') %]</td>
259 <td class="numeric">[% L.hidden_tag('tax_' _ loop.count, LxERP.format_tax(row.tax, 2)) %][% LxERP.format_amount(row.tax, 2) | html %]</td>
260 <td>[% row.taxchart %]</td>
261 <td>[% P.project.picker("project_id_"_ loop.count, row.project_id) %]</td>
267 <td>[% P.chart.picker("AR_chart_id", AR_chart_id, type="AR", class="wi-wider") %]</td>
268 <th class="numeric">[% LxERP.format_amount(invtotal, 2) | html %]</th>
269 <input type="hidden" name="oldinvtotal" value="[% oldinvtotal %]">
270 <input type="hidden" name="oldtotalpaid" value="[% oldtotalpaid %]">
271 <input type="hidden" name="taxaccounts" value="[% taxaccounts | html %]">
272 <td colspan="3"></td>
278 <table class="tbl-list" style="width:90%;">
279 <caption>[% 'Incoming Payments' | $T8 %]</caption>
282 <th>[% 'Date' | $T8 %]</th>
283 <th>[% 'Source' | $T8 %]</th>
284 <th>[% 'Memo' | $T8 %]</th>
285 <th class="right">[% 'Amount' | $T8 %]</th>
288 <th>[% 'Exch' | $T8 %]</th>
290 <th>[% 'Account' | $T8 %]</th>
291 <th>[% 'Project Number' | $T8 %]</th>
295 [% FOREACH row IN payments %]
298 [% IF row.changeable %]
299 [% L.date_tag('datepaid_' _ loop.count, row.datepaid ? row.datepaid : today) %]
301 [% row.datepaid | html %][% L.hidden_tag('datepaid_' _ loop.count, row.datepaid) %]
305 [% IF row.changeable %]
306 <input type="text" name="source_[% loop.count %]" size="11" value="[% row.source | html %]">
308 [% row.source | html %]<input type="hidden" name="source_[% loop.count %]" value="[% row.source | html %]">
312 [% IF row.changeable %]
313 <input type="text" name="memo_[% loop.count %]" size="11" value="[% row.memo | html %]">
315 [% row.memo | html %]<input type="hidden" name="memo_[% loop.count %]" value="[% row.memo | html %]">
319 [% IF row.changeable %]
320 <input name="paid_[% loop.count %]" id="payment_paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]" size="11" type="text" data-validate="number" class="numeric">
322 [% LxERP.format_amount(row.paid, 2) | html %]<input type="hidden" name="paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]"> [% defaultcurrency %]
326 [% IF row.changeable && loop.last && paid_missing > 0 %]
327 <input type="button" id="ar_set_to_paid_missing" value="[% 'Set to paid missing' | $T8 %]">
332 [% IF row.forex || !row.changeable%]
333 <input type="hidden" name="exchangerate_[% loop.count %]" value="[% LxERP.format_amount(row.exchangerate, 5, 1) %]">
334 [%- LxERP.format_amount(row.exchangerate, 5, 0) -%] = [% LxERP.format_amount(row.defaultcurrency_paid, 2) %] [% defaultcurrency %]</br>
335 [% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
337 <input type="text" name="exchangerate_[% loop.count %]" size="10" value="[% LxERP.format_amount(row.exchangerate, 5, 1) %]">
339 <input type="hidden" name="forex_[% loop.count %]" value="[% row.forex | html %]">
343 [% IF row.changeable %]
344 [% row.selectAR_paid %]
346 [% row.AR_paid | html %]<input type="hidden" name="AR_paid_[% loop.count %]" value="[% row.AR_paid | html %]">
350 [% IF row.changeable %]
351 [% P.project.picker("paid_project_id_"_ loop.count, row.paid_project_id) %]
353 [% project_labels.${row.paid_project_id} | html %]
354 <input type="hidden" name="paid_project_id_[% loop.count %]" value="[% row.paid_project_id %]">
356 <input type="hidden" name="acc_trans_id_[% loop.count %]" value="[% row.acc_trans_id | html %]">
357 <input type="hidden" name="gldate_[% loop.count %]" value="[% row.gldate | html %]">
366 <th class="right">[% 'Total' | $T8 %]</th>
367 <td class="numeric">[% LxERP.format_amount(totalpaid, 2) | html %] [% currency %] </td>
370 <td align="numeric">[% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]</td>
371 <input type="hidden" name="defaultcurrency_totalpaid" value="[% defaultcurrency_totalpaid %]">
372 <input type="hidden" name="is_linked_bank_transaction" value="[% is_linked_bank_transaction %]">
380 <th class="right">[% 'Missing amount' | $T8 %]</th>
382 [% LxERP.format_amount(paid_missing, 2) | html %] [% currency %]
383 <input type="hidden" name="paidaccounts" value="[% paidaccounts %]">
395 </div><!-- /.wrapper -->
397 </div><!-- /#ui-tabs-basic-data -->
398 </div><!-- ./tabwidget -->
400 <script type="text/javascript">
401 $('#ar_set_to_paid_missing').click(function(){ $('input[id^="payment_paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });