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