ConstantPrincipal
Updated 2024-02-16 15:01:41.797000
Syntax
SELECT * FROM [westclintech].[wct].[ConstantPrincipal](
<@OutstandingAmount, float,>
,<@InterestBasis, nvarchar(4000),>
,<@InterestRate, float,>
,<@PrincipalPaymentFrequency, int,>
,<@InterestPaymentFrequency, int,>
,<@LastPrinPayAmount, float,>
,<@MaturityDate, datetime,>
,<@ReferenceDate, datetime,>
,<@PrevPrincipalPayDate, datetime,>
,<@PrevInterestPayDate, datetime,>
,<@StartDate, datetime,>
,<@FirstPrincipalPayDate, datetime,>
,<@FirstInterestPayDate, datetime,>
,<@PrincipalGracePeriodStartDate, datetime,>
,<@PrincipalGracePeriodEndDate, datetime,>
,<@InterestGracePeriodStartDate, datetime,>
,<@InterestGracePeriodEndDate, datetime,>)
Description
Use the table-valued function ConstantPrincipal to return the cash flow schedule for a loan with a fixed maturity date where the principal is reduced on a straight-line basis. ConstantPrincipal computes the periodic interest and principal amounts bring the loan balance to zero on the maturity date. ConstantPrincipal supports separate interest and principal repayment schedules.
The interest and principal payment periods are entered in ConstantPrincipal as the number of months between payments. For example, a loan with monthly payments of interest would have an interest frequency of 1. If principal is to be repaid every months, then it would have a principal payment frequency of 6.
ConstantPrincipal supports both an initial grace period and an additional grace period during the life of the loan, for principal and/or interest. All payments and their associated dates are calculated with respect to the reference date supplied to the function (which should not be confused with the start date). If an initial interest grace period is entered in ConstantPrincipal and it is greater than the reference date, then it becomes the first interest payment date and subsequent interest payments are calculated from that date forward. The same principal applies for principal payments.
If any payments would otherwise occur in the specified grace period, then that payment is moved to the end of the grace period and all remaining payments are calculated from the end of the grace period.
If no initial grace period is specified then the first payment date is calculated using the respective payment frequency. If the start date has been entered and the number of months between the start date and the reference date is less than the frequency, then the first payment date is calculated by adding the respective frequency (as a number of months) to the start date.
If no start date has been entered but a previous payment date has been entered and the number of months between the previous payment date and the reference date is less than the frequency, then the first payment date is calculated by adding the respective frequency (as a number of months) to the previous payment date.
If there is no start date and previous payment dates or the number of months between those dates and the reference date is greater than the frequency, then the first payment date is calculated by adding the resepctive frequency (as a number of months) to the reference date.
All payments in the resultant table are moved to the end of the month and interest is calculated using these end-of-month dates.
The interest rate is calculated as:
I=P\times\left[\left(\left(1+\frac{R\times{F}}{12}\right)^{12\slash{F}}\right)^T\right]-1
Where:
{"columns":[{"field":"column 1"},{"field":"column 2"},{"field":"column 3"}],"rows":[{"column 1":"I","column 2":"=","column 3":"InterestRate"},{"column 1":"R","column 2":"=","column 3":"@InterestRate"},{"column 1":"F","column 2":"=","column 3":"@Frequency"},{"column 1":"T","column 2":"=","column 3":"Time, in years, from the previous interest payment date to PaymentDate"}]}
In the case where there are one or more principal payments between interest payment dates, the interest payment amount is calculated using the outstanding principal balances during the interest payment period.
If the irregular period is longer than the regular period then the interest amount is broken out into the regular interest amount and a 'grace' interest amount.
Arguments
@InterestRate
the annual rate of interest for the loan. @InterestRate is an expression of type float or of a type that can be implicitly converted to float.
@PrevPrincipalPayDate
the last principal payment date prior to the reference date. @PrevPrincipalPayDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@PrincipalGracePeriodStartDate
the date on which the (interim) principal grace period commences. @PrincipalGracePeriodStartDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@InterestPaymentFrequency
the number of months in a regular interest payment. @InterestPaymentFrequency is an expression of type int or of a type that can be implicitly converted to int.
@OutstandingAmount
the principal amount of the loan. @OutstandingAmount is an expression of type float or of a type that can be implicitly converted to float.
@LastPrinPayAmount
the amount of the principal payment due on the maturity date. @LastPrinPayAmount is an expression of type float or of a type that can be implicitly converted to float.
@FirstInterestPayDate
the first interest payment date of the loan if other than a regular periodic payment. @FirstPayDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@MaturityDate
the maturity date of the loan. @MaturityDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@PrincipalPaymentFrequency
the number of months between principal payments. @PrincipalPaymentFrequency is an expression of type int or of a type that can be implicitly converted to int.
@InterestGracePeriodEndDate
the date on which the (interim) interest grace period concludes. @GracePeriodEndDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@PrincipalGracePeriodEndDate
the date on which the (interim) principal grace period concludes. @PrincipalGracePeriodEndDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@ReferenceDate
the starting date for the number of months with respect to all other dates. @ReferenceDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@StartDate
the start date of the loan. @StartDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@PrevInterestPayDate
the last interest payment date prior to the reference date. @PrevPrincipalPayDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@InterestGracePeriodStartDate
the date on which the (interim) interest grace period commences. @InterestGracePeriodStartDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@FirstPrincipalPayDate
the first principal payment date of the loan if other than a regular periodic payment. @FirstPayDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@InterestBasis
the day count convention used to calculate the interest amount. @InterestBasis can be 30/360, Actual/360, Actual/365, or Actual/Actual. @InterestBasis is an expression of the character string data type category.
Return Type
table
{"columns": [{"field": "colName", "headerName": "Name", "header": "name"}, {"field": "colDatatype", "headerName": "Type", "header": "type"}, {"field": "colDesc", "headerName": "Description", "header": "description", "minWidth": 1000}], "rows": [{"id": "88edcc17-d6cb-42d3-b63f-f60c28c68f1e", "colName": "Period", "colDatatype": "int", "colDesc": "A reference number uniquely identifying a row in the resultant table."}, {"id": "ebfa897a-dfc9-4cb6-b1a3-d91d3a3befec", "colName": "PrincipalPayment", "colDatatype": "float", "colDesc": "The amount of the principal payment."}, {"id": "9aa2239d-cfff-4495-aa26-bda1123afa2f", "colName": "InterestPayment", "colDatatype": "float", "colDesc": "The amount of the regular interest payment."}, {"id": "42ed9fee-c45b-4332-8279-84706111c821", "colName": "CashFlow", "colDatatype": "float", "colDesc": "PrincipalPayment + InterestPayment + GraceInterest."}, {"id": "95238765-20b9-4625-9a65-27f54d0f9c7c", "colName": "OutstandingExposure", "colDatatype": "float", "colDesc": "When Period = 0 then @OutstandingAmount. For Period > 0 then OutstandingExposure(Period-1) + InterestPayment."}, {"id": "4ddf868a-4971-47a9-b392-1ac8583ba32e", "colName": "CapitalAmountInDebt", "colDatatype": "float", "colDesc": "When Period = 0, @OutstandingAmount. For Period > 0 then CapitalAmountInDebt(Period-1) \u2013 PrincipalPayment"}, {"id": "a20c88ad-74ba-4094-a380-b773cb7d8015", "colName": "TotalExposure", "colDatatype": "float", "colDesc": "When Period = 0, @OutstandingAmount. For Period > 0 then CapitalAmountInDebt(Period-1) + InterestPayment"}, {"id": "c6024003-fa47-4649-b420-8efddab7b7bd", "colName": "NumberOfMonth", "colDatatype": "int", "colDesc": "The number of months between the @ReferenceDate and the PaymentDate."}, {"id": "f4a45e98-4f54-4a25-81dc-3752956f6334", "colName": "PaymentDate", "colDatatype": "datetime", "colDesc": "The end-of-month date of the payment."}, {"id": "ba639cf4-5d55-42a9-9a47-a270680c53e8", "colName": "GraceInterest", "colDatatype": "float", "colDesc": "The amount of the grace interest"}, {"id": "f95da0dc-ab6a-416c-b270-a6ca0cf30c3d", "colName": "InterestRate", "colDatatype": "float", "colDesc": "The interest rate from the previous interest payment date to the PaymentDate."}]}
Remarks
The PaymentDate for all rows is generated as the last day of the month.
For Period = 0, PrincipalPayment, InterestPayment, CashFlow, NumberOfMonth, GraceInterest, and InterestRate are set to 0.
If @Frequency is NULL then @Frequency = 1.
If @InterestRate is NULL then @InterestRate = 0.
If @ReferenceDate is NULL then @ReferenceDate = GETDATE().
GraceInterest is only calculated on @FirstInterestPayDate and @InterestGracePeriodEndDate.
GraceInterest is only calculated if length of the grace interst periods is greater than @PaymentFrequency.
GraceInterest is the difference between the interest for the period from the previous interest payment to PaymentDate and interest that would have been calculated for a period with length equal to @PaymentFrequency.
CashFlow may not equal PaymentAmount on @FirstPayDate or @GracePeriodEndDate due to GraceInterest.
The last row returned will always be for the maturity date and may be shorter than a regular period depending on the combination of dates and @PaymentFrequency
Examples
This is a simple 5-year 100,000 loan with quarterly payments of principal and interest and an interest rate of 4.5%.
SELECT *
FROM wct.ConstantPrincipal( 100000, --@OutstandingAmount
'30/360', --@InterestBasis
.045, --@InterestRate
3, --@FreqPayPrincipal
3, --@FreqPayInterest
10000.00, --@LastPrinPayAmount
'2019-10-01', --@MaturityDate
'2014-10-01', --@ReferenceDate
NULL, --@PrevPrincipalPayDate
NULL, --@PrevInterestPayDate
NULL, --@StartDate
NULL, --@FirstPrincipalPayDate
NULL, --@FirstInterestPayDate
NULL, --@PrincipalGracePeriodStartDate
NULL, --@PrincipalGracePeriodEndDate
NULL, --@InterestGracePeriodStartDate
NULL --@InterestGracePeriodEndDate
);
This produces the following result.
{"columns":[{"field":"Period","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"PrincipalPayment","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"InterestPayment","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"CashFlow","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"OutstandingExposure","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"CapitalAmountInDebt","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"TotalExposure","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NumberOfMonth","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"PaymentDate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"GraceInterest","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"InterestRate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Period":"0","PrincipalPayment":"0","InterestPayment":"0","CashFlow":"0","OutstandingExposure":"100000","CapitalAmountInDebt":"100000","TotalExposure":"100000","NumberOfMonth":"0","PaymentDate":"2014-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0"},{"Period":"1","PrincipalPayment":"4736.84210526316","InterestPayment":"1125","CashFlow":"5861.84210526316","OutstandingExposure":"101125","CapitalAmountInDebt":"95263.1578947368","TotalExposure":"101125","NumberOfMonth":"3","PaymentDate":"2015-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"2","PrincipalPayment":"4736.84210526316","InterestPayment":"1071.71052631579","CashFlow":"5808.55263157894","OutstandingExposure":"102196.710526316","CapitalAmountInDebt":"90526.3157894737","TotalExposure":"96334.8684210526","NumberOfMonth":"6","PaymentDate":"2015-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"3","PrincipalPayment":"4736.84210526316","InterestPayment":"1018.42105263158","CashFlow":"5755.26315789473","OutstandingExposure":"103215.131578947","CapitalAmountInDebt":"85789.4736842105","TotalExposure":"91544.7368421053","NumberOfMonth":"9","PaymentDate":"2015-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"4","PrincipalPayment":"4736.84210526316","InterestPayment":"965.131578947367","CashFlow":"5701.97368421052","OutstandingExposure":"104180.263157895","CapitalAmountInDebt":"81052.6315789474","TotalExposure":"86754.6052631579","NumberOfMonth":"12","PaymentDate":"2015-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"5","PrincipalPayment":"4736.84210526316","InterestPayment":"911.842105263156","CashFlow":"5648.68421052631","OutstandingExposure":"105092.105263158","CapitalAmountInDebt":"76315.7894736842","TotalExposure":"81964.4736842105","NumberOfMonth":"15","PaymentDate":"2016-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"6","PrincipalPayment":"4736.84210526316","InterestPayment":"858.552631578946","CashFlow":"5595.3947368421","OutstandingExposure":"105950.657894737","CapitalAmountInDebt":"71578.947368421","TotalExposure":"77174.3421052631","NumberOfMonth":"18","PaymentDate":"2016-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"7","PrincipalPayment":"4736.84210526316","InterestPayment":"805.263157894735","CashFlow":"5542.10526315789","OutstandingExposure":"106755.921052632","CapitalAmountInDebt":"66842.1052631579","TotalExposure":"72384.2105263158","NumberOfMonth":"21","PaymentDate":"2016-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"8","PrincipalPayment":"4736.84210526316","InterestPayment":"751.973684210525","CashFlow":"5488.81578947368","OutstandingExposure":"107507.894736842","CapitalAmountInDebt":"62105.2631578947","TotalExposure":"67594.0789473684","NumberOfMonth":"24","PaymentDate":"2016-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"9","PrincipalPayment":"4736.84210526316","InterestPayment":"698.684210526314","CashFlow":"5435.52631578947","OutstandingExposure":"108206.578947368","CapitalAmountInDebt":"57368.4210526316","TotalExposure":"62803.947368421","NumberOfMonth":"27","PaymentDate":"2017-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"10","PrincipalPayment":"4736.84210526316","InterestPayment":"645.394736842104","CashFlow":"5382.23684210526","OutstandingExposure":"108851.973684211","CapitalAmountInDebt":"52631.5789473684","TotalExposure":"58013.8157894737","NumberOfMonth":"30","PaymentDate":"2017-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"11","PrincipalPayment":"4736.84210526316","InterestPayment":"592.105263157894","CashFlow":"5328.94736842105","OutstandingExposure":"109444.078947368","CapitalAmountInDebt":"47894.7368421052","TotalExposure":"53223.6842105263","NumberOfMonth":"33","PaymentDate":"2017-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"12","PrincipalPayment":"4736.84210526316","InterestPayment":"538.815789473683","CashFlow":"5275.65789473684","OutstandingExposure":"109982.894736842","CapitalAmountInDebt":"43157.8947368421","TotalExposure":"48433.5526315789","NumberOfMonth":"36","PaymentDate":"2017-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"13","PrincipalPayment":"4736.84210526316","InterestPayment":"485.526315789473","CashFlow":"5222.36842105263","OutstandingExposure":"110468.421052632","CapitalAmountInDebt":"38421.0526315789","TotalExposure":"43643.4210526316","NumberOfMonth":"39","PaymentDate":"2018-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"14","PrincipalPayment":"4736.84210526316","InterestPayment":"432.236842105262","CashFlow":"5169.07894736842","OutstandingExposure":"110900.657894737","CapitalAmountInDebt":"33684.2105263158","TotalExposure":"38853.2894736842","NumberOfMonth":"42","PaymentDate":"2018-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"15","PrincipalPayment":"4736.84210526316","InterestPayment":"378.947368421052","CashFlow":"5115.78947368421","OutstandingExposure":"111279.605263158","CapitalAmountInDebt":"28947.3684210526","TotalExposure":"34063.1578947368","NumberOfMonth":"45","PaymentDate":"2018-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"16","PrincipalPayment":"4736.84210526316","InterestPayment":"325.657894736841","CashFlow":"5062.5","OutstandingExposure":"111605.263157895","CapitalAmountInDebt":"24210.5263157894","TotalExposure":"29273.0263157894","NumberOfMonth":"48","PaymentDate":"2018-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"17","PrincipalPayment":"4736.84210526316","InterestPayment":"272.368421052631","CashFlow":"5009.21052631579","OutstandingExposure":"111877.631578947","CapitalAmountInDebt":"19473.6842105263","TotalExposure":"24482.8947368421","NumberOfMonth":"51","PaymentDate":"2019-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"18","PrincipalPayment":"4736.84210526316","InterestPayment":"219.07894736842","CashFlow":"4955.92105263158","OutstandingExposure":"112096.710526316","CapitalAmountInDebt":"14736.8421052631","TotalExposure":"19692.7631578947","NumberOfMonth":"54","PaymentDate":"2019-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"19","PrincipalPayment":"4736.84210526316","InterestPayment":"165.78947368421","CashFlow":"4902.63157894737","OutstandingExposure":"112262.5","CapitalAmountInDebt":"9999.99999999997","TotalExposure":"14902.6315789473","NumberOfMonth":"57","PaymentDate":"2019-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"20","PrincipalPayment":"9999.99999999997","InterestPayment":"112.5","CashFlow":"10112.5","OutstandingExposure":"112375","CapitalAmountInDebt":"0","TotalExposure":"10112.5","NumberOfMonth":"60","PaymentDate":"2019-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"}]}
We modify the SQL to have monthly payments of principal and quarterly payments of interest.
SELECT *
FROM wct.ConstantPrincipal( 100000, --@OutstandingAmount
'30/360', --@InterestBasis
.045, --@InterestRate
1, --@FreqPayPrincipal
3, --@FreqPayInterest
10000.00, --@LastPrinPayAmount
'2019-10-01', --@MaturityDate
'2014-10-01', --@ReferenceDate
NULL, --@PrevPrincipalPayDate
NULL, --@PrevInterestPayDate
NULL, --@StartDate
NULL, --@FirstPrincipalPayDate
NULL, --@FirstInterestPayDate
NULL, --@PrincipalGracePeriodStartDate
NULL, --@PrincipalGracePeriodEndDate
NULL, --@InterestGracePeriodStartDate
NULL --@InterestGracePeriodEndDate
);
This produces the following result.
{"columns":[{"field":"Period","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"PrincipalPayment","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"InterestPayment","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"CashFlow","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"OutstandingExposure","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"CapitalAmountInDebt","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"TotalExposure","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NumberOfMonth","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"PaymentDate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"GraceInterest","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"InterestRate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Period":"0","PrincipalPayment":"0","InterestPayment":"0","CashFlow":"0","OutstandingExposure":"100000","CapitalAmountInDebt":"100000","TotalExposure":"100000","NumberOfMonth":"0","PaymentDate":"2014-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0"},{"Period":"1","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"100000","CapitalAmountInDebt":"98474.5762711864","TotalExposure":"100000","NumberOfMonth":"1","PaymentDate":"2014-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"2","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"100000","CapitalAmountInDebt":"96949.1525423729","TotalExposure":"98474.5762711864","NumberOfMonth":"2","PaymentDate":"2014-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"3","PrincipalPayment":"1525.42372881356","InterestPayment":"1107.88164596234","CashFlow":"2633.3053747759","OutstandingExposure":"101107.881645962","CapitalAmountInDebt":"95423.7288135593","TotalExposure":"98057.0341883352","NumberOfMonth":"3","PaymentDate":"2015-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"4","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"101107.881645962","CapitalAmountInDebt":"93898.3050847457","TotalExposure":"95423.7288135593","NumberOfMonth":"4","PaymentDate":"2015-02-28 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"5","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"101107.881645962","CapitalAmountInDebt":"92372.8813559322","TotalExposure":"93898.3050847457","NumberOfMonth":"5","PaymentDate":"2015-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"6","PrincipalPayment":"1525.42372881356","InterestPayment":"1056.39859511488","CashFlow":"2581.82232392844","OutstandingExposure":"102164.280241077","CapitalAmountInDebt":"90847.4576271186","TotalExposure":"93429.2799510471","NumberOfMonth":"6","PaymentDate":"2015-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"7","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"102164.280241077","CapitalAmountInDebt":"89322.0338983051","TotalExposure":"90847.4576271186","NumberOfMonth":"7","PaymentDate":"2015-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"8","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"102164.280241077","CapitalAmountInDebt":"87796.6101694915","TotalExposure":"89322.0338983051","NumberOfMonth":"8","PaymentDate":"2015-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"9","PrincipalPayment":"1525.42372881356","InterestPayment":"1004.91554426742","CashFlow":"2530.33927308098","OutstandingExposure":"103169.195785345","CapitalAmountInDebt":"86271.1864406779","TotalExposure":"88801.5257137589","NumberOfMonth":"9","PaymentDate":"2015-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"10","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"103169.195785345","CapitalAmountInDebt":"84745.7627118644","TotalExposure":"86271.1864406779","NumberOfMonth":"10","PaymentDate":"2015-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"11","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"103169.195785345","CapitalAmountInDebt":"83220.3389830508","TotalExposure":"84745.7627118644","NumberOfMonth":"11","PaymentDate":"2015-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"12","PrincipalPayment":"1525.42372881356","InterestPayment":"953.432493419966","CashFlow":"2478.85622223353","OutstandingExposure":"104122.628278765","CapitalAmountInDebt":"81694.9152542372","TotalExposure":"84173.7714764708","NumberOfMonth":"12","PaymentDate":"2015-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"13","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"104122.628278765","CapitalAmountInDebt":"80169.4915254237","TotalExposure":"81694.9152542372","NumberOfMonth":"13","PaymentDate":"2015-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"14","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"104122.628278765","CapitalAmountInDebt":"78644.0677966101","TotalExposure":"80169.4915254237","NumberOfMonth":"14","PaymentDate":"2015-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"15","PrincipalPayment":"1525.42372881356","InterestPayment":"901.949442572509","CashFlow":"2427.37317138607","OutstandingExposure":"105024.577721337","CapitalAmountInDebt":"77118.6440677966","TotalExposure":"79546.0172391826","NumberOfMonth":"15","PaymentDate":"2016-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"16","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"105024.577721337","CapitalAmountInDebt":"75593.220338983","TotalExposure":"77118.6440677966","NumberOfMonth":"16","PaymentDate":"2016-02-29 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"17","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"105024.577721337","CapitalAmountInDebt":"74067.7966101694","TotalExposure":"75593.220338983","NumberOfMonth":"17","PaymentDate":"2016-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"18","PrincipalPayment":"1525.42372881356","InterestPayment":"850.466391725053","CashFlow":"2375.89012053861","OutstandingExposure":"105875.044113062","CapitalAmountInDebt":"72542.3728813559","TotalExposure":"74918.2630018945","NumberOfMonth":"18","PaymentDate":"2016-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"19","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"105875.044113062","CapitalAmountInDebt":"71016.9491525423","TotalExposure":"72542.3728813559","NumberOfMonth":"19","PaymentDate":"2016-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"20","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"105875.044113062","CapitalAmountInDebt":"69491.5254237287","TotalExposure":"71016.9491525423","NumberOfMonth":"20","PaymentDate":"2016-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"21","PrincipalPayment":"1525.42372881356","InterestPayment":"798.983340877596","CashFlow":"2324.40706969115","OutstandingExposure":"106674.02745394","CapitalAmountInDebt":"67966.1016949152","TotalExposure":"70290.5087646063","NumberOfMonth":"21","PaymentDate":"2016-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"22","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"106674.02745394","CapitalAmountInDebt":"66440.6779661016","TotalExposure":"67966.1016949152","NumberOfMonth":"22","PaymentDate":"2016-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"23","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"106674.02745394","CapitalAmountInDebt":"64915.2542372881","TotalExposure":"66440.6779661016","NumberOfMonth":"23","PaymentDate":"2016-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"24","PrincipalPayment":"1525.42372881356","InterestPayment":"747.500290030139","CashFlow":"2272.9240188437","OutstandingExposure":"107421.52774397","CapitalAmountInDebt":"63389.8305084745","TotalExposure":"65662.7545273182","NumberOfMonth":"24","PaymentDate":"2016-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"25","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"107421.52774397","CapitalAmountInDebt":"61864.4067796609","TotalExposure":"63389.8305084745","NumberOfMonth":"25","PaymentDate":"2016-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"26","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"107421.52774397","CapitalAmountInDebt":"60338.9830508474","TotalExposure":"61864.4067796609","NumberOfMonth":"26","PaymentDate":"2016-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"27","PrincipalPayment":"1525.42372881356","InterestPayment":"696.017239182682","CashFlow":"2221.44096799624","OutstandingExposure":"108117.544983153","CapitalAmountInDebt":"58813.5593220338","TotalExposure":"61035.0002900301","NumberOfMonth":"27","PaymentDate":"2017-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"28","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"108117.544983153","CapitalAmountInDebt":"57288.1355932202","TotalExposure":"58813.5593220338","NumberOfMonth":"28","PaymentDate":"2017-02-28 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"29","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"108117.544983153","CapitalAmountInDebt":"55762.7118644067","TotalExposure":"57288.1355932202","NumberOfMonth":"29","PaymentDate":"2017-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"30","PrincipalPayment":"1525.42372881356","InterestPayment":"644.534188335225","CashFlow":"2169.95791714878","OutstandingExposure":"108762.079171488","CapitalAmountInDebt":"54237.2881355931","TotalExposure":"56407.2460527419","NumberOfMonth":"30","PaymentDate":"2017-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"31","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"108762.079171488","CapitalAmountInDebt":"52711.8644067796","TotalExposure":"54237.2881355931","NumberOfMonth":"31","PaymentDate":"2017-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"32","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"108762.079171488","CapitalAmountInDebt":"51186.440677966","TotalExposure":"52711.8644067796","NumberOfMonth":"32","PaymentDate":"2017-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"33","PrincipalPayment":"1525.42372881356","InterestPayment":"593.051137487769","CashFlow":"2118.47486630133","OutstandingExposure":"109355.130308976","CapitalAmountInDebt":"49661.0169491524","TotalExposure":"51779.4918154538","NumberOfMonth":"33","PaymentDate":"2017-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"34","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"109355.130308976","CapitalAmountInDebt":"48135.5932203389","TotalExposure":"49661.0169491524","NumberOfMonth":"34","PaymentDate":"2017-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"35","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"109355.130308976","CapitalAmountInDebt":"46610.1694915253","TotalExposure":"48135.5932203389","NumberOfMonth":"35","PaymentDate":"2017-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"36","PrincipalPayment":"1525.42372881356","InterestPayment":"541.568086640312","CashFlow":"2066.99181545387","OutstandingExposure":"109896.698395616","CapitalAmountInDebt":"45084.7457627117","TotalExposure":"47151.7375781656","NumberOfMonth":"36","PaymentDate":"2017-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"37","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"109896.698395616","CapitalAmountInDebt":"43559.3220338982","TotalExposure":"45084.7457627117","NumberOfMonth":"37","PaymentDate":"2017-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"38","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"109896.698395616","CapitalAmountInDebt":"42033.8983050846","TotalExposure":"43559.3220338982","NumberOfMonth":"38","PaymentDate":"2017-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"39","PrincipalPayment":"1525.42372881356","InterestPayment":"490.085035792855","CashFlow":"2015.50876460641","OutstandingExposure":"110386.783431409","CapitalAmountInDebt":"40508.4745762711","TotalExposure":"42523.9833408775","NumberOfMonth":"39","PaymentDate":"2018-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"40","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"110386.783431409","CapitalAmountInDebt":"38983.0508474575","TotalExposure":"40508.4745762711","NumberOfMonth":"40","PaymentDate":"2018-02-28 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"41","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"110386.783431409","CapitalAmountInDebt":"37457.6271186439","TotalExposure":"38983.0508474575","NumberOfMonth":"41","PaymentDate":"2018-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"42","PrincipalPayment":"1525.42372881356","InterestPayment":"438.601984945398","CashFlow":"1964.02571375896","OutstandingExposure":"110825.385416354","CapitalAmountInDebt":"35932.2033898304","TotalExposure":"37896.2291035893","NumberOfMonth":"42","PaymentDate":"2018-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"43","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"110825.385416354","CapitalAmountInDebt":"34406.7796610168","TotalExposure":"35932.2033898304","NumberOfMonth":"43","PaymentDate":"2018-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"44","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"110825.385416354","CapitalAmountInDebt":"32881.3559322032","TotalExposure":"34406.7796610168","NumberOfMonth":"44","PaymentDate":"2018-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"45","PrincipalPayment":"1525.42372881356","InterestPayment":"387.118934097942","CashFlow":"1912.5426629115","OutstandingExposure":"111212.504350452","CapitalAmountInDebt":"31355.9322033897","TotalExposure":"33268.4748663012","NumberOfMonth":"45","PaymentDate":"2018-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"46","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"111212.504350452","CapitalAmountInDebt":"29830.5084745761","TotalExposure":"31355.9322033897","NumberOfMonth":"46","PaymentDate":"2018-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"47","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"111212.504350452","CapitalAmountInDebt":"28305.0847457626","TotalExposure":"29830.5084745761","NumberOfMonth":"47","PaymentDate":"2018-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"48","PrincipalPayment":"1525.42372881356","InterestPayment":"335.635883250485","CashFlow":"1861.05961206404","OutstandingExposure":"111548.140233703","CapitalAmountInDebt":"26779.661016949","TotalExposure":"28640.720629013","NumberOfMonth":"48","PaymentDate":"2018-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"49","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"111548.140233703","CapitalAmountInDebt":"25254.2372881354","TotalExposure":"26779.661016949","NumberOfMonth":"49","PaymentDate":"2018-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"50","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"111548.140233703","CapitalAmountInDebt":"23728.8135593219","TotalExposure":"25254.2372881354","NumberOfMonth":"50","PaymentDate":"2018-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"51","PrincipalPayment":"1525.42372881356","InterestPayment":"284.152832403028","CashFlow":"1809.57656121659","OutstandingExposure":"111832.293066106","CapitalAmountInDebt":"22203.3898305083","TotalExposure":"24012.9663917249","NumberOfMonth":"51","PaymentDate":"2019-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"52","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"111832.293066106","CapitalAmountInDebt":"20677.9661016948","TotalExposure":"22203.3898305083","NumberOfMonth":"52","PaymentDate":"2019-02-28 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"53","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"111832.293066106","CapitalAmountInDebt":"19152.5423728812","TotalExposure":"20677.9661016948","NumberOfMonth":"53","PaymentDate":"2019-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"54","PrincipalPayment":"1525.42372881356","InterestPayment":"232.669781555572","CashFlow":"1758.09351036913","OutstandingExposure":"112064.962847661","CapitalAmountInDebt":"17627.1186440676","TotalExposure":"19385.2121544368","NumberOfMonth":"54","PaymentDate":"2019-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"55","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"112064.962847661","CapitalAmountInDebt":"16101.6949152541","TotalExposure":"17627.1186440676","NumberOfMonth":"55","PaymentDate":"2019-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"56","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"112064.962847661","CapitalAmountInDebt":"14576.2711864405","TotalExposure":"16101.6949152541","NumberOfMonth":"56","PaymentDate":"2019-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"57","PrincipalPayment":"1525.42372881356","InterestPayment":"181.186730708115","CashFlow":"1706.61045952167","OutstandingExposure":"112246.149578369","CapitalAmountInDebt":"13050.847457627","TotalExposure":"14757.4579171486","NumberOfMonth":"57","PaymentDate":"2019-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"58","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"112246.149578369","CapitalAmountInDebt":"11525.4237288134","TotalExposure":"13050.847457627","NumberOfMonth":"58","PaymentDate":"2019-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"59","PrincipalPayment":"1525.42372881356","InterestPayment":"0","CashFlow":"1525.42372881356","OutstandingExposure":"112246.149578369","CapitalAmountInDebt":"9999.99999999985","TotalExposure":"11525.4237288134","NumberOfMonth":"59","PaymentDate":"2019-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"60","PrincipalPayment":"9999.99999999985","InterestPayment":"129.703679860658","CashFlow":"10129.7036798605","OutstandingExposure":"112375.85325823","CapitalAmountInDebt":"0","TotalExposure":"10129.7036798605","NumberOfMonth":"60","PaymentDate":"2019-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"}]}
In this example we modify the SQL so that the first interest payment isn't due until January of 2015 and the first principal payment isn't due until March of 2015.
SELECT *
FROM wct.ConstantPrincipal( 100000, --@OutstandingAmount
'30/360', --@InterestBasis
.045, --@InterestRate
1, --@FreqPayPrincipal
3, --@FreqPayInterest
10000.00, --@LastPrinPayAmount
'2019-10-01', --@MaturityDate
'2014-10-01', --@ReferenceDate
NULL, --@PrevPrincipalPayDate
NULL, --@PrevInterestPayDate
NULL, --@StartDate
'2015-03-01', --@FirstPrincipalPayDate
'2015-01-01', --@FirstInterestPayDate
NULL, --@PrincipalGracePeriodStartDate
NULL, --@PrincipalGracePeriodEndDate
NULL, --@InterestGracePeriodStartDate
NULL --@InterestGracePeriodEndDate
);
This produces the following result.
{"columns":[{"field":"Period","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"PrincipalPayment","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"InterestPayment","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"CashFlow","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"OutstandingExposure","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"CapitalAmountInDebt","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"TotalExposure","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NumberOfMonth","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"PaymentDate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"GraceInterest","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"InterestRate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Period":"0","PrincipalPayment":"0","InterestPayment":"0","CashFlow":"0","OutstandingExposure":"100000","CapitalAmountInDebt":"100000","TotalExposure":"100000","NumberOfMonth":"0","PaymentDate":"2014-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0"},{"Period":"1","PrincipalPayment":"0","InterestPayment":"1125","CashFlow":"1125","OutstandingExposure":"101125","CapitalAmountInDebt":"100000","TotalExposure":"101125","NumberOfMonth":"3","PaymentDate":"2015-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"2","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"101125","CapitalAmountInDebt":"98363.6363636364","TotalExposure":"100000","NumberOfMonth":"5","PaymentDate":"2015-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"3","PrincipalPayment":"1636.36363636364","InterestPayment":"1118.88650497609","CashFlow":"2755.25014133972","OutstandingExposure":"102243.886504976","CapitalAmountInDebt":"96727.2727272727","TotalExposure":"99482.5228686125","NumberOfMonth":"6","PaymentDate":"2015-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"4","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"102243.886504976","CapitalAmountInDebt":"95090.9090909091","TotalExposure":"96727.2727272727","NumberOfMonth":"7","PaymentDate":"2015-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"5","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"102243.886504976","CapitalAmountInDebt":"93454.5454545455","TotalExposure":"95090.9090909091","NumberOfMonth":"8","PaymentDate":"2015-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"6","PrincipalPayment":"1636.36363636364","InterestPayment":"1069.81849294142","CashFlow":"2706.18212930505","OutstandingExposure":"103313.704997918","CapitalAmountInDebt":"91818.1818181818","TotalExposure":"94524.3639474869","NumberOfMonth":"9","PaymentDate":"2015-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"7","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"103313.704997918","CapitalAmountInDebt":"90181.8181818182","TotalExposure":"91818.1818181818","NumberOfMonth":"10","PaymentDate":"2015-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"8","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"103313.704997918","CapitalAmountInDebt":"88545.4545454546","TotalExposure":"90181.8181818182","NumberOfMonth":"11","PaymentDate":"2015-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"9","PrincipalPayment":"1636.36363636364","InterestPayment":"1014.59122021415","CashFlow":"2650.95485657778","OutstandingExposure":"104328.296218132","CapitalAmountInDebt":"86909.0909090909","TotalExposure":"89560.0457656687","NumberOfMonth":"12","PaymentDate":"2015-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"10","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"104328.296218132","CapitalAmountInDebt":"85272.7272727273","TotalExposure":"86909.0909090909","NumberOfMonth":"13","PaymentDate":"2015-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"11","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"104328.296218132","CapitalAmountInDebt":"83636.3636363637","TotalExposure":"85272.7272727273","NumberOfMonth":"14","PaymentDate":"2015-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"12","PrincipalPayment":"1636.36363636364","InterestPayment":"959.363947486875","CashFlow":"2595.72758385051","OutstandingExposure":"105287.660165619","CapitalAmountInDebt":"82000","TotalExposure":"84595.7275838505","NumberOfMonth":"15","PaymentDate":"2016-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"13","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"105287.660165619","CapitalAmountInDebt":"80363.6363636364","TotalExposure":"82000","NumberOfMonth":"16","PaymentDate":"2016-02-29 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"14","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"105287.660165619","CapitalAmountInDebt":"78727.2727272728","TotalExposure":"80363.6363636364","NumberOfMonth":"17","PaymentDate":"2016-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"15","PrincipalPayment":"1636.36363636364","InterestPayment":"904.136674759603","CashFlow":"2540.50031112324","OutstandingExposure":"106191.796840378","CapitalAmountInDebt":"77090.9090909091","TotalExposure":"79631.4094020324","NumberOfMonth":"18","PaymentDate":"2016-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"16","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"106191.796840378","CapitalAmountInDebt":"75454.5454545455","TotalExposure":"77090.9090909091","NumberOfMonth":"19","PaymentDate":"2016-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"17","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"106191.796840378","CapitalAmountInDebt":"73818.1818181819","TotalExposure":"75454.5454545455","NumberOfMonth":"20","PaymentDate":"2016-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"18","PrincipalPayment":"1636.36363636364","InterestPayment":"848.909402032332","CashFlow":"2485.27303839597","OutstandingExposure":"107040.70624241","CapitalAmountInDebt":"72181.8181818182","TotalExposure":"74667.0912202142","NumberOfMonth":"21","PaymentDate":"2016-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"19","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"107040.70624241","CapitalAmountInDebt":"70545.4545454546","TotalExposure":"72181.8181818182","NumberOfMonth":"22","PaymentDate":"2016-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"20","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"107040.70624241","CapitalAmountInDebt":"68909.090909091","TotalExposure":"70545.4545454546","NumberOfMonth":"23","PaymentDate":"2016-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"21","PrincipalPayment":"1636.36363636364","InterestPayment":"793.68212930506","CashFlow":"2430.0457656687","OutstandingExposure":"107834.388371716","CapitalAmountInDebt":"67272.7272727274","TotalExposure":"69702.773038396","NumberOfMonth":"24","PaymentDate":"2016-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"22","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"107834.388371716","CapitalAmountInDebt":"65636.3636363637","TotalExposure":"67272.7272727274","NumberOfMonth":"25","PaymentDate":"2016-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"23","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"107834.388371716","CapitalAmountInDebt":"64000.0000000001","TotalExposure":"65636.3636363637","NumberOfMonth":"26","PaymentDate":"2016-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"24","PrincipalPayment":"1636.36363636364","InterestPayment":"738.454856577788","CashFlow":"2374.81849294142","OutstandingExposure":"108572.843228293","CapitalAmountInDebt":"62363.6363636364","TotalExposure":"64738.4548565779","NumberOfMonth":"27","PaymentDate":"2017-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"25","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"108572.843228293","CapitalAmountInDebt":"60727.2727272728","TotalExposure":"62363.6363636364","NumberOfMonth":"28","PaymentDate":"2017-02-28 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"26","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"108572.843228293","CapitalAmountInDebt":"59090.9090909092","TotalExposure":"60727.2727272728","NumberOfMonth":"29","PaymentDate":"2017-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"27","PrincipalPayment":"1636.36363636364","InterestPayment":"683.227583850517","CashFlow":"2319.59122021415","OutstandingExposure":"109256.070812144","CapitalAmountInDebt":"57454.5454545455","TotalExposure":"59774.1366747597","NumberOfMonth":"30","PaymentDate":"2017-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"28","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"109256.070812144","CapitalAmountInDebt":"55818.1818181819","TotalExposure":"57454.5454545455","NumberOfMonth":"31","PaymentDate":"2017-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"29","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"109256.070812144","CapitalAmountInDebt":"54181.8181818182","TotalExposure":"55818.1818181819","NumberOfMonth":"32","PaymentDate":"2017-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"30","PrincipalPayment":"1636.36363636364","InterestPayment":"628.000311123245","CashFlow":"2264.36394748688","OutstandingExposure":"109884.071123267","CapitalAmountInDebt":"52545.4545454546","TotalExposure":"54809.8184929415","NumberOfMonth":"33","PaymentDate":"2017-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"31","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"109884.071123267","CapitalAmountInDebt":"50909.090909091","TotalExposure":"52545.4545454546","NumberOfMonth":"34","PaymentDate":"2017-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"32","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"109884.071123267","CapitalAmountInDebt":"49272.7272727273","TotalExposure":"50909.090909091","NumberOfMonth":"35","PaymentDate":"2017-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"33","PrincipalPayment":"1636.36363636364","InterestPayment":"572.773038395973","CashFlow":"2209.13667475961","OutstandingExposure":"110456.844161663","CapitalAmountInDebt":"47636.3636363637","TotalExposure":"49845.5003111233","NumberOfMonth":"36","PaymentDate":"2017-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"34","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"110456.844161663","CapitalAmountInDebt":"46000","TotalExposure":"47636.3636363637","NumberOfMonth":"37","PaymentDate":"2017-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"35","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"110456.844161663","CapitalAmountInDebt":"44363.6363636364","TotalExposure":"46000","NumberOfMonth":"38","PaymentDate":"2017-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"36","PrincipalPayment":"1636.36363636364","InterestPayment":"517.545765668701","CashFlow":"2153.90940203234","OutstandingExposure":"110974.389927332","CapitalAmountInDebt":"42727.2727272728","TotalExposure":"44881.1821293051","NumberOfMonth":"39","PaymentDate":"2018-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"37","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"110974.389927332","CapitalAmountInDebt":"41090.9090909091","TotalExposure":"42727.2727272728","NumberOfMonth":"40","PaymentDate":"2018-02-28 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"38","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"110974.389927332","CapitalAmountInDebt":"39454.5454545455","TotalExposure":"41090.9090909091","NumberOfMonth":"41","PaymentDate":"2018-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"39","PrincipalPayment":"1636.36363636364","InterestPayment":"462.31849294143","CashFlow":"2098.68212930507","OutstandingExposure":"111436.708420273","CapitalAmountInDebt":"37818.1818181818","TotalExposure":"39916.8639474869","NumberOfMonth":"42","PaymentDate":"2018-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"40","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"111436.708420273","CapitalAmountInDebt":"36181.8181818182","TotalExposure":"37818.1818181818","NumberOfMonth":"43","PaymentDate":"2018-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"41","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"111436.708420273","CapitalAmountInDebt":"34545.4545454546","TotalExposure":"36181.8181818182","NumberOfMonth":"44","PaymentDate":"2018-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"42","PrincipalPayment":"1636.36363636364","InterestPayment":"407.091220214158","CashFlow":"2043.45485657779","OutstandingExposure":"111843.799640487","CapitalAmountInDebt":"32909.0909090909","TotalExposure":"34952.5457656687","NumberOfMonth":"45","PaymentDate":"2018-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"43","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"111843.799640487","CapitalAmountInDebt":"31272.7272727273","TotalExposure":"32909.0909090909","NumberOfMonth":"46","PaymentDate":"2018-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"44","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"111843.799640487","CapitalAmountInDebt":"29636.3636363637","TotalExposure":"31272.7272727273","NumberOfMonth":"47","PaymentDate":"2018-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"45","PrincipalPayment":"1636.36363636364","InterestPayment":"351.863947486886","CashFlow":"1988.22758385052","OutstandingExposure":"112195.663587974","CapitalAmountInDebt":"28000","TotalExposure":"29988.2275838505","NumberOfMonth":"48","PaymentDate":"2018-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"46","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"112195.663587974","CapitalAmountInDebt":"26363.6363636364","TotalExposure":"28000","NumberOfMonth":"49","PaymentDate":"2018-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"47","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"112195.663587974","CapitalAmountInDebt":"24727.2727272727","TotalExposure":"26363.6363636364","NumberOfMonth":"50","PaymentDate":"2018-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"48","PrincipalPayment":"1636.36363636364","InterestPayment":"296.636674759614","CashFlow":"1933.00031112325","OutstandingExposure":"112492.300262734","CapitalAmountInDebt":"23090.9090909091","TotalExposure":"25023.9094020324","NumberOfMonth":"51","PaymentDate":"2019-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"49","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"112492.300262734","CapitalAmountInDebt":"21454.5454545455","TotalExposure":"23090.9090909091","NumberOfMonth":"52","PaymentDate":"2019-02-28 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"50","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"112492.300262734","CapitalAmountInDebt":"19818.1818181818","TotalExposure":"21454.5454545455","NumberOfMonth":"53","PaymentDate":"2019-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"51","PrincipalPayment":"1636.36363636364","InterestPayment":"241.409402032343","CashFlow":"1877.77303839598","OutstandingExposure":"112733.709664766","CapitalAmountInDebt":"18181.8181818182","TotalExposure":"20059.5912202142","NumberOfMonth":"54","PaymentDate":"2019-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"52","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"112733.709664766","CapitalAmountInDebt":"16545.4545454546","TotalExposure":"18181.8181818182","NumberOfMonth":"55","PaymentDate":"2019-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"53","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"112733.709664766","CapitalAmountInDebt":"14909.0909090909","TotalExposure":"16545.4545454546","NumberOfMonth":"56","PaymentDate":"2019-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"54","PrincipalPayment":"1636.36363636364","InterestPayment":"186.182129305071","CashFlow":"1822.54576566871","OutstandingExposure":"112919.891794071","CapitalAmountInDebt":"13272.7272727273","TotalExposure":"15095.273038396","NumberOfMonth":"57","PaymentDate":"2019-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"55","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"112919.891794071","CapitalAmountInDebt":"11636.3636363637","TotalExposure":"13272.7272727273","NumberOfMonth":"58","PaymentDate":"2019-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"56","PrincipalPayment":"1636.36363636364","InterestPayment":"0","CashFlow":"1636.36363636364","OutstandingExposure":"112919.891794071","CapitalAmountInDebt":"10000","TotalExposure":"11636.3636363637","NumberOfMonth":"59","PaymentDate":"2019-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"57","PrincipalPayment":"10000","InterestPayment":"130.954856577799","CashFlow":"10130.9548565778","OutstandingExposure":"113050.846650649","CapitalAmountInDebt":"0","TotalExposure":"10130.9548565778","NumberOfMonth":"60","PaymentDate":"2019-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"}]}
We modify the SQL so that there are no payments in 2018.
SELECT *
FROM wct.ConstantPrincipal( 100000, --@OutstandingAmount
'30/360', --@InterestBasis
.045, --@InterestRate
1, --@FreqPayPrincipal
3, --@FreqPayInterest
10000.00, --@LastPrinPayAmount
'2019-10-01', --@MaturityDate
'2014-10-01', --@ReferenceDate
NULL, --@PrevPrincipalPayDate
NULL, --@PrevInterestPayDate
NULL, --@StartDate
'2015-03-01', --@FirstPrincipalPayDate
'2015-01-01', --@FirstInterestPayDate
'2018-01-01', --@PrincipalGracePeriodStartDate
'2019-01-01', --@PrincipalGracePeriodEndDate
'2018-01-01', --@InterestGracePeriodStartDate
'2019-01-01' --@InterestGracePeriodEndDate
);
This produces the following result.
{"columns":[{"field":"Period","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"PrincipalPayment","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"InterestPayment","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"CashFlow","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"OutstandingExposure","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"CapitalAmountInDebt","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"TotalExposure","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NumberOfMonth","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"PaymentDate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"GraceInterest","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"InterestRate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Period":"0","PrincipalPayment":"0","InterestPayment":"0","CashFlow":"0","OutstandingExposure":"100000","CapitalAmountInDebt":"100000","TotalExposure":"100000","NumberOfMonth":"0","PaymentDate":"2014-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0"},{"Period":"1","PrincipalPayment":"0","InterestPayment":"1125","CashFlow":"1125","OutstandingExposure":"101125","CapitalAmountInDebt":"100000","TotalExposure":"101125","NumberOfMonth":"3","PaymentDate":"2015-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"2","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"101125","CapitalAmountInDebt":"97906.976744186","TotalExposure":"100000","NumberOfMonth":"5","PaymentDate":"2015-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"3","PrincipalPayment":"2093.02325581395","InterestPayment":"1117.18041334151","CashFlow":"3210.20366915546","OutstandingExposure":"102242.180413341","CapitalAmountInDebt":"95813.9534883721","TotalExposure":"99024.1571575275","NumberOfMonth":"6","PaymentDate":"2015-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"4","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"102242.180413341","CapitalAmountInDebt":"93720.9302325581","TotalExposure":"95813.9534883721","NumberOfMonth":"7","PaymentDate":"2015-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"5","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"102242.180413341","CapitalAmountInDebt":"91627.9069767442","TotalExposure":"93720.9302325581","NumberOfMonth":"8","PaymentDate":"2015-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"6","PrincipalPayment":"2093.02325581395","InterestPayment":"1054.41900259949","CashFlow":"3147.44225841345","OutstandingExposure":"103296.599415941","CapitalAmountInDebt":"89534.8837209302","TotalExposure":"92682.3259793437","NumberOfMonth":"9","PaymentDate":"2015-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"7","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"103296.599415941","CapitalAmountInDebt":"87441.8604651163","TotalExposure":"89534.8837209302","NumberOfMonth":"10","PaymentDate":"2015-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"8","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"103296.599415941","CapitalAmountInDebt":"85348.8372093023","TotalExposure":"87441.8604651163","NumberOfMonth":"11","PaymentDate":"2015-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"9","PrincipalPayment":"2093.02325581395","InterestPayment":"983.779467715774","CashFlow":"3076.80272352973","OutstandingExposure":"104280.378883657","CapitalAmountInDebt":"83255.8139534884","TotalExposure":"86332.6166770181","NumberOfMonth":"12","PaymentDate":"2015-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"10","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"104280.378883657","CapitalAmountInDebt":"81162.7906976744","TotalExposure":"83255.8139534884","NumberOfMonth":"13","PaymentDate":"2015-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"11","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"104280.378883657","CapitalAmountInDebt":"79069.7674418605","TotalExposure":"81162.7906976744","NumberOfMonth":"14","PaymentDate":"2015-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"12","PrincipalPayment":"2093.02325581395","InterestPayment":"913.139932832054","CashFlow":"3006.16318864601","OutstandingExposure":"105193.518816489","CapitalAmountInDebt":"76976.7441860465","TotalExposure":"79982.9073746925","NumberOfMonth":"15","PaymentDate":"2016-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"13","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"105193.518816489","CapitalAmountInDebt":"74883.7209302326","TotalExposure":"76976.7441860465","NumberOfMonth":"16","PaymentDate":"2016-02-29 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"14","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"105193.518816489","CapitalAmountInDebt":"72790.6976744186","TotalExposure":"74883.7209302326","NumberOfMonth":"17","PaymentDate":"2016-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"15","PrincipalPayment":"2093.02325581395","InterestPayment":"842.500397948335","CashFlow":"2935.52365376229","OutstandingExposure":"106036.019214437","CapitalAmountInDebt":"70697.6744186046","TotalExposure":"73633.1980723669","NumberOfMonth":"18","PaymentDate":"2016-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"16","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"106036.019214437","CapitalAmountInDebt":"68604.6511627907","TotalExposure":"70697.6744186046","NumberOfMonth":"19","PaymentDate":"2016-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"17","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"106036.019214437","CapitalAmountInDebt":"66511.6279069767","TotalExposure":"68604.6511627907","NumberOfMonth":"20","PaymentDate":"2016-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"18","PrincipalPayment":"2093.02325581395","InterestPayment":"771.860863064615","CashFlow":"2864.88411887857","OutstandingExposure":"106807.880077502","CapitalAmountInDebt":"64418.6046511628","TotalExposure":"67283.4887700414","NumberOfMonth":"21","PaymentDate":"2016-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"19","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"106807.880077502","CapitalAmountInDebt":"62325.5813953488","TotalExposure":"64418.6046511628","NumberOfMonth":"22","PaymentDate":"2016-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"20","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"106807.880077502","CapitalAmountInDebt":"60232.5581395349","TotalExposure":"62325.5813953488","NumberOfMonth":"23","PaymentDate":"2016-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"21","PrincipalPayment":"2093.02325581395","InterestPayment":"701.221328180896","CashFlow":"2794.24458399485","OutstandingExposure":"107509.101405683","CapitalAmountInDebt":"58139.5348837209","TotalExposure":"60933.7794677158","NumberOfMonth":"24","PaymentDate":"2016-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"22","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"107509.101405683","CapitalAmountInDebt":"56046.511627907","TotalExposure":"58139.5348837209","NumberOfMonth":"25","PaymentDate":"2016-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"23","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"107509.101405683","CapitalAmountInDebt":"53953.488372093","TotalExposure":"56046.511627907","NumberOfMonth":"26","PaymentDate":"2016-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"24","PrincipalPayment":"2093.02325581395","InterestPayment":"630.581793297176","CashFlow":"2723.60504911113","OutstandingExposure":"108139.68319898","CapitalAmountInDebt":"51860.4651162791","TotalExposure":"54584.0701653902","NumberOfMonth":"27","PaymentDate":"2017-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"25","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"108139.68319898","CapitalAmountInDebt":"49767.4418604651","TotalExposure":"51860.4651162791","NumberOfMonth":"28","PaymentDate":"2017-02-28 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"26","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"108139.68319898","CapitalAmountInDebt":"47674.4186046511","TotalExposure":"49767.4418604651","NumberOfMonth":"29","PaymentDate":"2017-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"27","PrincipalPayment":"2093.02325581395","InterestPayment":"559.942258413456","CashFlow":"2652.96551422741","OutstandingExposure":"108699.625457393","CapitalAmountInDebt":"45581.3953488372","TotalExposure":"48234.3608630646","NumberOfMonth":"30","PaymentDate":"2017-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"28","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"108699.625457393","CapitalAmountInDebt":"43488.3720930232","TotalExposure":"45581.3953488372","NumberOfMonth":"31","PaymentDate":"2017-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"29","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"108699.625457393","CapitalAmountInDebt":"41395.3488372093","TotalExposure":"43488.3720930232","NumberOfMonth":"32","PaymentDate":"2017-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"30","PrincipalPayment":"2093.02325581395","InterestPayment":"489.302723529737","CashFlow":"2582.32597934369","OutstandingExposure":"109188.928180923","CapitalAmountInDebt":"39302.3255813953","TotalExposure":"41884.651560739","NumberOfMonth":"33","PaymentDate":"2017-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"31","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"109188.928180923","CapitalAmountInDebt":"37209.3023255814","TotalExposure":"39302.3255813953","NumberOfMonth":"34","PaymentDate":"2017-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"32","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"109188.928180923","CapitalAmountInDebt":"35116.2790697674","TotalExposure":"37209.3023255814","NumberOfMonth":"35","PaymentDate":"2017-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"33","PrincipalPayment":"2093.02325581395","InterestPayment":"418.663188646017","CashFlow":"2511.68644445997","OutstandingExposure":"109607.591369569","CapitalAmountInDebt":"33023.2558139535","TotalExposure":"35534.9422584134","NumberOfMonth":"36","PaymentDate":"2017-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"34","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"109607.591369569","CapitalAmountInDebt":"30930.2325581395","TotalExposure":"33023.2558139535","NumberOfMonth":"37","PaymentDate":"2017-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"35","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"109607.591369569","CapitalAmountInDebt":"28837.2093023256","TotalExposure":"30930.2325581395","NumberOfMonth":"38","PaymentDate":"2017-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"36","PrincipalPayment":"2093.02325581395","InterestPayment":"324.418604651162","CashFlow":"3776.7116153893","OutstandingExposure":"109932.00997422","CapitalAmountInDebt":"26744.1860465116","TotalExposure":"29161.6279069767","NumberOfMonth":"51","PaymentDate":"2019-01-31 00:00:00.000","GraceInterest":"1359.26975492419","InterestRate":"0.0575299435517851"},{"Period":"37","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"109932.00997422","CapitalAmountInDebt":"24651.1627906977","TotalExposure":"26744.1860465116","NumberOfMonth":"52","PaymentDate":"2019-02-28 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"38","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"109932.00997422","CapitalAmountInDebt":"22558.1395348837","TotalExposure":"24651.1627906977","NumberOfMonth":"53","PaymentDate":"2019-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"39","PrincipalPayment":"2093.02325581395","InterestPayment":"277.384118878578","CashFlow":"2370.40737469253","OutstandingExposure":"110209.394093099","CapitalAmountInDebt":"20465.1162790697","TotalExposure":"22835.5236537623","NumberOfMonth":"54","PaymentDate":"2019-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"40","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"110209.394093099","CapitalAmountInDebt":"18372.0930232558","TotalExposure":"20465.1162790697","NumberOfMonth":"55","PaymentDate":"2019-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"41","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"110209.394093099","CapitalAmountInDebt":"16279.0697674418","TotalExposure":"18372.0930232558","NumberOfMonth":"56","PaymentDate":"2019-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"42","PrincipalPayment":"2093.02325581395","InterestPayment":"206.744583994858","CashFlow":"2299.76783980881","OutstandingExposure":"110416.138677094","CapitalAmountInDebt":"14186.0465116279","TotalExposure":"16485.8143514367","NumberOfMonth":"57","PaymentDate":"2019-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"},{"Period":"43","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"110416.138677094","CapitalAmountInDebt":"12093.0232558139","TotalExposure":"14186.0465116279","NumberOfMonth":"58","PaymentDate":"2019-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00373602473683632"},{"Period":"44","PrincipalPayment":"2093.02325581395","InterestPayment":"0","CashFlow":"2093.02325581395","OutstandingExposure":"110416.138677094","CapitalAmountInDebt":"9999.99999999997","TotalExposure":"12093.0232558139","NumberOfMonth":"59","PaymentDate":"2019-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.00748600735450711"},{"Period":"45","PrincipalPayment":"9999.99999999997","InterestPayment":"136.105049111139","CashFlow":"10136.1050491111","OutstandingExposure":"110552.243726205","CapitalAmountInDebt":"0","TotalExposure":"10136.1050491111","NumberOfMonth":"60","PaymentDate":"2019-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.01125"}]}
In this example we change the SQL so that the principal payment frequency to every 5 months, the interest payment frequency to every 6 months, remove the grace periods, and calculate the first payment dates from the previous interest and previous principal payment dates.
SELECT *
FROM wct.ConstantPrincipal( 100000, --@OutstandingAmount
'30/360', --@InterestBasis
.045, --@InterestRate
5, --@FreqPayPrincipal
6, --@FreqPayInterest
10000.00, --@LastPrinPayAmount
'2019-10-01', --@MaturityDate
'2014-10-01', --@ReferenceDate
'2014-06-01', --@PrevPrincipalPayDate
'2014-05-01', --@PrevInterestPayDate
NULL, --@StartDate
NULL, --@FirstPrincipalPayDate
NULL, --@FirstInterestPayDate
NULL, --@PrincipalGracePeriodStartDate
NULL, --@PrincipalGracePeriodEndDate
NULL, --@InterestGracePeriodStartDate
NULL --@InterestGracePeriodEndDate
);
This produces the following result.
{"columns":[{"field":"Period","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"PrincipalPayment","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"InterestPayment","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"CashFlow","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"OutstandingExposure","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"CapitalAmountInDebt","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"TotalExposure","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NumberOfMonth","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"PaymentDate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"GraceInterest","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"InterestRate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Period":"0","PrincipalPayment":"0","InterestPayment":"0","CashFlow":"0","OutstandingExposure":"100000","CapitalAmountInDebt":"100000","TotalExposure":"100000","NumberOfMonth":"0","PaymentDate":"2014-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0"},{"Period":"1","PrincipalPayment":"7500","InterestPayment":"371.53195748072","CashFlow":"7871.53195748072","OutstandingExposure":"100371.531957481","CapitalAmountInDebt":"92500","TotalExposure":"100371.531957481","NumberOfMonth":"1","PaymentDate":"2014-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.0037153195748072"},{"Period":"2","PrincipalPayment":"7500","InterestPayment":"0","CashFlow":"7500","OutstandingExposure":"100371.531957481","CapitalAmountInDebt":"85000","TotalExposure":"92500","NumberOfMonth":"6","PaymentDate":"2015-04-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.0187151476707064"},{"Period":"3","PrincipalPayment":"0","InterestPayment":"2053.38510318894","CashFlow":"2053.38510318894","OutstandingExposure":"102424.91706067","CapitalAmountInDebt":"85000","TotalExposure":"87053.3851031889","NumberOfMonth":"7","PaymentDate":"2015-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.0225"},{"Period":"4","PrincipalPayment":"7500","InterestPayment":"0","CashFlow":"7500","OutstandingExposure":"102424.91706067","CapitalAmountInDebt":"77500","TotalExposure":"85000","NumberOfMonth":"11","PaymentDate":"2015-09-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.0149443052261604"},{"Period":"5","PrincipalPayment":"0","InterestPayment":"1856.66667938131","CashFlow":"1856.66667938131","OutstandingExposure":"104281.583740051","CapitalAmountInDebt":"77500","TotalExposure":"79356.6666793813","NumberOfMonth":"13","PaymentDate":"2015-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.0225"},{"Period":"6","PrincipalPayment":"7500","InterestPayment":"0","CashFlow":"7500","OutstandingExposure":"104281.583740051","CapitalAmountInDebt":"70000","TotalExposure":"77500","NumberOfMonth":"16","PaymentDate":"2016-02-29 00:00:00.000","GraceInterest":"0","InterestRate":"0.0111874208078342"},{"Period":"7","PrincipalPayment":"0","InterestPayment":"1659.84434394124","CashFlow":"1659.84434394124","OutstandingExposure":"105941.428083992","CapitalAmountInDebt":"70000","TotalExposure":"71659.8443439412","NumberOfMonth":"19","PaymentDate":"2016-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.0225"},{"Period":"8","PrincipalPayment":"7500","InterestPayment":"0","CashFlow":"7500","OutstandingExposure":"105941.428083992","CapitalAmountInDebt":"62500","TotalExposure":"70000","NumberOfMonth":"21","PaymentDate":"2016-07-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00744444274915734"},{"Period":"9","PrincipalPayment":"0","InterestPayment":"1462.91771080379","CashFlow":"1462.91771080379","OutstandingExposure":"107404.345794796","CapitalAmountInDebt":"62500","TotalExposure":"63962.9177108038","NumberOfMonth":"25","PaymentDate":"2016-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.0225"},{"Period":"10","PrincipalPayment":"7500","InterestPayment":"0","CashFlow":"7500","OutstandingExposure":"107404.345794796","CapitalAmountInDebt":"55000","TotalExposure":"62500","NumberOfMonth":"26","PaymentDate":"2016-12-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.0037153195748072"},{"Period":"11","PrincipalPayment":"7500","InterestPayment":"1265.8863924697","CashFlow":"8765.8863924697","OutstandingExposure":"108670.232187266","CapitalAmountInDebt":"47500","TotalExposure":"56265.8863924697","NumberOfMonth":"31","PaymentDate":"2017-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.0225"},{"Period":"12","PrincipalPayment":"7500","InterestPayment":"0","CashFlow":"7500","OutstandingExposure":"108670.232187266","CapitalAmountInDebt":"40000","TotalExposure":"47500","NumberOfMonth":"36","PaymentDate":"2017-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.0187151476707064"},{"Period":"13","PrincipalPayment":"0","InterestPayment":"1040.88510318894","CashFlow":"1040.88510318894","OutstandingExposure":"109711.117290455","CapitalAmountInDebt":"40000","TotalExposure":"41040.8851031889","NumberOfMonth":"37","PaymentDate":"2017-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.0225"},{"Period":"14","PrincipalPayment":"7500","InterestPayment":"0","CashFlow":"7500","OutstandingExposure":"109711.117290455","CapitalAmountInDebt":"32500","TotalExposure":"40000","NumberOfMonth":"41","PaymentDate":"2018-03-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.0149443052261604"},{"Period":"15","PrincipalPayment":"0","InterestPayment":"844.166679381314","CashFlow":"844.166679381314","OutstandingExposure":"110555.283969836","CapitalAmountInDebt":"32500","TotalExposure":"33344.1666793813","NumberOfMonth":"43","PaymentDate":"2018-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.0225"},{"Period":"16","PrincipalPayment":"7500","InterestPayment":"0","CashFlow":"7500","OutstandingExposure":"110555.283969836","CapitalAmountInDebt":"25000","TotalExposure":"32500","NumberOfMonth":"46","PaymentDate":"2018-08-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.0111874208078342"},{"Period":"17","PrincipalPayment":"0","InterestPayment":"647.344343941242","CashFlow":"647.344343941242","OutstandingExposure":"111202.628313777","CapitalAmountInDebt":"25000","TotalExposure":"25647.3443439412","NumberOfMonth":"49","PaymentDate":"2018-11-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.0225"},{"Period":"18","PrincipalPayment":"7500","InterestPayment":"0","CashFlow":"7500","OutstandingExposure":"111202.628313777","CapitalAmountInDebt":"17500","TotalExposure":"25000","NumberOfMonth":"51","PaymentDate":"2019-01-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.00744444274915734"},{"Period":"19","PrincipalPayment":"0","InterestPayment":"450.417710803793","CashFlow":"450.417710803793","OutstandingExposure":"111653.046024581","CapitalAmountInDebt":"17500","TotalExposure":"17950.4177108038","NumberOfMonth":"55","PaymentDate":"2019-05-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.0225"},{"Period":"20","PrincipalPayment":"7500","InterestPayment":"0","CashFlow":"7500","OutstandingExposure":"111653.046024581","CapitalAmountInDebt":"10000","TotalExposure":"17500","NumberOfMonth":"56","PaymentDate":"2019-06-30 00:00:00.000","GraceInterest":"0","InterestRate":"0.0037153195748072"},{"Period":"21","PrincipalPayment":"10000","InterestPayment":"215.432795041156","CashFlow":"10215.4327950412","OutstandingExposure":"111868.478819622","CapitalAmountInDebt":"0","TotalExposure":"10215.4327950412","NumberOfMonth":"60","PaymentDate":"2019-10-31 00:00:00.000","GraceInterest":"0","InterestRate":"0.0187151476707064"}]}
See Also
BALLOON - Schedule with periodic interest payments and principal repaid at maturity
BULLET - Schedule with single interest and principal payment at maturity
CONSTANTCASHFLOW - Schedule with equal periodic cash flows
CONSTANTPAYMENTAMOUNT - Schedule with no maturity with fixed periodic payment amount
CONSTANTPRINCIPALAMOUNT - Schedule with no fixed maturity with a fixed periodic principal payment
CONSTANTPRINCIPALRATE - Schedule with no fixed maturity where a fixed percentage principal payment