Skip to content

Commit

Permalink
fixes #208
Browse files Browse the repository at this point in the history
  • Loading branch information
Courier-Online committed Jul 30, 2016
1 parent b413eaf commit b9932e3
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions files/cojm/live/ajaxchangejob.php
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,9 @@
SELECT
status,
targetcollectiondate,
duedate
collectionworkingwindow,
duedate,
deliveryworkingwindow
FROM Orders
INNER JOIN Services, Clients
WHERE `Orders`.`id` = :getid LIMIT 0,1";
Expand All @@ -2308,6 +2310,8 @@
$status=$cp->status;
$targetcollectiondate=$cp->targetcollectiondate;
$duedate=$cp->duedate;
$collectionworkingwindow=$cp->collectionworkingwindow;
$deliveryworkingwindow=$cp->deliveryworkingwindow;



Expand All @@ -2317,9 +2321,22 @@



if ($status<49){

if ($collectionworkingwindow<>'0000-00-00 00:00:00') { $nextactiondate=$collectionworkingwindow; } else {
$nextactiondate = $targetcollectiondate;
}



} else {

if ($status<49){ $nextactiondate = $targetcollectiondate; } else { $nextactiondate = $duedate; }
if ($deliveryworkingwindow<>'0000-00-00 00:00:00') { $nextactiondate=$deliveryworkingwindow; } else {
$nextactiondate = $duedate;
}


}
$sql = "UPDATE Orders SET nextactiondate='$nextactiondate' WHERE ID='$id' LIMIT 1";
$result = mysql_query($sql, $conn_id);
if ($result){
Expand Down

0 comments on commit b9932e3

Please sign in to comment.