From 28c0aeff77b7b4cf7ca0985be4f431b2832616c1 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Mon, 26 Feb 2024 00:38:25 +0800 Subject: [PATCH] dont show payment on homepage if it is in refund process --- .../Filters/DoesNotHaveRefundInProgress.php | 24 +++++++++++++++++++ .../SupplierPendingOrdersSectionComponent.vue | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 app/Classes/General/Eloquent/Filters/DoesNotHaveRefundInProgress.php diff --git a/app/Classes/General/Eloquent/Filters/DoesNotHaveRefundInProgress.php b/app/Classes/General/Eloquent/Filters/DoesNotHaveRefundInProgress.php new file mode 100644 index 00000000..60618626 --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/DoesNotHaveRefundInProgress.php @@ -0,0 +1,24 @@ +whereDoesntHave('transactions', function ($query) { + return $query->where('type', TransactionType::REFUND)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION]); + }); + } +} diff --git a/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue b/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue index fa345d58..8f6fb8c7 100644 --- a/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue +++ b/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue @@ -117,7 +117,7 @@
- + @@ -202,7 +202,7 @@ // todo-refund: activate this for partial refund // this.$refs.pendingOrdersList.updateFilters({per_page: 10000, status: 2, type: 1, original_currency_id_in: [this.selectedCurrency.id], transaction_service_id: this.selectedService.id, is_not_fully_refunded: true}); - this.$refs.pendingOrdersList.updateFilters({per_page: 10000, status: 2, type: 1, original_currency_id_in: [this.selectedCurrency.id], transaction_service_id: this.selectedService.id}); + this.$refs.pendingOrdersList.updateFilters({per_page: 10, status: 2, type: 1, original_currency_id_in: [this.selectedCurrency.id], transaction_service_id: this.selectedService.id, does_not_have_refund_in_progress: true}); this.selectedSupplier.status = false; this.currencyDropdownLaunch.status = false;