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]

(no description)

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

Defines 1 class

Payments:: (2 methods):
  annuity()
  interestPayment()


Class: Payments  - X-Ref

annuity($interestRate,$numberOfPeriods,$presentValue,$futureValue = 0,$type = FinancialConstants::PAYMENT_END_OF_PERIOD)   X-Ref
PMT.

Returns the constant payment (annuity) for a cash flow with a constant interest rate.

param: mixed $interestRate Interest rate per period
param: mixed $numberOfPeriods Number of periods
param: mixed $presentValue Present Value
param: mixed $futureValue Future Value
param: mixed $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
return: float|string Result, or a string containing an error

interestPayment($interestRate,$period,$numberOfPeriods,$presentValue,$futureValue = 0,$type = FinancialConstants::PAYMENT_END_OF_PERIOD)   X-Ref
PPMT.

Returns the interest payment for a given period for an investment based on periodic, constant payments
and a constant interest rate.

param: mixed $interestRate Interest rate per period
param: mixed $period Period for which we want to find the interest
param: mixed $numberOfPeriods Number of periods
param: mixed $presentValue Present Value
param: mixed $futureValue Future Value
param: mixed $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
return: float|string Result, or a string containing an error