Merge branch 'bankerweiterung_und_skonto'
[kivitendo-erp.git] / templates / webpages / reconciliation / tabs / overview.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5
6 [% SET debug = 0 %]
7
8   <div style="height:500px; overflow:auto;">
9     <table width=99% id="link_table">
10       <thead>
11         <tr class="listheading">
12           <th></th>
13
14           <th></th>
15           <th>[% 'Type' | $T8 %]</th>
16           [% IF debug %]<th>[% 'ID/Acc_ID' | $T8 %]</th>[% END %]
17           <th>[% 'Transdate' | $T8 %]</th>
18           <th>[% 'Amount BT' | $T8 %]</th>
19           <th>[% 'Amount BB' | $T8 %]</th>
20           <th>[% 'Remote Name/Customer/Description' | $T8 %]</th>
21           <th>[% 'Purpose/Reference' | $T8 %]</th>
22           <th>[% 'Remote account number' | $T8 %]</th>
23           <th>[% 'Remote bank code' | $T8 %]</th>
24           <th>[% 'Source' | $T8 %]</th>
25         </tr>
26       </thead>
27
28       [% PROCESS 'reconciliation/_linked_transactions.html' %]
29
30       <tfoot>
31         <tr class="listtotal">
32           <td class="top_border"></td>
33           <td class="top_border"></td>
34           <td class="top_border"></td>
35           <td class="top_border"></td>
36           <td class="top_border"></td>
37           <td class="bt_balance top_border" align="right">[% LxERP.format_amount(SELF.bt_balance, 2) %]</td>
38           <td class="bb_balance top_border" align="right">[% LxERP.format_amount(-1 * SELF.bb_balance, 2) %]</td>
39           <td class="top_border"></td>
40           <td class="top_border"></td>
41           <td class="top_border"></td>
42           <td class="top_border"></td>
43           <td class="top_border"></td>
44         </tr>
45       </tfoot>
46     </table>
47   </div>
48
49   <hr size="3" noshade>
50
51   <div id="assigned_elements"></div>
52
53 <script type="text/javascript">
54 <!--
55
56 function filter_table () {
57   var url="controller.pl?action=Reconciliation/filter_overview";
58   $.ajax({
59     url: url,
60     type: "POST",
61     data: $('#reconciliation_form').serialize(),
62     success: function(new_data) {
63       $("tbody[class^='listrow']").remove();
64       $("#assigned_elements").html('');
65       $("#link_table").append(new_data['html']);
66       $(".absolut_bt_balance").html(new_data['absolut_bt_balance']);
67       $(".absolut_bb_balance").html(new_data['absolut_bb_balance']);
68       $(".bt_balance").html(new_data['bt_balance']);
69       $(".bb_balance").html(new_data['bb_balance']);
70     }
71   });
72 }
73
74 function update_reconciliation_table () {
75   var url="controller.pl?action=Reconciliation/update_reconciliation_table";
76   $.ajax({
77     url: url,
78     type: "POST",
79     data: $('#reconciliation_form').serialize(),
80     success: function(new_data) {
81       $('#assigned_elements').html(new_data['html']);
82     }
83   });
84 }
85
86 function delete_element (id, type) {
87   if (type == 'BT') {
88     $("input[name^='bt_ids'][value=" + id + "]").attr('checked', false);
89   }
90   if (type == 'BB') {
91     $("input[name^='bb_ids'][value=" + id + "]").attr('checked', false);
92   }
93   update_reconciliation_table();
94 }
95
96 function submit_with_action(action) {
97   $('<input>').attr({
98     id : "action",
99     name : "action",
100     type : "hidden",
101     value : "Reconciliation/reconcile"
102   }).appendTo('#reconciliation_form');
103   $("#reconciliation_form").submit();
104 }
105
106 function delete_reconciliation(rec_group) {
107   var check = confirm('[% 'Really cancel link?' | $T8 %]');
108   if (check == true) {
109     var url="controller.pl?action=Reconciliation/delete_reconciliation&rec_group=" + rec_group + "&" + $('#reconciliation_form') . serialize();
110     $.ajax({
111       url: url,
112       success: function(new_data) {
113         $("tbody[class^='listrow']").remove();
114         $("#assigned_elements").html('');
115         $("#link_table").append(new_data['html']);
116         $(".absolut_bt_balance").html(new_data['absolut_bt_balance']);
117         $(".absolut_bb_balance").html(new_data['absolut_bb_balance']);
118         $(".bt_balance").html(new_data['bt_balance']);
119         $(".bb_balance").html(new_data['bb_balance']);
120       }
121     });
122   }
123 }
124
125 //-->
126 </script>
127