blend_spreadsheet_loan_generator 0.1.112 → 0.1.113
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: 3a686aabdf2ad77dc1401d3a58a9048c819f26baa430f7230b161189b2aab7f1
|
4
|
+
data.tar.gz: 5507bea96b5ff6c0dcb6e3d377edaf3a2c74c96fe29fcd769dc87530d00635f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f1a3ab207cebd8f8f678f878b4ddcee383ec9262c7135f4d951853a1a2736da80779e759a69e8f3955058910b8edd86ffbc5620232c51e5702f5eee28ec3d2a
|
7
|
+
data.tar.gz: 61f3e0ed44d252ba8c1027fea4a29334b35338cebbbd1a2bfb316aca895ad9fa875ea546477d0d04c0f4bda5439362e5195d6a8978d6ea7e62c9594828831493
|
@@ -79,19 +79,23 @@ module BlendSpreadsheetLoanGenerator
|
|
79
79
|
|
80
80
|
due_on = values[last_paid_line + 1][:due_on] + 1.month
|
81
81
|
|
82
|
-
|
82
|
+
capital_paid_for_ratio = amount_paid.to_f - (
|
83
83
|
values[last_paid_line + 1][:period_interests] +
|
84
84
|
values[last_paid_line + 1][:period_reimbursed_capitalized_interests] +
|
85
85
|
values[last_paid_line + 1][:period_fees] +
|
86
86
|
values[last_paid_line + 1][:period_reimbursed_capitalized_fees] +
|
87
87
|
values[last_paid_line + 1][:capitalized_fees_end]
|
88
88
|
)
|
89
|
+
capital_paid = [
|
90
|
+
0,
|
91
|
+
capital_paid_for_ratio - values[last_paid_line + 1][:capitalized_interests_end]
|
92
|
+
].max
|
89
93
|
remaining_capital_for_ratio = (
|
90
94
|
values[last_paid_line + 1][:remaining_capital_start] +
|
91
95
|
values[last_paid_line + 1][:capitalized_interests_end]
|
92
96
|
)
|
93
97
|
|
94
|
-
ratio = options.fetch(:ratio,
|
98
|
+
ratio = options.fetch(:ratio, capital_paid_for_ratio.to_f / remaining_capital_for_ratio).to_f
|
95
99
|
guaranteed_interests_paid = ratio * total_guaranteed_interests
|
96
100
|
guaranteed_fees_paid = ratio * total_guaranteed_fees
|
97
101
|
|