kaurikk / loan-payment-schedule
This package is abandoned and no longer maintained.
No replacement package was suggested.
[Loan payment schedule library]
0.0.1
2017-02-28 11:49 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: >=6.0
This package is not auto-updated.
Last update: 2023-04-29 19:14:18 UTC
README
loan-payment-schedule
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
Basic usage
// 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();