blend_spreadsheet_loan_generator 0.1.19 → 0.1.20

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: 3a4482f5c0a0e93b8085f1bc9d064a15873d9da91d4a3c945febb087b9a233ff
4
- data.tar.gz: a00f98340c0aa4109b950d59c132bbbeab5878992b474875db21078010762162
3
+ metadata.gz: e577c4867c3181945bf7cb960443c26aca398c1b2650cc41b23eecb2ba07740f
4
+ data.tar.gz: 7751b3676cd92659f849d265a1be7cc4b49ae251533b2b8a8aeb30198a82aac9
5
5
  SHA512:
6
- metadata.gz: 3a7e731e49a56746d8a0b60e7a867efa6f10c65e59ad785fed1dd0529e3f1ca748582f1c6e54867b3c25cf54fb553d05f3b5d4a915194815960868c1c0fda226
7
- data.tar.gz: 3337ca2d8d85a4eabb170869097eded13b92404f5ea402bb70ef6b943946479784f8e46d0fa868a58498f9b0c52184958671050d3a4944ce3a7099a7e1a2f1c3
6
+ metadata.gz: 10a1b186823531afe0ecdd159228b7ca9da495d9792c3f1900f611c560795642351475c68deb7f8b4ab9f262da9ef9ec086157cce1749d037f0c7702fca7cd85
7
+ data.tar.gz: c41aa92c96c91fc17f89dcc5b1772351705a995809365e06263019fbfc077f82a10b8d7406f26bad97d3503cc82ce4101b0c1afc04a5330be7b555e892ded191
@@ -3,7 +3,6 @@ module BlendSpreadsheetLoanGenerator
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
-
7
6
  def columns
8
7
  %w[
9
8
  index
@@ -13,6 +13,7 @@ module BlendSpreadsheetLoanGenerator
13
13
  argument :rate, type: :float, required: true, desc: 'year rate post restructuration'
14
14
 
15
15
  option :guaranteed_terms, type: :integer, default: 0
16
+ option :ratio, type: :float
16
17
  option :duration, type: :integer, desc: 'duration'
17
18
  option :period_duration, type: :integer, default: 1, desc: 'duration of a period in months'
18
19
  option :due_on, type: :date, default: Date.today, desc: 'date of the pay day of the first period DD/MM/YYYY'
@@ -74,9 +75,9 @@ module BlendSpreadsheetLoanGenerator
74
75
  values[last_paid_line + 1][:capitalized_interests_start] +
75
76
  values[last_paid_line + 1][:capitalized_fees_start]
76
77
  )
78
+ ratio = options.fetch(:ratio, (capital_paid.to_f / values[last_paid_line + 1][:remaining_capital_start]))
77
79
  guaranteed_interests_paid = (
78
- (capital_paid.to_f / values[last_paid_line + 1][:remaining_capital_start]) *
79
- total_guaranteed_interests
80
+ ratio * total_guaranteed_interests
80
81
  )
81
82
  capital_paid -= guaranteed_interests_paid
82
83
 
@@ -1,7 +1,7 @@
1
1
  require 'dry/cli'
2
2
 
3
3
  module BlendSpreadsheetLoanGenerator
4
- VERSION = '0.1.19'.freeze
4
+ VERSION = '0.1.20'.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.19
4
+ version: 0.1.20
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-12 00:00:00.000000000 Z
11
+ date: 2021-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport