add api file po asset, api receive item inventaris add insert into table stock_inventaris

This commit is contained in:
2026-07-08 17:15:55 +07:00
parent 752c372c2f
commit 2874fab71d
2 changed files with 79 additions and 50 deletions

View File

@@ -1190,10 +1190,10 @@ class PurchaseOrderAset extends MY_Controller {
}
}
private function insertLog($poID, $type, $prm, $dataBefore, $dataAfter, $userID, $desc = '') {
$sql = "INSERT INTO acc_one_log.purchase_order_log (
PurchaseOrderLogPurchaseOrderID,
PurchaseOrderLogType,
private function insertLog($poID, $type, $prm, $dataBefore, $dataAfter, $userID, $desc = '') {
$sql = "INSERT INTO acc_one_log.purchase_order_log (
PurchaseOrderLogPurchaseOrderID,
PurchaseOrderLogType,
PurchaseOrderLogPrm,
PurchaseOrderLogJSONBefore,
PurchaseOrderLogJSONAfter,
@@ -1208,7 +1208,26 @@ class PurchaseOrderAset extends MY_Controller {
if (!$que) {
$this->db->trans_rollback();
$this->sys_error_db("[Error] failed insert into table log PO");
exit;
}
}
}
exit;
}
}
## MUTATIONS ##
public function insertPurchaseOrderAsset()
{
try {
if (!$this->isLogin) {
throw new Exception('Invalid token');
}
} catch (Exception $e) {
$msg = '[Error] ' . $e->getMessage();
$code = $e->getCode();
if ($code == 0) {
$this->sys_error($msg);
} else {
$this->sys_error_db($msg);
}
exit;
}
}
}