diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 69e0a264..efcdb99c 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -17,6 +17,7 @@ class TransactionResource extends JsonResource public function toArray($request) { $booking = (int)$this->type === TransactionType::BILL ? $this->owner->owner : $this->booking; + $days = Carbon::parse($this->created_at)->addDays($booking->service_id === 1 ? 1 : 2); return [ 'id' => $this->id, @@ -41,8 +42,8 @@ class TransactionResource extends JsonResource 'expires_on' => Carbon::parse($this->expires_on)->format('d-m-Y h:i:s A'), 'updated_at' => Carbon::parse($this->updated_at)->format('d-m-Y h:i:s A'), 'interval' => [ - 'value' => (Carbon::parse($this->created_at)->addDays(3)->gt(Carbon::now()) ) ? '+' : '-' , - 'duration' => Carbon::parse($this->created_at)->addDays(3)->diff(Carbon::now())->format('%d'), + 'value' => $days->gt(Carbon::now()) ? '+' : '-', + 'duration' => $days->diff(Carbon::now())->format('%d'), ] ]; } diff --git a/resources/assets/vue/components/bookings/elements/PaymentProofComponent.vue b/resources/assets/vue/components/bookings/elements/PaymentProofComponent.vue index 97480ac0..59484c81 100644 --- a/resources/assets/vue/components/bookings/elements/PaymentProofComponent.vue +++ b/resources/assets/vue/components/bookings/elements/PaymentProofComponent.vue @@ -28,6 +28,12 @@ {{item.booking.company.reference}} +