]> wagnertech.de Git - mfinanz.git/blobdiff - templates/webpages/ir/_payments.html
date error in mapping
[mfinanz.git] / templates / webpages / ir / _payments.html
index d47ecd4f0c9ab65a48c225ad2ae9ce5205a2eb64..df7a722c88f810c9bfc1491f29a4d90bbe5b24ee 100644 (file)
      <td align="center">
   [% SET forex        = 'forex_'        _ i %]
   [% SET exchangerate = 'exchangerate_' _ i %]
+  [% 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, 2) %]">
-        [% LxERP.format_amount($forex, 2) %]
+        <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 %]">
     <tr>
       <td></td>
       <td></td>
-      <td align="center">[% 'Total' | $T8 %]</td>
-      <td align="center">[% LxERP.format_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) %]') });
+     $('#is_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });
     </script>