}
$required_by = FA::sql2date($order->required_date);
if($required_by === null) {
- $required_by = FA::sql2date($order->delivery_date);
+ $required_by = FA::sql2date($order->expiry_date);
}
- if($required_by->getTime() < $date->getTime()) {
+ if($required_by !== null && $required_by->getTime() < $date->getTime()) {
$classes->push("late");
} else {
- $classes->push("on_time");
+ $hold_until = FA::sql2date($order->hold_until_date);
+ php_Lib::hprint($hold_until);
+ php_Lib::hprint($date);
+ if($hold_until === null) {
+ $hold_until = FA::sql2date($order->delivery_date);
+ }
+ if($hold_until->getTime() > $date->getTime()) {
+ $classes->push("early");
+ } else {
+ $classes->push("on_time");
+ }
}
- $cells = new _hx_array(array($order->order_id, "<a href=\"/modules/order_line_extra/order_lines_view.php?customer_id=" . Std::string($order->debtor_no) . "\">" . Std::string($order->deliver_to) . "</a>", "<input type=\"text\" name=\"" . $row_id . "[quantity]\" value=\"" . Std::string($order->quantity) . "\">", $before, $left, $order->from_stk_loc, $order->delivery_date, $order->required_date, $order->comment));
+ $cells = new _hx_array(array($order->order_id, "<a href=\"/modules/order_line_extra/order_lines_view.php?customer_id=" . Std::string($order->debtor_no) . "\">" . Std::string($order->deliver_to) . "</a>", "<input type=\"text\" name=\"" . $row_id . "[quantity]\" value=\"" . Std::string($order->quantity) . "\">", $before, $left, $order->from_stk_loc, $order->hold_until_date, $order->required_date, $order->comment));
$attributes->push("class=\"" . $classes->join(" ") . "\"");
$this->printRow($cells, $attributes);
}
unset($quantityForLocation);
}
$left -= $quantity;
- $this->formatOrder($order, $left, $location->delivery);
- unset($quantity,$order);
+ $now = Date::now();
+ $this->formatOrder($order, $left, ItemScheduler_4($this, $_g, $_g1, $left, $location, $locationIter, $locations, $now, $order, $qoh, $quantity, $startDate));
+ unset($quantity,$order,$now);
}
}
while(0 >= $left && $locationIter->hasNext()) {
}
}
}
+function ItemScheduler_4(&$»this, &$_g, &$_g1, &$left, &$location, &$locationIter, &$locations, &$now, &$order, &$qoh, &$quantity, &$startDate) {
+ if($now->getTime() > $location->delivery->getTime()) {
+ return $now;
+ } else {
+ return $location->delivery;
+ }
+}