Compare commits
29 Commits
main
...
feat/inv-c
| Author | SHA1 | Date | |
|---|---|---|---|
| 33666a2f5f | |||
| b29ba9f225 | |||
| c83c42698a | |||
| 009aff7d44 | |||
| 6dbe0e400b | |||
| 0ea56f09fa | |||
| a6412c9688 | |||
| bcb553ea56 | |||
| 2874fab71d | |||
| 752c372c2f | |||
| c125289b92 | |||
| fe5e6dd6cb | |||
| 5fd6db863a | |||
| fc9947bce4 | |||
| c296d5598b | |||
| 5bd8e038fc | |||
| 8f07a65485 | |||
| 7e88cf247b | |||
| 7af9fb2ca4 | |||
| 77fc97e964 | |||
| b7a00bc242 | |||
| 834f23f26e | |||
| dc88589c78 | |||
| 3871a680dd | |||
| 13af691645 | |||
| 775a390bcb | |||
| 9c87e9ce25 | |||
| 0d1dcb1b5e | |||
| 22719de06f |
113
application/controllers/map/InventarisCoaMapping.http
Normal file
113
application/controllers/map/InventarisCoaMapping.http
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
@token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJNX1VzZXJJRCI6IjM4MCIsIk1fVXNlclVzZXJuYW1lIjoicmVnc2J5IiwiTV9Vc2VyR3JvdXBEYXNoYm9hcmQiOiJvbmUtdWlcL3Rlc3RcL3Z1ZXhcL2FjYy1vbmUtanVybmFsXC8iLCJNX1VzZXJEZWZhdWx0VF9TYW1wbGVTdGF0aW9uSUQiOiIwIiwiTV9TdGFmZk5hbWUiOiJTdGFmZiBSZWdpb25hbCIsImlzX2NvdXJpZXIiOiJOIiwidGltZV9hdXRvbG9nb3V0IjoiMTIwIiwiTV9Vc2VyTG9jYXRpb25JRCI6IjM3IiwiTV9Vc2VyTG9jYXRpb25GbGFnIjoiUiIsIlNfUmVnaW9uYWxOYW1lIjoiU3VyYWJheWEgUmF5YSIsIlNfUmVnaW9uYWxJRCI6IjYiLCJNX0JyYW5jaE5hbWUiOiIiLCJNX0JyYW5jaENvZGUiOiIiLCJNX0JyYW5jaElEIjoiMCIsImxvZ2luTGV2ZWwiOiJyZWdpb25hbCIsIk1fQnJhbmNoQ29tcGFueUlEIjoiMSIsIk1fQnJhbmNoQ29tcGFueU5hbWUiOiJQVCBQUkFNSVRBIiwiaXAiOiIxMzkuMTk1LjEyMi4yMzUiLCJhZ2VudCI6Ik1vemlsbGFcLzUuMCAoWDExOyBMaW51eCB4ODZfNjQ7IHJ2OjEzNy4wKSBHZWNrb1wvMjAxMDAxMDEgRmlyZWZveFwvMTM3LjAiLCJ2ZXJzaW9uIjoidjIiLCJsYXN0LWxvZ2luIjoiMjAyNS0wNi0wNCAxMzoyMDowNSIsIk1fU2F0ZWxsaXRlSUQiOjB9.hm6JtstjaQOzb7oDSXQ-oMWuX_jFQZH-HDr3r3OzPac"
|
||||||
|
|
||||||
|
@host = accone.aplikasi.web.id/one-api
|
||||||
|
|
||||||
|
###
|
||||||
|
// create inventaris coa mapping
|
||||||
|
POST https://{{host}}/map/InventarisCoaMapping/createInvCoaMapping/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"M_InventarisGolID": 1,
|
||||||
|
"CoaInventarisID": 101,
|
||||||
|
"CoaHutangID": 102,
|
||||||
|
"CoaPembelianID": 103,
|
||||||
|
"CoaBebanPenyusutanID": 104,
|
||||||
|
"CoaAkumulasiPenyusutanID": 105,
|
||||||
|
"CoaLabaPelepasanID": 106,
|
||||||
|
"CoaRugiPelepasanID": 107
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// get inventaris coa mapping by ID
|
||||||
|
POST https://{{host}}/map/InventarisCoaMapping/getInvCoaMapping/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"M_InventarisCoaMappingID": 1
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// edit inventaris coa mapping
|
||||||
|
POST https://{{host}}/map/InventarisCoaMapping/editInvCoaMapping/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"M_InventarisCoaMappingID": 1,
|
||||||
|
"M_InventarisGolID": 2,
|
||||||
|
"CoaInventarisID": 201,
|
||||||
|
"CoaHutangID": 202,
|
||||||
|
"CoaPembelianID": 203,
|
||||||
|
"CoaBebanPenyusutanID": 204,
|
||||||
|
"CoaAkumulasiPenyusutanID": 205,
|
||||||
|
"CoaLabaPelepasanID": 206,
|
||||||
|
"CoaRugiPelepasanID": 207
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// delete inventaris coa mapping
|
||||||
|
POST https://{{host}}/map/InventarisCoaMapping/deleteInvCoaMapping/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"M_InventarisCoaMappingID": 1
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// create inventaris item coa mapping
|
||||||
|
POST https://{{host}}/map/InventarisCoaMapping/createInvItemCoaMapping/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"M_ItemID": 10,
|
||||||
|
"CoaInventarisID": 201,
|
||||||
|
"CoaHutangID": 202,
|
||||||
|
"CoaPembelianID": 203,
|
||||||
|
"CoaBebanPenyusutanID": 204,
|
||||||
|
"CoaAkumulasiPenyusutanID": 205,
|
||||||
|
"CoaLabaPelepasanID": 206,
|
||||||
|
"CoaRugiPelepasanID": 207
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// get inventaris item coa mapping by ID
|
||||||
|
POST https://{{host}}/map/InventarisCoaMapping/getInvItemCoaMapping/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"M_InventarisItemCoaMappingID": 1
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// edit inventaris item coa mapping
|
||||||
|
POST https://{{host}}/map/InventarisCoaMapping/editInvItemCoaMapping/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"M_InventarisItemCoaMappingID": 1,
|
||||||
|
"M_ItemID": 11,
|
||||||
|
"CoaInventarisID": 301,
|
||||||
|
"CoaHutangID": 302,
|
||||||
|
"CoaPembelianID": 303,
|
||||||
|
"CoaBebanPenyusutanID": 304,
|
||||||
|
"CoaAkumulasiPenyusutanID": 305,
|
||||||
|
"CoaLabaPelepasanID": 306,
|
||||||
|
"CoaRugiPelepasanID": 307
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// delete inventaris item coa mapping
|
||||||
|
POST https://{{host}}/map/InventarisCoaMapping/deleteInvItemCoaMapping/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"M_InventarisItemCoaMappingID": 1
|
||||||
|
}
|
||||||
361
application/controllers/map/InventarisCoaMapping.php
Normal file
361
application/controllers/map/InventarisCoaMapping.php
Normal file
@@ -0,0 +1,361 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class InventarisCoaMapping extends MY_Controller {
|
||||||
|
var $db;
|
||||||
|
public function index() {
|
||||||
|
echo "Inventaris COA Mapping API";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
## MUTATIONS ##
|
||||||
|
public function createInvCoaMapping() {
|
||||||
|
try {
|
||||||
|
if (!$this->isLogin) {
|
||||||
|
$this->sys_error("invalid token");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->trans_begin();
|
||||||
|
|
||||||
|
$para = $this->sys_input;
|
||||||
|
$user = $this->sys_user;
|
||||||
|
|
||||||
|
$sql = "INSERT INTO m_inventaris_coa_mapping (
|
||||||
|
M_InventarisCoaMappingM_InventarisGolID,
|
||||||
|
M_InventarisCoaMappingCoaInventarisID,
|
||||||
|
M_InventarisCoaMappingCoaHutangID,
|
||||||
|
M_InventarisCoaMappingCoaPembelianID,
|
||||||
|
M_InventarisCoaMappingCoaBebanPenyusutanID,
|
||||||
|
M_InventarisCoaMappingCoaAkumulasiPenyusutanID,
|
||||||
|
M_InventarisCoaMappingCoaLabaPelepasanID,
|
||||||
|
M_InventarisCoaMappingCoaRugiPelepasanID,
|
||||||
|
M_InventarisCoaMappingCreatedUserID,
|
||||||
|
M_InventarisCoaMappingCreated,
|
||||||
|
M_InventarisCoaMappingLastUpdated
|
||||||
|
) VALUES (?,?,?,?,?,?,?,?,?,NOW(),NOW())";
|
||||||
|
$query = $this->db->query($sql, [
|
||||||
|
$para['M_InventarisGolID'],
|
||||||
|
$para['CoaInventarisID'],
|
||||||
|
$para['CoaHutangID'],
|
||||||
|
$para['CoaPembelianID'],
|
||||||
|
$para['CoaBebanPenyusutanID'],
|
||||||
|
$para['CoaAkumulasiPenyusutanID'],
|
||||||
|
$para['CoaLabaPelepasanID'],
|
||||||
|
$para['CoaRugiPelepasanID'],
|
||||||
|
$user['M_UserID']
|
||||||
|
]);
|
||||||
|
if (!$query) {
|
||||||
|
$this->db->trans_rollback();
|
||||||
|
$this->sys_error_db("[Error] insert into table m_inventaris_coa_mapping");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$insertID = $this->db->insert_id();
|
||||||
|
|
||||||
|
$this->db->trans_commit();
|
||||||
|
$this->sys_ok($insertID);
|
||||||
|
} catch (Exception $exc) {
|
||||||
|
$msg = $exc->getMessage();
|
||||||
|
$this->sys_error($msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
## QUERY ##
|
||||||
|
public function getInvCoaMapping() {
|
||||||
|
try {
|
||||||
|
if (!$this->isLogin) {
|
||||||
|
$this->sys_error("invalid token");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$para = $this->sys_input;
|
||||||
|
|
||||||
|
$sql = "SELECT
|
||||||
|
M_InventarisCoaMappingID,
|
||||||
|
M_InventarisCoaMappingM_InventarisGolID,
|
||||||
|
M_InventarisCoaMappingCoaInventarisID,
|
||||||
|
M_InventarisCoaMappingCoaHutangID,
|
||||||
|
M_InventarisCoaMappingCoaPembelianID,
|
||||||
|
M_InventarisCoaMappingCoaBebanPenyusutanID,
|
||||||
|
M_InventarisCoaMappingCoaAkumulasiPenyusutanID,
|
||||||
|
M_InventarisCoaMappingCoaLabaPelepasanID,
|
||||||
|
M_InventarisCoaMappingCoaRugiPelepasanID,
|
||||||
|
M_InventarisCoaMappingCreatedUserID,
|
||||||
|
M_InventarisCoaMappingCreated,
|
||||||
|
M_InventarisCoaMappingLastUpdated
|
||||||
|
FROM m_inventaris_coa_mapping
|
||||||
|
WHERE M_InventarisCoaMappingIsActive = 'Y'
|
||||||
|
AND M_InventarisCoaMappingID = ?";
|
||||||
|
$query = $this->db->query($sql, [$para['M_InventarisCoaMappingID']]);
|
||||||
|
if (!$query) {
|
||||||
|
$this->sys_error_db("[Error] get data m_inventaris_coa_mapping");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$data = $query->row_array();
|
||||||
|
|
||||||
|
$this->sys_ok($data);
|
||||||
|
} catch (Exception $exc) {
|
||||||
|
$msg = $exc->getMessage();
|
||||||
|
$this->sys_error($msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
## MUTATIONS ##
|
||||||
|
public function editInvCoaMapping() {
|
||||||
|
try {
|
||||||
|
if (!$this->isLogin) {
|
||||||
|
$this->sys_error("invalid token");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->trans_begin();
|
||||||
|
|
||||||
|
$para = $this->sys_input;
|
||||||
|
$user = $this->sys_user;
|
||||||
|
|
||||||
|
$sql = "UPDATE m_inventaris_coa_mapping SET
|
||||||
|
M_InventarisCoaMappingM_InventarisGolID = ?,
|
||||||
|
M_InventarisCoaMappingCoaInventarisID = ?,
|
||||||
|
M_InventarisCoaMappingCoaHutangID = ?,
|
||||||
|
M_InventarisCoaMappingCoaPembelianID = ?,
|
||||||
|
M_InventarisCoaMappingCoaBebanPenyusutanID = ?,
|
||||||
|
M_InventarisCoaMappingCoaAkumulasiPenyusutanID = ?,
|
||||||
|
M_InventarisCoaMappingCoaLabaPelepasanID = ?,
|
||||||
|
M_InventarisCoaMappingCoaRugiPelepasanID = ?,
|
||||||
|
M_InventarisCoaMappingLastUpdated = NOW()
|
||||||
|
WHERE M_InventarisCoaMappingIsActive = 'Y'
|
||||||
|
AND M_InventarisCoaMappingID = ?";
|
||||||
|
$query = $this->db->query($sql, [
|
||||||
|
$para['M_InventarisGolID'],
|
||||||
|
$para['CoaInventarisID'],
|
||||||
|
$para['CoaHutangID'],
|
||||||
|
$para['CoaPembelianID'],
|
||||||
|
$para['CoaBebanPenyusutanID'],
|
||||||
|
$para['CoaAkumulasiPenyusutanID'],
|
||||||
|
$para['CoaLabaPelepasanID'],
|
||||||
|
$para['CoaRugiPelepasanID'],
|
||||||
|
$para['M_InventarisCoaMappingID']
|
||||||
|
]);
|
||||||
|
if (!$query) {
|
||||||
|
$this->db->trans_rollback();
|
||||||
|
$this->sys_error_db("[Error] update table m_inventaris_coa_mapping");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->trans_commit();
|
||||||
|
$this->sys_ok("[Success] update data inventaris coa mapping");
|
||||||
|
} catch (Exception $exc) {
|
||||||
|
$msg = $exc->getMessage();
|
||||||
|
$this->sys_error($msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteInvCoaMapping() {
|
||||||
|
try {
|
||||||
|
if (!$this->isLogin) {
|
||||||
|
$this->sys_error("invalid token");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->trans_begin();
|
||||||
|
|
||||||
|
$para = $this->sys_input;
|
||||||
|
|
||||||
|
$sql = "UPDATE m_inventaris_coa_mapping SET
|
||||||
|
M_InventarisCoaMappingIsActive = 'N',
|
||||||
|
M_InventarisCoaMappingLastUpdated = NOW()
|
||||||
|
WHERE M_InventarisCoaMappingIsActive = 'Y'
|
||||||
|
AND M_InventarisCoaMappingID = ?";
|
||||||
|
$query = $this->db->query($sql, [$para['M_InventarisCoaMappingID']]);
|
||||||
|
if (!$query) {
|
||||||
|
$this->db->trans_rollback();
|
||||||
|
$this->sys_error_db("[Error] soft delete data m_inventaris_coa_mapping");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->trans_commit();
|
||||||
|
$this->sys_ok("[Success] delete data inventaris coa mapping");
|
||||||
|
} catch (Exception $exc) {
|
||||||
|
$msg = $exc->getMessage();
|
||||||
|
$this->sys_error($msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
## MUTATIONS ITEM ##
|
||||||
|
public function createInvItemCoaMapping() {
|
||||||
|
try {
|
||||||
|
if (!$this->isLogin) {
|
||||||
|
$this->sys_error("invalid token");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->trans_begin();
|
||||||
|
|
||||||
|
$para = $this->sys_input;
|
||||||
|
$user = $this->sys_user;
|
||||||
|
|
||||||
|
$sql = "INSERT INTO m_inventaris_item_coa_mapping (
|
||||||
|
M_InventarisItemCoaMappingM_ItemID,
|
||||||
|
M_InventarisItemCoaMappingCoaInventarisID,
|
||||||
|
M_InventarisItemCoaMappingCoaHutangID,
|
||||||
|
M_InventarisItemCoaMappingCoaPembelianID,
|
||||||
|
M_InventarisItemCoaMappingCoaBebanPenyusutanID,
|
||||||
|
M_InventarisItemCoaMappingCoaAkumulasiPenyusutanID,
|
||||||
|
M_InventarisItemCoaMappingCoaLabaPelepasanID,
|
||||||
|
M_InventarisItemCoaMappingCoaRugiPelepasanID,
|
||||||
|
M_InventarisItemCoaMappingCreatedUserID,
|
||||||
|
M_InventarisItemCoaMappingCreated,
|
||||||
|
M_InventarisItemCoaMappingLastUpdated
|
||||||
|
) VALUES (?,?,?,?,?,?,?,?,?,NOW(),NOW())";
|
||||||
|
$query = $this->db->query($sql, [
|
||||||
|
$para['M_ItemID'],
|
||||||
|
$para['CoaInventarisID'],
|
||||||
|
$para['CoaHutangID'],
|
||||||
|
$para['CoaPembelianID'],
|
||||||
|
$para['CoaBebanPenyusutanID'],
|
||||||
|
$para['CoaAkumulasiPenyusutanID'],
|
||||||
|
$para['CoaLabaPelepasanID'],
|
||||||
|
$para['CoaRugiPelepasanID'],
|
||||||
|
$user['M_UserID']
|
||||||
|
]);
|
||||||
|
if (!$query) {
|
||||||
|
$this->db->trans_rollback();
|
||||||
|
$this->sys_error_db("[Error] insert into table m_inventaris_item_coa_mapping");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$insertID = $this->db->insert_id();
|
||||||
|
|
||||||
|
$this->db->trans_commit();
|
||||||
|
$this->sys_ok($insertID);
|
||||||
|
} catch (Exception $exc) {
|
||||||
|
$msg = $exc->getMessage();
|
||||||
|
$this->sys_error($msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
## QUERY ITEM ##
|
||||||
|
public function getInvItemCoaMapping() {
|
||||||
|
try {
|
||||||
|
if (!$this->isLogin) {
|
||||||
|
$this->sys_error("invalid token");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$para = $this->sys_input;
|
||||||
|
|
||||||
|
$sql = "SELECT
|
||||||
|
M_InventarisItemCoaMappingID,
|
||||||
|
M_InventarisItemCoaMappingM_ItemID,
|
||||||
|
M_InventarisItemCoaMappingCoaInventarisID,
|
||||||
|
M_InventarisItemCoaMappingCoaHutangID,
|
||||||
|
M_InventarisItemCoaMappingCoaPembelianID,
|
||||||
|
M_InventarisItemCoaMappingCoaBebanPenyusutanID,
|
||||||
|
M_InventarisItemCoaMappingCoaAkumulasiPenyusutanID,
|
||||||
|
M_InventarisItemCoaMappingCoaLabaPelepasanID,
|
||||||
|
M_InventarisItemCoaMappingCoaRugiPelepasanID,
|
||||||
|
M_InventarisItemCoaMappingCreatedUserID,
|
||||||
|
M_InventarisItemCoaMappingCreated,
|
||||||
|
M_InventarisItemCoaMappingLastUpdated
|
||||||
|
FROM m_inventaris_item_coa_mapping
|
||||||
|
WHERE M_InventarisItemCoaMappingIsActive = 'Y'
|
||||||
|
AND M_InventarisItemCoaMappingID = ?";
|
||||||
|
$query = $this->db->query($sql, [$para['M_InventarisItemCoaMappingID']]);
|
||||||
|
if (!$query) {
|
||||||
|
$this->sys_error_db("[Error] get data m_inventaris_item_coa_mapping");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$data = $query->row_array();
|
||||||
|
|
||||||
|
$this->sys_ok($data);
|
||||||
|
} catch (Exception $exc) {
|
||||||
|
$msg = $exc->getMessage();
|
||||||
|
$this->sys_error($msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
## MUTATIONS ITEM ##
|
||||||
|
public function editInvItemCoaMapping() {
|
||||||
|
try {
|
||||||
|
if (!$this->isLogin) {
|
||||||
|
$this->sys_error("invalid token");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->trans_begin();
|
||||||
|
|
||||||
|
$para = $this->sys_input;
|
||||||
|
$user = $this->sys_user;
|
||||||
|
|
||||||
|
$sql = "UPDATE m_inventaris_item_coa_mapping SET
|
||||||
|
M_InventarisItemCoaMappingM_ItemID = ?,
|
||||||
|
M_InventarisItemCoaMappingCoaInventarisID = ?,
|
||||||
|
M_InventarisItemCoaMappingCoaHutangID = ?,
|
||||||
|
M_InventarisItemCoaMappingCoaPembelianID = ?,
|
||||||
|
M_InventarisItemCoaMappingCoaBebanPenyusutanID = ?,
|
||||||
|
M_InventarisItemCoaMappingCoaAkumulasiPenyusutanID = ?,
|
||||||
|
M_InventarisItemCoaMappingCoaLabaPelepasanID = ?,
|
||||||
|
M_InventarisItemCoaMappingCoaRugiPelepasanID = ?,
|
||||||
|
M_InventarisItemCoaMappingLastUpdated = NOW()
|
||||||
|
WHERE M_InventarisItemCoaMappingIsActive = 'Y'
|
||||||
|
AND M_InventarisItemCoaMappingID = ?";
|
||||||
|
$query = $this->db->query($sql, [
|
||||||
|
$para['M_ItemID'],
|
||||||
|
$para['CoaInventarisID'],
|
||||||
|
$para['CoaHutangID'],
|
||||||
|
$para['CoaPembelianID'],
|
||||||
|
$para['CoaBebanPenyusutanID'],
|
||||||
|
$para['CoaAkumulasiPenyusutanID'],
|
||||||
|
$para['CoaLabaPelepasanID'],
|
||||||
|
$para['CoaRugiPelepasanID'],
|
||||||
|
$para['M_InventarisItemCoaMappingID']
|
||||||
|
]);
|
||||||
|
if (!$query) {
|
||||||
|
$this->db->trans_rollback();
|
||||||
|
$this->sys_error_db("[Error] update table m_inventaris_item_coa_mapping");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->trans_commit();
|
||||||
|
$this->sys_ok("[Success] update data inventaris item coa mapping");
|
||||||
|
} catch (Exception $exc) {
|
||||||
|
$msg = $exc->getMessage();
|
||||||
|
$this->sys_error($msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteInvItemCoaMapping() {
|
||||||
|
try {
|
||||||
|
if (!$this->isLogin) {
|
||||||
|
$this->sys_error("invalid token");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->trans_begin();
|
||||||
|
|
||||||
|
$para = $this->sys_input;
|
||||||
|
|
||||||
|
$sql = "UPDATE m_inventaris_item_coa_mapping SET
|
||||||
|
M_InventarisItemCoaMappingIsActive = 'N',
|
||||||
|
M_InventarisItemCoaMappingLastUpdated = NOW()
|
||||||
|
WHERE M_InventarisItemCoaMappingIsActive = 'Y'
|
||||||
|
AND M_InventarisItemCoaMappingID = ?";
|
||||||
|
$query = $this->db->query($sql, [$para['M_InventarisItemCoaMappingID']]);
|
||||||
|
if (!$query) {
|
||||||
|
$this->db->trans_rollback();
|
||||||
|
$this->sys_error_db("[Error] soft delete data m_inventaris_item_coa_mapping");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->trans_commit();
|
||||||
|
$this->sys_ok("[Success] delete data inventaris item coa mapping");
|
||||||
|
} catch (Exception $exc) {
|
||||||
|
$msg = $exc->getMessage();
|
||||||
|
$this->sys_error($msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -172,6 +172,302 @@ Content-Type: application/json
|
|||||||
"ID": ""
|
"ID": ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// upload attachment — requires multipart/form-data with file(s)
|
||||||
|
// Gunakan REST Client atau Postman. Contoh format:
|
||||||
|
// POST https://{{host}}/mockup/purchase/order/PurchaseOrderAset/uploadAttachment/
|
||||||
|
// Content-Type: multipart/form-data; boundary=----boundary
|
||||||
|
//
|
||||||
|
// ------boundary
|
||||||
|
// Content-Disposition: form-data; name="token"
|
||||||
|
//
|
||||||
|
// eyJ...
|
||||||
|
// ------boundary
|
||||||
|
// Content-Disposition: form-data; name="ponumber"
|
||||||
|
//
|
||||||
|
// PO24070001
|
||||||
|
// ------boundary
|
||||||
|
// Content-Disposition: form-data; name="poID"
|
||||||
|
//
|
||||||
|
// 1
|
||||||
|
// ------boundary
|
||||||
|
// Content-Disposition: form-data; name="contractID"
|
||||||
|
//
|
||||||
|
// 1
|
||||||
|
// ------boundary
|
||||||
|
// Content-Disposition: form-data; name="files"; filename="foto1.jpg"
|
||||||
|
// Content-Type: image/jpeg
|
||||||
|
//
|
||||||
|
// < /path/to/foto1.jpg
|
||||||
|
// ------boundary
|
||||||
|
// Content-Disposition: form-data; name="files"; filename="foto2.jpg"
|
||||||
|
// Content-Type: image/jpeg
|
||||||
|
//
|
||||||
|
// < /path/to/foto2.jpg
|
||||||
|
// ------boundary--
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}}
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// listing po asset
|
||||||
|
POST https://{{host}}/mockup/purchase/order/PurchaseOrderAset/getDaftarPoAset/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"search": "",
|
||||||
|
"currpage": 1,
|
||||||
|
"startdate": "2026-01-01",
|
||||||
|
"enddate": "2026-12-31",
|
||||||
|
"status": "All"
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// get daftar attachment
|
||||||
|
POST https://{{host}}/mockup/purchase/order/PurchaseOrderAset/getDaftarAttachment/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"contractID": 1,
|
||||||
|
"poID": 1
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// update approval PO — verifikasi manager (level 1)
|
||||||
|
POST https://{{host}}/mockup/purchase/order/PurchaseOrderAset/updateApprovalPO/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"poID": 1,
|
||||||
|
"approvelevel": "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// get data kontrak po asset
|
||||||
|
POST https://{{host}}/mockup/purchase/order/PurchaseOrderAset/getDataKontrakPoAset/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"poID": 1
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// create po asset
|
||||||
|
POST https://{{host}}/mockup/purchase/order/PurchaseOrderAset/createPoAsset/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"podate": "2026-07-09",
|
||||||
|
"reference": "REF-ASSET-001",
|
||||||
|
"supplierID": 1,
|
||||||
|
"typepajak": "nominal",
|
||||||
|
"valuepajak": 0,
|
||||||
|
"typediskon": "nominal",
|
||||||
|
"valuediskon": 0,
|
||||||
|
"catatan": "PO Asset Test",
|
||||||
|
"summary": {
|
||||||
|
"subtotal": 775000000,
|
||||||
|
"diskon": 37500000,
|
||||||
|
"pajak": 81125000,
|
||||||
|
"total": 818625000
|
||||||
|
},
|
||||||
|
"detail": [
|
||||||
|
{
|
||||||
|
"M_ItemID": 123,
|
||||||
|
"ItemUnitID": 1,
|
||||||
|
"RequestQty": 2,
|
||||||
|
"SupplierPrice": 75000000,
|
||||||
|
"TempTotal": 150000000,
|
||||||
|
"DiskonType": "R",
|
||||||
|
"DiskonAmount": 0,
|
||||||
|
"detail": [
|
||||||
|
{
|
||||||
|
"PurchaseRequestID": 1,
|
||||||
|
"PurchaseRequestDetailID": 1,
|
||||||
|
"PurchaseRequestFlagID": 1,
|
||||||
|
"M_ItemID": 123,
|
||||||
|
"ItemUnitID": 1,
|
||||||
|
"OriginalQty": 2,
|
||||||
|
"RequestQty": 2,
|
||||||
|
"SupplierPrice": 75000000
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"M_ItemID": 124,
|
||||||
|
"ItemUnitID": 2,
|
||||||
|
"RequestQty": 5,
|
||||||
|
"SupplierPrice": 25000000,
|
||||||
|
"TempTotal": 125000000,
|
||||||
|
"DiskonType": "P",
|
||||||
|
"DiskonAmount": 10,
|
||||||
|
"detail": [
|
||||||
|
{
|
||||||
|
"PurchaseRequestID": 2,
|
||||||
|
"PurchaseRequestDetailID": 2,
|
||||||
|
"PurchaseRequestFlagID": 2,
|
||||||
|
"M_ItemID": 124,
|
||||||
|
"ItemUnitID": 2,
|
||||||
|
"OriginalQty": 3,
|
||||||
|
"RequestQty": 3,
|
||||||
|
"SupplierPrice": 25000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"PurchaseRequestID": 2,
|
||||||
|
"PurchaseRequestDetailID": 3,
|
||||||
|
"PurchaseRequestFlagID": 3,
|
||||||
|
"M_ItemID": 124,
|
||||||
|
"ItemUnitID": 2,
|
||||||
|
"OriginalQty": 2,
|
||||||
|
"RequestQty": 2,
|
||||||
|
"SupplierPrice": 25000000
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"M_ItemID": 125,
|
||||||
|
"ItemUnitID": 1,
|
||||||
|
"RequestQty": 1,
|
||||||
|
"SupplierPrice": 500000000,
|
||||||
|
"TempTotal": 500000000,
|
||||||
|
"DiskonType": "R",
|
||||||
|
"DiskonAmount": 25000000,
|
||||||
|
"detail": [
|
||||||
|
{
|
||||||
|
"PurchaseRequestID": 3,
|
||||||
|
"PurchaseRequestDetailID": 4,
|
||||||
|
"PurchaseRequestFlagID": 4,
|
||||||
|
"M_ItemID": 125,
|
||||||
|
"ItemUnitID": 1,
|
||||||
|
"OriginalQty": 1,
|
||||||
|
"RequestQty": 1,
|
||||||
|
"SupplierPrice": 500000000
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"assetAttachmentID": null,
|
||||||
|
"contractName": "Kontrak Pengadaan Mesin X",
|
||||||
|
"contractDate": "2026-07-09",
|
||||||
|
"contractStart": "2026-07-09",
|
||||||
|
"contractEnd": "2027-07-09",
|
||||||
|
"contractDuration": 12,
|
||||||
|
"installmentNumber": 12,
|
||||||
|
"installmentDate": 1,
|
||||||
|
"installmentPayAmount": 12500000,
|
||||||
|
"installmentDownPaymentType": "nominal",
|
||||||
|
"installmentDownPayment": 5000000
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// edit po asset
|
||||||
|
POST https://{{host}}/mockup/purchase/order/PurchaseOrderAset/editPoAsset/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"PurchaseOrderID": 1,
|
||||||
|
"PurchaseOrderAssetContractID": 1,
|
||||||
|
"podate": "2026-07-09",
|
||||||
|
"reference": "REF-ASSET-001-UPDATED",
|
||||||
|
"supplierID": 1,
|
||||||
|
"typepajak": "percent",
|
||||||
|
"valuepajak": 11,
|
||||||
|
"typediskon": "nominal",
|
||||||
|
"valuediskon": 0,
|
||||||
|
"catatan": "PO Asset Updated",
|
||||||
|
"summary": {
|
||||||
|
"subtotal": 775000000,
|
||||||
|
"diskon": 0,
|
||||||
|
"pajak": 85250000,
|
||||||
|
"total": 860250000
|
||||||
|
},
|
||||||
|
"detail": [
|
||||||
|
{
|
||||||
|
"M_ItemID": 123,
|
||||||
|
"ItemUnitID": 1,
|
||||||
|
"RequestQty": 3,
|
||||||
|
"SupplierPrice": 75000000,
|
||||||
|
"TempTotal": 225000000,
|
||||||
|
"DiskonType": "R",
|
||||||
|
"DiskonAmount": 0,
|
||||||
|
"detail": [
|
||||||
|
{
|
||||||
|
"PurchaseRequestID": 1,
|
||||||
|
"PurchaseRequestDetailID": 1,
|
||||||
|
"PurchaseRequestFlagID": 1,
|
||||||
|
"M_ItemID": 123,
|
||||||
|
"ItemUnitID": 1,
|
||||||
|
"OriginalQty": 3,
|
||||||
|
"RequestQty": 3,
|
||||||
|
"SupplierPrice": 75000000
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"M_ItemID": 124,
|
||||||
|
"ItemUnitID": 2,
|
||||||
|
"RequestQty": 5,
|
||||||
|
"SupplierPrice": 25000000,
|
||||||
|
"TempTotal": 125000000,
|
||||||
|
"DiskonType": "R",
|
||||||
|
"DiskonAmount": 0,
|
||||||
|
"detail": [
|
||||||
|
{
|
||||||
|
"PurchaseRequestID": 2,
|
||||||
|
"PurchaseRequestDetailID": 2,
|
||||||
|
"PurchaseRequestFlagID": 2,
|
||||||
|
"M_ItemID": 124,
|
||||||
|
"ItemUnitID": 2,
|
||||||
|
"OriginalQty": 3,
|
||||||
|
"RequestQty": 3,
|
||||||
|
"SupplierPrice": 25000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"PurchaseRequestID": 2,
|
||||||
|
"PurchaseRequestDetailID": 3,
|
||||||
|
"PurchaseRequestFlagID": 3,
|
||||||
|
"M_ItemID": 124,
|
||||||
|
"ItemUnitID": 2,
|
||||||
|
"OriginalQty": 2,
|
||||||
|
"RequestQty": 2,
|
||||||
|
"SupplierPrice": 25000000
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"assetAttachmentID": 1,
|
||||||
|
"contractName": "Kontrak Pengadaan Mesin X - Revisi",
|
||||||
|
"contractDate": "2026-07-10",
|
||||||
|
"contractStart": "2026-07-10",
|
||||||
|
"contractEnd": "2027-10-10",
|
||||||
|
"contractDuration": 15,
|
||||||
|
"installmentNumber": 15,
|
||||||
|
"installmentDate": 5,
|
||||||
|
"installmentPayAmount": 15000000,
|
||||||
|
"installmentDownPaymentType": "persen",
|
||||||
|
"installmentDownPayment": 20
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// delete po asset
|
||||||
|
POST https://{{host}}/mockup/purchase/order/PurchaseOrderAset/deletePoAsset/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"poID": 1,
|
||||||
|
"contractID": 1,
|
||||||
|
"ponumber": "PO24070001"
|
||||||
|
}
|
||||||
|
|
||||||
### Test isValidMultiple Warehouse
|
### Test isValidMultiple Warehouse
|
||||||
### Should return True karena UnitRequest = UnitPurchase
|
### Should return True karena UnitRequest = UnitPurchase
|
||||||
GET https://{{host}}/mockup/purchase/order/PurchaseOrder/isValidMultipleWarehouse/
|
GET https://{{host}}/mockup/purchase/order/PurchaseOrder/isValidMultipleWarehouse/
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1946,18 +1946,18 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// insert stockid barcode barang
|
// insert stockid barcode barang
|
||||||
$sql_update_barcode = "UPDATE t_barcode_barang SET
|
// $sql_update_barcode = "UPDATE t_barcode_barang SET
|
||||||
T_BarcodeBarangStockID = ?
|
// T_BarcodeBarangStockID = ?
|
||||||
WHERE T_BarcodeBarangReceiveOrderPoDetailID = ?";
|
// WHERE T_BarcodeBarangReceiveOrderPoDetailID = ?";
|
||||||
$qry_update_barcode = $this->db->query($sql_update_barcode, [
|
// $qry_update_barcode = $this->db->query($sql_update_barcode, [
|
||||||
$stock_ID,
|
// $stock_ID,
|
||||||
$detail['ReceiveOrderPoDetailID']
|
// $detail['ReceiveOrderPoDetailID']
|
||||||
]);
|
// ]);
|
||||||
if (!$qry_update_barcode) {
|
// if (!$qry_update_barcode) {
|
||||||
$this->db->trans_rollback();
|
// $this->db->trans_rollback();
|
||||||
$this->sys_error_db("[Error] update barcode stockID", $this->db);
|
// $this->sys_error_db("[Error] update barcode stockID", $this->db);
|
||||||
exit;
|
// exit;
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
$sql_insert_stock = "INSERT INTO stock (
|
$sql_insert_stock = "INSERT INTO stock (
|
||||||
StockWarehouseAlmariID,
|
StockWarehouseAlmariID,
|
||||||
@@ -1990,18 +1990,18 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
$stock_qty_end = intval($batch['qty']);
|
$stock_qty_end = intval($batch['qty']);
|
||||||
|
|
||||||
// insert stockid barcode barang
|
// insert stockid barcode barang
|
||||||
$sql_update_barcode = "UPDATE t_barcode_barang SET
|
// $sql_update_barcode = "UPDATE t_barcode_barang SET
|
||||||
T_BarcodeBarangStockID = ?
|
// T_BarcodeBarangStockID = ?
|
||||||
WHERE T_BarcodeBarangReceiveOrderPoDetailID = ?";
|
// WHERE T_BarcodeBarangReceiveOrderPoDetailID = ?";
|
||||||
$qry_update_barcode = $this->db->query($sql_update_barcode, [
|
// $qry_update_barcode = $this->db->query($sql_update_barcode, [
|
||||||
$stockID,
|
// $stockID,
|
||||||
$detail['ReceiveOrderPoDetailID']
|
// $detail['ReceiveOrderPoDetailID']
|
||||||
]);
|
// ]);
|
||||||
if (!$qry_update_barcode) {
|
// if (!$qry_update_barcode) {
|
||||||
$this->db->trans_rollback();
|
// $this->db->trans_rollback();
|
||||||
$this->sys_error_db("[Error] update barcode stockID", $this->db);
|
// $this->sys_error_db("[Error] update barcode stockID", $this->db);
|
||||||
exit;
|
// exit;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert stock card
|
// insert stock card
|
||||||
@@ -2736,6 +2736,47 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
|
|
||||||
$barcodeID = $this->db->insert_id();
|
$barcodeID = $this->db->insert_id();
|
||||||
|
|
||||||
|
# check if item already in stock #
|
||||||
|
$sql_cekstock = "SELECT StockID
|
||||||
|
FROM stock
|
||||||
|
JOIN warehouse ON WarehouseID = StockWarehouseID
|
||||||
|
AND WarehouseIsActive = 'Y'
|
||||||
|
WHERE WarehouseM_BranchID = ?
|
||||||
|
AND StockItemID = ?
|
||||||
|
AND StockItemUnitID = ?";
|
||||||
|
$que_cekstock = $this->db->query($sql_cekstock, [
|
||||||
|
$user['M_BranchID'],
|
||||||
|
$item['ReceiveOrderPoItemID'],
|
||||||
|
$item['ReceiveOrderPoItemUnitID'],
|
||||||
|
]);
|
||||||
|
if (!$que_cekstock) {
|
||||||
|
$this->db->trans_rollback();
|
||||||
|
$this->sys_error_db("[Error] query cek stock");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$stockID = $que_cekstock->row_array()['StockID'];
|
||||||
|
|
||||||
|
# insert stock inventaris #
|
||||||
|
$sql_stockinventaris = "INSERT INTO stock_inventory (
|
||||||
|
StockInventoryStockID,
|
||||||
|
StockInventoryRuanganID,
|
||||||
|
StockInventoryBarcode,
|
||||||
|
StockInventoryBranchID,
|
||||||
|
StockInventoryCreatedUserID
|
||||||
|
) VALUES (?,?,?,?,?)";
|
||||||
|
$que_stockinventaris = $this->db->query($sql_stockinventaris, [
|
||||||
|
$stockID,
|
||||||
|
$param['ruanganID'],
|
||||||
|
$noBarcode,
|
||||||
|
$user['M_BranchID'],
|
||||||
|
$user['M_UserID']
|
||||||
|
]);
|
||||||
|
if (!$que_stockinventaris) {
|
||||||
|
$this->db->trans_rollback();
|
||||||
|
$this->sys_error_db("[Error] insert into table stock inventaris");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
# insert each inventory handover detail #
|
# insert each inventory handover detail #
|
||||||
$sql_insert_handover_detail = "INSERT INTO asset_handover_detail(
|
$sql_insert_handover_detail = "INSERT INTO asset_handover_detail(
|
||||||
AssetHandoverDetailAssetHandoverID,
|
AssetHandoverDetailAssetHandoverID,
|
||||||
|
|||||||
54
scripts/deploy-controllers.sh
Executable file
54
scripts/deploy-controllers.sh
Executable file
@@ -0,0 +1,54 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
REMOTE_HOST="accone.aplikasi.web.id"
|
||||||
|
LOCAL_PATH="application/controllers/"
|
||||||
|
REMOTE_PATH="/home/one/project/accone/one-api/application/controllers/"
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
if ! command -v rsync >/dev/null 2>&1; then
|
||||||
|
echo "rsync is required but was not found in PATH." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v ssh >/dev/null 2>&1; then
|
||||||
|
echo "ssh is required but was not found in PATH." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v awk >/dev/null 2>&1; then
|
||||||
|
echo "awk is required but was not found in PATH." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 <test|sync> [remote_user]" >&2
|
||||||
|
echo "Examples:" >&2
|
||||||
|
echo " $0 test" >&2
|
||||||
|
echo " $0 sync" >&2
|
||||||
|
echo " $0 test one" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
COMMAND="${1:-}"
|
||||||
|
REMOTE_USER="${2:-one}"
|
||||||
|
REMOTE="${REMOTE_USER}@${REMOTE_HOST}"
|
||||||
|
|
||||||
|
case "$COMMAND" in
|
||||||
|
test)
|
||||||
|
echo "Checking SSH connection to ${REMOTE}..."
|
||||||
|
ssh -o ConnectTimeout=10 "$REMOTE" "test -d '$REMOTE_PATH'"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Files/folders that would be uploaded:"
|
||||||
|
rsync -rzcin --out-format="%i %n%L" "$LOCAL_PATH" "${REMOTE}:${REMOTE_PATH}" \
|
||||||
|
| awk '$1 ~ /^</ || $1 ~ /^cd/ { print }'
|
||||||
|
;;
|
||||||
|
sync)
|
||||||
|
rsync -rzcv "$LOCAL_PATH" "${REMOTE}:${REMOTE_PATH}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
Reference in New Issue
Block a user