diff --git a/app/Http/Resources/BookingResource.php b/app/Http/Resources/BookingResource.php index 5d8b3836..9c6edf96 100644 --- a/app/Http/Resources/BookingResource.php +++ b/app/Http/Resources/BookingResource.php @@ -49,7 +49,7 @@ class BookingResource extends JsonResource 'marking' => $this->marking, 'amount' => $this->fix_amount, 'floating_amount' => floatval((App()->make(CalculatesBookingFloatingAmount::class))->execute($this->resource, $this->fix_currency_id)), - 'paid_amount_with_refund' => floatval((App()->make(CalculatesBookingPayableAmount::class))->execute($this->resource, $this->fix_currency_id)) - floatval((App()->make(CalculatesBookingRefundAmount::class))->execute($this->resource, $this->fix_currency_id)), + // 'paid_amount_with_refund' => floatval((App()->make(CalculatesBookingPayableAmount::class))->execute($this->resource, $this->fix_currency_id)) - floatval((App()->make(CalculatesBookingRefundAmount::class))->execute($this->resource, $this->fix_currency_id)), 'paid_amount' => floatval((App()->make(CalculatesBookingPayableAmount::class))->execute($this->resource, $this->fix_currency_id)), 'outstanding_amount_with_refund' => $outStandingAmountWithRefund > 0 ? $outStandingAmountWithRefund : 0, 'refunded_amount' => floatval((App()->make(CalculatesBookingRefundAmount::class))->execute($this->resource, $this->fix_currency_id)), diff --git a/resources/assets/vue/components/bookings/sections/BookingDetailsSectionComponent.vue b/resources/assets/vue/components/bookings/sections/BookingDetailsSectionComponent.vue index bc5f3dca..0e702efc 100644 --- a/resources/assets/vue/components/bookings/sections/BookingDetailsSectionComponent.vue +++ b/resources/assets/vue/components/bookings/sections/BookingDetailsSectionComponent.vue @@ -5,8 +5,8 @@
-
-
+
+
@@ -122,7 +122,7 @@
-
+
@@ -395,7 +395,7 @@
-
+
Regenerate E-Invoice
(Refund)
@@ -636,6 +636,28 @@ } return 'NOT PROVIDED'; }, + showDownloadPDFButtons(){ + const condition1 = !(this.booking.amount === 0 && this.booking.outstanding_amount === 0 && this.booking.paid_amount === 0); + const isBookingWithFullRefund = this.booking.payment_history.some(payment => + payment.status === 7 && this.booking.amount === payment.refunded_amount + ); + + return condition1 || isBookingWithFullRefund; + }, + showGenerateEInvoiceRefundButton(){ + const condition1 = this.booking.amount === 0 && this.booking.outstanding_amount === 0 && this.booking.paid_amount === 0 + && this.$store.getters.isSuperAdmin && this.booking.einvoice; + const isBookingWithFullRefund = this.booking.payment_history.some(payment => + payment.status === 7 && this.booking.amount === payment.refunded_amount + ); + return condition1 || isBookingWithFullRefund; + }, + isBookingWithAFullRefund(){ + const isBookingWithFullRefund = this.booking.payment_history.some(payment => + payment.status === 7 && this.booking.amount === payment.refunded_amount + ); + return isBookingWithFullRefund; + } }, watch: { pendingQueue(inComplete){