blend_spreadsheet_loan_generator 0.1.102 → 0.1.106
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3decf3ef46d2a7636475a1364d97c98089a323fafaa671f2aaf0741b665887a5
|
4
|
+
data.tar.gz: 612c00e81f10f7da63d2c780596b5b1a3a9c5f110a8fd3e7633574fe5d779c23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a249a15ffc47d20f3aea1ff65b9fe7708de9e439c214e9855b3092cfd866c6e3bf0080a14ba40fd0379b74d5e29289f138f5526e8a8184030c115d631b32b5e7
|
7
|
+
data.tar.gz: 9a2dfca3ff564d50acbda00a914019dfe9d68bc63379aa00684ceabcf24d4f83df04c03770abc4a3bc8c579f6c531c74832a43d95f994982314515a9d6ac5f08
|
@@ -80,19 +80,15 @@ module BlendSpreadsheetLoanGenerator
|
|
80
80
|
due_on = values[last_paid_line + 1][:due_on] + 1.month
|
81
81
|
|
82
82
|
capital_paid = amount_paid.to_f - (
|
83
|
-
values[last_paid_line + 1][:
|
84
|
-
values[last_paid_line + 1][:
|
85
|
-
values[last_paid_line + 1][:period_calculated_interests] +
|
86
|
-
values[last_paid_line + 1][:period_calculated_fees]
|
83
|
+
values[last_paid_line + 1][:capitalized_interests_end] +
|
84
|
+
values[last_paid_line + 1][:capitalized_fees_end]
|
87
85
|
)
|
88
86
|
capital_paid_for_ratio = amount_paid.to_f - (
|
89
|
-
values[last_paid_line + 1][:
|
90
|
-
values[last_paid_line + 1][:period_calculated_fees]
|
87
|
+
values[last_paid_line + 1][:capitalized_fees_end]
|
91
88
|
)
|
92
89
|
remaining_capital_for_ratio = (
|
93
|
-
values[last_paid_line + 1][:
|
94
|
-
values[last_paid_line + 1][:
|
95
|
-
values[last_paid_line + 1][:period_calculated_interests]
|
90
|
+
values[last_paid_line + 1][:remaining_capital_end] +
|
91
|
+
values[last_paid_line + 1][:capitalized_interests_end]
|
96
92
|
)
|
97
93
|
|
98
94
|
ratio = options.fetch(:ratio, capital_paid_for_ratio.to_f / remaining_capital_for_ratio).to_f
|
@@ -170,6 +170,7 @@ module BlendSpreadsheetLoanGenerator
|
|
170
170
|
|
171
171
|
def period_calculated_fees_formula(line:, first_term_skip: false)
|
172
172
|
term = line - 1
|
173
|
+
return excel_float(0.0) if first_term_skip && term == 1
|
173
174
|
if loan.bullet_term?(term)
|
174
175
|
index = first_term_skip ? index(line - 1) : index(line)
|
175
176
|
|
@@ -179,7 +180,7 @@ module BlendSpreadsheetLoanGenerator
|
|
179
180
|
|
180
181
|
"=#{current} - #{capitalized_fees_start(line)}"
|
181
182
|
elsif loan.deferred_and_capitalized > 0 && term > loan.deferred_and_capitalized
|
182
|
-
index = first_term_skip ? loan.deferred_and_capitalized : loan.deferred_and_capitalized
|
183
|
+
index = first_term_skip ? loan.deferred_and_capitalized - 1 : loan.deferred_and_capitalized
|
183
184
|
|
184
185
|
with_fees = "#{remaining_capital_start(line)} * (1 + #{period_rate(line)} + #{period_fees_rate(line)})^#{index} * (#{period_rate(line)} + #{period_fees_rate(line)})"
|
185
186
|
without_fees = "#{remaining_capital_start(line)} * (1 + #{period_rate(line)})^#{index} * #{period_rate(line)}"
|
@@ -206,6 +207,7 @@ module BlendSpreadsheetLoanGenerator
|
|
206
207
|
|
207
208
|
def capitalized_fees_end_formula(line:, first_term_skip: false)
|
208
209
|
term = line - 1
|
210
|
+
return excel_float(0.0) if first_term_skip && term == 1
|
209
211
|
if term <= loan.deferred_and_capitalized
|
210
212
|
index = first_term_skip ? index(line - 1) : index(line)
|
211
213
|
with_fees = "#{remaining_capital_start(line)} * (1 + #{period_fees_rate(line)} + #{period_rate(line)})^#{index}"
|