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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8fae1b53a7ecf7549facdc39a0c66457b7dfca65307a160d3b1fe517e31a47f
4
- data.tar.gz: 76d46ad120ab3796290b224e98c4c48d2739b629a7cbb6fd1308a3a82bd8fcdd
3
+ metadata.gz: d1ef06c9e6d161ca0643d7132efb9f277c2e9534de5e58de72fc524b816ac14f
4
+ data.tar.gz: 8cfeb927285be2ebddc1a8f953868070966cf7cdf1c84cf20d7048ee5f498073
5
5
  SHA512:
6
- metadata.gz: cf7229ac603b71b2f6a48c2a51664b2a09d5b27e301f39470f5a5b949f7d83f8e4a770caad432a23db3da6e346551647853fa9382fbfa55ea8c7a26858af1cec
7
- data.tar.gz: c290b721a56d0c96c4ca40d63a3b3617f0ffa07fd70114337b80f2a4a57aa6c4b883230e8d0d0f6dc33a2c2b9188e00268958fc21dc62ae3a62bd18dce129d42
6
+ metadata.gz: cb121467116fe7ef24162f907282a945b8c948e0e29742742e1dadad9e27475e4f40dc09326d50588f8866ebb4f077560576e587fa215783d537e3950b690a74
7
+ data.tar.gz: 496f2a78991e96c22d13e8a578f2d5925dacef3b633c4473909433684cbcdb423b18979580d4da7817972b35f945fe707ef7e259849538af97095aa30f825d24
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.0.1] - 2021-10-04
4
+ - Updated calc_global_net_taxable_amount to handle nil case for fiscal_revenues_p2
5
+
3
6
  ## [0.1.0] - 2021-06-07
4
7
 
5
8
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- french_tax_system (1.0.0)
4
+ french_tax_system (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -52,4 +52,4 @@ DEPENDENCIES
52
52
  rubocop (~> 1.17)
53
53
 
54
54
  BUNDLED WITH
55
- 2.2.19
55
+ 2.2.25
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FrenchTaxSystem
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
@@ -61,7 +61,32 @@ module FrenchTaxSystem
61
61
 
62
62
  # Methods
63
63
 
64
- # xxx
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.key?(:fiscal_revenues_p2) ? simulation[:fiscal_revenues_p2] : 0)) * (1 - REVENUES_STANDARD_ALLOWANCE)) + net_taxable_property_income_amount
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.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-06-17 00:00:00.000000000 Z
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.2.19
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