blend_spreadsheet_loan_generator 0.1.40 → 0.1.41
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: 1357474c60cfb9e4c2856a80890d3d009fc78a66d38848e1b280ba3e1326dbd1
|
4
|
+
data.tar.gz: 6c7c524d35b0877d3d8a446142fc7c3e7bb5291af9fa9c07fc8343334e7dba6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 774098b91a0e32d71bfa251adf70f888e5a2447172da89fe6f8310d2e6dc460910c3c9e60cf05589e41fd03a95ad466b3ee1fc3a1f2c2e98d3713ef49a96736e
|
7
|
+
data.tar.gz: 269d14778cc7c31d65a900e6542cc2a0dfe101d07aa2670b11bf8ed22b9556cf13d97df81b2d64a3f615d7c03d5b50a52baf56927b7904c6b04d72c5e46bf009
|
@@ -87,14 +87,14 @@ module BlendSpreadsheetLoanGenerator
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
|
-
def apply_formulas(worksheet:, early_repayment
|
90
|
+
def apply_formulas(worksheet:, early_repayment: true)
|
91
91
|
columns.each.with_index do |title, column|
|
92
92
|
worksheet[1, column + 1] = title
|
93
93
|
end
|
94
94
|
loan.duration.times do |line|
|
95
95
|
columns.each.with_index do |title, column|
|
96
96
|
if early_repayment && title == 'period_calculated_fees'
|
97
|
-
worksheet[line + 2, column + 1] = @formula.send("#{title}_formula", line: line + 2, early_repayment
|
97
|
+
worksheet[line + 2, column + 1] = @formula.send("#{title}_formula", line: line + 2, early_repayment: true)
|
98
98
|
else
|
99
99
|
worksheet[line + 2, column + 1] = @formula.send("#{title}_formula", line: line + 2)
|
100
100
|
end
|
@@ -127,7 +127,7 @@ module BlendSpreadsheetLoanGenerator
|
|
127
127
|
|
128
128
|
@formula = Formula.new(loan: loan)
|
129
129
|
|
130
|
-
apply_formulas(worksheet: worksheet, early_repayment
|
130
|
+
apply_formulas(worksheet: worksheet, early_repayment: true)
|
131
131
|
|
132
132
|
worksheet[2, columns.index('remaining_capital_start') + 1] =
|
133
133
|
excel_float(values[last_paid_line + 1][:remaining_capital_start])
|
@@ -168,7 +168,7 @@ module BlendSpreadsheetLoanGenerator
|
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
171
|
-
def period_calculated_fees_formula(line:, early_repayment
|
171
|
+
def period_calculated_fees_formula(line:, early_repayment: false)
|
172
172
|
term = line - 1
|
173
173
|
if loan.deferred_and_capitalized > 0 && term > loan.deferred_and_capitalized
|
174
174
|
with_fees = "#{remaining_capital_start(line)} * (1 + #{period_rate(line)} + #{period_fees_rate(line)})^#{loan.deferred_and_capitalized} * (#{period_rate(line)} + #{period_fees_rate(line)})"
|
@@ -177,7 +177,7 @@ module BlendSpreadsheetLoanGenerator
|
|
177
177
|
"=#{with_fees} - #{without_fees}"
|
178
178
|
elsif loan.bullet_term?(term)
|
179
179
|
index = (
|
180
|
-
if early_repayment
|
180
|
+
if early_repayment
|
181
181
|
index(line - 1)
|
182
182
|
else
|
183
183
|
index(line)
|