Revision 90e0cc0b
Von Moritz Bunkus vor mehr als 4 Jahren hinzugefügt
SL/DB/Helper/Payment.pm | ||
---|---|---|
foreach my $transaction (@{ $self->transactions }) {
|
||
# find all transactions with an AR_amount or AP_amount link
|
||
my $tax = SL::DB::Manager::Tax->get_first( where => [taxkey => $transaction->taxkey, id => $transaction->tax_id ]);
|
||
|
||
# acc_trans entries for the taxes (chart_link == A[RP]_tax) often
|
||
# have combinations of taxkey & tax_id that don't exist in
|
||
# tax. Those must be skipped.
|
||
next if !$tax && ($transaction->chart_link !~ m{A[RP]_amount});
|
||
|
||
croak "no tax for taxkey " . $transaction->{taxkey} unless ref $tax;
|
||
|
||
$transaction->{chartlinks} = { map { $_ => 1 } split(m/:/, $transaction->chart_link) };
|
Auch abrufbar als: Unified diff
Skontovorschläge: ungültige Steuer-Zeilen aus acc_trans ignorieren
Buchungen in acc_trans, die das Steuer-Konto ansprechen (also eines,
bei dem chart_link AR_tax oder AP_tax enthält), haben oftmals eine
ungültige Kombination aus taxkey & tax_id (ungültig im Sinne von:
diese Kombination gibt's in der Tabelle tax nicht).
Für Skontoberechnung sind solche Zeilen aber irrelevant. Also sie
einfach überspringen und nicht sterben.