X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/0c4036d25359c5a110d9179a53fdfa0e338259b3..34ca68b5bd568ca93a89224d779e749fcba8cdd8:/SL/OE.pm diff --git a/SL/OE.pm b/SL/OE.pm index 72c11ed32..e279e4a65 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -606,7 +606,12 @@ sub retrieve { undef @ids; } - $query_add = qq|, current_date AS transdate, current_date AS reqdate| if (!$form->{id}); + my $query_add = ''; + if (!$form->{id}) { + my $wday = (localtime(time))[6]; + my $next_workday = $wday == 5 ? 3 : $wday == 6 ? 2 : 1; + $query_add = qq|, current_date AS transdate, date(current_date + interval '${next_workday} days') AS reqdate|; + } # get default accounts $query = qq|SELECT (SELECT c.accno FROM chart c WHERE d.inventory_accno_id = c.id) AS inventory_accno,