1 [%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
5 [%- INCLUDE 'common/flash.html' %]
7 [% IF SELF.problems.size %]
8 [% INCLUDE 'bank_transactions/_problems.html' %]
11 <p>[% HTML.escape(bank_account.name) %] [% HTML.escape(bank_account.iban) %], [% 'Bank code' | $T8 %] [% HTML.escape(bank_account.bank_code) %], [% 'Bank' | $T8 %] [% HTML.escape(bank_account.bank) %]</p>
13 [% IF FORM.filter.fromdate %] [% 'From' | $T8 %] [% FORM.filter.fromdate %] [% END %]
14 [% IF FORM.filter.todate %] [% 'to (date)' | $T8 %] [% FORM.filter.todate %][% END %]
17 <form method="post" id="list_form">
18 [% L.hidden_tag('filter.bank_account', FORM.filter.bank_account) %]
19 [% L.hidden_tag('filter.fromdate', FORM.filter.fromdate) %]
20 [% L.hidden_tag('filter.todate', FORM.filter.todate) %]
22 <div class="tabwidget">
24 <li><a href="#all" onclick="show_invoice_button();">[% 'All transactions' | $T8 %]</a></li>
25 <li><a href="#automatic" onclick="show_proposal_button();">[% 'Proposals' | $T8 %]</a></li>
28 <div id="all">[% PROCESS "bank_transactions/tabs/all.html" %]</div>
29 <div id="automatic">[% PROCESS "bank_transactions/tabs/automatic.html" %]</div>
32 [% L.hidden_tag('action', 'BankTransaction/dispatch') %]
33 [% L.submit_tag('action_save_invoices', LxERP.t8('Save invoices')) %]
34 [% L.submit_tag('action_save_proposals', LxERP.t8('Save proposals'), style='display: none') %]
38 <script type="text/javascript">
42 $('#check_all').checkall('INPUT[name^="proposal_ids"]');
46 $('.sort_link').each(function() {
47 var _href = $(this).attr("href");
48 $(this).attr("href", _href + "&filter.fromdate=" + "[% FORM.filter.fromdate %]" + "&filter.todate=" + "[% FORM.filter.todate %]");
52 function show_invoice_button () {
53 $("#action_save_proposals").hide();
54 $("#action_save_invoices").show();
57 function show_proposal_button () {
58 $("#action_save_invoices").hide();
59 $("#action_save_proposals").show();
62 function assign_invoice(bt_id) {
64 url: 'controller.pl?action=BankTransaction/assign_invoice',
65 data: '&bt_id=' + bt_id,
67 id: 'assign_invoice_window',
68 dialog: { title: kivi.t8('Assign invoice') }
73 function add_invoices(bt_id, prop_id, prop_invnumber) {
74 // prop_id is a proposed invoice_id
75 // remove the added invoice from all the other suggestions
76 var number_of_elements = document.getElementsByName(prop_id).length;
77 for( var i = 0; i < number_of_elements; i++ ) {
78 var node = document.getElementsByName(prop_id)[0];
79 node.parentNode.removeChild(node);
81 var invoices = document.getElementById('assigned_invoices_' + bt_id);
84 url: 'controller.pl?action=BankTransaction/ajax_payment_suggestion&bt_id=' + bt_id + '&prop_id=' + prop_id,
85 success: function(data) {
86 invoices.innerHTML += data.html;
91 function delete_invoice(bt_id, prop_id) {
92 $( "#" + bt_id + "\\." + prop_id ).remove();
95 function create_invoice(bt_id) {
97 url: 'controller.pl?action=BankTransaction/create_invoice',
98 data: '&bt_id=' + bt_id + "&filter.bank_account=[% FORM.filter.bank_account %]&filter.todate=[% FORM.filter.todate %]&filter.fromdate=[% FORM.filter.fromdate %]",
100 id: 'create_invoice_window',
101 dialog: { title: kivi.t8('Create invoice') }