Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ae9cf413

Von Jan Büren vor etwa 2 Jahren hinzugefügt

  • ID ae9cf413f1b31fb47e21670d01623d6ddaedda11
  • Vorgänger 28b51413
  • Nachfolger debe22e0

Wechselkurs für Bankverbuchungen eingeben

Unterschiede anzeigen:

SL/Controller/BankTransaction.pm
push @{ $self->problems }, $self->save_single_bank_transaction(
bank_transaction_id => $bank_transaction_id,
invoice_ids => $invoice_ids,
sources => [ map { $::form->{"sources_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
memos => [ map { $::form->{"memos_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
sources => [ map { $::form->{"sources_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
memos => [ map { $::form->{"memos_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
book_fx_bank_fees => [ map { $::form->{"book_fx_bank_fees_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
currency_ids => [ map { $::form->{"currency_id_${bank_transaction_id}_${_}"} } @{ $invoice_ids } ],
exchangerates => [ map { $::form->parse_amount(\%::myconfig, $::form->{"exchangerate_${bank_transaction_id}_${_}"}) } @{ $invoice_ids } ],
);
$count += scalar( @{$invoice_ids} );
}
......
my $n_invoices = 0;
foreach my $invoice (@{ $data{invoices} }) {
my $source = ($data{sources} // [])->[$n_invoices];
my $memo = ($data{memos} // [])->[$n_invoices];
my $source = ($data{sources} // [])->[$n_invoices];
my $memo = ($data{memos} // [])->[$n_invoices];
my $fx_rate = ($data{exchangerates} // [])->[$n_invoices];
my $fx_book = ($data{book_fx_bank_fees} // [])->[$n_invoices];
my $currency_id = ($data{currency_ids} // [])->[$n_invoices];
$n_invoices++ ;
# safety check invoice open
......
source => $source,
memo => $memo,
skonto_amount => $free_skonto_amount,
exchangerate => $fx_rate,
fx_book => $fx_book,
currency_id => $currency_id,
bt_id => $bt_id,
transdate => $bank_transaction->valutadate->to_kivitendo);
my $bank_amount = shift @acc_ids;
die "Invalid state, calculated invoice_amount differs from expected invoice amount" unless (abs($bank_amount->{return_bank_amount}) - abs($amount_for_booking) < 0.001);
my $booked_amount = shift @acc_ids;
use Data::Dumper;
$main::lxdebug->message(0, 'hier1:' .Dumper $booked_amount);
$main::lxdebug->message(0, 'hier2:' .Dumper @acc_ids);
$bank_transaction->invoice_amount($bank_transaction->invoice_amount + $booked_amount * $sign);
# ... and record the origin via BankTransactionAccTrans
if (scalar(@acc_ids) < 2) {
return {
templates/webpages/bank_transactions/_payment_suggestion.html
[% LxERP.t8("Open amount") %]: [% LxERP.format_amount(invoice.open_amount, 2) %]</br>
[% P.select_tag("invoice_skontos." _ bt_id _ "[]", SELECT_OPTIONS, value_key="payment_type", title_key="display", onChange="kivi.BankTransaction.update_skonto(this, " _ bt_id _ ", " _ invoice.id _ ", '$formatted_skonto_amount')" ) %]</br>
[% LxERP.t8("Skonto amount") %]: [% P.input_tag("free_skonto_amount." _ bt_id _ "." _ invoice.id _ "", "$formatted_skonto_amount_selected", default=0, style=style, disabled=1, size=4, class='numeric', onblur="kivi.BankTransaction.update_invoice_amount(" _ bt_id _ ", 0, this)") %]
[% IF invoice.forex %]
</br>
</br>
[% LxERP.t8("Curr") %]: <b>[% HTML.escape(invoice.currency.name) %]</b></br>
[% daily_exchangerate = invoice.get_exchangerate_for_bank_transaction(bt_id) %]
[% formatted_daily_exchangerate = daily_exchangerate ? LxERP.format_amount(daily_exchangerate, 5) : LxERP.format_amount(1, 5) %]
[% UNLESS daily_exchangerate %][% LxERP.t8("new") %] [% END %][% LxERP.t8("default exchange rate") %]: [% P.input_tag("exchangerate_" _ bt_id _ "_" _ invoice.id , "$formatted_daily_exchangerate", style=style, disabled=0, size=4, class='numeric') %]
[% P.hidden_tag("currency_id_" _ bt_id _ "_" _ invoice.id, invoice.currency.id) %]
</br>
[% UNLESS invoice.is_sales %]
[% P.checkbox_tag("book_fx_bank_fees_" _ bt_id _ "_" _ invoice.id, value=1, checked="1") %] [% LxERP.t8("Bank Fee Booking") %]
</br>
[% END %]
[% END %]
[% P.link_tag("#", "x", onclick="kivi.BankTransaction.delete_invoice(" _ bt_id _ "," _ invoice.id _ ")") %]
</span>

Auch abrufbar als: Unified diff