StartTrans(); $sql = " SELECT total_quantity FROM materials_inventory WHERE id = '$item_no' "; $system_quantity = $database->getOne($sql); $stock_take_id = 0; if($system_quantity!=$actual_quantity){ $stock_take_id = common_stock_take::createStockTake($item_no,$actual_quantity,$system_quantity); }else{ $stock_take_id = common_stock_take::createStockTake($item_no,$actual_quantity,$system_quantity,$submitter); } //added this coz client does not want approval anymore, remove it if iHub they want approval back common_stock_take::approveStockTakeWithQuantity($stock_take_id,$item_no,$actual_quantity); $result = $database->CompleteTrans(); $status = false; if($result) $status = true; else $status = false; $results = array("status" => $status); $json = json_encode($results); echo $json; ?>