Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ba9673c7

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

  • ID ba9673c7121216882f1b9ae12fccdc2baf78079e
  • Vorgänger 238d4a46
  • Nachfolger 929c74e8

Anzahlungs-Rg.: Nummern, Summen und Steuern für Schlussrechnungsdruck

Unterschiede anzeigen:

SL/IS.pm
35 35

  
36 36
package IS;
37 37

  
38
use List::Util qw(max);
38
use List::Util qw(max sum0);
39 39

  
40 40
use Carp;
41 41
use SL::AM;
......
176 176

  
177 177
  my @payment_arrays = qw(payment paymentaccount paymentdate paymentsource paymentmemo);
178 178

  
179
  map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays, @tax_arrays, @payment_arrays, @prepared_arrays);
179
  my @invoices_for_advance_payment_arrays = qw(iap_invnumber iap_transdate ifip_amount iap_taxamount);
180

  
181
  map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays, @tax_arrays, @payment_arrays, @prepared_arrays, @invoices_for_advance_payment_arrays);
180 182

  
181 183
  my $totalweight = 0;
182 184
  foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) {
......
575 577
  $form->{username} = $myconfig->{name};
576 578
  $form->{$_} = $form->format_amount($myconfig, $form->{$_}, 2) for @separate_totals;
577 579

  
580
  foreach my $invoice_for_advance_payment (@{$self->_get_invoices_for_advance_payment($form->{convert_from_ar_ids} || $form->{id})}) {
581
    my %pat       = $invoice_for_advance_payment->calculate_prices_and_taxes;
582
    my $taxamount = sum0 values %{ $pat{taxes_by_tax_id} };
583

  
584
    push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_$_"} },              $invoice_for_advance_payment->$_) for qw(invnumber transdate);
585
    push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_amount_nofmt"} },    $invoice_for_advance_payment->amount);
586
    push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_amount"} },          $invoice_for_advance_payment->amount_as_number);
587
    push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_taxamount_nofmt"} }, $taxamount);
588
    push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_taxamount"} },       $form->format_amount($myconfig, $taxamount, 2));
589

  
590
    $form->{iap_amount_nofmt}    += $invoice_for_advance_payment->amount;
591
    $form->{iap_taxamount_nofmt} += $taxamount;
592
    $form->{iap_existing}         = 1;
593
  }
594
  $form->{iap_amount}    = $form->format_amount($myconfig, $form->{iap_amount_nofmt},    2);
595
  $form->{iap_taxamount} = $form->format_amount($myconfig, $form->{iap_taxamount_nofmt}, 2);
596

  
578 597
  $main::lxdebug->leave_sub();
579 598
}
580 599

  

Auch abrufbar als: Unified diff