Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e6da1538

Von Bernd Bleßmann vor fast 3 Jahren hinzugefügt

  • ID e6da15380c9b77f893b3dec45f81e8c53aef316a
  • Vorgänger 01ab11ba
  • Nachfolger 50572139

Anzahlungs-Rg.: Steuer der Anzahlungs-Rgs. nicht bei Schluss-Rg. buchen

Unterschiede anzeigen:

SL/IS.pm
1082 1082
    }
1083 1083
  }
1084 1084

  
1085
  if (!$already_booked && $form->{type} eq 'final_invoice') {
1085
  if ($form->{type} eq 'final_invoice') {
1086 1086
    my $invoices_for_advance_payment = $self->_get_invoices_for_advance_payment($form->{convert_from_ar_ids} || $form->{id});
1087 1087
    if (scalar @$invoices_for_advance_payment > 0) {
1088 1088
      # reverse booking for invoices for advance payment
......
1101 1101
        #     if deletion of final invoice is allowed, reverting bookings in invoices
1102 1102
        #     for advance payment are allowed, too.
1103 1103
        # $booking->id, $self->id in helper table
1104
        $form->{amount}->{$invoice_for_advance_payment->id}->{$advance_payment_clearing_chart->accno} = -1 * $invoice_for_advance_payment->netamount;
1105
        $form->{memo}  ->{$invoice_for_advance_payment->id}->{$advance_payment_clearing_chart->accno} = 'reverse booking by final invoice';
1106
        # AR
1107
        $form->{amount}->{$invoice_for_advance_payment->id}->{$form->{AR}} = $invoice_for_advance_payment->netamount;
1108
        $form->{memo}  ->{$invoice_for_advance_payment->id}->{$form->{AR}} = 'reverse booking by final invoice';
1104
        if (!$already_booked) {
1105
          $form->{amount}->{$invoice_for_advance_payment->id}->{$advance_payment_clearing_chart->accno} = -1 * $invoice_for_advance_payment->netamount;
1106
          $form->{memo}  ->{$invoice_for_advance_payment->id}->{$advance_payment_clearing_chart->accno} = 'reverse booking by final invoice';
1107
          # AR
1108
          $form->{amount}->{$invoice_for_advance_payment->id}->{$form->{AR}} = $invoice_for_advance_payment->netamount;
1109
          $form->{memo}  ->{$invoice_for_advance_payment->id}->{$form->{AR}} = 'reverse booking by final invoice';
1110
        }
1111

  
1112
        # VAT for invoices for advance payment is booked on payment of these. So do not book this VAT for final invoice.
1113
        # Collect VAT of invoices for advance payment.
1114
        # Set sellprices to fxsellprices for items, because
1115
        # the PriceTaxCalculator sets fxsellprice from sellprice before calculating.
1116
        $_->sellprice($_->fxsellprice) for @{$invoice_for_advance_payment->items};
1117
        my %pat = $invoice_for_advance_payment->calculate_prices_and_taxes;
1118

  
1119
        foreach my $tax_chart_id (keys %{ $pat{taxes_by_chart_id} }) {
1120
          my $tax_accno = SL::DB::Chart->new(id => $tax_chart_id)->load->accno;
1121
          $form->{amount}{ $form->{id} }{$tax_accno} -= $pat{taxes_by_chart_id}->{$tax_chart_id};
1122
        }
1109 1123
      }
1110 1124
    }
1111 1125
  }

Auch abrufbar als: Unified diff