<li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
[%- IF id %]
<li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
+ <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
[%- END %]
</ul>
<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 %]">
[% 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 = accno_arap) %]
+ [% 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>
</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>