/** * Manual-gen a req */ public function manualGenOrderRequest($inId, $reqRow) { $inDbo = CalemFactory::getDbo('inventory'); $inRow = $inDbo->fetchById($inId); if (!$inRow['qty_to_order']) { return; } //In case it's processed already //Figure out the due date $initRow = $this->conf['in_order_gen']['req_manual']['init']; foreach ($initRow as $key => $val) { if (!$reqRow[$key]) { $reqRow[$key] = $val; } } $dueDate = $this->getReqDueDateByWo($inId); if ($dueDate) { $reqRow['due_date'] = CalemText::datetimeToDate($dueDate); } $reqRow['request_time'] = CalemText::getServerDateTime(); $reqBo = new CalemReqBo(); $reqId = $reqBo->createInOrderRequest($reqRow, $inId, $inRow['qty_to_order'], $inRow['uom_id']); }