french_tax_system 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +2 -2
- data/lib/french_tax_system/version.rb +1 -1
- data/lib/french_tax_system.rb +27 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1ef06c9e6d161ca0643d7132efb9f277c2e9534de5e58de72fc524b816ac14f
|
4
|
+
data.tar.gz: 8cfeb927285be2ebddc1a8f953868070966cf7cdf1c84cf20d7048ee5f498073
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb121467116fe7ef24162f907282a945b8c948e0e29742742e1dadad9e27475e4f40dc09326d50588f8866ebb4f077560576e587fa215783d537e3950b690a74
|
7
|
+
data.tar.gz: 496f2a78991e96c22d13e8a578f2d5925dacef3b633c4473909433684cbcdb423b18979580d4da7817972b35f945fe707ef7e259849538af97095aa30f825d24
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/french_tax_system.rb
CHANGED
@@ -61,7 +61,32 @@ module FrenchTaxSystem
|
|
61
61
|
|
62
62
|
# Methods
|
63
63
|
|
64
|
-
#
|
64
|
+
# SIMULATION HASH KEYS ARE SYMBOLS not string
|
65
|
+
|
66
|
+
# Calculate the income tax to pay over the years (from first to investment_top_fscail year) with or without the generated income from the property investment
|
67
|
+
#
|
68
|
+
# @params [Hash] simulation a simulation created by Mini-Keyz app
|
69
|
+
# @options simulation [Integer] :house_rent_amount_per_year how much is the rent paid by the tenant (euros/year)
|
70
|
+
# @options simulation [Integer] :house_price_bought_amount how much was the house bought (euros)
|
71
|
+
# @options simulation [Integer] :house_first_works_amount how much were the first works realized (euros)
|
72
|
+
# @options simulation [Integer] :house_landlord_charges_amount_per_year how much are the landlord charges (euros/year)
|
73
|
+
# @options simulation [Float] :house_property_management_amount_per_year how much is property management cost (euros/year)
|
74
|
+
# @options simulation [Integer] :house_property_tax_amount_per_year how much is the property tax (euros/year)
|
75
|
+
# @options simulation [Integer] :house_insurance_gli_amount_per_year how much is gli insurance cost (euros/year)
|
76
|
+
# @options simulation [Integer] :house_insurance_pno_amount_per_year how much is pno insurance cost (euros/year)
|
77
|
+
# @options simulation [Integer] :credit_loan_amount how much is credit loan amount (euros)
|
78
|
+
# @options simulation [Integer] :credit_loan_duration how long is the credit (years)
|
79
|
+
# @options simulation [Float] :credit_loan_cumulative_interests_paid_for_year_two how much is the credit interest cost for year 2 (euros/year)
|
80
|
+
# @options simulation [Float] :credit_loan_insurance_amount_per_year how much is the credit insurance cost (euros/year)
|
81
|
+
# @options simulation [String] :fiscal_status what fiscal status has been chosen
|
82
|
+
# @options simulation [String] :fiscal_regimen what fiscal regimen has been chosen
|
83
|
+
# @options simulation [Integer] :fiscal_revenues_p1 salary from person 1 of the fiscal household (euros)
|
84
|
+
# @options simulation [Integer] :fiscal_revenues_p2 salary from person 2 of the fiscal household (euros)
|
85
|
+
# @options simulation [String] :fiscal_marital_status fiscal relation between the 'parents' of the household
|
86
|
+
# @options simulation [Integer] :fiscal_nb_dependent_children number of dependent children of fiscal household (nb)
|
87
|
+
# @options simulation [Integer] :fiscal_nb_alternate_custody_children number of alternate custody children of fiscal household (nb)
|
88
|
+
# @params [String] calculation_method indicates if the calculation is made with or without the property income
|
89
|
+
# @params [Integer] investment_top_fiscal_year the last year of the period we want to calculate the taxes amount on
|
65
90
|
def calc_taxes_amount_per_year(simulation, calculation_method, investment_top_fiscal_year)
|
66
91
|
# Iterate over investment first to top fiscal year and return an array which concatenates all hashes generated per fiscal year
|
67
92
|
income_tax_array = []
|
@@ -198,7 +223,7 @@ module FrenchTaxSystem
|
|
198
223
|
#
|
199
224
|
# @return [Float] the global net taxable amount (euros)
|
200
225
|
def calc_global_net_taxable_amount(simulation, net_taxable_property_income_amount)
|
201
|
-
((simulation[:fiscal_revenues_p1] + (simulation.
|
226
|
+
((simulation[:fiscal_revenues_p1] + (simulation[:fiscal_revenues_p2].nil? ? 0 : simulation[:fiscal_revenues_p2])) * (1 - REVENUES_STANDARD_ALLOWANCE)) + net_taxable_property_income_amount
|
202
227
|
end
|
203
228
|
|
204
229
|
# Calculate the household's number of fiscal parts
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: french_tax_system
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathieu EUSTACHY
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
75
|
+
rubygems_version: 3.1.6
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: A gem that replicates french tax system
|