Zum Inhalt springen

API reference / Quittio \ Core \ Documents

InterestCharge

final readonly class in quittio/core

Quittio\Core\Documents\InterestCharge · Source

Default interest on an open amount for a period (simple interest).

The period runs from $from (first day with interest, inclusive) to $until (exclusive): interest from 2026-02-01 until 2026-03-01 covers 28 days, the last day with interest is lastDay() (2026-02-28). Show lastDay() in texts, never $until.

Day count: by default actual/actual, i.e. the days of each calendar year are divided by the length of that year (365 or 366), so that a full year yields exactly the annual rate (section 288 BGB: "für das Jahr"). A fixed basis ($dayCount 365 or 360) divides all days by that number instead.

Constants#

ConstantValueDescription
ACTUAL_ACTUALnullActual days divided by the length of each calendar year (365 or 366).

Properties#

PropertyTypeDescription
$amount readonly?Brick\Money\Money
$base readonlyBrick\Money\Money
$dayCount readonly?int
$description readonly?string
$from readonlyDate
$ratePercent readonlyBrick\Math\BigDecimal
$until readonlyDate

Methods#

MethodDescription
->__construct()
->days()Days with interest: from $from inclusive to $until exclusive.
->lastDay()The last day with interest (the day before $until), for display.
->total()Stated amount, or base × rate × days / day count basis, rounded half up once.

__construct()#

public function __construct(
    Money $base,
    BigDecimal $ratePercent,
    Date $from,
    Date $until,
    ?string $description = null,
    ?Money $amount = null,
    ?int $dayCount = self::ACTUAL_ACTUAL,
)
ParameterTypeDescription
$baseBrick\Money\Money
$ratePercentBrick\Math\BigDecimal
$fromDate
$untilDate
$description?string = null
$amount?Brick\Money\Money = null
$dayCount?int = self::ACTUAL_ACTUAL

days()#

public function days(): int

Days with interest: from $from inclusive to $until exclusive.

Returns
int

lastDay()#

public function lastDay(): Date

The last day with interest (the day before $until), for display.

Returns
Date

total()#

public function total(): Money

Stated amount, or base × rate × days / day count basis, rounded half up once.

Returns
Brick\Money\Money

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