[%- USE T8 %]
[%- USE LxERP %][%- USE P -%]
-<h1>[% title | html %]</h1>
+<h1>
+ [% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %]
+ [% title %]
+</h1>
[%- INCLUDE 'common/flash.html' %]
<input type="hidden" name="forex" value="[% forex | html %]">
<input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
-<input type="hidden" name="id" value="[% id | html %]">
+<input id="id" type="hidden" name="id" value="[% id | html %]">
<input type="hidden" name="sort" value="[% sort | html %]">
<input type="hidden" name="closedto" value="[% closedto | html %]">
<input type="hidden" name="locked" value="[% locked | html %]">
<input type="hidden" name="rowcount" value="[% rowcount | html %]">
<input type="hidden" name="paidaccounts" value="[% paidaccounts | html %]">
+[% L.hidden_tag('zugferd_session_file', zugferd_session_file) %]
[%- P.hidden_tag('convert_from_oe_id', convert_from_oe_id) -%]
+[% IF !id %]
+[% L.hidden_tag('form_validity_token', form_validity_token) %]
+[% END %]
+[% L.hidden_tag('email_journal_id', email_journal_id) %]
+[% L.hidden_tag('email_attachment_id', email_attachment_id) %]
+[% L.hidden_tag('workflow_email_journal_id', workflow_email_journal_id) %]
+[% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %]
+[% L.hidden_tag('workflow_email_callback', workflow_email_callback) %]
+
[% FOREACH i IN [1..paidaccounts] %]
[% temp = "acc_trans_id_"_ i %]
<input type="hidden" name="[% temp %]" value="[% $temp | html %]">
<div id="ap_tabs" class="tabwidget">
<ul>
<li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
+[% IF email_attachment_id || workflow_email_attachment_id %]
+ <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>
+[% END %]
[%- IF INSTANCE_CONF.get_webdav %]
<li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
[%- END %]
[%- IF id AND INSTANCE_CONF.get_doc_storage %]
- <li><a href="controller.pl?action=File/list&file_type=document&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Documents' | $T8 %]</a></li>
+ <li><a href="#ui-tabs-docs">[% 'Documents' | $T8 %]</a></li>
<li><a href="controller.pl?action=File/list&file_type=attachment&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
[%- END %]
[%- IF id %]
[%- END %]
</ul>
+[%- IF id AND INSTANCE_CONF.get_doc_storage %]
+ <div id="ui-tabs-docs"></div>
+[%- END %]
+
<div id="ui-tabs-basic-data">
<table width="100%">
<tr valign="top">
<tr>
<th align="right" nowrap>[% 'Vendor' | $T8 %]</th>
<td colspan="3">
- [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", style="width: 300px", onchange="\$('#update_button').click()") %]
- [% L.button_tag("show_vc_details('vendor')", LxERP.t8('Details (one letter abbreviation)')) %]
+ [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", show_details="1",
+ style="width: 330px", class=(initial_focus == 'vendor_id' ? "initial_focus" : "")) %]
[% L.hidden_tag("previous_vendor_id", vendor_id) %]
</td>
</tr>
<span class="plus[% creditremaining_plus %]">[% creditremaining | html %]</span>
</td>
</tr>
-
[%- IF invoice_obj.sepa_exports.as_list.size %]
<tr>
<th align="right">[% LxERP.t8("SEPA exports") %]</th>
</td>
</tr>
[%- END %]
-
<tr>
<th align="right" nowrap>[% 'Currency' | $T8 %]</th>
- <td>[% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]</td>
-
+ <td>
+ [%- IF readonly %]
+ [% HTML.escape(currency) %]
+ [% L.hidden_tag("currency", currency) %]
+ [%- ELSE %]
+ [% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]
+ [%- END %]
+ </td>
[% IF ( defaultcurrency && (currency != defaultcurrency) ) %]
<th align=right>[% 'Exchangerate' | $T8 %]</th>
- [% IF ( forex ) %]
- <td><input type="hidden" name="exchangerate" value="[% exchangerate | html %]">[% exchangerate | html %]</td>
- [% ELSE %]
- <td><input type="text" name="exchangerate" size="10" value="[% exchangerate | html %]"></td>
- [% END %]
+ <td>
+ [%- IF readonly %]
+ [% LxERP.format_amount(exchangerate, 5) %]
+ [% L.hidden_tag("exchangerate", LxERP.format_amount(exchangerate, 5)) %]
+ [%- ELSE %]
+ <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
+ [%- END %]
+ [% IF record_forex %][% 'record exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
+ [% L.hidden_tag("record_forex", record_forex) %]
[% END %]
-
</tr>
[% IF ALL_DEPARTMENTS %]
<tr>
<th align="right" nowrap>[% 'Department' | $T8 %]</th>
- <td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1) %]</td>
+ <td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = "width:334px") %]</td>
</tr>
[% END %]
+ <tr>
+ <th align="right">[% 'Transaction description' | $T8 %]</th>
+ <td colspan="3">[% L.input_tag("transaction_description", transaction_description, style="width:330px", "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
+ </tr>
<tr>
<td align="right"><input name="taxincluded" class="checkbox" type="checkbox" value="1" [% IF ( taxincluded ) %]checked[% END %]></td>
<th align=left nowrap>[% 'Tax Included' | $T8 %]</th>
</tr>
<tr>
<th align="right" nowrap>[% 'Invoice Date' | $T8 %]</th>
- <td>[% L.date_tag('transdate', transdate) %]</td>
+ <td>[% L.date_tag('transdate', transdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("transdate")') %]</td>
</tr>
<tr>
<th align="right" nowrap>[% 'Due Date' | $T8 %]</th>
<tr>
<td>
[% SET selected_chart_id = "AP_amount_chart_id_"_ i %]
- [% P.chart.picker("AP_amount_chart_id_" _ i, $selected_chart_id, style="width: 400px", type="AP_amount", class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %]
+ [% 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" : "")) %]
[% L.hidden_tag("previous_AP_amount_chart_id_" _ i, $selected_chart_id) %]
<input type="hidden" name="tax_[% i %]" value="[% temp = "tax"_ i %][% $temp | html %]">
</td>
<td>
- <input name="amount_[% i %]" size="10" value="[% temp = "amount_"_ i %][% $temp | html %]">
+ <input name="amount_[% i %]" size="10" [% readonly ? 'readonly' : '' %] value="[% temp = "amount_"_ i %][% $temp | html %]">
</td>
<td>
- [% temp = "tax_"_ i %][% $temp | html %]
+ [% temp_r = "tax_reverse_"_ i %]
+ [% IF ($temp_r) %]
+ [% $temp_r | html %]
+
+ [% temp_c = "tax_charge_"_ i %][% $temp_c | html %]
+ [% ELSE %]
+ [% temp = "tax_"_ i %][% $temp | html %]
+ [% END %]
</td>
<td>
[% temp = 'selected_taxchart_'_ i %]
[% L.textarea_tag("intnotes", intnotes, wrap="soft", rows=textarea_rows, cols=50, readonly=readonly) %]
</td>
<td>
- [% L.select_tag('payment_id', payment_terms, default=payment_id, title_key='description', with_empty=1, style="width: 250px") %]
+ [% 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')") %]
</td>
<tr>
</table>
</td>
[% temp = "paid_"_ i %]
- <td align="center">
+ <td align="right">
[% IF( changeable ) %]
<input name="[% temp %]" size="11" data-validate="number" class="numeric" value="[% $temp | html %]" id="[%- 'payment_' _ temp -%]">
[% ELSE %]
[% $temp | html %]
- <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
+ <input type="hidden" name="[% temp %]" value="[% $temp | html %]"> [% defaultcurrency %]
[% END %]
</td>
<td align="center">
[% temp = "exchangerate_"_ i %]
[% temp_forex = "forex_"_ i %]
+ [% SET defaultcurrency_paid = 'defaultcurrency_paid_' _ i %]
+ [% SET record_forex = 'record_forex_' _ i %]
+ [% SET fx_transaction = 'fx_transaction_' _ i %]
[% IF( $temp_forex || !changeable ) %]
- [% $temp | html %]
+ [% $temp | html %] = [% LxERP.format_amount($defaultcurrency_paid,2) %] [% defaultcurrency %] </br>
+ [% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
+
<input type="hidden" name="[% temp %]" value="[% $temp | html %]">
[% ELSE %]
<input name="[% temp %]" size="11" value="[% $temp | html %]">
[% END %]
-
<input type=hidden name="[% temp_forex %]" value="[% $temp_forex | html %]">
+ <input type="hidden" name="[% fx_transaction %]" value="1">
</td>
[% END %]
<td></td>
<td></td>
<td align="center">[% 'Total' | $T8 %]</td>
- <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
+ <td align="right">[% LxERP.format_amount(totalpaid, 2) | html %] [% currency %]</td>
+ [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
+ <td></td>
+ <td align="center">[% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]</td>
+ <input type="hidden" name="defaultcurrency_totalpaid" value="[% defaultcurrency_totalpaid %]">
+ <input type="hidden" name="is_linked_bank_transaction" value="[% is_linked_bank_transaction %]">
+ [% END %]
+
</tr>
<tr>
<td></td>
<td></td>
<td align="center">[% 'Missing amount' | $T8 %]</td>
- <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
+ <td align="right">[% LxERP.format_amount(paid_missing, 2) | html %] [% currency %]</td>
</tr>
</table>
[% END %]
<hr size="3" noshade>
<script type='text/javascript'>
- $('#ap_set_to_paid_missing').click(function(){ $('input[id^="payment_paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });
+ $('#ap_set_to_paid_missing').click(function(){ $('input[id^="payment_paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });
</script>