diff --git a/app/Classes/General/Eloquent/Filters/DoesNotHavePaymentStatusIn.php b/app/Classes/General/Eloquent/Filters/DoesNotHavePaymentStatusIn.php new file mode 100644 index 00000000..f8e9f214 --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/DoesNotHavePaymentStatusIn.php @@ -0,0 +1,22 @@ +whereDoesntHave('transactions', function (Builder $query) use($value) { + $query->where('type', TransactionType::PAYMENT)->whereIn('status', $value); + }); + } +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/HavePaymentStatusNotIn.php b/app/Classes/General/Eloquent/Filters/HavePaymentStatusNotIn.php new file mode 100644 index 00000000..0b989f73 --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/HavePaymentStatusNotIn.php @@ -0,0 +1,22 @@ +whereHas('transactions', function (Builder $query) use($value) { + $query->where('type', TransactionType::PAYMENT)->whereNotIn('status', $value); + }); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php index 1cca14f6..f674e67f 100644 --- a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php +++ b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php @@ -105,9 +105,14 @@ class CallbackBillplzLogic $token = Auth::fromUser(User::find(1)); $request->headers->set('Authorization', 'Bearer '.$token); + // check if is wallet top up + if($transaction->owner instanceof Wallet && $transaction->status !== ApprovalStatus::APPROVED) { + $this->updatesWalletBalance->execute($transaction->owner, $transaction->amount); + } + $this->updatesTransactionStatus->execute($transaction, $status); - if(($invoice->amount - $transaction->amount) < 0.01) { + if(($invoice->amount - $transaction->amount) < 0.01 && !$transaction->owner instanceof Wallet) { $this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED); $packingList->status = ApprovalStatus::APPROVED; diff --git a/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue b/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue index 4ebdffaa..b594b3a5 100644 --- a/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue +++ b/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue @@ -27,6 +27,22 @@ +
+
+
+ + +
+
+
+
+
Payment In Progress
+
+
+
@@ -52,12 +68,17 @@
- + +
+
+
+
+
- +
diff --git a/resources/assets/vue/components/paymentsBilling/elements/PaymentsBillingComponents.vue b/resources/assets/vue/components/paymentsBilling/elements/PaymentsBillingComponents.vue index b3c896b7..f00e8be4 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/PaymentsBillingComponents.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/PaymentsBillingComponents.vue @@ -23,6 +23,10 @@

Amount

MYR {{ item.amount.toFixed(2) }}
+
+

Payment Date

+
{{ item.payment_history[item.payment_history.length-1].created_at }}
+