blend_spreadsheet_loan_generator 0.1.43 → 0.1.44

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: 579b2d03b24b45a57e78c9c5ddf59b268e308bed4cc8430abe7d1c16ef0f1947
4
- data.tar.gz: c0ba98674ce0c1d2a77571969e30fd4dbdb4da04a7c38dff8fbce8e66dc939d7
3
+ metadata.gz: 67df2b7e1ae954e3a178958ff9ae38eac5c075dad5da0e0746a2dbe5d2ef12a4
4
+ data.tar.gz: 8fb75d6abae44e6df84aa79a3df562ee468c70d904db568a4cc452988af47f7d
5
5
  SHA512:
6
- metadata.gz: 839a032643e22e7445b1dfe06d3cc2bd97db8ee65c84bc2f4e18f157206a5a068b83825100595af093dde0925babfb3a119843ed321cb36a52f08974323e789a
7
- data.tar.gz: f17f59099f9ab23e65cbef14230c76bd17ce90aad022d9e433a4b3b53bf2ec4cafefc82c988ca478e0ceac8b606acade5c89845f0edecb254dfc5876db6f1971
6
+ metadata.gz: e3920a396b1195ce22bb4d20682747d98896c37e68bc93bee8936505192357a71c09e10a5c5e8cfee7116309a45d61b421c58a79dbaba4b6a530249919884167
7
+ data.tar.gz: ea1a0ea185b50379b64f0425f2f18967bad50a893c06531cd89f751da36c911827f8ac1c2611603b8177d037716b390e9fa2126527702900cef0b4844d7ac8c2
@@ -170,12 +170,7 @@ module BlendSpreadsheetLoanGenerator
170
170
 
171
171
  def period_calculated_fees_formula(line:, early_repayment: false)
172
172
  term = line - 1
173
- if loan.deferred_and_capitalized > 0 && term > loan.deferred_and_capitalized
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)})"
175
- without_fees = "#{remaining_capital_start(line)} * (1 + #{period_rate(line)})^#{loan.deferred_and_capitalized} * #{period_rate(line)}"
176
-
177
- "=#{with_fees} - #{without_fees}"
178
- elsif loan.bullet_term?(term)
173
+ if loan.bullet_term?(term)
179
174
  index = (
180
175
  if early_repayment
181
176
  index(line - 1)
@@ -188,6 +183,11 @@ module BlendSpreadsheetLoanGenerator
188
183
  current = "#{with_fees} - #{without_fees}"
189
184
 
190
185
  "=#{current} - #{capitalized_fees_start(line)}"
186
+ elsif loan.deferred_and_capitalized > 0 && term > loan.deferred_and_capitalized
187
+ 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)})"
188
+ without_fees = "#{remaining_capital_start(line)} * (1 + #{period_rate(line)})^#{loan.deferred_and_capitalized} * #{period_rate(line)}"
189
+
190
+ "=#{with_fees} - #{without_fees}"
191
191
  else
192
192
  amount_to_capitalize = [
193
193
  '(',
@@ -1,7 +1,7 @@
1
1
  require 'dry/cli'
2
2
 
3
3
  module BlendSpreadsheetLoanGenerator
4
- VERSION = '0.1.43'.freeze
4
+ VERSION = '0.1.44'.freeze
5
5
 
6
6
  class Version < Dry::CLI::Command
7
7
  desc 'Print version'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blend_spreadsheet_loan_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.43
4
+ version: 0.1.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - MZiserman