Revision c4d3f82d
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
SL/Controller/BankTransaction.pm | ||
---|---|---|
511 | 511 |
push @{ $self->problems }, $self->save_single_bank_transaction( |
512 | 512 |
bank_transaction_id => $bank_transaction_id, |
513 | 513 |
invoice_ids => $invoice_ids, |
514 |
sources => ($::form->{sources} // {})->{$_}, |
|
515 |
memos => ($::form->{memos} // {})->{$_}, |
|
514 | 516 |
); |
515 | 517 |
$count += scalar( @{$invoice_ids} ); |
516 | 518 |
} |
... | ... | |
537 | 539 |
|
538 | 540 |
sub action_save_proposals { |
539 | 541 |
my ($self) = @_; |
542 |
|
|
540 | 543 |
if ( $::form->{proposal_ids} ) { |
541 | 544 |
my $propcount = scalar(@{ $::form->{proposal_ids} }); |
542 | 545 |
if ( $propcount > 0 ) { |
... | ... | |
620 | 623 |
my $n_invoices = 0; |
621 | 624 |
|
622 | 625 |
foreach my $invoice (@{ $data{invoices} }) { |
626 |
my $source = ($data{sources} // [])->[$n_invoices]; |
|
627 |
my $memo = ($data{memos} // [])->[$n_invoices]; |
|
623 | 628 |
|
624 | 629 |
$n_invoices++ ; |
625 | 630 |
|
... | ... | |
665 | 670 |
trans_id => $invoice->id, |
666 | 671 |
amount => $open_amount, |
667 | 672 |
payment_type => $payment_type, |
673 |
source => $source, |
|
674 |
memo => $memo, |
|
668 | 675 |
transdate => $bank_transaction->transdate->to_kivitendo); |
669 | 676 |
} elsif ( $invoice->is_sales && $invoice->type eq 'credit_note' ) { |
670 | 677 |
# no check for overpayment/multiple payments |
... | ... | |
672 | 679 |
trans_id => $invoice->id, |
673 | 680 |
amount => $invoice->open_amount, |
674 | 681 |
payment_type => $payment_type, |
682 |
source => $source, |
|
683 |
memo => $memo, |
|
675 | 684 |
transdate => $bank_transaction->transdate->to_kivitendo); |
676 | 685 |
} else { # use the whole amount of the bank transaction for the invoice, overpay the invoice if necessary |
677 | 686 |
my $overpaid_amount = $amount_of_transaction - $invoice->open_amount; |
... | ... | |
679 | 688 |
trans_id => $invoice->id, |
680 | 689 |
amount => $amount_of_transaction, |
681 | 690 |
payment_type => $payment_type, |
691 |
source => $source, |
|
692 |
memo => $memo, |
|
682 | 693 |
transdate => $bank_transaction->transdate->to_kivitendo); |
683 | 694 |
$bank_transaction->invoice_amount($bank_transaction->amount); |
684 | 695 |
$amount_of_transaction = 0; |
SL/DB/Helper/Payment.pm | ||
---|---|---|
112 | 112 |
my $reference_account = $self->reference_account; |
113 | 113 |
croak "can't find reference account (link = AR/AP) for invoice" unless ref $reference_account; |
114 | 114 |
|
115 |
my $memo = $params{'memo'} || '';
|
|
116 |
my $source = $params{'source'} || '';
|
|
115 |
my $memo = $params{memo} // '';
|
|
116 |
my $source = $params{source} // '';
|
|
117 | 117 |
|
118 | 118 |
my $rounded_params_amount = _round( $params{amount} ); # / $exchangerate); |
119 | 119 |
my $fx_gain_loss_amount = 0; # for fx_gain and fx_loss |
js/kivi.BankTransaction.js | ||
---|---|---|
87 | 87 |
|
88 | 88 |
$.cookie('jquery_ui_tab_bt_tabs', ui_tab); |
89 | 89 |
}; |
90 |
|
|
91 |
ns.show_set_all_sources_memos_dialog = function(sources_selector, memos_selector) { |
|
92 |
var dlg_id = 'set_all_sources_memos_dialog'; |
|
93 |
var $dlg = $('#' + dlg_id); |
|
94 |
|
|
95 |
$dlg.data('sources-selector', sources_selector); |
|
96 |
$dlg.data('memos-selector', memos_selector); |
|
97 |
|
|
98 |
$('#set_all_sources').val(''); |
|
99 |
$('#set_all_memos').val(''); |
|
100 |
|
|
101 |
kivi.popup_dialog({ |
|
102 |
id: dlg_id, |
|
103 |
dialog: { |
|
104 |
title: kivi.t8('Set all source and memo fields') |
|
105 |
} |
|
106 |
}); |
|
107 |
}; |
|
108 |
|
|
109 |
ns.set_all_sources_memos = function(sources_selector, memos_selector) { |
|
110 |
var $dlg = $('#set_all_sources_memos_dialog'); |
|
111 |
|
|
112 |
['sources', 'memos'].forEach(function(type) { |
|
113 |
var value = $('#set_all_' + type).val(); |
|
114 |
if (value !== '') |
|
115 |
$($dlg.data(type + '-selector')).each(function(idx, input) { |
|
116 |
$(input).val(value); |
|
117 |
}); |
|
118 |
}); |
|
119 |
|
|
120 |
$dlg.dialog('close'); |
|
121 |
}; |
|
90 | 122 |
}); |
js/locale/de.js | ||
---|---|---|
89 | 89 |
"Save and keep open":"Speichern und geöffnet lassen", |
90 | 90 |
"Section/Function block actions":"Abschnitts-/Funktionsblockaktionen", |
91 | 91 |
"Select template to paste":"Einzufügende Vorlage auswählen", |
92 |
"Set all source and memo fields":"Alle Beleg-/Memo-Felder setzen", |
|
92 | 93 |
"Show all details":"Alle Details anzeigen", |
93 | 94 |
"Show details":"Details anzeigen", |
94 | 95 |
"Subject":"Betreff", |
locale/de/all | ||
---|---|---|
2598 | 2598 |
'Service, assembly or part' => 'Dienstleistung, Erzeugnis oder Ware', |
2599 | 2599 |
'Services' => 'Dienstleistungen', |
2600 | 2600 |
'Set (set to)' => 'Setze', |
2601 |
'Set all source and memo fields' => 'Alle Beleg-/Memo-Felder setzen', |
|
2601 | 2602 |
'Set count for one or more of the items to select them' => 'Zum Selektieren bitte Menge für einen oder mehrere Artikel setzen', |
2602 | 2603 |
'Set eMail text' => 'E-Mail Text eingeben', |
2604 |
'Set fields' => 'Felder setzen', |
|
2603 | 2605 |
'Set lastcost' => 'EK-Preis übernehmen', |
2604 | 2606 |
'Set sellprice' => 'VK-Preis übernehmen', |
2605 | 2607 |
'Set to paid missing' => 'Fehlbetrag setzen', |
templates/webpages/bank_transactions/list.html | ||
---|---|---|
27 | 27 |
<div id="automatic">[% PROCESS "bank_transactions/tabs/automatic.html" %]</div> |
28 | 28 |
</div> |
29 | 29 |
|
30 |
<div id="set_all_sources_memos_dialog" class="hidden"> |
|
31 |
<table> |
|
32 |
<tr> |
|
33 |
<th>[% LxERP.t8("Source") %]:</th> |
|
34 |
<td>[% L.input_tag("set_all_sources", "") %]</td> |
|
35 |
</tr> |
|
36 |
|
|
37 |
<tr> |
|
38 |
<th>[% LxERP.t8("Memo") %]:</th> |
|
39 |
<td>[% L.input_tag("set_all_memos", "") %]</td> |
|
40 |
</tr> |
|
41 |
</table> |
|
42 |
|
|
43 |
<p> |
|
44 |
[% L.button_tag("kivi.BankTransaction.set_all_sources_memos()", LxERP.t8("Set fields")) %] |
|
45 |
<a href="#" onclick="$('#set_all_sources_memos_dialog').dialog('close');">[%- LxERP.t8("Cancel") %]</a> |
|
46 |
</p> |
|
47 |
</div> |
|
30 | 48 |
|
31 | 49 |
<script type="text/javascript"> |
32 | 50 |
<!-- |
templates/webpages/bank_transactions/tabs/all.html | ||
---|---|---|
1 | 1 |
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%] |
2 | 2 |
|
3 | 3 |
[% SET debug=1 %] |
4 |
<form method="post" id="list_form"> |
|
4 |
<form method="post" id="list_all_form">
|
|
5 | 5 |
[% L.hidden_tag('filter.bank_account', FORM.filter.bank_account) %] |
6 | 6 |
[% L.hidden_tag('filter.fromdate', FORM.filter.fromdate) %] |
7 | 7 |
[% L.hidden_tag('filter.todate', FORM.filter.todate) %] |
templates/webpages/bank_transactions/tabs/automatic.html | ||
---|---|---|
1 | 1 |
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%] |
2 | 2 |
|
3 |
<form method="post" id="list_form"> |
|
3 |
<form method="post" id="list_automatic_form">
|
|
4 | 4 |
[% L.hidden_tag('filter.bank_account', FORM.filter.bank_account) %] |
5 | 5 |
[% L.hidden_tag('filter.fromdate', FORM.filter.fromdate) %] |
6 | 6 |
[% L.hidden_tag('filter.todate', FORM.filter.todate) %] |
... | ... | |
19 | 19 |
<th>[% 'Skonto' | $T8 %]</th> |
20 | 20 |
<th>[% 'Purpose/Reference' | $T8 %]</th> |
21 | 21 |
<th>[% 'Customer/Vendor/Remote name' | $T8 %]</th> |
22 |
<th>[% LxERP.t8("Source") %]</th> |
|
23 |
<th>[% LxERP.t8("Memo") %]</th> |
|
22 | 24 |
</tr> |
23 | 25 |
</thead> |
24 | 26 |
[% IF !PROPOSALS.size %] |
... | ... | |
54 | 56 |
END %] |
55 | 57 |
</td> |
56 | 58 |
<td>[% HTML.escape(proposal.remote_name) %]</td> |
59 |
<td></td> |
|
60 |
<td></td> |
|
57 | 61 |
</tr> |
58 | 62 |
|
59 | 63 |
[% FOREACH proposed_invoice = proposal.proposals %] |
... | ... | |
69 | 73 |
[% L.hidden_tag("invoice_skontos." _ proposal.id _ "[]", proposed_invoice.skonto_type) %]</td> |
70 | 74 |
<td[% IF proposed_invoice.invnumber == invnumber_found %] class="invoice_number_highlight"[% END %]>[% proposed_invoice.link %]</td> |
71 | 75 |
<td>[% HTML.escape(proposed_invoice.customer.name) %][% HTML.escape(proposed_invoice.vendor.name) %]</td> |
76 |
<td>[% L.input_tag("sources." _ proposal.id _ "[]", "", size=20) %]</td> |
|
77 |
<td>[% L.input_tag("memos." _ proposal.id _ "[]", "", size=20) %]</td> |
|
72 | 78 |
</tr> |
73 | 79 |
[% END %] |
74 |
<tr><td style="height:10px" colspan="8"></td></tr>
|
|
80 |
<tr><td style="height:10px" colspan="10"></td></tr>
|
|
75 | 81 |
</tbody> |
76 | 82 |
[% END %] |
77 | 83 |
[% END %] |
78 | 84 |
</table> |
79 |
[% L.submit_tag('action_save_proposals', LxERP.t8('Save proposals')) %] |
|
85 |
|
|
86 |
<p> |
|
87 |
[% L.submit_tag('action_save_proposals', LxERP.t8('Save proposals')) %] |
|
88 |
[% L.button_tag('kivi.BankTransaction.show_set_all_sources_memos_dialog("#list_automatic_form [name^=\\"sources.\\"]", "#list_automatic_form [name^=\\"memos.\\"]")', LxERP.t8('Set all source and memo fields')) %] |
|
89 |
</p> |
|
80 | 90 |
|
81 | 91 |
</form> |
Auch abrufbar als: Unified diff
Kontoauszug verbuchen: »Beleg«/»Memo« bei Vorschlägen angeben können