From: <ex...@us...> - 2014-02-12 03:04:29
|
Revision: 6569 http://sourceforge.net/p/web-erp/reponame/6569 Author: exsonqu Date: 2014-02-12 03:04:26 +0000 (Wed, 12 Feb 2014) Log Message: ----------- 14/2/2014 Exson: Fixed the Earliest date calculation when is over Friday cutoff Time in DateFunctions.inc. Modified Paths: -------------- trunk/includes/DateFunctions.inc Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2014-02-10 15:09:27 UTC (rev 6568) +++ trunk/includes/DateFunctions.inc 2014-02-12 03:04:26 UTC (rev 6569) @@ -922,6 +922,9 @@ * */ $EarliestDispatch = time(); + /* If the hour is after Dispatch Cut Off Time default dispatch date to tomorrow */ + $EarliestDispatch = (Date('H')>=$_SESSION['DispatchCutOffTime'])?($EarliestDispatch+24*60*60):$EarliestDispatch; + if ((Date('w',$EarliestDispatch)==0) AND ($_SESSION['WorkingDaysWeek'] != '7')){ /*if today is a sunday AND the company does NOT work 7 days a week, the dispatch date must be tomorrow (Monday) or after */ @@ -934,11 +937,9 @@ $EarliestDispatch = Mktime(0,0,0,Date('m',$EarliestDispatch),Date('d',$EarliestDispatch)+2,Date('y',$EarliestDispatch)); - }elseif (Date('H')>$_SESSION['DispatchCutOffTime']) { + }else { -/* If the hour is after Dispatch Cut Off Time default dispatch date to tomorrow */ - - $EarliestDispatch = Mktime(0,0,0,Date('m'),Date('d')+1,Date('y')); + $EarliestDispatch = Mktime(0,0,0,Date('m'),Date('d'),Date('y')); } return $EarliestDispatch; } @@ -1080,4 +1081,4 @@ return $myrow[0]; } -?> \ No newline at end of file +?> |