dev-master
9999999-dev[Loan payment schedule library]
MIT
The Requires
- php >=7.1
The Development Requires
by Kauri Kont-Kontson
0.0.1
0.0.1.0[Loan payment schedule library]
MIT
The Requires
- php >=7.1
The Development Requires
by Kauri Kont-Kontson
Wallogit.com
2017 © Pedro Peláez
[Loan payment schedule library]
Library to generate loan payment schedule based on configuration. Contains 3 main parts: * PaymentScheduleConfig - holds configuration settings for payment schedule * PaymentScheduleFactory - generates payment schedule based on configuration * PaymentSchedule - holds collection of payment dates for payment schedule generated by factory, (*2)
// We have a loan for 5 years with montly payments
// How many payments loan schedule has
$noOfPayment = 5*12;
// First day of the payment schedule (first day when loan principal is out)
$startDate = new \DateTime('2000-01-01');
// What is the pattern used to generate payment dates
$dateIntervalPattern = 'P1M';
$config = new PaymentScheduleConfig($noOfPayments, $startDate, $dateIntervalPattern);
$schedule = PaymentScheduleFactory::generate($config);
var_dump($schedule instanceof PaymentScheduleInterface); // true
// Get array of payment dates
$paymentDates = $schedule->getPaymentDates();
[Loan payment schedule library]
MIT
[Loan payment schedule library]
MIT