CoolCMS API

SellerTaxStatusLookup
in package

FinalYes

Pure seller VAT status timeline rules (no I/O).

The repository loads every status row of one seller; this helper decides:

  • findStatusOn(): the row with the newest valid_from <= date; none = null (status missing),
  • resolveUseVatOn(): the legacy "charges VAT" bool of the facade — payer → true, identified / non-payer → false; no history at all → the flat use_vat safety net; history starting later → null.

Dates are compared as Y-m-d strings (a DATE column, no timezone shift).

Tags
phpstan-type

SellerTaxStatusRow array{validFrom: string, vatStatus: string}

Table of Contents

Methods

findStatusOn()  : array{validFrom: string, vatStatus: string}|null
resolveUseVatOn()  : bool|null

Methods

findStatusOn()

public static findStatusOn(array<int, array{validFrom: string, vatStatus: string}> $rows, DateTimeInterface $date) : array{validFrom: string, vatStatus: string}|null
Parameters
$rows : array<int, array{validFrom: string, vatStatus: string}>
$date : DateTimeInterface
Return values
array{validFrom: string, vatStatus: string}|null

resolveUseVatOn()

public static resolveUseVatOn(array<int, array{validFrom: string, vatStatus: string}> $rows, bool $flatUseVat, DateTimeInterface $date) : bool|null
Parameters
$rows : array<int, array{validFrom: string, vatStatus: string}>
$flatUseVat : bool
$date : DateTimeInterface
Return values
bool|null
On this page

Search results