]> wagnertech.de Git - mfinanz.git/blob - templates/design40_webpages/ir/_payments.html
date error in mapping
[mfinanz.git] / templates / design40_webpages / ir / _payments.html
1 [% USE T8 %]
2 [% USE LxERP %]
3 [% USE L %]
4 [% USE HTML %]
5
6
7 <table class="tbl-list wi-moderate">
8   <caption>
9       [% 'Payments' | $T8 %]
10   </caption>
11
12   <thead>
13     <tr>
14       <th>[% 'Date' | $T8 %]</th>
15       <th>[% 'Source' | $T8 %]</th>
16       <th>[% 'Memo' | $T8 %]</th>
17       <th>[% 'Amount' | $T8 %]</th>
18       <th></th>
19       [% IF show_exchangerate %]
20       <th>[% 'Exch' | $T8 %]</th>
21       [% END %]
22       <th>[% 'Account' | $T8 %]</th>
23     </tr>
24   </thead>
25
26
27
28   <tbody>
29   [% FOREACH i = paid_indices %]
30     [% SET changeable    = 'changeable_'    _ i %]
31     [% SET acc_trans_id  = 'acc_trans_id_'  _ i %]
32     [% SET p_gldate      = 'gldate_'        _ i %]
33     [% SET datepaid      = 'datepaid_'      _ i %]
34     [% SET source        = 'source_'        _ i %]
35     [% SET memo          = 'memo_'          _ i %]
36     [% SET paid          = 'paid_'          _ i %]
37     [% SET AP_paid       = 'AP_paid_'       _ i %]
38     [% SET selectAP_paid_ref = 'selectAP_paid_' _ i %]
39   <tr>
40
41     <td>
42       <input type=hidden name="acc_trans_id_[% i %]" value=[% $acc_trans_id %]>
43       <input type=hidden name="gldate_[% i %]" value=[% $p_gldate %]>
44       [% IF $changeable %]
45         [% IF $datepaid %]
46           [% L.date_tag('datepaid_'_ i, $datepaid) %]
47         [% ELSE %]
48           [% L.date_tag('datepaid_'_ i, today) %]
49         [% END %]
50       [% ELSE %]
51         <input type="hidden" name="datepaid_[% i %]" value="[% $datepaid %]">[% $datepaid %]
52       [% END %]
53     </td>
54     <td>
55       [% IF $changeable %]
56         <input type="text" name="source_[% i %]" size="11" value="[% $source %]">
57       [% ELSE %]
58        <input type="hidden" name="source_[% i %]" value="[% $source %]">[% $source %]
59       [% END %]
60     </td>
61     <td>
62       [% IF $changeable %]
63         <input type="text" name="memo_[% i %]" size="11" value="[% $memo %]">
64       [% ELSE %]
65         <input type="hidden" name="memo_[% i %]" value="[% $memo %]">[% $memo %]
66       [% END %]
67     </td>
68     <td>
69       [% IF $changeable %]
70         <input type="text" name="paid_[% i %]" size="11" value="[% LxERP.format_amount($paid, 2, 1) %]">
71       [% ELSE %]
72         <input type="hidden" name="paid_[% i %]" value="[% LxERP.format_amount($paid, 2, 1) %]">
73         [% LxERP.format_amount($paid, 2, 1) %]
74       [% END %]
75     </td>
76     <td>
77       [% IF $changeable && loop.last && paid_missing > 0 %]
78         <input type='button' id='is_set_to_paid_missing' value='[% 'Set to paid missing' | $T8 %]'>
79       [% END %]
80     </td>
81
82     [% IF show_exchangerate %]
83       <td class="numeric">
84         [% SET forex        = 'forex_'        _ i %]
85         [% SET exchangerate = 'exchangerate_' _ i %]
86         [% SET defaultcurrency_paid  = 'defaultcurrency_paid_' _ i %]
87         [% SET record_forex = 'record_forex_' _ i %]
88         [% IF $forex %]
89           <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 5) %]">
90           <input type="hidden" name="record_forex_[% i %]" value="[% $record_forex %]">
91           <input type="hidden" name="forex_[% i %]"        value="[% $forex %]">
92           <input type="hidden" name="defaultcurrency_paid_[% i %]"      value="[% $defaultcurrency_paid %]">
93           [% LxERP.format_amount($forex, 5) %] = [% LxERP.format_amount($defaultcurrency_paid, 5) %] [% defaultcurrency %] </br>
94           [% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
95         [% ELSE %]
96           [% IF $changeable %]
97             <input type="text" name="exchangerate_[% i %]" size="10" value="[% LxERP.format_amount($exchangerate, 5, 1) %]">
98           [% ELSE %]
99             <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 5, 1) %]">
100             [% LxERP.format_amount($exchangerate, 5, 1) %]
101           [% END %]
102         [% END %]
103         <input type="hidden" name="forex_[% i %]" value="[% $forex %]">
104       </td>
105     [% END %]
106
107     <td>
108       [% IF $changeable %]
109         <select name="AP_paid_[% i %]">[% $selectAP_paid_ref %]</select>
110       [% ELSE %]
111         <input type="hidden" name="AP_paid_[% i %]" value="[% $AP_paid %]">[% $AP_paid %]
112       [% END %]
113     </td>
114
115   </tr>
116   [% END # foreach %]
117   </tbody>
118
119   <tfoot>
120   <tr>
121     <td></td>
122     <td></td>
123     <td>[% 'Total' | $T8 %]</td>
124     <td>[% LxERP.format_amount(totalpaid, 2) | html %] [% currency %]</td>
125     <td></td>
126     [% IF show_exchangerate %]
127       <td align="numeric">[% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]</td>
128       <input type="hidden" name="defaultcurrency_totalpaid" value="[% defaultcurrency_totalpaid %]">
129     [% END %]
130     <td colspan="2"></td>
131   </tr>
132 [% UNLESS show_exchangerate %]
133   <tr>
134     <td></td>
135     <td></td>
136     <td>[% 'Missing amount' | $T8 %]</td>
137     <td>[% LxERP.format_amount(paid_missing, 2) | html %]</td>
138     <td colspan="2"></td>
139   </tr>
140 [% END %]
141   </tfoot>
142 </table>
143
144 <input type="hidden" name="paidaccounts" value="[% paidaccounts %]">
145 <input type="hidden" name="selectAP_paid" value="[% selectAP_paid %]">
146 <input type="hidden" name="oldinvtotal" value="[% oldinvtotal %]">
147 <input type="hidden" name="oldtotalpaid" value="[% totalpaid %]">
148
149
150 <script type='text/javascript'>
151   $('#is_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });
152 </script>