[%- USE L %]
+[%- USE P %]
[%- USE HTML %]
[%- USE T8 %]
[%- USE LxERP %][%- USE P -%]
-<form method="post" action="[% script | html %]">
+<h1>[% title | html %]</h1>
+
+[%- INCLUDE 'common/flash.html' %]
-<input type="hidden" name="selectvendor" value="[% selectvendor | html %]">
-<input type="hidden" name="selectcurrency" value="[% selectcurrency | html %]">
+<form method="post" action="[% script | html %]" id="form">
-<input type="hidden" name="oldvendor" value="[% oldvendor | html %]">
-<input type="hidden" name="vendor_id" value="[% vendor_id | html %]">
<input type="hidden" name="terms" value="[% terms | html %]">
<input type="hidden" name="creditlimit" value="[% creditlimit | html %]">
<input type="hidden" name="paidaccounts" value="[% paidaccounts | html %]">
+[%- P.hidden_tag('convert_from_oe_id', convert_from_oe_id) -%]
+
[% FOREACH i IN [1..paidaccounts] %]
[% temp = "acc_trans_id_"_ i %]
<input type="hidden" name="[% temp %]" value="[% $temp | html %]">
<input type="hidden" name="[% temp %]" value="[% $temp | html %]">
[% END %]
-<h1>[% title | html %]</h1>
-
[% IF ( saved_message ) %]
<p>[% saved_message | html %]</p>
[% 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="controller.pl?action=File/list&file_type=attachment&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
+[%- END %]
[%- IF id %]
[%- IF AUTH.assert('record_links', 1) %]
<li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
<tr>
<th align="right" nowrap>[% 'Vendor' | $T8 %]</th>
<td colspan="3">
- [% IF ( selectvendor ) %]
- <select name="vendor" onchange="document.getElementById('update_button').click();"[% IF initial_focus == 'vendor' %] class="initial_focus"[% END %]>[% selectvendor %]</select>
- [% ELSE %]
- <input name=vendor value="[% vendor | html %]" size="35"[% IF initial_focus == 'vendor' %] class="initial_focus"[% END %]>
- [% END %]
- <input type="button" value="D" onclick="show_vc_details('vendor')">
+ [% 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)')) %]
+ [% L.hidden_tag("previous_vendor_id", vendor_id) %]
</td>
</tr>
<tr>
<th align="right" nowrap>[% 'Currency' | $T8 %]</th>
- <td><select name="currency">[% selectcurrency %]</select></td>
+ <td>[% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]</td>
[% IF ( defaultcurrency && (currency != defaultcurrency) ) %]
<th align=right>[% 'Exchangerate' | $T8 %]</th>
<table>
<tr>
<th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
- <td><input name="invnumber" size="11" value="[% invnumber | html %]" [% readonly %]></td>
+ <td>[% L.input_tag("invnumber", invnumber, size="11", readonly=readonly) %]</td>
</tr>
<tr>
<th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
- <td><input name="ordnumber" size="11" value="[% ordnumber | html %]" [% readonly %]></td>
+ <td>[% L.input_tag("ordnumber", ordnumber, size="11", readonly=readonly) %]</td>
</tr>
<tr>
<th align="right" nowrap>[% 'Invoice 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", 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>
<td>
[% temp = 'selected_taxchart_'_ i %]
- [% L.select_tag('taxchart_'_ i, ALL_TAXCHARTS, value_title_sub = \taxchart_value_title_sub, default = $temp) %]
+ [% taxcharts = 'taxcharts_' _ i %]
+ [% L.select_tag('taxchart_'_ i, $taxcharts, value_title_sub = \taxchart_value_title_sub, default = $temp, style="width: 250px") %]
</td>
<td>
[% temp = "project_id_"_ i %]
</tr>
<tr>
<td>
- [% P.chart_picker('AP_chart_id', AP_chart_id, style="width: 400px", type="AP") %]
+ [% P.chart.picker('AP_chart_id', AP_chart_id, style="width: 400px", type="AP") %]
</td>
<th align="left">[% invtotal | html %]</th>
<td colspan="4"></td>
</tr>
<tr>
<td>
+ [% UNLESS no_payment_bookings %]
<table width="100%">
<tr class="listheading">
<th class="listheading" colspan="7">[% 'Payments' | $T8 %]</th>
[% temp = "paid_"_ i %]
<td align="center">
[% IF( changeable ) %]
- <input name="[% temp %]" size="11" value="[% $temp | html %]" onBlur="check_right_number_format(this);">
+ <input name="[% temp %]" size="11" data-validate="number" class="numeric" value="[% $temp | html %]">
[% ELSE %]
[% $temp | html %]
<input type="hidden" name="[% temp %]" value="[% $temp | html %]">
</td>
[% END %]
- [% temp = "AP_paid_"_ i %]
+ [% temp = "AP_paid_"_ i %]
+ [% readonly = "AP_paid_readonly_desc_"_ i %]
<td align="center">
[% IF( changeable ) %]
[% L.select_tag(temp, ALL_CHARTS_AP_paid, value_title_sub = \AP_paid_value_title_sub, default = ($temp || accno_arap)) %]
[% ELSE %]
- [% $temp | html %]
+ [% $readonly | html %]
<input type="hidden" name="[% temp %]" value="[% $temp | html %]">
[% END %]
</td>
<td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
</tr>
</table>
+ [% END %]
</td>
</tr>
</table>