Added tax support
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user