diff --git a/app/Http/Resources/BookingResource.php b/app/Http/Resources/BookingResource.php index dd951fff..0eeb9670 100644 --- a/app/Http/Resources/BookingResource.php +++ b/app/Http/Resources/BookingResource.php @@ -46,6 +46,7 @@ class BookingResource extends JsonResource ], 'status' => $this->status, 'created_at' => Carbon::parse($this->created_at)->format('d-m-Y'), + 'created_at_with_time' => Carbon::parse($this->created_at)->format('d-m-Y h:i:s A'), $this->mergeWhen($this->relationLoaded('transactions'), [ 'purchase_order' => new TransactionResource($this->transactions()->where('type', TransactionType::PURCHASE_ORDER)->first()), 'payment_attempts' => TransactionResource::collection( diff --git a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue index ab0bb5c4..af43a8b7 100644 --- a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue +++ b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue @@ -4,16 +4,19 @@
-
+
Status
{{ item.status === 1 ? 'Pending Verification' : item.status === 4 ? 'Rejected' : 'Processing Payment'}}
+
+ {{ item.status === 1 ? 'Pending Verification' : item.status === 4 ? 'Rejected' : 'Processing Payment'}} +
-
Payment Amount
+
{{ item.type === 6 ? 'Refund' : 'Payment' }} Amount
{{item.currency.short_code}} {{(Math.round((item.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
@@ -25,7 +28,7 @@
-
+
@@ -176,7 +179,7 @@
-
+
@@ -186,102 +189,6 @@
- -
-
-
-
-
Refund Type:
-
-
-
- {{refundMethod.name}} -
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
Fully Refund
-
-
-
-
-
-
-
-
-
Partially Refund
-
-
-
-
-
-
-
-
-
-
-
-
- - - - -
-
-
-
-
{{''}}
-
-
-
-
-
-
- - - - -
-
-
-
-
{{''}}
-
-
-
-
-
-
-
- - -
-
-
-
-
- -
-
- -
-
-
-
@@ -292,41 +199,17 @@ data(){ return { expandPaymentDetails: false, - expandRefund: false, - refundMethod: { - name: 'Partially Refund', - status: false - }, amount: (Math.round(1000 * 100) / 100).toFixed(2), parameters: { amount: (Math.round(1000 * 100) / 100).toFixed(2), bank_id: 1 }, - expanded: false, section: 'bookingDetailSection', } }, methods: { - submitForm(){ - this.submit(this.route('api.booking.refund.create', this.data.booking.id, this.data.id), 'post', this.section, true, true); - }, - requestRefund(){ - this.expandRefund = !this.expandRefund; - this.expandPaymentDetails = !this.expandPaymentDetails; - }, clickExpand(){ - if (this.expandPaymentDetails === false && this.expandRefund === false) { - this.expandPaymentDetails = !this.expandPaymentDetails; - } else { - this.expandRefund = false; - this.expandPaymentDetails = false; - } - }, - updateRefundType(refund){ - this.refundMethod = { - name: refund.name, - status: !this.refundMethod.status - } + this.expandPaymentDetails = !this.expandPaymentDetails; }, }, mixins: [componentHandler] diff --git a/resources/assets/vue/components/bookings/elements/RefundVerificationComponent.vue b/resources/assets/vue/components/bookings/elements/RefundVerificationComponent.vue index b947f571..914cb47a 100644 --- a/resources/assets/vue/components/bookings/elements/RefundVerificationComponent.vue +++ b/resources/assets/vue/components/bookings/elements/RefundVerificationComponent.vue @@ -10,7 +10,13 @@
Date
- {{ data.booking.created_at }} + {{ data.booking.created_at_with_time }} +
+
+
+
reference
+
-
+
Amount
-
- {{ data.booking.amount }} +
+ {{(Math.round((data.booking.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
+
+
-
Reject
+
Reject
@@ -73,7 +81,7 @@
Cancel
-
Approve
+
Approve
@@ -98,13 +106,15 @@ export default { data() { return { - status: '' + parameters: { + status: null, + } } }, methods: { approveRefund(status){ this.isLoading = true; - this.status = status; + this.parameters.status = status; this.submit(this.route('api.transaction.refund.status.update', this.data.id), 'put', 'listRefundTransactionSection', true, true); }, }, diff --git a/resources/views/pages/dashboards/admin.blade.php b/resources/views/pages/dashboards/admin.blade.php index 256be0dd..40ffa8ff 100644 --- a/resources/views/pages/dashboards/admin.blade.php +++ b/resources/views/pages/dashboards/admin.blade.php @@ -83,7 +83,7 @@
- +