X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/3da73190b8f201bfb33e3b6d96bbc6330142e922..b6213d3539ccd179cd1f21b9afc54b8de8970774:/SL/OE.pm diff --git a/SL/OE.pm b/SL/OE.pm index 01e930cbf..8b073b9c5 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -244,6 +244,10 @@ SQL $query .= qq| AND ${not} COALESCE(pcfg.active, 'f')|; } + if ($form->{reqdate_unset_or_old}) { + $query .= qq| AND ((o.reqdate IS NULL) OR (o.reqdate < date_trunc('month', current_date)))|; + } + if (($form->{order_probability_value} || '') ne '') { my $op = $form->{order_probability_value} eq 'le' ? '<=' : '>='; $query .= qq| AND (o.order_probability ${op} ?)|; @@ -605,10 +609,10 @@ sub save { $form->{ordtotal} = $amount; - # add shipto $form->{name} = $form->{ $form->{vc} }; $form->{name} =~ s/--\Q$form->{"$form->{vc}_id"}\E//; + # add shipto if (!$form->{shipto_id}) { $form->add_shipto($dbh, $form->{id}, "OE"); }