Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 33d579af

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 33d579af2747e8427fab0e31625871a83cff75e9
  • Vorgänger 04a484b3
  • Nachfolger 96def4ca

Kontoauszug verbuchen: Spalte »Zugewiesen« bei Zuweisungsänderung neu berechnen

Unterschiede anzeigen:

SL/Controller/BankTransaction.pm
337 337
                                     value_key => 'payment_type',
338 338
                                     title_key => 'display' )
339 339
    if @select_options;
340
  $html .= '<a href=# onclick="kivi.BankTransaction.delete_invoice(' . $::form->{bt_id} . ',' . $::form->{prop_id} . ');">x</a>';
341
  $html = SL::Presenter->html_tag('div', $html, id => $::form->{bt_id} . '.' . $::form->{prop_id});
340
  $html .= SL::Presenter->html_tag('a', 'x', href => '#', onclick => "kivi.BankTransaction.delete_invoice(" . $::form->{bt_id} . ',' . $::form->{prop_id} . ")");
341
  $html = SL::Presenter->html_tag('div', $html, id => $::form->{bt_id} . '.' . $::form->{prop_id}, 'data-invoice-amount' => $invoice->open_amount * 1);
342 342

  
343 343
  $self->render(\ SL::JSON::to_json( { 'html' => $html } ), { layout => 0, type => 'json', process => 0 });
344 344
};
js/kivi.BankTransaction.js
19 19
      url: 'controller.pl?action=BankTransaction/ajax_payment_suggestion&bt_id=' + bank_transaction_id  + '&prop_id=' + proposal_id,
20 20
      success: function(data) {
21 21
        $('#assigned_invoices_' + bank_transaction_id).append(data.html);
22
        ns.update_invoice_amount(bank_transaction_id);
22 23
      }
23 24
    });
24 25
  };
......
26 27
  ns.delete_invoice = function(bank_transaction_id, proposal_id) {
27 28
    $( "#" + bank_transaction_id + "\\." + proposal_id ).remove();
28 29
    $('[data-proposal-id=' + proposal_id + ']').show();
30
    ns.update_invoice_amount(bank_transaction_id);
29 31
  };
30 32

  
31 33
  ns.create_invoice = function(bank_transaction_id) {
......
59 61
      success: function(new_html) {
60 62
        $('#assigned_invoices_' + bank_transaction_id).append(new_html);
61 63
        $('#assign_invoice_window').dialog('close');
64
        ns.update_invoice_amount(bank_transaction_id);
62 65
      }
63 66
    });
64 67
  }
65 68

  
69
  ns.update_invoice_amount = function(bank_transaction_id) {
70
    var $container = $('#invoice_amount_' + bank_transaction_id);
71
    var amount     = $container.data('invoice-amount') * 1;
72

  
73
    $('[id^="' + bank_transaction_id + '."]').each(function(idx, elt) {
74
      amount += $(elt).data('invoice-amount');
75
    });
76

  
77
    $container.html(kivi.format_amount(amount, 2));
78
  };
79

  
66 80
  ns.init_list = function(ui_tab) {
67 81
    $('#check_all').checkall('INPUT[name^="proposal_ids"]');
82

  
68 83
    $('.sort_link').each(function() {
69 84
      var _href = $(this).attr("href");
70 85
      $(this).attr("href", _href + "&filter.fromdate=" + $('#filter_fromdate').val() + "&filter.todate=" + $('#filter_todate').val());
templates/webpages/bank_transactions/invoices.html
1 1
[% USE L %]
2 2
[% USE T8 %]
3
[% USE LxERP %]
3
[% USE LxERP %][%- USE HTML -%]
4 4
[% FOREACH invoice = INVOICES %]
5
  <div id="[% bt_id %].[% invoice.id %]">
5
  <div id="[% bt_id %].[% invoice.id %]" data-invoice-amount="[% HTML.escape(invoice.open_amount * 1) %]">
6 6
    [% L.hidden_tag('invoice_ids.' _ bt_id _'[]', invoice.id) %]
7 7
    [% 'Invno.' | $T8 %]: [% invoice.invnumber %]
8 8
    [% 'Open amount' | $T8 %]: [% LxERP.format_amount(invoice.open_amount, 2) %]
templates/webpages/bank_transactions/tabs/all.html
99 99
     </td>
100 100
     <td align=right>[% bt.transdate_as_date %]</td>
101 101
     <td align=right>[% LxERP.format_amount(bt.amount, 2) %]</td>
102
     <td align=right>[% LxERP.format_amount(bt.invoice_amount, 2) %]</td>
102
     <td align=right id="invoice_amount_[% HTML.escape(bt.id) %]" data-invoice-amount="[% HTML.escape(bt.invoice_amount) %]">[% HTML.escape(LxERP.format_amount(bt.invoice_amount, 2)) %]</td>
103 103
     <td>[% HTML.escape(bt.remote_name) %]</td>
104 104
     <td>[% HTML.escape(bt.purpose) %]</td>
105 105
     <td>[% HTML.escape(bt.transaction_text) %]</td>

Auch abrufbar als: Unified diff