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#
| Constant | Value | Description |
|---|---|---|
ACTUAL_ACTUAL | null | Actual days divided by the length of each calendar year (365 or 366). |
Properties#
| Property | Type | Description |
|---|---|---|
$amount readonly | ?Brick\Money\Money | |
$base readonly | Brick\Money\Money | |
$dayCount readonly | ?int | |
$description readonly | ?string | |
$from readonly | Date | |
$ratePercent readonly | Brick\Math\BigDecimal | |
$until readonly | Date |
Methods#
| Method | Description |
|---|---|
->__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,
)| Parameter | Type | Description |
|---|---|---|
$base | Brick\Money\Money | |
$ratePercent | Brick\Math\BigDecimal | |
$from | Date | |
$until | Date | |
$description | ?string = null | |
$amount | ?Brick\Money\Money = null | |
$dayCount | ?int = self::ACTUAL_ACTUAL |
days()#
public function days(): intDays with interest: from $from inclusive to $until exclusive.
- Returns
int
lastDay()#
public function lastDay(): DateThe last day with interest (the day before $until), for display.
- Returns
Date
total()#
public function total(): MoneyStated amount, or base × rate × days / day count basis, rounded half up once.
- Returns
Brick\Money\Money