X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=2958a6fa0f22e2ca2696b984cfb5aaf82847a47d;hb=9dffa52a454bc38c7640fdbb6b09102a199ebd12;hp=f4bfd1da65fd6bbd3558f50e8044b6a75f3eee87;hpb=028a47070f1c96c07828b9c8e802be253224df4f;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index f4bfd1da6..2958a6fa0 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -124,9 +124,7 @@ sub invoice_details { push(@{ $form->{licensenumber} }, $licensenumber); push(@{ $form->{validuntil} }, $locale->date($myconfig, $validuntil, 0)); - $licensenumber = "Lizenz: " . $licensenumber; $sth->finish; - push(@{ $form->{licensenumber} }, $licensenumber); } else { push(@{ $form->{licensenumber} }, ""); push(@{ $form->{validuntil} }, ""); @@ -141,14 +139,14 @@ sub invoice_details { $dec = length $dec; my $decimalplaces = ($dec > 2) ? $dec : 2; - my $discount = - $form->round_amount( - $sellprice * $form->parse_amount($myconfig, - $form->{"discount_$i"}) / 100, - $decimalplaces); + my $i_discount = $form->round_amount($sellprice * + $form->parse_amount($myconfig, $form->{"discount_$i"}) / 100, $decimalplaces); + + my $discount = $form->round_amount($form->{"qty_$i"} * $i_discount, $decimalplaces); # keep a netprice as well, (sellprice - discount) - $form->{"netprice_$i"} = $sellprice - $discount; + $form->{"netprice_$i"} = $sellprice - $i_discount; + push(@{ $form->{netprice} }, ($form->{"netprice_$i"} != 0) ? $form->format_amount( @@ -167,6 +165,7 @@ sub invoice_details { $linetotal = ($linetotal != 0) ? $linetotal : " "; push(@{ $form->{discount} }, $discount); + push(@{ $form->{p_discount} }, $form->{"discount_$i"}); $form->{total} += $linetotal; @@ -347,8 +346,6 @@ sub customer_details { $contact = "and cp.cp_id = $form->{cp_id}"; } - $taxincluded = $form->{taxincluded}; - # get rest for the customer my $query = qq|SELECT ct.*, cp.*, ct.notes as customernotes FROM customer ct @@ -358,9 +355,10 @@ sub customer_details { $sth->execute || $form->dberror($query); $ref = $sth->fetchrow_hashref(NAME_lc); - map { $form->{$_} = $ref->{$_} } keys %$ref; - $form->{taxincluded} = $taxincluded; + # remove id and taxincluded before copy back + delete @$ref{qw(id taxincluded)}; + map { $form->{$_} = $ref->{$_} } keys %$ref; $sth->finish; $dbh->disconnect;