hasVerifiedVatId()) { return new self($domestic, false); } $vatId = $customer->normalisedVatId(); $country = substr($vatId, 0, 2); $seller = strtoupper((string) config('provisioning.tax.seller_country', 'AT')); // Reverse charge is an intra-EU business rule: it needs a member state // that is not ours, and a number that at least looks like one. $eligible = in_array($country, self::EU_MEMBER_STATES, true) && $country !== $seller && preg_match('/^[A-Z]{2}[0-9A-Z]{8,12}$/', $vatId) === 1; return $eligible ? new self(0.0, true) : new self($domestic, false); } public function grossCents(int $netCents): int { return (int) round($netCents * (1 + $this->rate)); } public function percentLabel(): string { return rtrim(rtrim(number_format($this->rate * 100, 1, ',', '.'), '0'), ','); } }