X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=e29f67fe2717941cb5c49e906c1f49ea95dbe0c6;hb=4a648176621310d6b0c099c7f7af2d5a8ecf0890;hp=890bdccaf9ff82c26dce5c21098c276852d12b81;hpb=56eb34447cfb6edabc995cd97555c6a70823b422;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index 890bdccaf..e29f67fe2 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -106,10 +106,10 @@ sub invoice_details { push(@{ $form->{description} }, qq|$form->{"description_$i"}|); push(@{ $form->{qty} }, $form->format_amount($myconfig, $form->{"qty_$i"})); - push(@{ $form->{unit} }, qq|$form->{"unit_$i"}|); + push(@{ $form->{unit} }, qq|$form->{"unit_$i"}|); push(@{ $form->{deliverydate_oe} }, qq|$form->{"deliverydate_$i"}|); - push(@{ $form->{sellprice} }, $form->{"sellprice_$i"}); + push(@{ $form->{sellprice} }, $form->{"sellprice_$i"}); push(@{ $form->{ordnumber_oe} }, qq|$form->{"ordnumber_$i"}|); push(@{ $form->{transdate_oe} }, qq|$form->{"transdate_$i"}|); @@ -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,10 +139,14 @@ sub invoice_details { $dec = length $dec; my $decimalplaces = ($dec > 2) ? $dec : 2; - my $i_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); + my $discount = + $form->round_amount($form->{"qty_$i"} * $i_discount, $decimalplaces); # keep a netprice as well, (sellprice - discount) $form->{"netprice_$i"} = $sellprice - $i_discount; @@ -166,7 +168,7 @@ sub invoice_details { : " "; $linetotal = ($linetotal != 0) ? $linetotal : " "; - push(@{ $form->{discount} }, $discount); + push(@{ $form->{discount} }, $discount); push(@{ $form->{p_discount} }, $form->{"discount_$i"}); $form->{total} += $linetotal; @@ -302,9 +304,6 @@ sub invoice_details { $form->{paid} = $form->format_amount($myconfig, $form->{paid}, 2); - # myconfig variables - map { $form->{$_} = $myconfig->{$_} } - (qw(company address tel fax signature businessnumber)); $form->{username} = $myconfig->{name}; $dbh->disconnect; @@ -358,8 +357,8 @@ sub customer_details { $ref = $sth->fetchrow_hashref(NAME_lc); - # remove id and taxincluded before copy back - delete @$ref{qw(id taxincluded)}; + # remove notes, id and taxincluded before copy back + delete @$ref{qw(id taxincluded notes)}; map { $form->{$_} = $ref->{$_} } keys %$ref; $sth->finish; @@ -805,9 +804,10 @@ sub post_invoice { # set values which could be empty to 0 $form->{terms} *= 1; $form->{taxincluded} *= 1; - my $datepaid = ($form->{paid}) ? qq|'$form->{datepaid}'| : "NULL"; - my $duedate = ($form->{duedate}) ? qq|'$form->{duedate}'| : "NULL"; - my $deliverydate = ($form->{deliverydate}) ? qq|'$form->{deliverydate}'| : "NULL"; + my $datepaid = ($form->{paid}) ? qq|'$form->{datepaid}'| : "NULL"; + my $duedate = ($form->{duedate}) ? qq|'$form->{duedate}'| : "NULL"; + my $deliverydate = + ($form->{deliverydate}) ? qq|'$form->{deliverydate}'| : "NULL"; # fill in subject if there is none $form->{subject} = qq|$form->{label} $form->{invnumber}|