HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/wingssprayer.komma.pro/app/Vat/VatServiceInterface.php
<?php declare(strict_types=1);

namespace App\Vat;


use App\Orders\Models\Order;
use App\Products\ProductableInterface;
use App\Vat\Models\Rate;
use Komma\KMS\Sites\Models\Site;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection as DatabaseCollection;
use Illuminate\Database\Eloquent\Model;

/**
 * Class KmsUserService
 *
 * @package App\Users\Kms
 */
interface VatServiceInterface
{
    /**
     * This method will save an model
     *
     * @param $model Model or null
     * @param DatabaseCollection $sectionTabItems These must be filled with data. This is something you need to do yourself.
     *
     * @return mixed
     */
    public function saveModel(Model $model = null, DatabaseCollection $sectionTabItems): Model;

    /**
     * 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 Rate
     */
    public function getVatRate(): Rate;

    /**
     * Gets the vat rates for a certain site or the current one if your don't specify it.
     *
     * @param Site|null $site
     * @return Builder
     */
    public function vatRatesForSite(Site $site = null): Builder;

    /**
     * @param ProductableInterface $productable
     * @return ProductableInterface
     */
    public function calculateVatForProductable(ProductableInterface $productable);

    /**
     * Receives a price in cents and returns the price in cents including vat.
     *
     * @param float $exPriceInCents
     * @param Rate|null $rate 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, Rate $rate = 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 Rate|null $rate If you dont specify it, a default vat rate will be used.
     * @return int The price excluding vat.
     */
    public function calculateExVatRatePrice(float $incPriceInCents, Rate $rate = 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 $amount
     * @param Rate|null $rate If you dont specify it, a default vat rate will be used.
     * @return int
     */
    public function calculateVatRateAmountFromExAmount(float $amount, Rate $rate = 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 Rate|null $rate If you dont specify it, a default vat rate will be used.
     * @return int
     */
    public function calculateVatRateAmountFromIncAmount(float $incPriceInCents, Rate $rate = null): int;
}