BaseRateTable
in package
implements
ReferenceRates
Basiszinssatz according to section 247 BGB, published by the Deutsche Bundesbank and changed on 1 January and 1 July. Rates after the last entry are added with withRate(), BaseRates::register() or, in Laravel, the configuration quittio-de.base_rates and the command quittio:base-rate:update (BundesbankBaseRates).
Table of Contents
Interfaces
- ReferenceRates
- The reference interest rate of a country's late payment law, e.g. the German Basiszinssatz (section 247 BGB) or the ECB main refinancing rate. Default interest is the reference rate plus the points of the DunningLaw.
Constants
- PUBLISHED : array<string|int, mixed> = ['2023-01-01' => '1.62', '2023-07-01' => '3.12'...
- Known rates in percent, keyed by the first day of validity.
Methods
- __construct() : mixed
- lastChange() : Date
- Date of the most recent known rate, e.g. to warn when the table is outdated.
- periods() : array<int, BigDecimal}>
- Periods with a constant rate between two dates (inclusive start, exclusive end). A table entry that keeps the rate (e.g. 2026-01-01) does not start a new period.
- rateOn() : BigDecimal
- The base rate changes on 1 January and 1 July (section 247 (1) sentence 2 BGB). Dates from the next scheduled change after the last known rate on are unknown and rejected.
- validUntil() : Date
- First day for which the table has no rate: the next 1 January or 1 July after the last change.
- withRate() : self
- A copy with a rate in percent from $from on, e.g. a newly published rate.
Constants
PUBLISHED
Known rates in percent, keyed by the first day of validity.
public
array<string|int, mixed>
PUBLISHED
= ['2023-01-01' => '1.62', '2023-07-01' => '3.12', '2024-01-01' => '3.62', '2024-07-01' => '3.37', '2025-01-01' => '2.27', '2025-07-01' => '1.27', '2026-01-01' => '1.27', '2026-07-01' => '1.52']
Methods
__construct()
public
__construct([array<string, string> $rates = self::PUBLISHED ]) : mixed
Parameters
- $rates : array<string, string> = self::PUBLISHED
-
ISO date => rate in percent
lastChange()
Date of the most recent known rate, e.g. to warn when the table is outdated.
public
lastChange() : Date
Return values
Dateperiods()
Periods with a constant rate between two dates (inclusive start, exclusive end). A table entry that keeps the rate (e.g. 2026-01-01) does not start a new period.
public
periods(Date $from, Date $until) : array<int, BigDecimal}>
Parameters
Return values
array<int, BigDecimal}>rateOn()
The base rate changes on 1 January and 1 July (section 247 (1) sentence 2 BGB). Dates from the next scheduled change after the last known rate on are unknown and rejected.
public
rateOn(Date $date) : BigDecimal
Parameters
- $date : Date
Return values
BigDecimalvalidUntil()
First day for which the table has no rate: the next 1 January or 1 July after the last change.
public
validUntil() : Date
Return values
DatewithRate()
A copy with a rate in percent from $from on, e.g. a newly published rate.
public
withRate(Date|string $from, string $rate) : self
Parameters
- $from : Date|string
- $rate : string