]> wagnertech.de Git - mfinanz.git/blobdiff - templates/webpages/ir/_payments.html
date error in mapping
[mfinanz.git] / templates / webpages / ir / _payments.html
index 277d4db49e9c4aea6247ccc356fb11b7e5d7b133..df7a722c88f810c9bfc1491f29a4d90bbe5b24ee 100644 (file)
@@ -1,22 +1,19 @@
 [%- USE T8 %]
 [%- USE LxERP %]
+[%- USE L %]
+[%- USE HTML %]
   <tr>
    <td>
     <table width="100%">
      <tr class="listheading">
-[% IF is_type_credit_note || vc == 'vendor' %]
       <th colspan="6" class="listheading">[% 'Payments' | $T8 %]</th>
-[% ELSE %]
-      <th colspan="6" class="listheading">[% 'Incoming Payments' | $T8 %]</th>
-[%- END %]
      </tr>
-
-
      <tr>
       <th>[% 'Date' | $T8 %]</th>
       <th>[% 'Source' | $T8 %]</th>
       <th>[% 'Memo' | $T8 %]</th>
       <th>[% 'Amount' | $T8 %]</th>
+      <th></th>
 [% IF show_exchangerate %]
       <th>[% 'Exch' | $T8 %]</th>
 [% END %]
@@ -27,7 +24,7 @@
 [% FOREACH i = paid_indices %]
   [% SET changeable    = 'changeable_'    _ i %]
   [% SET acc_trans_id  = 'acc_trans_id_'  _ i %]
-  [% SET gldate        = 'gldate_'        _ i %]
+  [% SET p_gldate      = 'gldate_'        _ i %]
   [% SET datepaid      = 'datepaid_'      _ i %]
   [% SET source        = 'source_'        _ i %]
   [% SET memo          = 'memo_'          _ i %]
   [% SET selectAP_paid_ref = 'selectAP_paid_' _ i %]
 
      <input type=hidden name="acc_trans_id_[% i %]" value=[% $acc_trans_id %]>
-     <input type=hidden name="gldate_[% i %]" value=[% $gldate %]>
+     <input type=hidden name="gldate_[% i %]" value=[% $p_gldate %]>
 
      <tr>
 
     <td align="center">
     [% IF $changeable %]
-      <input id="datepaid_[% i %]" name="datepaid_[% i %]" size="11" title="[% dateformat %]" value="[% $datepaid %]">
-      <input type="button" name="datepaid_[% i %]" id="trigger_datepaid_[% i %]" value="?">
+      [% IF $datepaid %]
+        [% L.date_tag('datepaid_'_ i, $datepaid) %]
+      [% ELSE %]
+        [% L.date_tag('datepaid_'_ i, today) %]
+      [% END %]
     [% ELSE %]
       <input type="hidden" name="datepaid_[% i %]" value="[% $datepaid %]">[% $datepaid %]
     [% END %]
        [% LxERP.format_amount($paid, 2, 1) %]
     [% END %]
      </td>
+     <td>
+       [% IF $changeable && loop.last && paid_missing > 0 %]
+         <input type='button' id='is_set_to_paid_missing' value='[% 'Set to paid missing' | $T8 %]'>
+       [% END %]
+     </td>
 
 [% IF show_exchangerate %]
      <td align="center">
   [% SET forex        = 'forex_'        _ i %]
   [% SET exchangerate = 'exchangerate_' _ i %]
-  [% IF forex %]
-        <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 2) %]">
-        [% LxERP.format_amount(exchangerate, 2) %]
+  [% SET defaultcurrency_paid  = 'defaultcurrency_paid_' _ i %]
+  [% SET record_forex = 'record_forex_' _ i %]
+  [% SET fx_transaction = 'fx_transaction_' _ i %]
+  [% IF $forex %]
+        <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 5) %]">
+        <input type="hidden" name="record_forex_[% i %]" value="[% $record_forex %]">
+        <input type="hidden" name="forex_[% i %]"        value="[% $forex %]">
+        <input type="hidden" name="defaultcurrency_paid_[% i %]"      value="[% $defaultcurrency_paid %]">
+        <input type="hidden" name="fx_transaction_[% i %]" value="1">
+          [% LxERP.format_amount($forex, 5) %] = [% LxERP.format_amount($defaultcurrency_paid, 5) %] [% defaultcurrency %] </br>
+          [% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
   [% ELSE %]
      [% IF $changeable %]
-        <input name="exchangerate_[% i %]" size="10" value="[% LxERP.format_amount($exchangerate, 2, 1) %]">
+        <input name="exchangerate_[% i %]" size="10" value="[% LxERP.format_amount($exchangerate, 5, 1) %]">
      [% ELSE %]
-        <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 2, 1) %]">
-        [% LxERP.format_amount($exchangerate, 2, 1) %]
+        <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 5, 1) %]">
+        [% LxERP.format_amount($exchangerate, 5, 1) %]
      [% END %]
   [% END %]
-        <input type="hidden" name="forex_[% i %]" value="[% $forex %]">;
+        <input type="hidden" name="forex_[% i %]" value="[% $forex %]">
      </td>
 [% END %]
 
      </td>
 
     </tr>
-  [% IF $changeable %]
-    <script type='text/javascript'>
-     Calendar.setup({ inputField : "datepaid_[% i %]", ifFormat :"[% myconfig_jsc_dateformat %]", align : "TR", button : "trigger_datepaid_[% i %]" });
-     $('input[name="paid_[% i %]"]').blur(function(){ check_right_number_format(this) });
-     $('#datepaid_[% i %]').blur(function(){ check_right_date_format(this) });
-    </script>
-  [% END %]
 
 [% END # foreach %]
 
     <tr>
       <td></td>
       <td></td>
-      <td align="center">[% 'Total' | $T8 %]</td>
-      <td align="center">[% LxERP.foramt_amount(totalpaid, 2) | html %]</td>
+      <td align="center">[%- 'Total' | $T8 %]</td>
+      <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %] [% currency %]</td>
+      <td></td>
+      [% IF show_exchangerate %]
+        <td align="center">[% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]</td>
+        <input type="hidden" name="defaultcurrency_totalpaid" value="[% defaultcurrency_totalpaid %]">
+      [% END %]
     </tr>
+[% UNLESS show_exchangerate %]
     <tr>
       <td></td>
       <td></td>
-      <td align="center">[% 'Missing amount' | $T8 %]</td>
+      <td align="center">[%- 'Missing amount' | $T8 %]</td>
       <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
     </tr>
+[% END %]
 
      <input type="hidden" name="paidaccounts" value="[% paidaccounts %]">
      <input type="hidden" name="selectAP_paid" value="[% selectAP_paid %]">
 
     </td>
   </tr>
+    <script type='text/javascript'>
+     $('#is_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });
+    </script>