From 34ca68b5bd568ca93a89224d779e749fcba8cdd8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 25 Jun 2008 11:20:10 +0000 Subject: [PATCH] =?utf8?q?Bei=20Auftr=C3=A4gen,=20Angeboten,=20Preisanfrag?= =?utf8?q?en=20das=20Lieferdatum=20mit=20dem=20n=C3=A4chsten=20Werktag=20u?= =?utf8?q?nd=20nicht=20dem=20heutigen=20Datum=20vorbelegen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/OE.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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, -- 2.20.1