blend_spreadsheet_loan_generator 0.1.24 → 0.1.25

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: 0473a465aaf8c05516fd8ed8eeff3009996f4afe3c9dbc5578df88fb4985a03a
4
- data.tar.gz: a73d70c1cbfd2d2241dd2bc875750358bf6893914739b0b5efaf65271e8800f1
3
+ metadata.gz: 169f284925fdd8ff961eecf431c8fd62625cf9b5cc1006cf2c0d1fe2ff3d290d
4
+ data.tar.gz: af871dff6102cbb857cd7fbc65f75265b597cee10689adc820c1b7060cf72dbe
5
5
  SHA512:
6
- metadata.gz: 55e0989827c375bc5f13d58c7bef7d7bf0024126f838997b7a5c669e5a4bb378020c4dff1d616b78f6686f3b3050bbba7a5132fd18385cf0aaa668d1e8fd09a6
7
- data.tar.gz: 76cbd06e23b5250740ad087e08f4f61f22c6ae828e2ea1dec23559a2d55ae4bfbd5e1f7d72f81f0efa823ca3de7dd7dd86c2ca3c864fb68e7a7d7e4ee41a6bf8
6
+ metadata.gz: 483fbcafe2c4f763f2b1a53108d4d80f344471a730de69e2a938370ae5159581925f93b1efa33e29530afbc74897a0aaf4251a9885c46ac2f7926478a15c51cc
7
+ data.tar.gz: da813c5b56325a72db5023b2fad4be50008bb112c2198ac491a99d7d17c57131245eb2bc48750aef5c19addd9b2825a27e34a7e639a59ac125844c63e4aa4e11
data/exe/bslg CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require_relative '../lib/blend_spreadsheet_loan_generator'
4
+
4
5
  Dry::CLI.new(BlendSpreadsheetLoanGenerator).call
@@ -80,27 +80,24 @@ module BlendSpreadsheetLoanGenerator
80
80
 
81
81
  capital_paid = amount_paid.to_f - (
82
82
  values[last_paid_line + 1][:capitalized_interests_start] +
83
- values[last_paid_line + 1][:capitalized_fees_start]
84
- )
85
- actual_capital_paid = (
86
- capital_paid -
87
- values[last_paid_line + 1][:period_calculated_interests] -
83
+ values[last_paid_line + 1][:capitalized_fees_start] +
84
+ values[last_paid_line + 1][:period_calculated_interests] +
88
85
  values[last_paid_line + 1][:period_calculated_fees]
89
86
  )
90
87
 
91
- ratio = options.fetch(:ratio, (actual_capital_paid.to_f / values[last_paid_line + 1][:remaining_capital_start])).to_f
88
+ ratio = options.fetch(:ratio, (capital_paid.to_f / values[last_paid_line + 1][:remaining_capital_start])).to_f
92
89
  guaranteed_interests_paid = (
93
90
  ratio * total_guaranteed_interests
94
91
  )
95
- capital_paid -= guaranteed_interests_paid
96
92
 
97
93
  amount = (
98
94
  if last_paid_line == -1
99
- values[0][:remaining_capital_end]
95
+ values[0][:remaining_capital_start]
100
96
  else
101
97
  values[last_paid_line][:remaining_capital_end]
102
98
  end
103
99
  )
100
+
104
101
  @loan = Loan.new(
105
102
  amount: amount,
106
103
  duration: duration,
@@ -124,10 +121,10 @@ module BlendSpreadsheetLoanGenerator
124
121
  apply_formulas(worksheet: worksheet)
125
122
 
126
123
  worksheet[2, columns.index('remaining_capital_start') + 1] =
127
- excel_float(values[last_paid_line][:remaining_capital_end])
124
+ excel_float(values[last_paid_line + 1][:remaining_capital_start])
128
125
 
129
126
  worksheet[2, columns.index('remaining_capital_end') + 1] =
130
- "=#{excel_float(values[last_paid_line][:remaining_capital_end])} - #{period_capital(2)}"
127
+ "=#{excel_float(values[last_paid_line + 1][:remaining_capital_start])} - #{period_capital(2)}"
131
128
 
132
129
  worksheet[2, columns.index('period_interests') + 1] =
133
130
  "=ARRONDI(#{period_theoric_interests(2)}; 2)"
@@ -138,8 +135,7 @@ module BlendSpreadsheetLoanGenerator
138
135
  worksheet[2, columns.index('period_fees') + 1] =
139
136
  "=#{excel_float(values[last_paid_line + 1][:period_calculated_fees])}"
140
137
 
141
- worksheet[2, columns.index('period_capital') + 1] =
142
- "=#{excel_float(capital_paid)} - #{period_interests(2)} - #{period_fees(2)}"
138
+ worksheet[2, columns.index('period_capital') + 1] = "=#{excel_float(capital_paid)}"
143
139
 
144
140
  worksheet[2, columns.index('capitalized_interests_start') + 1] =
145
141
  excel_float(values[last_paid_line + 1][:capitalized_interests_start])
@@ -1,7 +1,7 @@
1
1
  require 'dry/cli'
2
2
 
3
3
  module BlendSpreadsheetLoanGenerator
4
- VERSION = '0.1.24'.freeze
4
+ VERSION = '0.1.25'.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.24
4
+ version: 0.1.25
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-13 00:00:00.000000000 Z
11
+ date: 2021-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport