4 [%- USE LxERP %][%- USE P -%]
 
   6 <h1>[% title | html %]</h1>
 
   8 [%- INCLUDE 'common/flash.html' %]
 
  10 <form method="post" action="[% script | html %]" id="form">
 
  12 <input type="hidden" name="terms" value="[% terms | html %]">
 
  14 <input type="hidden" name="creditlimit" value="[% creditlimit | html %]">
 
  15 <input type="hidden" name="creditremaining" value="[% creditremaining | html %]">
 
  17 <input type="hidden" name="forex" value="[% forex | html %]">
 
  18 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
 
  20 <input type="hidden" name="id" value="[% id | html %]">
 
  21 <input type="hidden" name="sort" value="[% sort | html %]">
 
  22 <input type="hidden" name="closedto" value="[% closedto | html %]">
 
  23 <input type="hidden" name="locked" value="[% locked | html %]">
 
  24 <input type="hidden" name="title" value="[% title_ | html %]">
 
  26 <input type="hidden" name="follow_up_trans_id_1" value="[% id | html %]">
 
  27 <input type="hidden" name="follow_up_trans_type_1" value="ap_transaction">
 
  28 <input type="hidden" name="follow_up_trans_info_1" value="[% follow_up_trans_info | html %]">
 
  29 <input type="hidden" name="follow_up_rowcount" value="1">
 
  31 <input type="hidden" name="defaultcurrency" value="[% defaultcurrency | html %]">
 
  32 <input type="hidden" name="fxgain_accno" value="[% fxgain_accno | html %]">
 
  33 <input type="hidden" name="fxloss_accno" value="[% fxloss_accno | html %]">
 
  35 <input type="hidden" name="oldinvtotal" value="[% oldinvtotal | html %]">
 
  36 <input type="hidden" name="oldtotalpaid" value="[% oldtotalpaid | html %]">
 
  38 <input type="hidden" name="taxaccounts" value="[% taxaccounts | html %]">
 
  40 <input type="hidden" name="rowcount" value="[% rowcount | html %]">
 
  42 <input type="hidden" name="paidaccounts" value="[% paidaccounts | html %]">
 
  44 [% FOREACH i IN [1..paidaccounts] %]
 
  45   [% temp = "acc_trans_id_"_ i %]
 
  46   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
 
  48   [% temp = "gldate_"_ i %]
 
  49   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
 
  52 [% IF ( saved_message ) %]
 
  53   <p>[% saved_message | html %]</p>
 
  56 <div id="ap_tabs" class="tabwidget">
 
  58   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
 
  59 [%- IF INSTANCE_CONF.get_webdav %]
 
  60   <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
 
  62 [%- IF id AND INSTANCE_CONF.get_doc_storage %]
 
  63       <li><a href="controller.pl?action=File/list&file_type=document&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Documents' | $T8 %]</a></li>
 
  64       <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
 
  67   [%- IF AUTH.assert('record_links', 1) %]
 
  68   <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
 
  70   <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
 
  74 <div id="ui-tabs-basic-data">
 
  83                 <th align="right" nowrap>[% 'Vendor' | $T8 %]</th>
 
  85                  [% P.customer_vendor_picker("vendor_id", vendor_id, type="vendor", style="width: 300px") %]
 
  86                  [% L.button_tag("show_vc_details('vendor')", LxERP.t8('Details (one letter abbreviation)')) %]
 
  87                  [% L.hidden_tag("previous_vendor_id", vendor_id) %]
 
  92                 <th align="right" valign="top">[% LxERP.t8("Credit Limit") %]</th>
 
  94                  [% creditlimit | html %];
 
  95                  [% LxERP.t8("Remaining") %]
 
  96                  <span class="plus[% creditremaining_plus %]">[% creditremaining | html %]</span>
 
 100 [%- IF invoice_obj.sepa_exports.as_list.size %]
 
 102                 <th align="right">[% LxERP.t8("SEPA exports") %]</th>
 
 104                  [% FOREACH export = invoice_obj.sepa_exports.as_list %]
 
 105                   <a href="sepa.pl?action=bank_transfer_edit&vc=vendor&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
 
 106                   [% UNLESS loop.last %], [% END %]
 
 113                 <th align="right" nowrap>[% 'Currency' | $T8 %]</th>
 
 114                 <td>[% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]</td>
 
 116                 [% IF ( defaultcurrency && (currency != defaultcurrency) ) %]
 
 117                   <th align=right>[% 'Exchangerate' | $T8 %]</th>
 
 119                     <td><input type="hidden" name="exchangerate" value="[% exchangerate | html %]">[% exchangerate | html %]</td>
 
 121                     <td><input type="text" name="exchangerate" size="10" value="[% exchangerate | html %]"></td>
 
 127               [% IF ALL_DEPARTMENTS %]
 
 129                   <th align="right" nowrap>[% 'Department' | $T8 %]</th>
 
 130                   <td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1) %]</td>
 
 135                 <td align="right"><input name="taxincluded" class="checkbox" type="checkbox" value="1" [% IF ( taxincluded ) %]checked[% END %]></td>
 
 136                 <th align=left nowrap>[% 'Tax Included' | $T8 %]</th>
 
 139                 <td align="right"><input name="direct_debit" class="checkbox" type="checkbox" value="1" [% IF direct_debit %]checked[% END %]></td>
 
 140                 <th align="left" nowrap>[% 'direct debit' | $T8 %]</th>
 
 148                 <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
 
 149                 <td>[% L.input_tag("invnumber", invnumber, size="11", readonly=readonly) %]</td>
 
 152                 <th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
 
 153                 <td>[% L.input_tag("ordnumber", ordnumber, size="11", readonly=readonly) %]</td>
 
 156                 <th align="right" nowrap>[% 'Invoice Date' | $T8 %]</th>
 
 157                 <td>[% L.date_tag('transdate', transdate) %]</td>
 
 160                 <th align="right" nowrap>[% 'Due Date' | $T8 %]</th>
 
 161                 <td>[% L.date_tag('duedate', duedate) %]</td>
 
 164                 <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
 
 166                   [% 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();") %]
 
 179         <tr class=listheading>
 
 180           <th class=listheading style="width:15%">[% 'Account' | $T8 %]</th>
 
 181           <th class=listheading style="width:10%">[% 'Amount' | $T8 %]</th>
 
 182           <th class=listheading style="width:10%">[% 'Tax' | $T8 %]</th>
 
 183           <th class=listheading style="width:10%">[% 'Taxkey' | $T8 %]</th>
 
 184           <th class=listheading style="width:10%">[% 'Project' | $T8 %]</th>
 
 187         [% FOREACH i IN [1..rowcount] %]
 
 190               [% SET selected_chart_id = "AP_amount_chart_id_"_ i %]
 
 191               [% P.chart_picker("AP_amount_chart_id_" _ i, $selected_chart_id, style="width: 400px", type="AP_amount", class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %]
 
 192               [% L.hidden_tag("previous_AP_amount_chart_id_" _ i, $selected_chart_id) %]
 
 193               <input type="hidden" name="tax_[% i %]" value="[% temp = "tax"_ i %][% $temp | html %]">
 
 196               <input name="amount_[% i %]" size="10" value="[% temp = "amount_"_ i %][% $temp | html %]">
 
 199               [% temp = "tax_"_ i %][% $temp | html %]
 
 202               [% temp = 'selected_taxchart_'_ i %]
 
 203               [% taxcharts = 'taxcharts_' _ i %]
 
 204               [% L.select_tag('taxchart_'_ i, $taxcharts, value_title_sub = \taxchart_value_title_sub, default = $temp, style="width: 250px") %]
 
 207               [% temp = "project_id_"_ i %]
 
 208               [% L.select_tag(temp, ALL_PROJECTS, with_empty = 1, default = loop.last ? globalproject_id : $temp, value_key = 'id', title_key = 'projectnumber') %]
 
 220             [% P.chart_picker('AP_chart_id', AP_chart_id, style="width: 400px", type="AP") %]
 
 222           <th align="left">[% invtotal | html %]</th>
 
 223           <td colspan="4"></td>
 
 232           <th align="left" width="1%">[% 'Notes' | $T8 %]</th>
 
 234             <textarea name="notes" rows="[% textarea_rows %]" cols="50" wrap="soft" [% readonly %]>[% notes | html %]</textarea>
 
 237           <th align="left" width=1%>[% 'Notes for vendor' | $T8 %]</th>
 
 239             <textarea name="intnotes" rows="[% textarea_rows %]" cols="50" wrap="soft" readonly>[% intnotes | html %]</textarea>
 
 248         <tr class="listheading">
 
 249           <th class="listheading" colspan="7">[% 'Payments' | $T8 %]</th>
 
 253           <th>[% 'Date' | $T8 %]</th>
 
 254           <th>[% 'Source' | $T8 %]</th>
 
 255           <th>[% 'Memo' | $T8 %]</th>
 
 256           <th>[% 'Amount' | $T8 %]</th>
 
 258           [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
 
 259             <th>[% 'Exch' | $T8 %]</th>
 
 261           <th>[% 'Account' | $T8 %]</th>
 
 262           <th>[% 'Project Number' | $T8 %]</th>
 
 265         [% FOREACH i IN [1..paidaccounts] %]
 
 266           [% temp = "paidaccount_changeable_"_ i %]
 
 267           [% changeable = $temp %]
 
 270             [% temp = "datepaid_"_ i %]
 
 272               [% IF( changeable ) %]
 
 273                 [% L.date_tag(temp, $temp ? $temp : today) %]
 
 276                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
 
 280             [% temp = "source_"_ i %]
 
 282               [% IF( changeable ) %]
 
 283                 <input name="[% temp %]" size="11" value="[% $temp | html %]">
 
 286                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
 
 290             [% temp = "memo_"_ i %]
 
 292               [% IF( changeable ) %]
 
 293                 <input name="[% temp %]" size="11" value="[% $temp | html %]">
 
 296                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
 
 300             [% temp = "paid_"_ i %]
 
 302               [% IF( changeable ) %]
 
 303                 <input name="[% temp %]" size="11" value="[% $temp | html %]" onBlur="check_right_number_format(this);">
 
 306                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
 
 311               [% IF changeable && loop.last && paid_missing > 0 %]
 
 312                 <input type="button" id="ap_set_to_paid_missing" value="[% "Set to paid missing" | $T8 %]">
 
 316             [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
 
 318                 [% temp = "exchangerate_"_ i %]
 
 319                 [% temp_forex = "forex_"_ i %]
 
 321                 [% IF( $temp_forex || !changeable ) %]
 
 323                   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
 
 325                   <input name="[% temp %]" size="11" value="[% $temp | html %]">
 
 328                 <input type=hidden name="[% temp_forex %]" value="[% $temp_forex | html %]">
 
 332             [% temp = "AP_paid_"_ i %]
 
 334               [% IF( changeable ) %]
 
 335                 [% L.select_tag(temp, ALL_CHARTS_AP_paid, value_title_sub = \AP_paid_value_title_sub, default = ($temp || accno_arap))  %]
 
 338                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
 
 343               [% temp = "paid_project_id_"_ i %]
 
 344               [% IF( changeable ) %]
 
 345                 [% L.select_tag(temp, ALL_PROJECTS, with_empty = 1, default = $temp, value_key = 'id', title_key = 'projectnumber') %]
 
 347                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
 
 348                 [% temp = "label"_ temp %]
 
 358           <td align="center">[% 'Total' | $T8 %]</td>
 
 359           <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
 
 364           <td align="center">[% 'Missing amount' | $T8 %]</td>
 
 365           <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
 
 372 [% PROCESS 'webdav/_list.html' %]
 
 374  [% LxERP.t8('Loading...') %]
 
 378 <hr size="3" noshade>
 
 380 <script type='text/javascript'>
 
 381  $('#ap_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });