513 |
513 |
push @{ $self->problems }, $self->save_single_bank_transaction(
|
514 |
514 |
bank_transaction_id => $bank_transaction_id,
|
515 |
515 |
invoice_ids => $invoice_ids,
|
516 |
|
sources => [ map { $::form->{"sources_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
|
517 |
|
memos => [ map { $::form->{"memos_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
|
|
516 |
sources => [ map { $::form->{"sources_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
|
|
517 |
memos => [ map { $::form->{"memos_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
|
|
518 |
book_fx_bank_fees => [ map { $::form->{"book_fx_bank_fees_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
|
|
519 |
currency_ids => [ map { $::form->{"currency_id_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
|
|
520 |
exchangerates => [ map { $::form->parse_amount(\%::myconfig, $::form->{"exchangerate_${bank_transaction_id}_${_}"}) } @{ $invoice_ids } ],
|
518 |
521 |
);
|
519 |
522 |
$count += scalar( @{$invoice_ids} );
|
520 |
523 |
}
|
... | ... | |
627 |
630 |
my $n_invoices = 0;
|
628 |
631 |
|
629 |
632 |
foreach my $invoice (@{ $data{invoices} }) {
|
630 |
|
my $source = ($data{sources} // [])->[$n_invoices];
|
631 |
|
my $memo = ($data{memos} // [])->[$n_invoices];
|
|
633 |
my $source = ($data{sources} // [])->[$n_invoices];
|
|
634 |
my $memo = ($data{memos} // [])->[$n_invoices];
|
|
635 |
my $fx_rate = ($data{exchangerates} // [])->[$n_invoices];
|
|
636 |
my $fx_book = ($data{book_fx_bank_fees} // [])->[$n_invoices];
|
|
637 |
my $currency_id = ($data{currency_ids} // [])->[$n_invoices];
|
632 |
638 |
|
633 |
639 |
$n_invoices++ ;
|
634 |
640 |
# safety check invoice open
|
... | ... | |
692 |
698 |
source => $source,
|
693 |
699 |
memo => $memo,
|
694 |
700 |
skonto_amount => $free_skonto_amount,
|
|
701 |
exchangerate => $fx_rate,
|
|
702 |
fx_book => $fx_book,
|
|
703 |
currency_id => $currency_id,
|
695 |
704 |
bt_id => $bt_id,
|
696 |
705 |
transdate => $bank_transaction->valutadate->to_kivitendo);
|
697 |
|
my $bank_amount = shift @acc_ids;
|
698 |
|
die "Invalid state, calculated invoice_amount differs from expected invoice amount" unless (abs($bank_amount->{return_bank_amount}) - abs($amount_for_booking) < 0.001);
|
|
706 |
my $booked_amount = shift @acc_ids;
|
|
707 |
use Data::Dumper;
|
|
708 |
$main::lxdebug->message(0, 'hier1:' .Dumper $booked_amount);
|
|
709 |
$main::lxdebug->message(0, 'hier2:' .Dumper @acc_ids);
|
|
710 |
$bank_transaction->invoice_amount($bank_transaction->invoice_amount + $booked_amount * $sign);
|
699 |
711 |
# ... and record the origin via BankTransactionAccTrans
|
700 |
712 |
if (scalar(@acc_ids) < 2) {
|
701 |
713 |
return {
|
Wechselkurs für Bankverbuchungen eingeben