From 88cf72eb75e45773c4d8d4b28306ed40c8a5b082 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Tue, 18 Oct 2022 10:44:15 +0800 Subject: [PATCH] fix invoice complete bug --- .../Billplzs/ControllersLogic/CallbackBillplzLogic.php | 2 +- .../ControllersLogic/ApprovePaymentTransactionLogic.php | 6 +++--- .../paymentsBilling/forms/PaymentFormComponent.vue | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php index 4b6aab57..85c9fe77 100644 --- a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php +++ b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php @@ -103,7 +103,7 @@ class CallbackBillplzLogic $this->updatesTransactionStatus->execute($transaction, ApprovalStatus::APPROVED); - if($transaction->amount - $invoice->amount < 0.01) { + if(($invoice->amount - $transaction->amount) < 0.01) { $this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED); $packingList->status = ApprovalStatus::APPROVED; diff --git a/app/Classes/Modules/Transactions/ControllersLogic/ApprovePaymentTransactionLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/ApprovePaymentTransactionLogic.php index 5fc9cc78..82924a35 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/ApprovePaymentTransactionLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/ApprovePaymentTransactionLogic.php @@ -81,7 +81,7 @@ class ApprovePaymentTransactionLogic extends AbstractControllerLogic $status = $request->route('status'); $transaction = $this->fetchesTransaction->execute(['id' => $request->route('transaction_id')]); - + $status === 'approve' ? $this->approvesDocument->execute($transaction->documents()->first()) : $this->rejectsDocument->execute($transaction->documents()->first()); $this->updatesTransactionStatus->execute($transaction, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED); @@ -90,7 +90,7 @@ class ApprovePaymentTransactionLogic extends AbstractControllerLogic $invoice = $transaction->owner; $packingList = $invoice->owner; - if($transaction->amount - $invoice->amount < 0.01) { + if(($invoice->amount - $transaction->amount) < 0.01) { $this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED); $packingList->status = ApprovalStatus::APPROVED; @@ -108,4 +108,4 @@ class ApprovePaymentTransactionLogic extends AbstractControllerLogic return $this->response([]); } -} \ No newline at end of file +} diff --git a/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue index 54a900e1..f61ac040 100644 --- a/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue @@ -17,7 +17,7 @@
- +