Neuer Bericht »Liquiditätsvorschau«
[kivitendo-erp.git] / SL / OE.pm
index 01e930c..b6f653a 100644 (file)
--- 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} ?)|;