1st installment date is Joining Date. Customer has to pay 10 installments. Each installment every month. So after 11 month customer is eligible to buy product for the saved amount. So maturity date is 11 months from the joining date. Example Joining Date: 12/Sep/2016 Maturity Date: 12/Jul/2017
If Customer pays within scheduled date or any day in that month maturity date do not extend else the maturity date is extended.
Scenario 1: Pays on time
------------------------
Joining date: 12/Sep/2016
Expected output: 12/Jul/2017
Joining Date 12/Sep/2016 Inst No Payment Date Actual Date payment Considered Month 1 12/Sep/2016 12/Sep/2016 Sep 2016 2 05/Oct/2016 12/Oct/2016 Oct 2016 3 21/Nov/2016 12/Nov/2016 Nov 2016 4 12/Dec/2016 12/Dec/2016 Dec 2016 5 02/Jan/2017 12/Jan/2017 Jan 2017 6 02/Feb/2017 12/Feb/2017 Feb 2017 7 06/Mar/2017 12/Mar/2017 Mar 2017 8 06/Apr/2017 12/Apr/2017 Apr 2017 9 01/May/2017 12/May/2017 May 2017 10 07/Jun/2017 12/Jun/2017 Jun 2017 Maturity Date 12/Jul/2017
Scenario 2: when payments paid with delay
-----------------------------------------
Joining date: 12/Sep/2016
Expected output: 12/Sep/2017
Joining Date 12/Sep/2016 Inst No Payment Date Actual Date Payment Considered Month 1 12/Sep/2016 12/Sep/2016 Sep 2016 2 05/Oct/2016 12/Oct/2016 Oct 2016 3 21/Nov/2016 12/Nov/2016 Nov 2016 4 02/Feb/2017 12/Dec/2016 Feb 2017 5 02/Feb/2017 12/Jan/2017 Mar 2017 6 06/Mar/2017 12/Feb/2017 Apr 2017 7 06/Mar/2017 12/Mar/2017 May 2017 8 01/Jun/2017 12/Apr/2017 Jun 2017 9 01/Jun/2017 12/May/2017 Jul 2017 10 07/Aug/2017 12/Jun/2017 Aug 2017 Maturity Date 12/Sep/2017