Zum Inhalt springen

API reference / Quittio \ Core \ Dunning

DefaultInterest

final readonly class in quittio/core

Quittio\Core\Dunning\DefaultInterest · Source

Default interest of a late payment law: the reference rate plus the points of the DunningLaw (business or consumer debtors), split at every change of the reference rate, with the day count basis of the law; a fixed rate of the law for businesses or consumers instead, if it has one. The result goes into DocumentBuilder::interestCharge().

Methods#

MethodDescription
->__construct()
->calculate()Interest charges for an open amount from the first day of default until $until (exclusive).
->flatRate()Flat rate for business debtors (e.g. 40 EUR, EU late payment directive), once per claim.
::forCountry()Default interest with the reference rates and the dunning law of a country pack.

__construct()#

public function __construct(
    ReferenceRates|null $rates,
    DunningLaw $law,
    (Closure(BigDecimal $rate, BigDecimal $referenceRate, string $points, Date $from, Date $lastDay, string $locale): ?string)|null $describe = null,
)
ParameterTypeDescription
$ratesReferenceRates|nullnull for a law with fixed rates only (DunningLaw::hasFixedRates())
$lawDunningLaw
$describe(Closure(Brick\Math\BigDecimal $rate, Brick\Math\BigDecimal $referenceRate, string $points, Date $from, Date $lastDay, string $locale): ?string)|null = nulltext of a charge, e.g. "Verzugszinsen 9 Prozentpunkte über dem Basiszinssatz …"; null = no text

calculate()#

public function calculate(
    Money $amount,
    Date $from,
    Date $until,
    bool $consumer = false,
    string $locale = 'en',
): list<InterestCharge>

Interest charges for an open amount from the first day of default until $until (exclusive).

ParameterTypeDescription
$amountBrick\Money\Money
$fromDate
$untilDate
$consumerbool = false
$localestring = 'en'
Returns
list<InterestCharge>
Throws
ConfigurationException – without reference rates for a debtor whose rate is not fixed

flatRate()#

public function flatRate(string $currency = 'EUR'): ?Money

Flat rate for business debtors (e.g. 40 EUR, EU late payment directive), once per claim.

ParameterTypeDescription
$currencystring = 'EUR'
Returns
?Brick\Money\Money

forCountry()#

public static function forCountry(CountryPack $pack): self

static

Default interest with the reference rates and the dunning law of a country pack.

ParameterTypeDescription
$packCountryPack
Returns
self
Throws
ConfigurationException – for a pack without reference rates whose law has no fixed rates

Die Open-Core-Pakete stehen unter der MIT-Lizenz. Die rechtlichen Formulierungen der Länderpakete sind mit einer Steuerberatung abzustimmen.