blend_spreadsheet_loan_generator 0.1.103 → 0.1.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e066d31e3aac210b466d4e3e6993d408dc26dcba046a5a1ecfe181b2dabb0989
|
4
|
+
data.tar.gz: b52baa3e2c499f79960579c5cfd0d33e28d288c3ca0b1263e3b02c7ba271657f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2637dd47c2545133a83c24d299cd4c72dd81ca02056fd210504a4100c85cc2eaa0534303c0a0415c9a83d76983893fdc9c567945ae29619a8d32ebb3f38a64d1
|
7
|
+
data.tar.gz: a3b538214455f066f8bcddeae2920df8255bf43d9f5294efd25e715978b83a0836b6cb82f65786b2f52712e48a91f82ae3663176de15cd41967244da64d7545d
|
@@ -80,19 +80,16 @@ 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][:
|
87
|
+
values[last_paid_line + 1][:period_interests] +
|
88
|
+
values[last_paid_line + 1][:period_fees]
|
91
89
|
)
|
92
90
|
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]
|
91
|
+
values[last_paid_line + 1][:remaining_capital_end] +
|
92
|
+
values[last_paid_line + 1][:capitalized_interests_end]
|
96
93
|
)
|
97
94
|
|
98
95
|
ratio = options.fetch(:ratio, capital_paid_for_ratio.to_f / remaining_capital_for_ratio).to_f
|
@@ -170,7 +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
|
173
|
+
return excel_float(0.0) if first_term_skip && term == 1
|
174
174
|
if loan.bullet_term?(term)
|
175
175
|
index = first_term_skip ? index(line - 1) : index(line)
|
176
176
|
|
@@ -180,7 +180,7 @@ module BlendSpreadsheetLoanGenerator
|
|
180
180
|
|
181
181
|
"=#{current} - #{capitalized_fees_start(line)}"
|
182
182
|
elsif loan.deferred_and_capitalized > 0 && term > loan.deferred_and_capitalized
|
183
|
-
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
|
184
184
|
|
185
185
|
with_fees = "#{remaining_capital_start(line)} * (1 + #{period_rate(line)} + #{period_fees_rate(line)})^#{index} * (#{period_rate(line)} + #{period_fees_rate(line)})"
|
186
186
|
without_fees = "#{remaining_capital_start(line)} * (1 + #{period_rate(line)})^#{index} * #{period_rate(line)}"
|
@@ -207,7 +207,7 @@ module BlendSpreadsheetLoanGenerator
|
|
207
207
|
|
208
208
|
def capitalized_fees_end_formula(line:, first_term_skip: false)
|
209
209
|
term = line - 1
|
210
|
-
return excel_float(0.0) if first_term_skip
|
210
|
+
return excel_float(0.0) if first_term_skip && term == 1
|
211
211
|
if term <= loan.deferred_and_capitalized
|
212
212
|
index = first_term_skip ? index(line - 1) : index(line)
|
213
213
|
with_fees = "#{remaining_capital_start(line)} * (1 + #{period_fees_rate(line)} + #{period_rate(line)})^#{index}"
|