74ce4f2fcaee6c7bca3096556e9cdd984fe2f6c5
[kivitendo-erp.git] / templates / webpages / acctranscorrections / assistant_for_wrong_taxkeys.html
1 [%- USE T8 %]
2 [% USE HTML %][% USE LxERP %]
3
4  <p><div class="listtop">[% title %]</div></p>
5
6  <p>
7   [% 'The following transaction contains wrong taxkeys:' | $T8 %]
8   <a href="[% problem.link %]">
9    [%- IF problem.data.module == 'ar' %]
10    [% 'AR Transaction' | $T8 %]
11    [%- ELSIF problem.data.module == 'ap' %]
12    [% 'AP Transaction' | $T8 %]
13    [%- ELSE %]
14    [% 'General Ledger Transaction' | $T8 %]
15    [%- END %]
16    [% HTML.escape(problem.data.reference) %]
17   </a>
18  </p>
19
20  <p>
21   [% 'This could have happened for two reasons:' | $T8 %]
22
23   [% 'The first reason is that kivitendo contained a bug which resulted in the wrong taxkeys being recorded for transactions in which two entries are posted for the same chart with different taxkeys.' | $T8 %]
24
25   [% 'The second reason is that kivitendo allowed the user to enter the tax amount manually regardless of the taxkey used.' | $T8 %]
26
27   [% 'Such entries cannot be exported into the DATEV format and have to be fixed as well.' | $T8 %]
28  </p>
29
30  <p>
31   [% 'The transaction is shown below in its current state.' | $T8 %]
32
33   [% 'You can correct this transaction by chosing the correct taxkeys from the drop down boxes and hitting the button "Fix transaction" afterwards.' | $T8 %]
34
35   [%- 'It is possible that even after such a correction there is something wrong with this transaction (e.g. taxes that don\'t match the selected taxkey). Therefore you should re-run the general ledger analysis.' | $T8 %]
36  </p>
37
38  <p>
39   [% 'You can also delete this transaction and re-enter it manually.' | $T8 %]
40
41   [% 'In order to do that hit the button "Delete transaction".' | $T8 %]
42  </p>
43
44  <p>[% 'At the moment the transaction looks like this:' | $T8 %]</p>
45
46  <form method="post" action="acctranscorrections.pl" name="Form">
47   <p>
48    <table>
49     <tr>
50      <th class="listheading">[% 'Account' | $T8 %]</th>
51      <th class="listheading">[% 'Debit' | $T8 %]</th>
52      <th class="listheading">[% 'Credit' | $T8 %]</th>
53      <th class="listheading">[% 'Recorded Tax' | $T8 %]</th>
54      <th class="listheading">[% 'Recorded taxkey' | $T8 %]</th>
55      <th class="listheading">[% 'Expected Tax' | $T8 %]</th>
56      <th class="listheading"></th>
57      <th class="listheading">[% 'Correct taxkey' | $T8 %]</th>
58     </tr>
59
60     [%- SET curr_row = 0 %]
61     [%- IF (problem.data.module == 'ar') || ((problem.data.module == 'gl') && (problem.acc_trans.credit.entries.first.acc_trans_id < problem.acc_trans.debit.entries.first.acc_trans_id)) %]
62      [%- SET order = [ 'credit', 'debit' ] %]
63      [%- SET other_side = 'debit' %]
64     [%- ELSE %]
65      [%- SET order = [ 'debit', 'credit' ] %]
66      [%- SET other_side = 'credit' %]
67     [%- END %]
68
69
70     [%- IF problem.acc_trans.credit.entries.size > problem.acc_trans.debit.entries.size %]
71     [%- ELSE %]
72     [%- END %]
73
74
75     [%- FOREACH idx = order %]
76      [%- FOREACH row = problem.acc_trans.$idx.entries %]
77       [%- SET curr_row = curr_row + 1 %]
78       <tr class="listrow[% curr_row % 2 %]">
79        <td>[% HTML.escape(row.accno) %]--[% HTML.escape(row.chartdescription) %]</td>
80        <td align="right">
81         [%- IF idx == 'debit' %]
82          [% LxERP.format_amount(row.display_amount, 2) %]
83         [%- END %]
84        </td>
85        <td align="right">
86         [%- IF idx == 'credit' %]
87          [% LxERP.format_amount(row.display_amount, 2) %]
88         [%- END %]
89        </td>
90        <td align="right">[% IF row.actual_tax %][% LxERP.format_amount(row.display_actual_tax, 2) %][% END %]</td>
91        <td>[% IF (problem.data.module == 'gl') || (idx != other_side) %][% HTML.escape(row.taxdescription) %][% END %]</td>
92        <td align="right">[% IF row.expected_tax %][% LxERP.format_amount(row.display_expected_tax, 2) %][% END %]</td>
93        <td align="center" valign="center"><img src="image/[% IF row.taxkey_error %]error[% ELSE %]ok[% END %].png"></td>
94
95        <td>
96         [%- IF row.taxkey_error %]
97          <input type="hidden" name="fixes[+].acc_trans_id" value="[% HTML.escape(row.acc_trans_id) %]">
98          <input type="hidden" name="fixes[].tax_entry_acc_trans_id" value="[% HTML.escape(row.tax_entry_acc_trans_id) %]">
99          <select name="fixes[].taxkey" style="width: 250px" onchange="enable_fix_button_maybe()">
100           <option value="">[% '---please select---' | $T8 %]</option>
101           [%- FOREACH taxkey = row.correct_taxkeys %]
102            <option value="[% HTML.escape(taxkey.taxkey) %]">[% HTML.escape(taxkey.description) %]</option>
103           [%- END %]
104         [%- ELSE %]
105         &nbsp;
106         [%- END %]
107       </tr>
108      [%- END %]
109     [%- END %]
110
111    </table>
112   </p>
113   <hr>
114
115   <p>
116    <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
117
118    <input type="hidden" name="action" value="dispatcher">
119    <input type="hidden" name="trans_id" value="[% HTML.escape(problem.data.trans_id) %]">
120    <input type="hidden" name="module" value="[% HTML.escape(problem.data.module) %]">
121    <input type="hidden" name="reference" value="[% HTML.escape(problem.data.reference) %]">
122    <input type="submit" class="submit" id="fix_transaction_button" name="action_fix_wrong_taxkeys" value="[% 'Fix transaction' | $T8 %]" disabled>
123    <input type="submit" class="submit" name="action_delete_transaction" value="[% 'Delete transaction' | $T8 %]">
124    <input type="button" class="submit" onclick="history.back()" value="[% 'Back' | $T8 %]">
125   </p>
126  </form>
127
128  <script type="text/javascript" src="js/jquery.js"></script>
129  <script type="text/javascript">
130   <!--
131     function enable_fix_button_maybe() {
132       var all_set = true;
133       $("[name='fixes[].taxkey']").each(function () {
134         var val = $(this).attr('value');
135         if (val == '')
136           all_set = false;
137       });
138
139       $("#fix_transaction_button").attr('disabled', !all_set);
140     }
141     -->
142  </script>
143