fix insert date downpayment dan branchcode receive order asset
This commit is contained in:
@@ -786,8 +786,8 @@ class PurchaseOrderAset extends MY_Controller {
|
||||
$PurchaseOrderID,
|
||||
$para['supplierID'],
|
||||
$summary_downpayment ?: 0.00,
|
||||
$para['contractStart'],
|
||||
$para['contractStart'],
|
||||
$para['contractDate'],
|
||||
$para['contractDate'],
|
||||
'Draft',
|
||||
$user['M_UserID'],
|
||||
$user['M_UserID']
|
||||
|
||||
@@ -791,26 +791,28 @@ class ReceiveItemPOAsset extends MY_Controller
|
||||
|
||||
// insert table ro #
|
||||
$sqlInsRO = 'INSERT INTO receive_order_po (
|
||||
ReceiveOrderPoNumber,
|
||||
ReceiveOrderPoSupplierID,
|
||||
ReceiveOrderPoIDate,
|
||||
ReceiveOrderPoWarehouseID,
|
||||
ReceiveOrderPoM_BranchCode,
|
||||
ReceiveOrderPoS_RegionalID,
|
||||
ReceiveOrderShippingCostAmount,
|
||||
ReceiveOrderShippingCostIsPaid,
|
||||
ReceiveOrderPoNote,
|
||||
ReceiveOrderPoRefNumber,
|
||||
ReceiveOrderPoDONumber,
|
||||
ReceiveOrderPoTypePurchase,
|
||||
ReceiveOrderPoCreatedUserID
|
||||
) VALUE (?,?,?,?,?,?,?,?,?,?,?,?,?)';
|
||||
ReceiveOrderPoNumber,
|
||||
ReceiveOrderPoSupplierID,
|
||||
ReceiveOrderPoIDate,
|
||||
ReceiveOrderPoWarehouseID,
|
||||
ReceiveOrderPoM_BranchCode,
|
||||
ReceiveOrderPoS_RegionalID,
|
||||
ReceiveOrderShippingCostAmount,
|
||||
ReceiveOrderShippingCostIsPaid,
|
||||
ReceiveOrderPoNote,
|
||||
ReceiveOrderPoRefNumber,
|
||||
ReceiveOrderPoDONumber,
|
||||
ReceiveOrderPoTypePurchase,
|
||||
ReceiveOrderPoCreatedUserID
|
||||
)
|
||||
SELECT ?, ?, ?, ?, b.M_BranchCode, ?, ?, ?, ?, ?, ?, ?, ?
|
||||
FROM branch b
|
||||
WHERE b.M_BranchID = ?';
|
||||
$queInsRO = $this->db->query($sqlInsRO, [
|
||||
$numGR,
|
||||
$param['supplier'],
|
||||
$param['date'],
|
||||
$param['gudangID'],
|
||||
$user['M_BranchCode'],
|
||||
$user['S_RegionalID'],
|
||||
$param['shipping'],
|
||||
$param['shippingIsPaid'],
|
||||
@@ -819,6 +821,7 @@ class ReceiveItemPOAsset extends MY_Controller
|
||||
$param['reference'],
|
||||
'aset',
|
||||
$user['M_UserID'],
|
||||
$param['branchID']
|
||||
]);
|
||||
if (!$queInsRO) {
|
||||
$this->db->trans_rollback();
|
||||
@@ -958,26 +961,28 @@ class ReceiveItemPOAsset extends MY_Controller
|
||||
$roID = $param['ReceiveOrderPoID'];
|
||||
|
||||
// update receive order header #
|
||||
$sqlHeader = "UPDATE receive_order_po SET
|
||||
ReceiveOrderPoNumber = ?,
|
||||
ReceiveOrderPoSupplierID = ?,
|
||||
ReceiveOrderPoIDate = ?,
|
||||
ReceiveOrderPoWarehouseID = ?,
|
||||
ReceiveOrderPoM_BranchCode = ?,
|
||||
ReceiveOrderPoS_RegionalID = ?,
|
||||
ReceiveOrderShippingCostAmount = ?,
|
||||
ReceiveOrderShippingCostIsPaid = ?,
|
||||
ReceiveOrderPoNote = ?,
|
||||
ReceiveOrderPoRefNumber = ?,
|
||||
ReceiveOrderPoDONumber = ?
|
||||
WHERE ReceiveOrderPoID = ?
|
||||
AND ReceiveOrderPoIsActive = 'Y'";
|
||||
$sqlHeader = "UPDATE receive_order_po r
|
||||
JOIN branch b ON b.M_BranchID = ?
|
||||
SET
|
||||
r.ReceiveOrderPoNumber = ?,
|
||||
r.ReceiveOrderPoSupplierID = ?,
|
||||
r.ReceiveOrderPoIDate = ?,
|
||||
r.ReceiveOrderPoWarehouseID = ?,
|
||||
r.ReceiveOrderPoM_BranchCode = b.M_BranchCode,
|
||||
r.ReceiveOrderPoS_RegionalID = ?,
|
||||
r.ReceiveOrderShippingCostAmount = ?,
|
||||
r.ReceiveOrderShippingCostIsPaid = ?,
|
||||
r.ReceiveOrderPoNote = ?,
|
||||
r.ReceiveOrderPoRefNumber = ?,
|
||||
r.ReceiveOrderPoDONumber = ?
|
||||
WHERE r.ReceiveOrderPoID = ?
|
||||
AND r.ReceiveOrderPoIsActive = 'Y'";
|
||||
$queHeader = $this->db->query($sqlHeader, [
|
||||
$param['branchID'],
|
||||
$param['ReceiveOrderPoNumber'],
|
||||
$param['supplier'],
|
||||
$param['date'],
|
||||
$param['gudangID'],
|
||||
$user['M_BranchCode'],
|
||||
$user['S_RegionalID'],
|
||||
$param['shipping'],
|
||||
$param['shippingIsPaid'],
|
||||
@@ -1460,7 +1465,7 @@ class ReceiveItemPOAsset extends MY_Controller
|
||||
$diskon_proratapo = $besarDiskonPO / doubleval($data_po['totalAllPricePO']);
|
||||
|
||||
$ratioQty = (intval($elem['ReceiveOrderPoDetailQty']) / intval($elem['QtyAllPO']));
|
||||
$diskon_prorata_item = round($ratioQty * $diskon_proratapo,2);
|
||||
$diskon_prorata_item = round($ratioQty * $diskon_proratapo, 2);
|
||||
|
||||
$total_diskonpo = round($total_diskonpo + $diskon_prorata_item, 2);
|
||||
$input_diskon = [$diskon, $diskon_prorata_item];
|
||||
|
||||
@@ -98,7 +98,7 @@ class PurchaseInvoiceInstallment extends MY_Controller
|
||||
$row["SupplierInvoiceID"],
|
||||
$amount,
|
||||
$installDate,
|
||||
$dueDate,
|
||||
$installDate,
|
||||
$createdBy
|
||||
]);
|
||||
|
||||
|
||||
@@ -361,25 +361,25 @@ class PaymentV2 extends MY_Controller
|
||||
|
||||
// GET data bayar #
|
||||
$sql_databayar = "SELECT
|
||||
CONCAT('Jurnal Payment Invoice Nomor : ',
|
||||
SupplierPaymentNumber, DATE_FORMAT(now(),
|
||||
', Tanggal : %d-%m-%Y ')
|
||||
) AS jurnaltitle,
|
||||
CONCAT('Nomor pembayaran kasir : ',
|
||||
SupplierPaymentCashierNumber,
|
||||
' dan Nomor grup pembayaran : ',
|
||||
SupplierPaymentGroupNumber
|
||||
) AS jurnaldesc,
|
||||
SupplierPaymentNumber AS no_payinv,
|
||||
SupplierPaymentCashierNumber AS addonvalue,
|
||||
SupplierPaymentCoaID AS coaID,
|
||||
coaDescription,
|
||||
SupplierPaymentAmount AS amount,
|
||||
SupplierPaymentRounding AS rounding,
|
||||
(SupplierPaymentAmount + SupplierPaymentRounding) AS bayar
|
||||
FROM supplier_payment
|
||||
JOIN coa ON coaID = SupplierPaymentCoaID
|
||||
WHERE SupplierPaymentID = ?";
|
||||
CONCAT('Jurnal Payment Invoice Nomor : ',
|
||||
SupplierPaymentNumber, DATE_FORMAT(now(),
|
||||
', Tanggal : %d-%m-%Y ')
|
||||
) AS jurnaltitle,
|
||||
CONCAT('Nomor pembayaran kasir : ',
|
||||
SupplierPaymentCashierNumber,
|
||||
' dan Nomor grup pembayaran : ',
|
||||
SupplierPaymentGroupNumber
|
||||
) AS jurnaldesc,
|
||||
SupplierPaymentNumber AS no_payinv,
|
||||
SupplierPaymentCashierNumber AS addonvalue,
|
||||
SupplierPaymentCoaID AS coaID,
|
||||
coaDescription,
|
||||
SupplierPaymentAmount AS amount,
|
||||
SupplierPaymentRounding AS rounding,
|
||||
(SupplierPaymentAmount + SupplierPaymentRounding) AS bayar
|
||||
FROM supplier_payment
|
||||
JOIN coa ON coaID = SupplierPaymentCoaID
|
||||
WHERE SupplierPaymentID = ?";
|
||||
$que_databayar = $this->db->query($sql_databayar, [$param['orderid']]);
|
||||
if (!$que_databayar) {
|
||||
$this->db->trans_rollback();
|
||||
@@ -441,10 +441,6 @@ class PaymentV2 extends MY_Controller
|
||||
];
|
||||
}
|
||||
|
||||
// "PI Cicilan Aset - {$invoiceNumber}";
|
||||
$description = '';
|
||||
// "Jurnal cicilan ke-{$cicilanKe} dari {$totalCicilan} | {$namaKontrak} | PO: {$nomorPO} | Periode {$periode}";
|
||||
|
||||
switch ($param['type']) {
|
||||
case 'DP':
|
||||
$data_bayar['jurnaltitle'] .= " | Pembayaran Uang Muka Aset - {$param['dpkode']}";
|
||||
|
||||
Reference in New Issue
Block a user