blend_spreadsheet_loan_generator 0.1.18 → 0.1.19

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: 6f1bd528dfab34e5a542c71fb717a135514bcd836c514459aa3cd48370d8c6ce
4
- data.tar.gz: 158fd28b4211df4ba3bc97b9fb79aa585267e2fb430974454f81780e3582c0aa
3
+ metadata.gz: 3a4482f5c0a0e93b8085f1bc9d064a15873d9da91d4a3c945febb087b9a233ff
4
+ data.tar.gz: a00f98340c0aa4109b950d59c132bbbeab5878992b474875db21078010762162
5
5
  SHA512:
6
- metadata.gz: 26472f95146cb98da47c04b28cb1fd1fc03e318cdcf1f960cce59b8faca80e4a007b8bcfd85a24ee259babdce978acae868b0fe20d0132694d45dcc0d8ba5853
7
- data.tar.gz: e88f0c3853586ecbc59cdbc0c255543dc19816e1873f35b3242bb6701f4aeef5b9a9a0dce4335efbfb6f5af0bdd3861c68931fcc10c54a66e56500a7db8cb212
6
+ metadata.gz: 3a7e731e49a56746d8a0b60e7a867efa6f10c65e59ad785fed1dd0529e3f1ca748582f1c6e54867b3c25cf54fb553d05f3b5d4a915194815960868c1c0fda226
7
+ data.tar.gz: 3337ca2d8d85a4eabb170869097eded13b92404f5ea402bb70ef6b943946479784f8e46d0fa868a58498f9b0c52184958671050d3a4944ce3a7099a7e1a2f1c3
data/exe/bslg CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require_relative '../lib/blend_spreadsheet_loan_generator'
4
-
5
4
  Dry::CLI.new(BlendSpreadsheetLoanGenerator).call
@@ -33,6 +33,7 @@ module BlendSpreadsheetLoanGenerator
33
33
  capitalized_fees_end
34
34
  period_reimbursed_capitalized_fees
35
35
  period_fees_rate
36
+ period_reimbursed_guaranteed_interests
36
37
  ]
37
38
  end
38
39
 
@@ -53,6 +54,7 @@ module BlendSpreadsheetLoanGenerator
53
54
  capitalized_fees_start
54
55
  capitalized_fees_end
55
56
  period_reimbursed_capitalized_fees
57
+ period_reimbursed_guaranteed_interests
56
58
  ]
57
59
  end
58
60
 
@@ -44,7 +44,7 @@ module BlendSpreadsheetLoanGenerator
44
44
  values.map! { |r| set_types([columns, r].transpose.to_h.with_indifferent_access) }
45
45
 
46
46
  last_paid_line = values.index { |term| term[:index] == last_paid_term.to_i }
47
- guaranteed_line = values.index { |term| term[:index] == options.fetch(:guaranteed_terms, nil) } || nil
47
+ guaranteed_line = values.index { |term| term[:index] == options.fetch(:guaranteed_terms, -1).to_i } || nil
48
48
  total_guaranteed_interests = (
49
49
  if guaranteed_line.present? && guaranteed_line > last_paid_line
50
50
  values[(last_paid_line + 1)..guaranteed_line].sum { |value| value[:period_calculated_interests] }
@@ -109,7 +109,7 @@ module BlendSpreadsheetLoanGenerator
109
109
  "=#{excel_float(values[last_paid_line][:remaining_capital_end])} - #{period_capital(2)}"
110
110
 
111
111
  worksheet[2, columns.index('period_interests') + 1] =
112
- "=ARRONDI(#{period_theoric_interests(2)} + #{excel_float(guaranteed_interests_paid)}; 2)"
112
+ "=ARRONDI(#{period_theoric_interests(2)}; 2)"
113
113
 
114
114
  worksheet[2, columns.index('period_theoric_interests') + 1] =
115
115
  "=#{excel_float(values[last_paid_line + 1][:period_calculated_interests])}"
@@ -136,6 +136,9 @@ module BlendSpreadsheetLoanGenerator
136
136
  worksheet[2, columns.index('period_reimbursed_capitalized_fees') + 1] =
137
137
  excel_float(values[last_paid_line + 1][:capitalized_fees_start])
138
138
 
139
+ worksheet[2, columns.index('period_reimbursed_guaranteed_interests') + 1] =
140
+ excel_float(guaranteed_interests_paid)
141
+
139
142
  apply_formats(worksheet: worksheet)
140
143
 
141
144
  worksheet.save
@@ -175,6 +178,7 @@ module BlendSpreadsheetLoanGenerator
175
178
  h[:capitalized_fees_end] = h[:capitalized_fees_end].to_f
176
179
  h[:period_reimbursed_capitalized_fees] = h[:period_reimbursed_capitalized_fees].to_f
177
180
  h[:period_fees_rate] = h[:period_fees_rate].to_f
181
+ h[:period_reimbursed_guaranteed_interests] = h[:period_reimbursed_guaranteed_interests].to_f
178
182
 
179
183
  h
180
184
  end
@@ -42,7 +42,9 @@ module BlendSpreadsheetLoanGenerator
42
42
  '+',
43
43
  period_interests(line),
44
44
  '+',
45
- period_reimbursed_capitalized_interests(line)
45
+ period_reimbursed_capitalized_interests(line),
46
+ '+',
47
+ period_reimbursed_guaranteed_interests(line)
46
48
  ].join(' ')
47
49
  "=ARRONDI(#{total}; 2)"
48
50
  end
@@ -207,5 +209,9 @@ module BlendSpreadsheetLoanGenerator
207
209
  def period_fees_rate_formula(line:)
208
210
  @interests_formula.period_fees_rate_formula(line: line)
209
211
  end
212
+
213
+ def period_reimbursed_guaranteed_interests_formula(line:)
214
+ excel_float(0.0)
215
+ end
210
216
  end
211
217
  end
@@ -1,7 +1,7 @@
1
1
  require 'dry/cli'
2
2
 
3
3
  module BlendSpreadsheetLoanGenerator
4
- VERSION = '0.1.18'.freeze
4
+ VERSION = '0.1.19'.freeze
5
5
 
6
6
  class Version < Dry::CLI::Command
7
7
  desc 'Print version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blend_spreadsheet_loan_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - MZiserman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-09 00:00:00.000000000 Z
11
+ date: 2021-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport