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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e577c4867c3181945bf7cb960443c26aca398c1b2650cc41b23eecb2ba07740f
|
4
|
+
data.tar.gz: 7751b3676cd92659f849d265a1be7cc4b49ae251533b2b8a8aeb30198a82aac9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10a1b186823531afe0ecdd159228b7ca9da495d9792c3f1900f611c560795642351475c68deb7f8b4ab9f262da9ef9ec086157cce1749d037f0c7702fca7cd85
|
7
|
+
data.tar.gz: c41aa92c96c91fc17f89dcc5b1772351705a995809365e06263019fbfc077f82a10b8d7406f26bad97d3503cc82ce4101b0c1afc04a5330be7b555e892ded191
|
@@ -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
|
-
|
79
|
-
total_guaranteed_interests
|
80
|
+
ratio * total_guaranteed_interests
|
80
81
|
)
|
81
82
|
capital_paid -= guaranteed_interests_paid
|
82
83
|
|
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.
|
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-
|
11
|
+
date: 2021-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|