<input type="hidden" name="creditremaining" value="[% creditremaining | 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 type="hidden" name="sort" value="[% sort | html %]">
<p>[% saved_message | html %]</p>
[% END %]
+<div class="tabwidget">
+ <ul>
+ <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
+[%- 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>
+ [%- END %]
+ <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
+[%- END %]
+ </ul>
+
+<div id="ui-tabs-basic-data">
<table width="100%">
<tr valign="top">
<td>
</tr>
<tr>
- <td></td>
- <td colspan="3">
- <table width="100%">
- <tr>
- <th align="left" nowrap>[% 'Credit Limit' | $T8 %]</th>
- <td>[% creditlimit | html %]</td>
- <th align="left" nowrap>[% 'Remaining' | $T8 %]</th>
- <td class="plus[% creditremaining_plus %]">[% creditremaining | html %]</td>
- </tr>
- </table>
+ <th align="right" valign="top">[% LxERP.t8("Credit Limit") %]</th>
+ <td>
+ [% creditlimit | html %];
+ [% LxERP.t8("Remaining") %]
+ <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>
+ [% FOREACH export = invoice_obj.sepa_exports.as_list %]
+ <a href="sepa.pl?action=bank_transfer_edit&vc=vendor&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
+ [% UNLESS loop.last %], [% END %]
+ [% END %]
</td>
</tr>
+[%- END %]
<tr>
<th align="right" nowrap>[% 'Currency' | $T8 %]</th>
<tr>
<th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
<td>
- [% L.select_tag('globalproject_id', ALL_PROJECTS, with_empty = 1, default = globalproject_id, value_key = 'id', title_key = 'projectnumber') %]
+ [% L.select_tag('globalproject_id', ALL_PROJECTS, with_empty = 1, default = globalproject_id, value_key = 'id', title_key = 'projectnumber', onChange = "document.getElementById('update_button').click();") %]
</td>
</tr>
</table>
<th>[% 'Source' | $T8 %]</th>
<th>[% 'Memo' | $T8 %]</th>
<th>[% 'Amount' | $T8 %]</th>
+ <th></th>
[% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
<th>[% 'Exch' | $T8 %]</th>
[% END %]
[% temp = "datepaid_"_ i %]
<td align="center">
[% IF( changeable ) %]
- [% L.date_tag(temp, $temp) %]
+ [% L.date_tag(temp, $temp ? $temp : today) %]
[% ELSE %]
[% $temp | html %]
- <input type="hidden" name="[% temp %]" value="[% $temp | html %]">|;
+ <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
[% END %]
</td>
[% END %]
</td>
+ <td>
+ [% IF changeable && loop.last && paid_missing > 0 %]
+ <input type="button" id="ap_set_to_paid_missing" value="[% "Set to paid missing" | $T8 %]">
+ [% END %]
+ </td>
+
[% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
<td align="center">
[% temp = "exchangerate_"_ i %]
[% temp = "AP_paid_"_ i %]
<td align="center">
[% IF( changeable ) %]
- [% L.select_tag(temp, ALL_CHARTS_AP_paid, value_title_sub = \AP_paid_value_title_sub, default = $temp) %]
+ [% L.select_tag(temp, ALL_CHARTS_AP_paid, value_title_sub = \AP_paid_value_title_sub, default = ($temp || accno_arap)) %]
[% ELSE %]
[% $temp | html %]
<input type="hidden" name="[% temp %]" value="[% $temp | html %]">
</table>
</td>
</tr>
- <tr>
- <td><hr size="3" noshade></td>
- </tr>
</table>
+</div>
+</div>
+
+<script type='text/javascript'>
+ $('#ap_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });
+</script>