From 672cc5696b0767ef2cd541ee2a2265d14f95f9fa Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 13 Jul 2021 20:00:52 +0800 Subject: [PATCH] fix duplicated currency order booking for payments bug --- .../ControllersLogic/CreateSupplierTransactionLogic.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php index 054513af..86be847a 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php @@ -101,6 +101,9 @@ class CreateSupplierTransactionLogic extends AbstractControllerLogic /** @var Transaction $payment */ $payment = $this->fetchesTransaction->execute(['id' => $payment['id']]); + + if($payment->status !== ApprovalStatus::APPROVED) continue; + $this->updatesTransactionStatus->execute($payment, ApprovalStatus::COMPLETED); $billNumber = $this->generatesTransactionBillNumber->execute('SPLR-'); $object = new TransactionObject($billNumber, TransactionType::BILL, $supplier->id, 1,