Added tax support

This commit is contained in:
2026-08-10 13:45:55 +02:00
parent 6b33c1b4dd
commit b3bbeb5b0b
18 changed files with 749 additions and 11 deletions
+8 -1
View File
@@ -4,6 +4,7 @@ namespace App\Resources;
use App\Enumerations\ParticipationFeeType;
use App\Enumerations\ParticipationType;
use App\Enumerations\VatPricingMode;
use App\Models\Event;
use App\ValueObjects\Amount;
use DateTime;
@@ -342,7 +343,13 @@ class EventResource extends JsonResource{
$basicFee = $basicFee->multiply(0.5);
}
return $basicFee;
// Bei bestehender USt-Pflicht und Netto-Preismodus die USt aufschlagen; gespeichert wird immer der
// finale Brutto-Betrag. Bei "inklusive" oder ohne Steuerpflicht bleibt der Beitrag unverändert.
if ($this->event->tax_liable && $this->event->vat_pricing_mode === VatPricingMode::AddOn->value) {
$basicFee = $basicFee->multiply(1 + $this->event->vat_rate / 100);
}
return new Amount(round($basicFee->getAmount(), 2), 'Euro');
}
}