1 [%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
3 <script type="text/javascript" src="js/wz_tooltip.js"></script>
7 [%- INCLUDE 'common/flash.html' %]
9 <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>
11 [% IF FORM.filter.fromdate %] [% 'From' | $T8 %] [% FORM.filter.fromdate %] [% END %]
12 [% IF FORM.filter.todate %] [% 'to (date)' | $T8 %] [% FORM.filter.todate %][% END %]
16 [% L.hidden_tag('filter.bank_account', FORM.filter.bank_account) %]
17 [% L.hidden_tag('filter.fromdate', FORM.filter.fromdate) %]
18 [% L.hidden_tag('filter.todate', FORM.filter.todate) %]
20 <div class="tabwidget">
22 <li><a href="#all" onclick="show_invoice_button();">[% 'All transactions' | $T8 %]</a></li>
23 <li><a href="#automatic" onclick="show_proposal_button();">[% 'Proposals' | $T8 %]</a></li>
26 <div id="all">[% PROCESS "bank_transactions/tabs/all.html" %]</div>
27 <div id="automatic">[% PROCESS "bank_transactions/tabs/automatic.html" %]</div>
30 [% L.hidden_tag('action', 'BankTransaction/dispatch') %]
31 [% L.submit_tag('action_save_invoices', LxERP.t8('Save invoices')) %]
32 [% L.submit_tag('action_save_proposals', LxERP.t8('Save proposals'), style='display: none') %]
36 <script type="text/javascript">
40 $('#check_all').checkall('INPUT[name^="proposal_ids"]');
44 $('.sort_link').each(function() {
45 var _href = $(this).attr("href");
46 $(this).attr("href", _href + "&filter.fromdate=" + "[% FORM.filter.fromdate %]" + "&filter.todate=" + "[% FORM.filter.todate %]");
50 function show_invoice_button () {
51 $("#action_save_proposals").hide();
52 $("#action_save_invoices").show();
55 function show_proposal_button () {
56 $("#action_save_invoices").hide();
57 $("#action_save_proposals").show();
60 function assign_invoice(bt_id) {
62 url: 'controller.pl?action=BankTransaction/assign_invoice',
63 data: '&bt_id=' + bt_id,
65 id: 'assign_invoice_window',
66 dialog: { title: kivi.t8('Assign invoice') }
71 function add_invoices(bt_id, prop_id, prop_invnumber) {
72 // prop_id is a proposed invoice_id
73 // remove the added invoice from all the other suggestions
74 var number_of_elements = document.getElementsByName(prop_id).length;
75 for( var i = 0; i < number_of_elements; i++ ) {
76 var node = document.getElementsByName(prop_id)[0];
77 node.parentNode.removeChild(node);
80 var invoices = document.getElementById('assigned_invoices_' + bt_id);
83 url: 'controller.pl?action=BankTransaction/ajax_payment_suggestion&bt_id=' + bt_id + '&prop_id=' + prop_id,
84 success: function(data) {
85 invoices.innerHTML += data.html;
90 function delete_invoice(bt_id, prop_id) {
91 $( "#" + bt_id + "\\." + prop_id ).remove();
94 function create_invoice(bt_id) {
96 url: 'controller.pl?action=BankTransaction/create_invoice',
97 data: '&bt_id=' + bt_id + "&filter.bank_account=[% FORM.filter.bank_account %]&filter.todate=[% FORM.filter.todate %]&filter.fromdate=[% FORM.filter.fromdate %]",
99 id: 'create_invoice_window',
100 dialog: { title: kivi.t8('Create invoice') }