, total: ?int, deposit: ?int, balance_due_on: ?string, price_adjustment: null, price_adjustment_label: null} */ public function columns(Property $property, CarbonImmutable $arrival, CarbonImmutable $departure, ?int $guests, ?int $portalTotal, ?string $channelName = null): array { if ($portalTotal === null) { return ['quote' => null, 'total' => null, 'deposit' => null, 'balance_due_on' => null, 'price_adjustment' => null, 'price_adjustment_label' => null]; } $label = self::LABEL.($channelName ? ' ('.$channelName.')' : ''); $quote = new PriceQuote( $arrival, $departure, (int) $guests, [new QuoteLine(QuoteLineType::Accommodation, $label, 1, $portalTotal, $portalTotal)], $property->deposit_percent, $arrival->subDays($property->balance_due_days_before_arrival), ); return [ 'quote' => [...$quote->toArray(), 'source' => 'portal'], 'total' => $quote->total(), 'deposit' => $quote->deposit(), 'balance_due_on' => $quote->balanceDueOn->toDateString(), 'price_adjustment' => null, 'price_adjustment_label' => null, ]; } }