Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

(no description)

File Size: 417 lines (19 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Coupons:: (9 methods):
  COUPDAYBS()
  COUPDAYS()
  COUPDAYSNC()
  COUPNCD()
  COUPNUM()
  COUPPCD()
  monthsDiff()
  couponFirstPeriodDate()
  validateCouponPeriod()


Class: Coupons  - X-Ref

COUPDAYBS($settlement,$maturity,$frequency,$basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)   X-Ref
COUPDAYBS.

Returns the number of days from the beginning of the coupon period to the settlement date.

Excel Function:
COUPDAYBS(settlement,maturity,frequency[,basis])

param: mixed $settlement The security's settlement date.
param: mixed $maturity The security's maturity date.
param: mixed $frequency The number of coupon payments per year (int).
param: mixed $basis The type of day count to use (int).
return: float|string

COUPDAYS($settlement,$maturity,$frequency,$basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)   X-Ref
COUPDAYS.

Returns the number of days in the coupon period that contains the settlement date.

Excel Function:
COUPDAYS(settlement,maturity,frequency[,basis])

param: mixed $settlement The security's settlement date.
param: mixed $maturity The security's maturity date.
param: mixed $frequency The number of coupon payments per year.
param: mixed $basis The type of day count to use (int).
return: float|string

COUPDAYSNC($settlement,$maturity,$frequency,$basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)   X-Ref
COUPDAYSNC.

Returns the number of days from the settlement date to the next coupon date.

Excel Function:
COUPDAYSNC(settlement,maturity,frequency[,basis])

param: mixed $settlement The security's settlement date.
param: mixed $maturity The security's maturity date.
param: mixed $frequency The number of coupon payments per year.
param: mixed $basis The type of day count to use (int) .
return: float|string

COUPNCD($settlement,$maturity,$frequency,$basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)   X-Ref
COUPNCD.

Returns the next coupon date after the settlement date.

Excel Function:
COUPNCD(settlement,maturity,frequency[,basis])

param: mixed $settlement The security's settlement date.
param: mixed $maturity The security's maturity date.
param: mixed $frequency The number of coupon payments per year.
param: mixed $basis The type of day count to use (int).
return: mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,

COUPNUM($settlement,$maturity,$frequency,$basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)   X-Ref
COUPNUM.

Returns the number of coupons payable between the settlement date and maturity date,
rounded up to the nearest whole coupon.

Excel Function:
COUPNUM(settlement,maturity,frequency[,basis])

param: mixed $settlement The security's settlement date.
param: mixed $maturity The security's maturity date.
param: mixed $frequency The number of coupon payments per year.
param: mixed $basis The type of day count to use (int).
return: int|string

COUPPCD($settlement,$maturity,$frequency,$basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD)   X-Ref
COUPPCD.

Returns the previous coupon date before the settlement date.

Excel Function:
COUPPCD(settlement,maturity,frequency[,basis])

param: mixed $settlement The security's settlement date.
param: mixed $maturity The security's maturity date.
param: mixed $frequency The number of coupon payments per year.
param: mixed $basis The type of day count to use (int).
return: mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,

monthsDiff(DateTime $result, int $months, string $plusOrMinus, int $day, bool $lastDayFlag)   X-Ref
No description

couponFirstPeriodDate(float $settlement, float $maturity, int $frequency, bool $next)   X-Ref
No description

validateCouponPeriod(float $settlement, float $maturity)   X-Ref
No description