blend_spreadsheet_loan_generator 0.1.33 → 0.1.34
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: 8afe8c32a76a11a3afd5fd90cc9c5728116650fdb99c3d68cbc9a69c6016d671
|
|
4
|
+
data.tar.gz: d727c22901f61615b4ef4cb592fe9f357dfbe1dfb65ca3fccb6a9b3ef1149b76
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd1c6e2922917ca77eb25f0bb316e9e693d1ecf8a6abddfbeb174c5facd778ad01979233af173bcaa822ee2f45805641738ebffd8657ef865645ddfc0aa2d139
|
|
7
|
+
data.tar.gz: 89a27d018920a740a9813a016fdc12bc183a10deabd001bd029274cfb9c384d1728401093e6ff1aff51abcaf2c437ecdbd8169d56fa6fb77346a517b590756d5
|
|
@@ -163,21 +163,30 @@ module BlendSpreadsheetLoanGenerator
|
|
|
163
163
|
term = line - 1
|
|
164
164
|
if term <= loan.deferred_and_capitalized
|
|
165
165
|
excel_float(0.0)
|
|
166
|
+
elsif loan.deferred_and_capitalized > 0 && loan.deferred.present?
|
|
167
|
+
|
|
166
168
|
else
|
|
167
169
|
"=ARRONDI(#{period_calculated_fees(line)}; 2)"
|
|
168
170
|
end
|
|
169
171
|
end
|
|
170
172
|
|
|
171
173
|
def period_calculated_fees_formula(line:)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
remaining_capital_start(line)
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
174
|
+
term = line - 1
|
|
175
|
+
if loan.deferred_and_capitalized > 0 && term > loan.deferred_and_capitalized
|
|
176
|
+
with_fees = "#{remaining_capital_start(line: line)} * (1 + #{period_rate(line: line)} + #{period_fees_rate(line: line)})^#{loan.deferred_and_capitalized} * (#{period_rate(line: line)} + #{period_fees_rate(line: line)})"
|
|
177
|
+
without_fees = "#{remaining_capital_start(line: line)} * (1 + #{period_rate(line: line)})^#{loan.deferred_and_capitalized} * #{period_rate(line: line)}"
|
|
178
|
+
"=#{with_fees} - #{without_fees}"
|
|
179
|
+
else
|
|
180
|
+
amount_to_capitalize = [
|
|
181
|
+
'(',
|
|
182
|
+
remaining_capital_start(line),
|
|
183
|
+
'+',
|
|
184
|
+
capitalized_interests_start(line),
|
|
185
|
+
')'
|
|
186
|
+
].join(' ')
|
|
187
|
+
|
|
188
|
+
"=#{amount_to_capitalize} * #{period_fees_rate(line)}"
|
|
189
|
+
end
|
|
181
190
|
end
|
|
182
191
|
|
|
183
192
|
def capitalized_fees_start_formula(line:)
|