X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FOE.pm;h=8e746f43c37580748fd8f3d7c3fc2b41e0dfe0a0;hb=6e351f3279ef4d5b782eb48e902002f87fe85d59;hp=279b08cce9bc3a00236995f6b295d2d5d7bcaeac;hpb=89360aadb2c3e0854a2815e5d0ed8a9efd1c5889;p=kivitendo-erp.git diff --git a/SL/OE.pm b/SL/OE.pm index 279b08cce..8e746f43c 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -795,6 +795,11 @@ sub retrieve { if (!$form->{id}) { my $wday = (localtime(time))[6]; my $next_workday = $wday == 5 ? 3 : $wday == 6 ? 2 : 1; + + # if we have a client configured interval for sales quotation, we add this + $next_workday += $::instance_conf->get_reqdate_interval if ($::instance_conf->get_reqdate_interval && + $form->{type} eq 'sales_quotation' ); + $query_add = qq|, current_date AS transdate, date(current_date + interval '${next_workday} days') AS reqdate|; } @@ -1236,7 +1241,7 @@ sub order_details { my $discount_round_error = $discount + ($linetotal_exact - $nodiscount_exact_linetotal); # not used - $form->{"netprice_$i"} = $form->round_amount($form->{"qty_$i"} ? ($linetotal / $form->{"qty_$i"}) : 0, 2); + $form->{"netprice_$i"} = $form->round_amount($form->{"qty_$i"} ? ($linetotal / $form->{"qty_$i"}) : 0, $decimalplaces); push @{ $form->{TEMPLATE_ARRAYS}->{netprice} }, ($form->{"netprice_$i"} != 0) ? $form->format_amount($myconfig, $form->{"netprice_$i"}, $decimalplaces) : ''; push @{ $form->{TEMPLATE_ARRAYS}->{netprice_nofmt} }, ($form->{"netprice_$i"} != 0) ? $form->{"netprice_$i"} : '';