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: 921655773138be86f9be5537649ee90ca790e2d67e552c743a5cd74115db1bc7
4
- data.tar.gz: d83df61bf603fecc1b04d7c13ff25fdf2f1e5370baaf12eb0063ad2ba84349c2
3
+ metadata.gz: 72957cc9d2f27e41c08296925655eb7a260e7fdaef6c0930dcc308f9a7c8ab25
4
+ data.tar.gz: ff081b04d72056d4de09f73e026069c4eae6151f1a684fab698aa796065ae635
5
5
  SHA512:
6
- metadata.gz: 9e80b9833c4a7cf49a850e3343cd85cfb2df61877c81b05d0b94d45fcb07fc318e1aaadf4a7cde6687a0497870bcadee7786ef16c8b0b04a86e3e7e72d4076e0
7
- data.tar.gz: 7ed5dbc054272947b041186687e35845f4dc0c267cb9e686758782b259b1d22b4db31123f368ec518184aace63096ad45c1150ca7d09cdb8f79e6e9a2089ffe8
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?(custom_early_repayment)
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 - 1
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}"
@@ -74,7 +74,7 @@ module BlendSpreadsheetLoanGenerator
74
74
 
75
75
  @formula = Formula.new(loan: loan)
76
76
 
77
- apply_formulas(worksheet: worksheet, first_term_skip: true)
77
+ apply_formulas(worksheet: worksheet)
78
78
  apply_formats(worksheet: worksheet)
79
79
 
80
80
  worksheet.save
@@ -1,7 +1,7 @@
1
1
  require 'dry/cli'
2
2
 
3
3
  module BlendSpreadsheetLoanGenerator
4
- VERSION = '0.1.101'.freeze
4
+ VERSION = '0.1.105'.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.101
4
+ version: 0.1.105
5
5
  platform: ruby
6
6
  authors:
7
7
  - MZiserman