X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/9dffa52a454bc38c7640fdbb6b09102a199ebd12..72539cb39a3d19f930a8e0e41e46bf41afe9a8f1:/SL/IS.pm diff --git a/SL/IS.pm b/SL/IS.pm index 2958a6fa0..d4d8c6f1d 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->{deliverydate} }, qq|$form->{"deliverydate_$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"}|); @@ -139,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; @@ -164,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; @@ -805,6 +809,8 @@ sub post_invoice { $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"; # fill in subject if there is none $form->{subject} = qq|$form->{label} $form->{invnumber}| @@ -837,6 +843,7 @@ Message: $form->{message}\r| if $form->{message}; paid = $form->{paid}, datepaid = $datepaid, duedate = $duedate, + deliverydate = $deliverydate, invoice = '1', shippingpoint = '$form->{shippingpoint}', shipvia = '$form->{shipvia}', @@ -1162,7 +1169,7 @@ sub retrieve_invoice { # retrieve invoice $query = qq|SELECT a.invnumber, a.ordnumber, a.quonumber, a.cusordnumber, - a.transdate AS invdate, a.paid, + a.transdate AS invdate, a.deliverydate, a.paid, a.shippingpoint, a.shipvia, a.terms, a.notes, a.intnotes, a.duedate, a.taxincluded, a.curr AS currency, a.employee_id, e.name AS employee