InterestCharge
in package
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.
Table of Contents
Constants
- ACTUAL_ACTUAL : int|null = null
- Actual days divided by the length of each calendar year (365 or 366).
Properties
- $amount : Money|null
- $base : Money
- $dayCount : int|null
- $description : string|null
- $from : Date
- $ratePercent : BigDecimal
- $until : Date
Methods
- __construct() : mixed
- days() : int
- Days with interest: from $from inclusive to $until exclusive.
- lastDay() : Date
- The last day with interest (the day before $until), for display.
- total() : Money
- Stated amount, or base × rate × days / day count basis, rounded half up once.
Constants
ACTUAL_ACTUAL
Actual days divided by the length of each calendar year (365 or 366).
public
int|null
ACTUAL_ACTUAL
= null
Properties
$amount
public
Money|null
$amount
= null
$base
public
Money
$base
$dayCount
public
int|null
$dayCount
= self::ACTUAL_ACTUAL
$description
public
string|null
$description
= null
$from
public
Date
$from
$ratePercent
public
BigDecimal
$ratePercent
$until
public
Date
$until
Methods
__construct()
public
__construct(Money $base, BigDecimal $ratePercent, Date $from, Date $until[, string|null $description = null ][, Money|null $amount = null ][, int|null $dayCount = self::ACTUAL_ACTUAL ]) : mixed
Parameters
days()
Days with interest: from $from inclusive to $until exclusive.
public
days() : int
Return values
intlastDay()
The last day with interest (the day before $until), for display.
public
lastDay() : Date
Return values
Datetotal()
Stated amount, or base × rate × days / day count basis, rounded half up once.
public
total() : Money