Compare commits
12 Commits
main
...
c125289b92
| Author | SHA1 | Date | |
|---|---|---|---|
| c125289b92 | |||
| fe5e6dd6cb | |||
| 5fd6db863a | |||
| fc9947bce4 | |||
| c296d5598b | |||
| 5bd8e038fc | |||
| 8f07a65485 | |||
| b7a00bc242 | |||
| 13af691645 | |||
| 775a390bcb | |||
| 0d1dcb1b5e | |||
| 22719de06f |
@@ -172,6 +172,291 @@ 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
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// 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
@@ -1514,23 +1514,23 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
# GET DATA RO #
|
# GET DATA RO #
|
||||||
$json_ro_before = $this->getDataROPO($ROID);
|
$json_ro_before = $this->getDataROPO($ROID);
|
||||||
$sql_ro = "SELECT
|
$sql_ro = "SELECT
|
||||||
receive_order_po.*,
|
receive_order_po.*,
|
||||||
DATE_FORMAT(ReceiveOrderPoIDate, '%d-%m-%Y') AS formatedDate,
|
DATE_FORMAT(ReceiveOrderPoIDate, '%d-%m-%Y') AS formatedDate,
|
||||||
CASE
|
CASE
|
||||||
WHEN WarehouseType = 'B'
|
WHEN WarehouseType = 'B'
|
||||||
THEN CONCAT(WarehouseCode,' ', WarehouseName, ' - ', M_BranchName)
|
THEN CONCAT(WarehouseCode,' ', WarehouseName, ' - ', M_BranchName)
|
||||||
WHEN WarehouseType = 'R'
|
WHEN WarehouseType = 'R'
|
||||||
THEN CONCAT(WarehouseCode,' ', WarehouseName, ' - ', S_RegionalName)
|
THEN CONCAT(WarehouseCode,' ', WarehouseName, ' - ', S_RegionalName)
|
||||||
ELSE ''
|
ELSE ''
|
||||||
END WarehouseName,
|
END WarehouseName,
|
||||||
WarehouseID
|
WarehouseID
|
||||||
FROM receive_order_po
|
FROM receive_order_po
|
||||||
JOIN warehouse ON ReceiveOrderPoWarehouseID = WarehouseID
|
JOIN warehouse ON ReceiveOrderPoWarehouseID = WarehouseID
|
||||||
JOIN s_regional ON WarehouseS_RegionalID = S_RegionalID
|
JOIN s_regional ON WarehouseS_RegionalID = S_RegionalID
|
||||||
AND S_RegionalIsActive = 'Y'
|
AND S_RegionalIsActive = 'Y'
|
||||||
LEFT JOIN m_branch ON WarehouseM_BranchID = M_BranchID
|
LEFT JOIN m_branch ON WarehouseM_BranchID = M_BranchID
|
||||||
AND M_BranchIsActive = 'Y'
|
AND M_BranchIsActive = 'Y'
|
||||||
WHERE ReceiveOrderPoID = ?";
|
WHERE ReceiveOrderPoID = ?";
|
||||||
$que_ro = $this->db->query($sql_ro, [$ROID]);
|
$que_ro = $this->db->query($sql_ro, [$ROID]);
|
||||||
if (!$que_ro) {
|
if (!$que_ro) {
|
||||||
$this->db->trans_rollback();
|
$this->db->trans_rollback();
|
||||||
@@ -1545,23 +1545,23 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql_detail_ro = "SELECT
|
$sql_detail_ro = "SELECT
|
||||||
receive_order_po_detail.*,
|
receive_order_po_detail.*,
|
||||||
PurchaseOrderID,
|
PurchaseOrderID,
|
||||||
PurchaseOrderNumber,
|
PurchaseOrderNumber,
|
||||||
PurchaseOrderTaxPercentPph,
|
PurchaseOrderTaxPercentPph,
|
||||||
PurchaseOrderTaxPercentPpn,
|
PurchaseOrderTaxPercentPpn,
|
||||||
PurchaseOrderSummaryDiscountAmount as DiscountPerItem,
|
PurchaseOrderSummaryDiscountAmount as DiscountPerItem,
|
||||||
PurchaseOrderSummaryQty as QtyAllPO,
|
PurchaseOrderSummaryQty as QtyAllPO,
|
||||||
PurchaseOrderSummaryTotal as TotalAllPO,
|
PurchaseOrderSummaryTotal as TotalAllPO,
|
||||||
PurchaseOrderDiscountPercent AS DiscPOPercent,
|
PurchaseOrderDiscountPercent AS DiscPOPercent,
|
||||||
PurchaseOrderDiscountAmount AS DiscPORupiah
|
PurchaseOrderDiscountAmount AS DiscPORupiah
|
||||||
FROM receive_order_po_detail
|
FROM receive_order_po_detail
|
||||||
JOIN purchase_order ON ReceiveOrderPoDetailPurchaseOrderID = PurchaseOrderID
|
JOIN purchase_order ON ReceiveOrderPoDetailPurchaseOrderID = PurchaseOrderID
|
||||||
JOIN purchase_order_summary ON ReceiveOrderPoDetailPurchaseOrderSummaryID = PurchaseOrderSummaryID
|
JOIN purchase_order_summary ON ReceiveOrderPoDetailPurchaseOrderSummaryID = PurchaseOrderSummaryID
|
||||||
AND PurchaseOrderSummaryIsActive = 'Y'
|
AND PurchaseOrderSummaryIsActive = 'Y'
|
||||||
WHERE ReceiveOrderPoDetailReceiveOrderPoID = ?
|
WHERE ReceiveOrderPoDetailReceiveOrderPoID = ?
|
||||||
AND ReceiveOrderPoDetailIsActive='Y'
|
AND ReceiveOrderPoDetailIsActive='Y'
|
||||||
GROUP BY ReceiveOrderPoDetailID";
|
GROUP BY ReceiveOrderPoDetailID";
|
||||||
$que_detail_ro = $this->db->query($sql_detail_ro, [$ROID]);
|
$que_detail_ro = $this->db->query($sql_detail_ro, [$ROID]);
|
||||||
if (!$que_detail_ro) {
|
if (!$que_detail_ro) {
|
||||||
$this->db->trans_rollback();
|
$this->db->trans_rollback();
|
||||||
@@ -1572,10 +1572,10 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
|
|
||||||
# UPDATE STATUS RO #
|
# UPDATE STATUS RO #
|
||||||
$sql_update_ro = "UPDATE receive_order_po SET
|
$sql_update_ro = "UPDATE receive_order_po SET
|
||||||
ReceiveOrderPoConfirmed = 'Y',
|
ReceiveOrderPoConfirmed = 'Y',
|
||||||
ReceiveOrderPoConfirmedDate = NOW(),
|
ReceiveOrderPoConfirmedDate = NOW(),
|
||||||
ReceiveOrderPoConfirmedUserID = ?
|
ReceiveOrderPoConfirmedUserID = ?
|
||||||
WHERE ReceiveOrderPoID = ?";
|
WHERE ReceiveOrderPoID = ?";
|
||||||
$que_update_ro = $this->db->query($sql_update_ro, [$user['M_UserID'], $ROID]);
|
$que_update_ro = $this->db->query($sql_update_ro, [$user['M_UserID'], $ROID]);
|
||||||
if (!$que_update_ro) {
|
if (!$que_update_ro) {
|
||||||
$this->db->trans_rollback();
|
$this->db->trans_rollback();
|
||||||
@@ -1594,8 +1594,8 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
$jurnal_number = $que_jrnl_num->row_array()['numbering'];
|
$jurnal_number = $que_jrnl_num->row_array()['numbering'];
|
||||||
|
|
||||||
$sql_periode = "SELECT periodeID FROM periode
|
$sql_periode = "SELECT periodeID FROM periode
|
||||||
WHERE DATE(NOW()) BETWEEN periodeStartDate AND periodeEndDate
|
WHERE DATE(NOW()) BETWEEN periodeStartDate AND periodeEndDate
|
||||||
AND periodeIsActive= 'Y' AND periodeIsClosed = 'N'";
|
AND periodeIsActive= 'Y' AND periodeIsClosed = 'N'";
|
||||||
$que_periode = $this->db->query($sql_periode, []);
|
$que_periode = $this->db->query($sql_periode, []);
|
||||||
if (!$que_periode) {
|
if (!$que_periode) {
|
||||||
$this->sys_error_db("[Error] get periode", $this->db);
|
$this->sys_error_db("[Error] get periode", $this->db);
|
||||||
@@ -1631,17 +1631,17 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
|
|
||||||
# INSERT JURNAL HEADER #
|
# INSERT JURNAL HEADER #
|
||||||
$sql_head_jurnal = "INSERT INTO jurnal (
|
$sql_head_jurnal = "INSERT INTO jurnal (
|
||||||
jurnalM_BranchCompanyID,
|
jurnalM_BranchCompanyID,
|
||||||
JurnalS_RegionalID,
|
JurnalS_RegionalID,
|
||||||
jurnalM_BranchCode,
|
jurnalM_BranchCode,
|
||||||
jurnalperiodeID,
|
jurnalperiodeID,
|
||||||
jurnalNo,
|
jurnalNo,
|
||||||
jurnalTitle,
|
jurnalTitle,
|
||||||
jurnalDescription,
|
jurnalDescription,
|
||||||
jurnalDate,
|
jurnalDate,
|
||||||
jurnalJurnalTypeID,
|
jurnalJurnalTypeID,
|
||||||
jurnalM_UserID
|
jurnalM_UserID
|
||||||
) VALUES (?,?,?,?,?,?,?,NOW(),?,?)";
|
) VALUES (?,?,?,?,?,?,?,NOW(),?,?)";
|
||||||
$que_head_jurnal = $this->db->query($sql_head_jurnal, [
|
$que_head_jurnal = $this->db->query($sql_head_jurnal, [
|
||||||
$user['M_BranchCompanyID'],
|
$user['M_BranchCompanyID'],
|
||||||
$user['S_RegionalID'],
|
$user['S_RegionalID'],
|
||||||
@@ -1668,9 +1668,9 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
foreach ($data_detail_ro as $key => $detail) {
|
foreach ($data_detail_ro as $key => $detail) {
|
||||||
# UPDATE PO Summary #
|
# UPDATE PO Summary #
|
||||||
$sql_posummary = "UPDATE purchase_order_summary SET
|
$sql_posummary = "UPDATE purchase_order_summary SET
|
||||||
PurchaseOrderSummaryQtyReceived = PurchaseOrderSummaryQtyReceived + ?
|
PurchaseOrderSummaryQtyReceived = PurchaseOrderSummaryQtyReceived + ?
|
||||||
WHERE PurchaseOrderSummaryIsActive = 'Y'
|
WHERE PurchaseOrderSummaryIsActive = 'Y'
|
||||||
AND PurchaseOrderSummaryID = ?";
|
AND PurchaseOrderSummaryID = ?";
|
||||||
$que_posummary = $this->db->query($sql_posummary, [
|
$que_posummary = $this->db->query($sql_posummary, [
|
||||||
intval($detail['ReceiveOrderPoDetailQty']),
|
intval($detail['ReceiveOrderPoDetailQty']),
|
||||||
$detail['ReceiveOrderPoDetailPurchaseOrderSummaryID']
|
$detail['ReceiveOrderPoDetailPurchaseOrderSummaryID']
|
||||||
@@ -1862,8 +1862,8 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
|
|
||||||
// save diskon prorata
|
// save diskon prorata
|
||||||
$sql_save_diskon = "UPDATE receive_order_po_detail SET
|
$sql_save_diskon = "UPDATE receive_order_po_detail SET
|
||||||
ReceiveOrderPoDetailDiskonPoProrata = ?
|
ReceiveOrderPoDetailDiskonPoProrata = ?
|
||||||
WHERE ReceiveOrderPoDetailID = ?";
|
WHERE ReceiveOrderPoDetailID = ?";
|
||||||
$que_save_diskon = $this->db->query($sql_save_diskon, [
|
$que_save_diskon = $this->db->query($sql_save_diskon, [
|
||||||
$diskon_prorata_item,
|
$diskon_prorata_item,
|
||||||
$detail['ReceiveOrderPoDetailID']
|
$detail['ReceiveOrderPoDetailID']
|
||||||
@@ -1898,9 +1898,9 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
// update stock based on batch
|
// update stock based on batch
|
||||||
foreach ($batch_list as $key => $batch) {
|
foreach ($batch_list as $key => $batch) {
|
||||||
$sql_cek_stock = "SELECT *
|
$sql_cek_stock = "SELECT *
|
||||||
FROM stock s
|
FROM stock s
|
||||||
JOIN m_item i ON s.StockItemID = i.M_ItemID
|
JOIN m_item i ON s.StockItemID = i.M_ItemID
|
||||||
WHERE s.StockItemID = ?
|
WHERE s.StockItemID = ?
|
||||||
AND s.StockItemUnitID = ?
|
AND s.StockItemUnitID = ?
|
||||||
AND s.StockWarehouseID = ?
|
AND s.StockWarehouseID = ?
|
||||||
AND i.M_ItemItem_CategoryID = ?";
|
AND i.M_ItemItem_CategoryID = ?";
|
||||||
@@ -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
|
||||||
@@ -2095,14 +2095,14 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
// insert jurnal tx for GRNI
|
// insert jurnal tx for GRNI
|
||||||
$total_grni = round($total_debet - ($total_discount_item + $total_discount_po), 2) + $ship_cost;
|
$total_grni = round($total_debet - ($total_discount_item + $total_discount_po), 2) + $ship_cost;
|
||||||
$sql_grni = "INSERT INTO jurnal_tx (
|
$sql_grni = "INSERT INTO jurnal_tx (
|
||||||
jurnalTxJurnalID,
|
jurnalTxJurnalID,
|
||||||
jurnalTxCoaID,
|
jurnalTxCoaID,
|
||||||
jurnalTxDescription,
|
jurnalTxDescription,
|
||||||
jurnalTxDebit,
|
jurnalTxDebit,
|
||||||
jurnalTxCredit,
|
jurnalTxCredit,
|
||||||
jurnalTxM_UserID
|
jurnalTxM_UserID
|
||||||
) SELECT ?, coaID, coaDescription, 0, ?, ?
|
) SELECT ?, coaID, coaDescription, 0, ?, ?
|
||||||
FROM coa WHERE coaAccountNo = '2110100030' LIMIT 1";
|
FROM coa WHERE coaAccountNo = '2110100030' LIMIT 1";
|
||||||
$que_grni = $this->db->query($sql_grni, [$jurnal_ID, $total_grni, $user['M_UserID']]);
|
$que_grni = $this->db->query($sql_grni, [$jurnal_ID, $total_grni, $user['M_UserID']]);
|
||||||
if (!$que_grni) {
|
if (!$que_grni) {
|
||||||
$this->db->trans_rollback();
|
$this->db->trans_rollback();
|
||||||
@@ -2112,13 +2112,13 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
$grni_jurnal_id = $this->db->insert_id();
|
$grni_jurnal_id = $this->db->insert_id();
|
||||||
|
|
||||||
$sql_addon_grni = "INSERT INTO jurnal_addon (
|
$sql_addon_grni = "INSERT INTO jurnal_addon (
|
||||||
jurnalAddOnJurnalID,
|
jurnalAddOnJurnalID,
|
||||||
jurnalAddOnJurnalTxID,
|
jurnalAddOnJurnalTxID,
|
||||||
jurnalAddOnCode,
|
jurnalAddOnCode,
|
||||||
jurnalAddOnValue,
|
jurnalAddOnValue,
|
||||||
jurnalAddOnCreated,
|
jurnalAddOnCreated,
|
||||||
jurnalAddOnCreatedUserID
|
jurnalAddOnCreatedUserID
|
||||||
) VALUES (?,?,'RONUMB',?,NOW(),?)";
|
) VALUES (?,?,'RONUMB',?,NOW(),?)";
|
||||||
$que_addon_grni = $this->db->query($sql_addon_grni, [
|
$que_addon_grni = $this->db->query($sql_addon_grni, [
|
||||||
$jurnal_ID,
|
$jurnal_ID,
|
||||||
$grni_jurnal_id,
|
$grni_jurnal_id,
|
||||||
@@ -2344,22 +2344,22 @@ class ReceiveItemPoInventaris extends MY_Controller
|
|||||||
$this->db->trans_begin();
|
$this->db->trans_begin();
|
||||||
|
|
||||||
$sql_insert = "INSERT INTO receive_order_po_inspeksi (
|
$sql_insert = "INSERT INTO receive_order_po_inspeksi (
|
||||||
ReceiveOrderPoInspeksiReceiveOrderPoDetailID,
|
ReceiveOrderPoInspeksiReceiveOrderPoDetailID,
|
||||||
ReceiveOrderPoInspeksiQtyPesan,
|
ReceiveOrderPoInspeksiQtyPesan,
|
||||||
ReceiveOrderPoInspeksiQtyActual,
|
ReceiveOrderPoInspeksiQtyActual,
|
||||||
ReceiveOrderPoInspeksiPricePesan,
|
ReceiveOrderPoInspeksiPricePesan,
|
||||||
ReceiveOrderPoInspeksiPriceActual,
|
ReceiveOrderPoInspeksiPriceActual,
|
||||||
ReceiveOrderPoInspeksiDatePesan,
|
ReceiveOrderPoInspeksiDatePesan,
|
||||||
ReceiveOrderPoInspeksiDateActual,
|
ReceiveOrderPoInspeksiDateActual,
|
||||||
ReceiveOrderPoInspeksiExpireDate,
|
ReceiveOrderPoInspeksiExpireDate,
|
||||||
ReceiveOrderPoInspeksiKeadaanKemasan,
|
ReceiveOrderPoInspeksiKeadaanKemasan,
|
||||||
ReceiveOrderPoInspeksiKondisiPengiriman,
|
ReceiveOrderPoInspeksiKondisiPengiriman,
|
||||||
ReceiveOrderPoInspeksiSimpulan,
|
ReceiveOrderPoInspeksiSimpulan,
|
||||||
ReceiveOrderPoInspeksiCatatan,
|
ReceiveOrderPoInspeksiCatatan,
|
||||||
ReceiveOrderPoInspeksiStaffPenerima,
|
ReceiveOrderPoInspeksiStaffPenerima,
|
||||||
ReceiveOrderPoInspeksiStaffPengirim,
|
ReceiveOrderPoInspeksiStaffPengirim,
|
||||||
ReceiveOrderPoInspeksiUserID
|
ReceiveOrderPoInspeksiUserID
|
||||||
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||||
$que_insert = $this->db->query($sql_insert, [
|
$que_insert = $this->db->query($sql_insert, [
|
||||||
$ROdetailID,
|
$ROdetailID,
|
||||||
$inspeksi['qty_po'],
|
$inspeksi['qty_po'],
|
||||||
@@ -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