From f7c8f685203be3f3ffc3cab7e974c62bafef6295 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 20 Sep 2022 16:19:05 +0800 Subject: [PATCH] billing fix up --- .../Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php | 3 ++- .../components/paymentsBilling/forms/PaymentFormComponent.vue | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php index 9fec8bc6..5d9e2a16 100644 --- a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php +++ b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php @@ -99,9 +99,10 @@ class CallbackBillplzLogic $request->headers->set('Authorization', 'Bearer '.$token); $this->updatesTransactionStatus->execute($transaction, ApprovalStatus::APPROVED); +dd($transaction->amount >= $invoice->amount); if($transaction->amount >= $invoice->amount) { - $this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED); + $packingList->update(['status' => ApprovalStatus::APPROVED])->save(); if(app()->environment('production')){ $this->updateDoFromVTPortalProcessor->execute($packingList); $this->updateDoFromYDPortalProcessor->execute($packingList); diff --git a/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue index 8f02c823..620fc857 100644 --- a/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue @@ -91,6 +91,9 @@ error: '', } }, + create(){ + this.parameters.amount = (this.data.outstanding - this.parameters.amount) === 0 ? this.parameters.amount : this.parameters.amount + 0.01 + }, validations: { parameters : { amount: { required },