add endpoint listing service items

This commit is contained in:
2026-09-13 19:40:44 +07:00
parent 48a5c43cd8
commit a00891a7be

View File

@@ -13,6 +13,45 @@ class ServiceCoaMapping extends MY_Controller
parent::__construct();
}
public function getListItemJasa()
{
try {
if (!$this->sys_input) {
throw new Exception("Invalid token");
}
$para = $this->sys_input;
$keyword = "%";
if ($para['keyword'] != '') {
$keyword .= $para['keyword'] . "%";
}
$sql = "SELECT
M_ItemID,
M_ItemCode,
M_ItemDesc
FROM m_item
WHERE M_ItemIsActive = 'Y'
AND M_ItemDesc LIKE ?
AND M_ItemItem_CategoryID = '4'";
$que = $this->db->query($sql, [$keyword]);
if (!$que) {
throw new Exception('failed to get item jasa', 1);
}
$data = $que->result_array();
$this->sys_ok($data);
} catch (Exception $e) {
$mssg = "[Error] " . $e->getMessage();
$code = $e->getCode();
if ($code == 0) {
$this->sys_error($mssg);
} else {
$this->sys_error_db($mssg);
}
exit();
}
}
public function getListCoa()
{
try {
@@ -24,6 +63,9 @@ class ServiceCoaMapping extends MY_Controller
$keyword = "%" . $para["keyword"] . "%";
$sql = "SELECT
coaID,
coaAccountNo,
coaDescription
FROM coa
WHERE coaIsInput = 'Y'
AND (