From b509099bf06314f92a684b9182274ec7c19d80d4 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 13 Jul 2021 20:09:10 +0800 Subject: [PATCH] fix duplicated currency order booking for payments bug --- .../ControllersLogic/CreateSupplierTransactionLogic.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php index 01e18b40..73f73d7d 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/CreateSupplierTransactionLogic.php @@ -102,7 +102,9 @@ class CreateSupplierTransactionLogic extends AbstractControllerLogic /** @var Transaction $payment */ $payment = $this->fetchesTransaction->execute(['id' => $payment['id']]); - if($payment->status !== ApprovalStatus::APPROVED) continue; + if($payment->status !== ApprovalStatus::APPROVED) { + continue; + } $this->updatesTransactionStatus->execute($payment, ApprovalStatus::COMPLETED); $billNumber = $this->generatesTransactionBillNumber->execute('SPLR-'); @@ -114,7 +116,9 @@ class CreateSupplierTransactionLogic extends AbstractControllerLogic $transactions[] = $this->createsTransaction->execute($payment->booking, $object); } - if(!count($transactions)) return $this->response([]); + if(!count($transactions)){ + return $this->response([]); + } $pdf = LaravelMpdf::loadView('pages.pdfs.currency_vendor_order', ['transactions' => $transactions, 'supplier' => $supplier]);