X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=8a94ec6b47f4ee9313cdc4cbf4c51351d52336da;hb=79c048aa6a9699c5a994d7e21f4fd3ec8fa29693;hp=ca1d51d5b10b900b26b3decf8598806667dc3737;hpb=7f6cc12910ab6f70677f464ee6a2847de0144ff6;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index ca1d51d5b..8a94ec6b4 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -154,7 +154,7 @@ sub invoice_details { partnotes serialnumber reqdate sellprice listprice netprice discount p_discount discount_sub nodiscount_sub linetotal nodiscount_linetotal tax_rate projectnumber projectdescription - price_factor price_factor_name partsgroup); + price_factor price_factor_name partsgroup weight lineweight); push @arrays, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs }; @@ -164,6 +164,7 @@ sub invoice_details { map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays, @tax_arrays, @payment_arrays); + my $totalweight = 0; foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) { $i = $item->[0]; @@ -280,6 +281,13 @@ sub invoice_details { push(@{ $form->{TEMPLATE_ARRAYS}->{projectnumber} }, $projectnumbers{$form->{"project_id_$i"}}); push(@{ $form->{TEMPLATE_ARRAYS}->{projectdescription} }, $projectdescriptions{$form->{"project_id_$i"}}); + my $lineweight = $form->{"qty_$i"} * $form->{"weight_$i"}; + $totalweight += $lineweight; + push @{ $form->{TEMPLATE_ARRAYS}->{weight} }, $form->format_amount($myconfig, $form->{"weight_$i"}, 3); + push @{ $form->{TEMPLATE_ARRAYS}->{weight_nofmt} }, $form->{"weight_$i"}; + push @{ $form->{TEMPLATE_ARRAYS}->{lineweight} }, $form->format_amount($myconfig, $lineweight, 3); + push @{ $form->{TEMPLATE_ARRAYS}->{lineweight_nofmt} }, $lineweight; + @taxaccounts = split(/ /, $form->{"taxaccounts_$i"}); $taxrate = 0; $taxdiff = 0; @@ -366,6 +374,9 @@ sub invoice_details { } } + $form->{totalweight} = $form->format_amount($myconfig, $totalweight, 3); + $form->{totalweight_nofmt} = $totalweight; + foreach my $item (sort keys %taxaccounts) { $tax += $taxamount = $form->round_amount($taxaccounts{$item}, 2);