FHM28052603SAS - commit remaining changes

This commit is contained in:
sas.fajri
2026-05-28 14:35:21 +07:00
parent 512f649616
commit ee7689654b
10 changed files with 8397 additions and 362 deletions

View File

@@ -0,0 +1,13 @@
{
"permissions": {
"allow": [
"Bash(ssh devcpone *)",
"Bash(git -C /Users/fajrihardhitamurti/REPO_CPONE/BE_CPONE ls-tree -r origin/master --name-only)",
"Bash(git *)",
"Bash(ssh *)",
"Bash(curl -s https://devcpone.aplikasi.web.id/one-api/mockup/resultentrysoelectromedis-v9-cpone/resultentry/search -H 'Accept: application/json, text/plain, */*' -H 'Content-Type: application/json;charset=UTF-8' -b 'cpone_project_mcu_id=1583; token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJNX1VzZXJJRCI6IjIiLCJNX1VzZXJFbWFpbCI6Impva29AZ21haWwuY29tIiwiTV9Vc2VyVXNlcm5hbWUiOiJqb2tvQGdtYWlsLmNvbSIsIk1fVXNlckdyb3VwRGFzaGJvYXJkIjoib25lLXVpXC90ZXN0XC92dWV4XC9vbmUtbWN1LW9mZmxpbmUtcHJlcmVnaXN0ZXItYXBwLWNwb25ldjhcLyIsIk1fVXNlckRlZmF1bHRUX1NhbXBsZVN0YXRpb25JRCI6IjEiLCJNX1N0YWZmTmFtZSI6IkFkbWluIENQT05FIiwiaXNfY291cmllciI6Ik4iLCJNX0JyYW5jaElEIjoiMTAiLCJNX0JyYW5jaE5hbWUiOiJMYWJvcmF0b3JpdW0gTWFrYXNzYXIiLCJ0aW1lX2F1dG9sb2dvdXQiOiIxNSIsImlwIjoiMTI4LjE5OS44Ni43IiwiYWdlbnQiOiJHby1odHRwLWNsaWVudFwvMS4xIiwidmVyc2lvbiI6InYyIiwibGFzdC1sb2dpbiI6IjIwMjYtMDUtMTEgMTM6NTg6MjIifQ.HL_TvRA5GaaL2X5NnJHDMQkRqWlbHE-fssgarBYWZSY' --data-raw '{\"startdate\":\"2026-05-11\",\"companyid\":0,\"switch_exclude\":false,\"search\":\"\",\"stationid\":\"1675\",\"groupid\":2,\"subgroupid\":0,\"current_page\":1,\"lastid\":-1,\"token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJNX1VzZXJJRCI6IjIiLCJNX1VzZXJFbWFpbCI6Impva29AZ21haWwuY29tIiwiTV9Vc2VyVXNlcm5hbWUiOiJqb2tvQGdtYWlsLmNvbSIsIk1fVXNlckdyb3VwRGFzaGJvYXJkIjoib25lLXVpXC90ZXN0XC92dWV4XC9vbmUtbWN1LW9mZmxpbmUtcHJlcmVnaXN0ZXItYXBwLWNwb25ldjhcLyIsIk1fVXNlckRlZmF1bHRUX1NhbXBsZVN0YXRpb25JRCI6IjEiLCJNX1N0YWZmTmFtZSI6IkFkbWluIENQT05FIiwiaXNfY291cmllciI6Ik4iLCJNX0JyYW5jaElEIjoiMTAiLCJNX0JyYW5jaE5hbWUiOiJMYWJvcmF0b3JpdW0gTWFrYXNzYXIiLCJ0aW1lX2F1dG9sb2dvdXQiOiIxNSIsImlwIjoiMTI4LjE5OS44Ni43IiwiYWdlbnQiOiJHby1odHRwLWNsaWVudFwvMS4xIiwidmVyc2lvbiI6InYyIiwibGFzdC1sb2dpbiI6IjIwMjYtMDUtMTEgMTM6NTg6MjIifQ.HL_TvRA5GaaL2X5NnJHDMQkRqWlbHE-fssgarBYWZSY\"}')",
"Bash(python3 -m json.tool)",
"Bash(scp *)"
]
}
}

View File

@@ -30,6 +30,7 @@ while read -r local_ref local_sha remote_ref remote_sha; do
repo_root=$(git rev-parse --show-toplevel)
if ! "$repo_root/scripts/devcpone_sync.sh" "$branch"; then
printf '%s\n' "devcpone sync skipped/failed; push kept intact" >&2
printf '%s\n' "devcpone sync failed; blocking push" >&2
exit 1
fi
done < "$tmpdir/pushes"

View File

@@ -578,6 +578,7 @@ class Transactionv2 extends MY_Controller
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
@@ -1117,6 +1118,7 @@ class Transactionv2 extends MY_Controller
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
@@ -1913,6 +1915,7 @@ class Transactionv2 extends MY_Controller
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
@@ -2412,6 +2415,7 @@ class Transactionv2 extends MY_Controller
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
@@ -2857,6 +2861,7 @@ class Transactionv2 extends MY_Controller
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
@@ -2904,7 +2909,15 @@ class Transactionv2 extends MY_Controller
T_OrderDetailIsActive = 'Y'
UNION
SELECT T_OrderDetailID as TrxLayananID,
Nat_GroupID as ProfitCostCenterCode,
case
when Nat_GroupID = 1 then '1100'
when Nat_GroupID = 2 then '1200'
when Nat_GroupID = 3 then '1200'
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
T_OrderDetailT_TestSasCode as LayananID,

File diff suppressed because it is too large Load Diff

View File

@@ -578,6 +578,7 @@ class Transactionv3 extends MY_Controller
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
@@ -1122,6 +1123,7 @@ class Transactionv3 extends MY_Controller
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
@@ -1918,6 +1920,7 @@ class Transactionv3 extends MY_Controller
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
@@ -2417,6 +2420,7 @@ class Transactionv3 extends MY_Controller
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
@@ -2862,6 +2866,7 @@ class Transactionv3 extends MY_Controller
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
@@ -2909,7 +2914,15 @@ class Transactionv3 extends MY_Controller
T_OrderDetailIsActive = 'Y'
UNION
SELECT T_OrderDetailID as TrxLayananID,
Nat_GroupID as ProfitCostCenterCode,
case
when Nat_GroupID = 1 then '1100'
when Nat_GroupID = 2 then '1200'
when Nat_GroupID = 3 then '1200'
when Nat_GroupID = 4 then '1303'
when Nat_GroupID = 5 then '1321'
when Nat_GroupID = 6 then '1600'
when Nat_GroupID = 7 then '1500'
end as ProfitCostCenterCode,
'' as TrxDepartemenID,
T_OrderDetailCreated as TanggalBuat,
T_OrderDetailT_TestSasCode as LayananID,

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,22 @@
<?php
class Patient extends MY_Controller
{
var $db_onedev;
public function index()
{
echo "Patient API";
}
public function __construct()
{
parent::__construct();
$this->db_onedev = $this->load->database("onedev", true);
}
public function add_notes($orderid){
$sql = " SELECT F_PaymentT_OrderHeaderID as note_order_id,
var $db_onedev;
public function index()
{
echo "Patient API";
}
public function __construct()
{
parent::__construct();
$this->db_onedev = $this->load->database("onedev", true);
}
public function add_notes($orderid)
{
$sql = " SELECT F_PaymentT_OrderHeaderID as note_order_id,
F_PaymentID as note_id,
F_PaymentDate as note_date,
DATE_FORMAT(F_PaymentDate,'%d-%m-%Y') as note_date,
F_PaymentNumber as note_number,
GROUP_CONCAT(M_PaymentTypeName separator ' , ') as paymenttypes_name,
MAX(F_PaymentTotal) as note_amount,
@@ -33,19 +34,18 @@ class Patient extends MY_Controller
if ($query) {
$rows = $query->result_array();
return $rows;
} else {
$this->sys_error_db("get notes", $this->db_onedev);
exit;
}
}
}
}
public function search()
{
if (! $this->isLogin) {
public function search()
{
if (! $this->isLogin) {
$this->sys_error("Invalid Token");
exit;
}
}
$prm = $this->sys_input;
$startdate = $prm['startdate'];
@@ -53,26 +53,28 @@ class Patient extends MY_Controller
$search = $prm["search"];
$status = $prm["status"];
$company = $prm["company"];
$userid = $this->sys_user["M_UserID"];
$filter_company = '';
if($company != '0' || $company != 0)
if ($company != '0' || $company != 0)
$filter_company = " AND CorporateID = {$company}";
$number_limit = 10;
$number_offset = ($prm['current_page'] - 1) * $number_limit ;
$number_offset = ($prm['current_page'] - 1) * $number_limit;
$where = " ( DATE(T_OrderHeaderDate) = '{$startdate}' ) AND ";
if($search != ''){
if ($search != '') {
$where = "( M_PatientName LIKE '%{$search}%' OR T_OrderHeaderLabNumber LIKE '%{$search}%' ) AND ";
if(strlen($search) == 10){
if (strlen($search) == 10) {
$where = "T_OrderHeaderLabNumber = '{$search}' AND ";
}
}
$sql = "SELECT count(*) as total
$sql = "SELECT count(*) as total
FROM t_orderheader
left join f_bill_detail on F_BillDetailT_OrderHeaderID = T_OrderHeaderID and F_BillDetailIsActive = 'Y'
JOIN m_user ON M_UserID = {$userid} AND T_OrderHeaderM_BranchID = M_UserLoginM_BranchID AND M_UserIsActive = 'Y'
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID
JOIN m_title ON M_PatientM_TitleID = M_TitleID
JOIN corporate ON T_OrderHeaderCorporateID = CorporateID $filter_company
left join f_bill_detail on F_BillDetailT_OrderHeaderID = T_OrderHeaderID and F_BillDetailIsActive = 'Y'
LEFT JOIN mgm_mcu ON T_OrderHeaderMgm_McuID = Mgm_McuID
LEFT JOIN last_statuspayment ON Last_StatusPaymentT_OrderHeaderID = T_OrderHeaderID AND Last_StatusPaymentIsActive = 'Y'
LEFT JOIN x_wa_outbox
@@ -83,18 +85,18 @@ class Patient extends MY_Controller
( ('{$status}' = 'N' AND (Last_StatusPaymentIsLunas = 'N' OR Last_StatusPaymentID IS NULL)) OR ('{$status}' = 'Y' AND Last_StatusPaymentIsLunas = 'Y') ) and F_BillDetailID is null";
$query = $this->db_onedev->query($sql);
$tot_count = 0;
$tot_page = 0;
if ($query) {
$tot_count = $query->result_array()[0]["total"];
$tot_page = ceil($tot_count/$number_limit);
$tot_page = ceil($tot_count / $number_limit);
} else {
$this->sys_error_db("t_samplestorage count", $this->db_onedev);
exit;
}
}
$sql = "SELECT t_orderheader.*,
M_PatientNoReg,
DATE_FORMAT(T_OrderHeaderDate,'%d-%m-%Y %H:%i') as order_date,
@@ -118,10 +120,11 @@ class Patient extends MY_Controller
IFNULL(XWaOutboxIsSent,'') as XWaOutboxIsSent,
IFNULL(XWaOutboxRetry,0) as XWaOutboxRetry
FROM t_orderheader
left join f_bill_detail on F_BillDetailT_OrderHeaderID = T_OrderHeaderID and F_BillDetailIsActive = 'Y'
JOIN m_user ON M_UserID = {$userid} AND T_OrderHeaderM_BranchID = M_UserLoginM_BranchID AND M_UserIsActive = 'Y'
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID
JOIN m_title ON M_PatientM_TitleID = M_TitleID
JOIN corporate ON T_OrderHeaderCorporateID = CorporateID $filter_company
left join f_bill_detail on F_BillDetailT_OrderHeaderID = T_OrderHeaderID and F_BillDetailIsActive = 'Y'
LEFT JOIN mgm_mcu ON T_OrderHeaderMgm_McuID = Mgm_McuID
LEFT JOIN last_statuspayment ON Last_StatusPaymentT_OrderHeaderID = T_OrderHeaderID AND Last_StatusPaymentIsActive = 'Y'
LEFT JOIN x_wa_outbox
@@ -135,9 +138,10 @@ class Patient extends MY_Controller
limit $number_limit offset $number_offset";
//echo $sql;
$query = $this->db_onedev->query($sql, $sql_param);
//echo $this->db_onedev->last_query();
$rows = $query->result_array();
if($rows){
foreach($rows as $k => $v){
if ($rows) {
foreach ($rows as $k => $v) {
$rows[$k]['notes'] = $this->add_notes($v['T_OrderHeaderID']);
}
}
@@ -145,59 +149,58 @@ class Patient extends MY_Controller
$sql = "SELECT * FROM `s_menu` WHERE `S_MenuName` = 'Registration (Walk In)' AND `S_MenuIsActive` = 'Y' ORDER BY `S_MenuID` DESC LIMIT 1";
$query = $this->db_onedev->query($sql);
$menu = $query->row_array();
if($menu){
if ($menu) {
$menu_url = $menu['S_MenuUrl'];
}
$result = array("total" => $tot_page, "records" => $rows, "sql"=> $this->db_onedev->last_query(), "menu_url" => $menu_url);
$result = array("total" => $tot_page, "records" => $rows, "sql" => $this->db_onedev->last_query(), "menu_url" => $menu_url);
$this->sys_ok($result);
exit;
}
}
function searchcompany(){
function searchcompany()
{
if (! $this->isLogin) {
$this->sys_error("Invalid Token");
exit;
}
$this->sys_error("Invalid Token");
exit;
}
$prm = $this->sys_input;
$max_rst = 12;
$tot_count =0;
$tot_count = 0;
$filter_date = '';
if(isset($prm['xdate']))
$filter_date = " JOIN t_orderheader ON T_OrderHeaderCorporateID = CorporateID AND DATE(T_OrderHeaderDate) = '{$prm['xdate']}' AND T_OrderHeaderIsActive = 'Y' ";
if (isset($prm['xdate']))
$filter_date = " JOIN t_orderheader ON T_OrderHeaderCorporateID = CorporateID AND DATE(T_OrderHeaderDate) = '{$prm['xdate']}' AND T_OrderHeaderIsActive = 'Y' ";
$q = [
'search' => '%'
];
if ($prm['search'] != '' )
{
if($prm['search'] == 'Semua')
$prm['search'] = "";
if ($prm['search'] != '') {
if ($prm['search'] == 'Semua')
$prm['search'] = "";
$q['search'] = "%{$prm['search']}%";
$q['search'] = "%{$prm['search']}%";
}
// QUERY TOTAL
// QUERY TOTAL
$sql = "SELECT count(*) as total
FROM corporate
WHERE
CorporateName like ?
AND CorporateIsActive = 'Y'";
$query = $this->db_onedev->query($sql,$q['search']);
$query = $this->db_onedev->query($sql, $q['search']);
//echo $query;
if ($query) {
$tot_count = $query->result_array()[0]["total"];
}
else {
$this->sys_error_db("m_city count",$this->db_onedev);
if ($query) {
$tot_count = $query->result_array()[0]["total"];
} else {
$this->sys_error_db("m_city count", $this->db_onedev);
exit;
}
$rows = array('id'=>0,'name'=>'Semua');
$rows = array('id' => 0, 'name' => 'Semua');
$sql = "
SELECT CorporateID as id, CorporateName as name
FROM corporate
@@ -207,19 +210,17 @@ class Patient extends MY_Controller
AND CorporateIsActive = 'Y'
ORDER BY CorporateName DESC
";
$query = $this->db_onedev->query($sql, array($q['search']));
$query = $this->db_onedev->query($sql, array($q['search']));
// echo $this->db_onedev->last_query();
if ($query) {
$rows = $query->result_array();
array_push($rows,array('id'=>0,'name'=>'Semua'));
//echo $this->db_onedev->last_query();
$result = array("total" => $tot_count, "records" => $rows, "total_display" => sizeof($rows));
$this->sys_ok($result);
}
else {
$this->sys_error_db("corporate rows",$this->db_onedev);
exit;
}
if ($query) {
$rows = $query->result_array();
array_push($rows, array('id' => 0, 'name' => 'Semua'));
//echo $this->db_onedev->last_query();
$result = array("total" => $tot_count, "records" => $rows, "total_display" => sizeof($rows));
$this->sys_ok($result);
} else {
$this->sys_error_db("corporate rows", $this->db_onedev);
exit;
}
}
}

View File

@@ -0,0 +1,225 @@
<?php
class Patient extends MY_Controller
{
var $db_onedev;
public function index()
{
echo "Patient API";
}
public function __construct()
{
parent::__construct();
$this->db_onedev = $this->load->database("onedev", true);
}
public function add_notes($orderid){
$sql = " SELECT F_PaymentT_OrderHeaderID as note_order_id,
F_PaymentID as note_id,
F_PaymentDate as note_date,
F_PaymentNumber as note_number,
GROUP_CONCAT(M_PaymentTypeName separator ' , ') as paymenttypes_name,
MAX(F_PaymentTotal) as note_amount,
M_StaffName as note_user,
F_PaymentDetailIsActive as note_active
FROM f_payment
JOIN f_paymentdetail ON F_PaymentDetailF_PaymentID = F_PaymentID
JOIN m_paymenttype ON F_PaymentDetailM_PaymentTypeID = M_PaymentTypeID
LEFT JOIN m_user ON F_PaymentDetailUserID = M_UserID
LEFT JOIN m_staff ON M_UserM_StaffID = M_StaffID
WHERE
F_PaymentT_OrderHeaderID = {$orderid}
GROUP BY F_PaymentID";
$query = $this->db_onedev->query($sql);
if ($query) {
$rows = $query->result_array();
return $rows;
} else {
$this->sys_error_db("get notes", $this->db_onedev);
exit;
}
}
public function search()
{
if (! $this->isLogin) {
$this->sys_error("Invalid Token");
exit;
}
$prm = $this->sys_input;
$startdate = $prm['startdate'];
$enddate = $prm['enddate'] . " 23:59:59";
$search = $prm["search"];
$status = $prm["status"];
$company = $prm["company"];
$filter_company = '';
if($company != '0' || $company != 0)
$filter_company = " AND CorporateID = {$company}";
$number_limit = 10;
$number_offset = ($prm['current_page'] - 1) * $number_limit ;
$where = " ( DATE(T_OrderHeaderDate) = '{$startdate}' ) AND ";
if($search != ''){
$where = "( M_PatientName LIKE '%{$search}%' OR T_OrderHeaderLabNumber LIKE '%{$search}%' ) AND ";
if(strlen($search) == 10){
$where = "T_OrderHeaderLabNumber = '{$search}' AND ";
}
}
$sql = "SELECT count(*) as total
FROM t_orderheader
left join f_bill_detail on F_BillDetailT_OrderHeaderID = T_OrderHeaderID and F_BillDetailIsActive = 'Y'
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID
JOIN m_title ON M_PatientM_TitleID = M_TitleID
JOIN corporate ON T_OrderHeaderCorporateID = CorporateID $filter_company
LEFT JOIN mgm_mcu ON T_OrderHeaderMgm_McuID = Mgm_McuID
LEFT JOIN last_statuspayment ON Last_StatusPaymentT_OrderHeaderID = T_OrderHeaderID AND Last_StatusPaymentIsActive = 'Y'
LEFT JOIN x_wa_outbox
ON T_OrderHeaderID = XWaOutboxRefID
AND XWaOutboxIsActive = 'Y'
WHERE T_OrderHeaderIsActive = 'Y' AND
$where
( ('{$status}' = 'N' AND (Last_StatusPaymentIsLunas = 'N' OR Last_StatusPaymentID IS NULL)) OR ('{$status}' = 'Y' AND Last_StatusPaymentIsLunas = 'Y') ) and F_BillDetailID is null";
$query = $this->db_onedev->query($sql);
$tot_count = 0;
$tot_page = 0;
if ($query) {
$tot_count = $query->result_array()[0]["total"];
$tot_page = ceil($tot_count/$number_limit);
} else {
$this->sys_error_db("t_samplestorage count", $this->db_onedev);
exit;
}
$sql = "SELECT t_orderheader.*,
M_PatientNoReg,
DATE_FORMAT(T_OrderHeaderDate,'%d-%m-%Y %H:%i') as order_date,
CONCAT(M_TitleName,'. ',M_PatientName) as M_PatientName,
M_PatientName as M_PatientName_eng,
M_TitleName,
CorporateName as M_CompanyName,
CorporateName as CorporateName,
Mgm_McuLabel as M_MouName,
Mgm_McuLabel,
IFNULL(Last_StatusPaymentBillTotal, T_OrderHeaderTotal) as totalbill,
IFNULL(Last_StatusPaymentPaid,0) as paid,
(IFNULL(Last_StatusPaymentBillTotal, T_OrderHeaderTotal) - IFNULL(Last_StatusPaymentPaid,0)) as unpaid,
Last_StatusPaymentIsLunas as flaglunas,
'' as notes,
0 as mindp_percent,
0 as mindp_amount,
F_BillDetailID,
IFNULL(M_PatientHp,'') as M_PatientHp,
IFNULL(M_PatientID,0) as M_PatientID,
IFNULL(XWaOutboxIsSent,'') as XWaOutboxIsSent,
IFNULL(XWaOutboxRetry,0) as XWaOutboxRetry
FROM t_orderheader
left join f_bill_detail on F_BillDetailT_OrderHeaderID = T_OrderHeaderID and F_BillDetailIsActive = 'Y'
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID
JOIN m_title ON M_PatientM_TitleID = M_TitleID
JOIN corporate ON T_OrderHeaderCorporateID = CorporateID $filter_company
LEFT JOIN mgm_mcu ON T_OrderHeaderMgm_McuID = Mgm_McuID
LEFT JOIN last_statuspayment ON Last_StatusPaymentT_OrderHeaderID = T_OrderHeaderID AND Last_StatusPaymentIsActive = 'Y'
LEFT JOIN x_wa_outbox
ON T_OrderHeaderID = XWaOutboxRefID
AND XWaOutboxIsActive = 'Y'
AND XWaOutboxType = 'KWITANSI'
WHERE T_OrderHeaderIsActive = 'Y' AND
$where
( ('{$status}' = 'N' AND (Last_StatusPaymentIsLunas = 'N' OR Last_StatusPaymentID IS NULL)) OR ('{$status}' = 'Y' AND Last_StatusPaymentIsLunas = 'Y') ) and F_BillDetailID is null
ORDER BY T_OrderHeaderID ASC
limit $number_limit offset $number_offset";
//echo $sql;
$query = $this->db_onedev->query($sql, $sql_param);
$rows = $query->result_array();
if($rows){
foreach($rows as $k => $v){
$rows[$k]['notes'] = $this->add_notes($v['T_OrderHeaderID']);
}
}
$sql = "SELECT * FROM `s_menu` WHERE `S_MenuName` = 'Registration (Walk In)' AND `S_MenuIsActive` = 'Y' ORDER BY `S_MenuID` DESC LIMIT 1";
$query = $this->db_onedev->query($sql);
$menu = $query->row_array();
if($menu){
$menu_url = $menu['S_MenuUrl'];
}
$result = array("total" => $tot_page, "records" => $rows, "sql"=> $this->db_onedev->last_query(), "menu_url" => $menu_url);
$this->sys_ok($result);
exit;
}
function searchcompany(){
if (! $this->isLogin) {
$this->sys_error("Invalid Token");
exit;
}
$prm = $this->sys_input;
$max_rst = 12;
$tot_count =0;
$filter_date = '';
if(isset($prm['xdate']))
$filter_date = " JOIN t_orderheader ON T_OrderHeaderCorporateID = CorporateID AND DATE(T_OrderHeaderDate) = '{$prm['xdate']}' AND T_OrderHeaderIsActive = 'Y' ";
$q = [
'search' => '%'
];
if ($prm['search'] != '' )
{
if($prm['search'] == 'Semua')
$prm['search'] = "";
$q['search'] = "%{$prm['search']}%";
}
// QUERY TOTAL
$sql = "SELECT count(*) as total
FROM corporate
WHERE
CorporateName like ?
AND CorporateIsActive = 'Y'";
$query = $this->db_onedev->query($sql,$q['search']);
//echo $query;
if ($query) {
$tot_count = $query->result_array()[0]["total"];
}
else {
$this->sys_error_db("m_city count",$this->db_onedev);
exit;
}
$rows = array('id'=>0,'name'=>'Semua');
$sql = "
SELECT CorporateID as id, CorporateName as name
FROM corporate
$filter_date
WHERE
CorporateName like ?
AND CorporateIsActive = 'Y'
ORDER BY CorporateName DESC
";
$query = $this->db_onedev->query($sql, array($q['search']));
// echo $this->db_onedev->last_query();
if ($query) {
$rows = $query->result_array();
array_push($rows,array('id'=>0,'name'=>'Semua'));
//echo $this->db_onedev->last_query();
$result = array("total" => $tot_count, "records" => $rows, "total_display" => sizeof($rows));
$this->sys_ok($result);
}
else {
$this->sys_error_db("corporate rows",$this->db_onedev);
exit;
}
}
}

View File

@@ -20,6 +20,7 @@ tmpdir=$(mktemp -d "${TMPDIR:-/tmp}/devcpone-sync.XXXXXX")
trap 'rm -rf "$tmpdir"' EXIT HUP INT TERM
manifest="$tmpdir/files.list"
verify_list="$tmpdir/files.verify"
if git rev-parse --verify HEAD^ >/dev/null 2>&1; then
git diff -M --name-only -z --diff-filter=ACMR HEAD^ HEAD > "$manifest"
@@ -31,12 +32,20 @@ if [ ! -s "$manifest" ]; then
exit 0
fi
ssh_cmd="ssh"
ssh_args="-o BatchMode=yes"
if [ -f "$ssh_key" ]; then
ssh_cmd="$ssh_cmd -i $ssh_key"
ssh_args="-i $ssh_key $ssh_args"
fi
ssh_cmd="$ssh_cmd -o BatchMode=yes"
ssh $ssh_args "$remote_host" "mkdir -p '$remote_root'" >/dev/null
rsync -a --relative --from0 --files-from="$manifest" -e "ssh $ssh_args" "$repo_root"/ "$remote_host:$remote_root"/
ssh "$remote_host" "mkdir -p '$remote_root'" >/dev/null
rsync -a --relative --from0 --files-from="$manifest" -e "$ssh_cmd" "$repo_root"/ "$remote_host:$remote_root"/
tr '\0' '\n' < "$manifest" > "$verify_list"
while IFS= read -r relpath; do
[ -n "$relpath" ] || continue
ssh $ssh_args "$remote_host" "test -e '$remote_root/$relpath'" || {
printf '%s\n' "devcpone verify failed: missing $remote_root/$relpath" >&2
exit 1
}
done < "$verify_list"