File: D:/HostingSpaces/SBogers10/shop.komma.nl/app/Vat/VatServiceInterface.php
<?php declare(strict_types=1);
namespace App\Vat;
use App\Orders\Models\Order;
use App\Products\AbstractProductable;
use App\Vat\Models\VatScenario;
use Illuminate\Support\Collection;
use Komma\KMS\Core\Attributes\Models\SelectOptionInterface;
/**
* Class KmsUserService
*
* @package App\Users\Kms
*/
interface VatServiceInterface
{
/**
* Calculates the orders vat amount for the current site and the total order price including vat.
* It fills the vat_amount and total_price (including vat) of an order.
*
* @param $order
*/
public function calculateOrderVatTotal(Order $order);
/**
* Returns the vat rate for the current site
*
* @return VatScenario
*/
public function getVatScenario(): VatScenario;
/**
* @param HasFinancialPropertiesInterface $hasFinancialProperties
* @return HasFinancialPropertiesInterface
*/
public function calculateVatForModelWithVatScenarioEnum(HasFinancialPropertiesInterface $hasFinancialProperties);
/**
* Receives a price in cents and returns the price in cents including vat.
*
* @param float $exPriceInCents
* @param VatScenario|null $vatScenario If you dont specify it, a default vat rate will be used.
*
* @return int The price including vat. The decimals represent fractions of cents.
*/
public function calculateIncVatRatePrice(float $exPriceInCents, VatScenario $vatScenario = null): int;
/**
* Receives a price in cents, that includes a given vat amount,
* and returns the price in cents without vat.
*
* @param float $incPriceInCents
* @param VatScenario|null $vatScenario If you dont specify it, a default vat rate will be used.
*
* @return int The price excluding vat.
*/
public function calculateExVatRatePrice(float $incPriceInCents, VatScenario $vatScenario = null): int;
/**
* Calculates the total amount of vat in cents for a certain given amount in cents.
* Warning! Rounds fractions of cents according to a rule in a config file.
*
* @param float $exPriceInCents
* @param VatScenario|null $vatScenario If you dont specify it, a default vat rate will be used.
*
* @return int
*/
public function calculateVatRateAmountFromExAmount(float $exPriceInCents, VatScenario $vatScenario = null): int;
/**
* Receives a price in cents, that includes a given vat amount, and returns the amount of vat in cents.
*
* @param float $incPriceInCents
* @param VatScenario|null $vatScenario If you dont specify it, a default vat rate will be used.
*
* @return int
*/
public function calculateVatRateAmountFromIncAmount(float $incPriceInCents, VatScenario $vatScenario = null): int;
/**
* Return a collection of SelectOptionInterface instances, representing available select options
*
* @see SelectOptionInterface
* @return Collection
*/
public function getVatScenariosForSelect(): Collection;
}