blend_spreadsheet_loan_generator 0.1.101 → 0.1.105
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: 72957cc9d2f27e41c08296925655eb7a260e7fdaef6c0930dcc308f9a7c8ab25
|
4
|
+
data.tar.gz: ff081b04d72056d4de09f73e026069c4eae6151f1a684fab698aa796065ae635
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22fd450d7087a51b999348bb324a9d38726ea33425ba85e77c77026a871e7ff4ff0fb2e2ff685aa7110d3920efaeccabce75382e15f4f3ee8dc2558e27dbd04c
|
7
|
+
data.tar.gz: 12e57b1f793e676501f7d1c127052eaf0d1f313b9a10a90238c1aa6164fb0ab2bd6082a79cde7b3c1dc78522d9044b02e1b6ee978b839f3d222a38dda537c0de
|
@@ -100,7 +100,7 @@ module BlendSpreadsheetLoanGenerator
|
|
100
100
|
end
|
101
101
|
loan.duration.times do |line|
|
102
102
|
columns.each.with_index do |title, column|
|
103
|
-
if first_term_skip && title.in?(
|
103
|
+
if first_term_skip && title.in?(first_term_skip_columns)
|
104
104
|
worksheet[line + 2, column + 1] = @formula.send("#{title}_formula", line: line + 2, first_term_skip: true)
|
105
105
|
else
|
106
106
|
worksheet[line + 2, column + 1] = @formula.send("#{title}_formula", line: line + 2)
|
@@ -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}"
|