X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FOE.pm;h=8b073b9c58c9c288a421e238d68ddffca67f5246;hb=313c7c4d7422770b3f28ce0b5d51f867472e1fce;hp=01e930cbf294b14d75c485e91ad8d62741f4c2da;hpb=3da73190b8f201bfb33e3b6d96bbc6330142e922;p=kivitendo-erp.git 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"); }