blend_spreadsheet_loan_generator 0.1.37 → 0.1.38

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: 27190e62c6f022886585a05178b48b3145887fc2299d32dd184572d034f8a22f
4
- data.tar.gz: 4208f3be04bc68c700ad262fcd90e7e6130c3eb3414ef5ac8ae46035a6d7cb30
3
+ metadata.gz: 7600f8eb355e9e5505dbddbbf4fee01c9f3830f20a3f33d40e64d90a1ef4ca92
4
+ data.tar.gz: 34f88205215b6c1885061567a2e506500749bba02e4ea37c859abb192a392f66
5
5
  SHA512:
6
- metadata.gz: 075fae95ddf44ce9ce1b360debd2942c5cfbb94a623f9f37519f74109db3f43cab3624953c383a14dfc829819a1e3d363e569aada4305ea63755313ccc58df3b
7
- data.tar.gz: 1c2721d5083b1e9e5bda9055dcc9ae3afe69744fb3b98036373a6b57f18e2d6dce2e0d34e0894cff7e21c8dd376b5fe9ea3e9790935e85cf721dc6456328327c
6
+ metadata.gz: a98439ca0cc32a014b5eb9a319db03e1ea5e176b20dbde268dc4f81d54da3b702d33ffc085a329988858d0f0448880e76fae10ad5440009253031dfc1d340439
7
+ data.tar.gz: 0663020d3eecf5a36d7c7eff0fedfa2f166692eac16d4959a32e2157c4e7cd3aede6dc60c981e2de0b444eee82bec8c07621011d7876caa980adc01ec6779dec
@@ -174,7 +174,7 @@ module BlendSpreadsheetLoanGenerator
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)})"
175
175
  without_fees = "#{remaining_capital_start(line)} * (1 + #{period_rate(line)})^#{loan.deferred_and_capitalized} * #{period_rate(line)}"
176
176
  "=#{with_fees} - #{without_fees}"
177
- elsif loan.bullet? && term == loan.duration
177
+ elsif loan.bullet_term?(term)
178
178
  with_fees = "#{remaining_capital_start(line)} * (1 + #{period_fees_rate(line)} + #{period_rate(line)})^#{index(line)}"
179
179
  without_fees = "#{remaining_capital_start(line)} * (1 + #{period_rate(line)})^#{index(line)}"
180
180
  current = "#{with_fees} - #{without_fees}"
@@ -112,6 +112,10 @@ module BlendSpreadsheetLoanGenerator
112
112
  fully_deferred? && deferred_and_capitalized == total_deferred_duration
113
113
  end
114
114
 
115
+ def bullet_term?(term)
116
+ deferred_and_capitalized <= term || bullet? # for last term
117
+ end
118
+
115
119
  def in_fine?
116
120
  fully_deferred? && deferred == total_deferred_duration
117
121
  end
@@ -1,7 +1,7 @@
1
1
  require 'dry/cli'
2
2
 
3
3
  module BlendSpreadsheetLoanGenerator
4
- VERSION = '0.1.37'.freeze
4
+ VERSION = '0.1.38'.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.37
4
+ version: 0.1.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - MZiserman