Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e7c0d9ce

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

  • ID e7c0d9cec5bc78093fa2b10ebc489f1b3bca4960
  • Vorgänger 4e33311d
  • Nachfolger 8c0ca780

Anzahlungsrechnung: Bei Schlussrechnung das Transferkonto ausgleichen

Unterschiede anzeigen:

SL/IS.pm
1124 1124
        #     for advance payment are allowed, too.
1125 1125
        # $booking->id, $self->id in helper table
1126 1126
        if (!$already_booked) {
1127
          $form->{amount}->{$invoice_for_advance_payment->id}->{$advance_payment_clearing_chart->accno} = -1 * $invoice_for_advance_payment->netamount;
1128
          $form->{memo}  ->{$invoice_for_advance_payment->id}->{$advance_payment_clearing_chart->accno} = 'reverse booking by final invoice';
1129
          # AR
1130
          $form->{amount}->{$invoice_for_advance_payment->id}->{$form->{AR}} = $invoice_for_advance_payment->netamount;
1131
          $form->{memo}  ->{$invoice_for_advance_payment->id}->{$form->{AR}} = 'reverse booking by final invoice';
1127
          # move all netamount to correct transfer chart (19% or 7%)
1128
          my %inv_calc = $invoice_for_advance_payment->calculate_prices_and_taxes();
1129
          my @trans_ids = keys %{ $inv_calc{amounts} };
1130
          die "Invalid state for advance payment invoice,more than one trans_id" if (scalar @trans_ids > 1);
1131
          my $entry = delete $inv_calc{amounts}{$trans_ids[0]};
1132
          my $tax;
1133
          if ($entry->{tax_id}) {
1134
            $tax = SL::DB::Manager::Tax->find_by(id => $entry->{tax_id}); # || die "Can't find tax with id " . $entry->{tax_id};
1135
          }
1136
          # no tax, no prob
1137
          if ($tax and $tax->rate != 0) {
1138
            my $transfer_chart = $tax->taxkey == 2 ? SL::DB::Chart->new(id => $::instance_conf->get_advance_payment_taxable_7_id)->load
1139
                              :  $tax->taxkey == 3 ? SL::DB::Chart->new(id => $::instance_conf->get_advance_payment_taxable_19_id)->load
1140
                              :  undef;
1141
            die "No Transfer Chart for Advance Payment" unless ref $transfer_chart eq 'SL::DB::Chart';
1142
            $form->{amount}->{$invoice_for_advance_payment->id}->{$transfer_chart->accno} = -1 * $invoice_for_advance_payment->netamount;
1143
            $form->{memo}  ->{$invoice_for_advance_payment->id}->{$transfer_chart->accno} = 'reverse booking by final invoice';
1144
            # AR
1145
            $form->{amount}->{$invoice_for_advance_payment->id}->{$form->{AR}} = $invoice_for_advance_payment->netamount;
1146
            $form->{memo}  ->{$invoice_for_advance_payment->id}->{$form->{AR}} = 'reverse booking by final invoice';
1147
          }
1132 1148
        }
1133 1149

  
1134 1150
        # VAT for invoices for advance payment is booked on payment of these. So do not book this VAT for final invoice.

Auch abrufbar als: Unified diff