diff --git a/application/controllers/mockup/fo/cashiernewpayment-v27/Payment.http b/application/controllers/mockup/fo/cashiernewpayment-v27/Payment.http index 69365948..a1ed1d56 100644 --- a/application/controllers/mockup/fo/cashiernewpayment-v27/Payment.http +++ b/application/controllers/mockup/fo/cashiernewpayment-v27/Payment.http @@ -1,8 +1,8 @@ -@token = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJNX1VzZXJJRCI6IjM0MCIsIk1fVXNlclVzZXJuYW1lIjoiYWRtaW5zYXMgIiwiTV9Vc2VyR3JvdXBEYXNoYm9hcmQiOiJvbmUtdWktbGFiXC90ZXN0XC92dWV4XC9vbmUtcGF0aWVudC1saXN0LWJhcmNvZGUtdnYtNi1jcG9uZVwvIiwiTV9Vc2VyRGVmYXVsdFRfU2FtcGxlU3RhdGlvbklEIjoiMCIsIk1fU3RhZmZOYW1lIjoiQURNSU4iLCJpc19jb3VyaWVyIjoiWSIsInRpbWVfYXV0b2xvZ291dCI6IjEwMDAwMDAiLCJpcCI6IjEzOS4xOTIuMTUyLjY2IiwiYWdlbnQiOiJNb3ppbGxhXC81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXRcLzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZVwvMTQxLjAuMC4wIFNhZmFyaVwvNTM3LjM2IEVkZ1wvMTQxLjAuMC4wIiwidmVyc2lvbiI6InYyIiwibGFzdC1sb2dpbiI6IjIwMjUtMTAtMDYgMTY6MTk6NTUiLCJNX1NhdGVsbGl0ZUlEIjowfQ.WAP_kdH8JXnXQaLunQSoG2jrYaFDlgahwUUpbY_9b-8 - -@url = devone.aplikasi.web.id - -### +@token = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJNX1VzZXJJRCI6IjM0MCIsIk1fVXNlclVzZXJuYW1lIjoiYWRtaW5zYXMgIiwiTV9Vc2VyR3JvdXBEYXNoYm9hcmQiOiJvbmUtdWktbGFiXC90ZXN0XC92dWV4XC9vbmUtcGF0aWVudC1saXN0LWJhcmNvZGUtdnYtNi1jcG9uZVwvIiwiTV9Vc2VyRGVmYXVsdFRfU2FtcGxlU3RhdGlvbklEIjoiMCIsIk1fU3RhZmZOYW1lIjoiQURNSU4iLCJpc19jb3VyaWVyIjoiWSIsInRpbWVfYXV0b2xvZ291dCI6IjEwMDAwMDAiLCJpcCI6IjEzOS4xOTIuMTUyLjY2IiwiYWdlbnQiOiJNb3ppbGxhXC81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXRcLzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZVwvMTQxLjAuMC4wIFNhZmFyaVwvNTM3LjM2IEVkZ1wvMTQxLjAuMC4wIiwidmVyc2lvbiI6InYyIiwibGFzdC1sb2dpbiI6IjIwMjUtMTAtMDYgMTY6MTk6NTUiLCJNX1NhdGVsbGl0ZUlEIjowfQ.WAP_kdH8JXnXQaLunQSoG2jrYaFDlgahwUUpbY_9b-8 + +@url = devone.aplikasi.web.id + +### POST https://{{url}}/one-api-lab/mockup/fo/cashiernewpayment-v27/payment/getLocations Content-Type: application/json @@ -20,3 +20,11 @@ Content-Type: application/json "end_id": 25, "token": "{{token}}" } + +### +POST https://{{url}}/one-api-lab/mockup/fo/cashiernewpayment-v27/payment/get_print_transaction_fo_kk_ina +Content-Type: application/json + +{ + "token": "{{token}}" +} diff --git a/application/controllers/mockup/fo/cashiernewpayment-v27/Payment.php b/application/controllers/mockup/fo/cashiernewpayment-v27/Payment.php index 7895798d..d61855ca 100644 --- a/application/controllers/mockup/fo/cashiernewpayment-v27/Payment.php +++ b/application/controllers/mockup/fo/cashiernewpayment-v27/Payment.php @@ -579,43 +579,43 @@ class Payment extends MY_Controller } } - function save_control() - { - if (! $this->isLogin) { - $this->sys_error("Invalid Token"); - exit; - } - $prm = $this->sys_input; - $userid = $this->sys_user['M_UserID']; - if ($prm['data'] && count($prm['data']) > 0) { - foreach ($prm['data'] as $key => $value) { - $sql = "UPDATE t_order_location - SET - T_OrderLocationIsActive = 'N', - T_OrderLocationLastUpdated = NOW(), - T_OrderLocationUserID = ? - WHERE - T_OrderLocationT_OrderHeaderID = ? AND - T_OrderLocationT_SampleStationID = ? AND - T_OrderLocationIsActive = 'Y'"; - $this->db_onedev->query($sql, array($userid, $value['order_id'], $value['station_id'])); - - $sql = "INSERT INTO t_order_location ( - T_OrderLocationT_OrderHeaderID, - T_OrderLocationM_LocationID, - T_OrderLocationT_SampleStationID, - T_OrderLocationIsActive, - T_OrderLocationCreated, - T_OrderLocationLastUpdated, - T_OrderLocationUserID - ) - VALUES (?,?,?,'Y',NOW(),NOW(),?)"; - $query = $this->db_onedev->query($sql, array($value['order_id'], $value['location_id'], $value['station_id'], $userid)); - } - $this->sys_ok(["datas" => '']); - } else { - $this->sys_error_db("data not valid", $this->db_onedev); - exit; + function save_control() + { + if (! $this->isLogin) { + $this->sys_error("Invalid Token"); + exit; + } + $prm = $this->sys_input; + $userid = $this->sys_user['M_UserID']; + if ($prm['data'] && count($prm['data']) > 0) { + foreach ($prm['data'] as $key => $value) { + $sql = "UPDATE t_order_location + SET + T_OrderLocationIsActive = 'N', + T_OrderLocationLastUpdated = NOW(), + T_OrderLocationUserID = ? + WHERE + T_OrderLocationT_OrderHeaderID = ? AND + T_OrderLocationT_SampleStationID = ? AND + T_OrderLocationIsActive = 'Y'"; + $this->db_onedev->query($sql, array($userid, $value['order_id'], $value['station_id'])); + + $sql = "INSERT INTO t_order_location ( + T_OrderLocationT_OrderHeaderID, + T_OrderLocationM_LocationID, + T_OrderLocationT_SampleStationID, + T_OrderLocationIsActive, + T_OrderLocationCreated, + T_OrderLocationLastUpdated, + T_OrderLocationUserID + ) + VALUES (?,?,?,'Y',NOW(),NOW(),?)"; + $query = $this->db_onedev->query($sql, array($value['order_id'], $value['location_id'], $value['station_id'], $userid)); + } + $this->sys_ok(["datas" => '']); + } else { + $this->sys_error_db("data not valid", $this->db_onedev); + exit; } } @@ -701,8 +701,8 @@ class Payment extends MY_Controller } } - function insert_voucher_payment($orderheaderID, $paymentID, $companyID, $mouID, $userID) - { + function insert_voucher_payment($orderheaderID, $paymentID, $companyID, $mouID, $userID) + { $sql = "INSERT INTO f_payment_voucher( F_Payment_VoucherT_OrderHeaderID, @@ -714,44 +714,66 @@ class Payment extends MY_Controller ) VALUES (?, ?, ?, ?, NOW(), ?) "; $query = $this->db_onedev->query($sql, array($orderheaderID, $paymentID, $companyID, $mouID, $userID)); - if (!$query) { - $this->sys_error_db("error inserta f payment voucher"); - exit; - } - } - - function lookup_print_transaction() - { - if (! $this->isLogin) { - $this->sys_error("Invalid Token"); - exit; - } - - $prm = $this->sys_input; - $startId = isset($prm['start_id']) && intval($prm['start_id']) > 0 ? intval($prm['start_id']) : 15; - $endId = isset($prm['end_id']) && intval($prm['end_id']) > 0 ? intval($prm['end_id']) : 25; - - if ($startId > $endId) { - $tmp = $startId; - $startId = $endId; - $endId = $tmp; - } - - $sql = "SELECT * - FROM print_transaction - WHERE Print_TransactionID >= ? AND Print_TransactionID <= ? - ORDER BY Print_TransactionID ASC"; - $query = $this->db_onedev->query($sql, array($startId, $endId)); - if ($query) { - $rows = $query->result_array(); - $result = array( - "total" => count($rows), - "records" => $rows - ); - $this->sys_ok($result); - } else { - $this->sys_error_db("lookup_print_transaction", $this->db_onedev); - exit; - } - } -} + if (!$query) { + $this->sys_error_db("error inserta f payment voucher"); + exit; + } + } + + function lookup_print_transaction() + { + if (! $this->isLogin) { + $this->sys_error("Invalid Token"); + exit; + } + + $prm = $this->sys_input; + $startId = isset($prm['start_id']) && intval($prm['start_id']) > 0 ? intval($prm['start_id']) : 15; + $endId = isset($prm['end_id']) && intval($prm['end_id']) > 0 ? intval($prm['end_id']) : 25; + + if ($startId > $endId) { + $tmp = $startId; + $startId = $endId; + $endId = $tmp; + } + + $sql = "SELECT * + FROM print_transaction + WHERE Print_TransactionID >= ? AND Print_TransactionID <= ? + ORDER BY Print_TransactionID ASC"; + $query = $this->db_onedev->query($sql, array($startId, $endId)); + if ($query) { + $rows = $query->result_array(); + $result = array( + "total" => count($rows), + "records" => $rows + ); + $this->sys_ok($result); + } else { + $this->sys_error_db("lookup_print_transaction", $this->db_onedev); + exit; + } + } + + function get_print_transaction_fo_kk_ina() + { + if (! $this->isLogin) { + $this->sys_error("Invalid Token"); + exit; + } + + $sql = "SELECT * FROM print_transaction WHERE Print_TransactionCode = 'FO-KK-INA'"; + $query = $this->db_onedev->query($sql); + if ($query) { + $rows = $query->result_array(); + $result = array( + "total" => count($rows), + "records" => $rows + ); + $this->sys_ok($result); + } else { + $this->sys_error_db("get_print_transaction_fo_kk_ina", $this->db_onedev); + exit; + } + } +}