Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8dfafa71

Von Jan Büren vor fast 6 Jahren hinzugefügt

  • ID 8dfafa71b083f9953e06784f81a5f1609e58b429
  • Vorgänger a9bbf9c6
  • Nachfolger b4cc349b

Payment::pay_invoice with skonto -> Steuersatz ist eindeutig

tax_id in acc_trans definiert sicherer den Steuersatz als der
taxkey (Steuerschlüssel von DATEV), s.a. FK-Constraint:
"acc_trans_tax_id_fkey" FOREIGN KEY (tax_id) REFERENCES tax(id)

Unterschiede anzeigen:

SL/DB/Helper/Payment.pm
461 461
  # my $transactions = $self->transactions;
462 462
  foreach my $transaction (@{ $self->transactions }) {
463 463
    # find all transactions with an AR_amount or AP_amount link
464
    my $tax = SL::DB::Manager::Tax->get_first( where => [taxkey => $transaction->taxkey]);
464
    my $tax = SL::DB::Manager::Tax->get_first( where => [taxkey => $transaction->taxkey, id => $transaction->tax_id ]);
465 465
    croak "no tax for taxkey " . $transaction->{taxkey} unless ref $tax;
466 466

  
467 467
    $transaction->{chartlinks} = { map { $_ => 1 } split(m/:/, $transaction->chart_link) };
......
542 542
        # $reference_ARAP_amount += $transaction->{amount} * $mult;
543 543

  
544 544
        # quick hack that works around problem of non-unique tax keys in SKR04
545
        my $tax = SL::DB::Manager::Tax->get_first( where => [taxkey => $transaction->{taxkey}]);
545
        # ? use tax_id in acc_trans
546
        my $tax = SL::DB::Manager::Tax->get_first( where => [id => $transaction->{tax_id}]);
546 547
        croak "no tax for taxkey " . $transaction->{taxkey} unless ref $tax;
547 548

  
548 549
        if ( $is_sales ) {

Auch abrufbar als: Unified diff