tax_computation 0.2.0 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/README.md +12 -4
 - data/lib/tax_computation/version.rb +1 -1
 - data/lib/tax_computation.rb +4 -4
 - data/tax_computation-0.1.0.gem +0 -0
 - data/tax_computation-0.1.1.gem +0 -0
 - data/tax_computation-0.2.0.gem +0 -0
 - data/tax_computation-0.2.1.gem +0 -0
 - data/tax_computation-0.2.2.gem +0 -0
 - data/tax_computation-0.2.3.gem +0 -0
 - data/tax_computation-0.2.4.gem +0 -0
 - data/tax_computation-0.2.5.gem +0 -0
 - metadata +10 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 75479f671a18d671e02fa477ceb5ed657d1f8d957e3d1aac690b5c1bb1c12f75
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 9e4295851d3086483e3339c85731be378a3b02c10b713dbb82347a5c27307c74
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 104fd9d5055e0a8c20e8e6b5fa1f30a92fd027db9770063a6f2c6fb8308517072978fb0fb10aca1f5fc4132c12a5b3228c2f902a8130674b2885dc931080df11
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 29090a7deb7c0733a156b3050d62e42bdbe294adca47c4a3039497be11521dc8b9a9f849b1927cd9393215bd92524fc3842c164203e33297a223e32924cd67df
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,8 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # TaxComputation
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            Welcome 
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            TODO: Delete this and the text above, and describe your gem
         
     | 
| 
      
 3 
     | 
    
         
            +
            Welcome! With this gem you can calculate the tax according to the new policy given by income tax department of Pakistan.
         
     | 
| 
       6 
4 
     | 
    
         | 
| 
       7 
5 
     | 
    
         
             
            ## Installation
         
     | 
| 
       8 
6 
     | 
    
         | 
| 
         @@ -22,7 +20,17 @@ Or install it yourself as: 
     | 
|
| 
       22 
20 
     | 
    
         | 
| 
       23 
21 
     | 
    
         
             
            ## Usage
         
     | 
| 
       24 
22 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
      
 23 
     | 
    
         
            +
            To get the tax monthly
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 26 
     | 
    
         
            +
            TaxComputation.calculate_monthly_tax(monthly_salary_amount) #it will return the tax monthly
         
     | 
| 
      
 27 
     | 
    
         
            +
            ```
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            To get the tax yearly
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 32 
     | 
    
         
            +
            TaxComputation.calculate_yearly_tax(yearly_salary_amount) #it will return the tax yearly
         
     | 
| 
      
 33 
     | 
    
         
            +
            ```
         
     | 
| 
       26 
34 
     | 
    
         | 
| 
       27 
35 
     | 
    
         
             
            ## Development
         
     | 
| 
       28 
36 
     | 
    
         | 
    
        data/lib/tax_computation.rb
    CHANGED
    
    | 
         @@ -3,7 +3,7 @@ 
     | 
|
| 
       3 
3 
     | 
    
         
             
            require_relative "tax_computation/version"
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            module TaxComputation
         
     | 
| 
       6 
     | 
    
         
            -
              RANGES = {600000.0...1200000.0 => {percentage: 5, fixed_amount: 0, low:  
     | 
| 
      
 6 
     | 
    
         
            +
              RANGES = {600000.0...1200000.0 => {percentage: 5, fixed_amount: 0, low: 600000},
         
     | 
| 
       7 
7 
     | 
    
         
             
                        1200000.0...1800000.0 => {percentage: 10, fixed_amount: 30000, low: 1200000},
         
     | 
| 
       8 
8 
     | 
    
         
             
                        1800000.0...2500000.0 => {percentage: 15, fixed_amount: 90000, low: 1800000},
         
     | 
| 
       9 
9 
     | 
    
         
             
                        2500000.0...3500000.0 => {percentage: 17.5, fixed_amount: 195000, low: 2500000},
         
     | 
| 
         @@ -13,17 +13,17 @@ module TaxComputation 
     | 
|
| 
       13 
13 
     | 
    
         
             
                        12000000.0...30000000.0 => {percentage: 27.5, fixed_amount: 2345000, low: 12000000},
         
     | 
| 
       14 
14 
     | 
    
         
             
                        30000000.0...50000000.0 => {percentage: 30, fixed_amount: 7295000, low: 30000000},
         
     | 
| 
       15 
15 
     | 
    
         
             
                        50000000.0...75000000.0 => {percentage: 32.5, fixed_amount: 13295000, low: 50000000},
         
     | 
| 
       16 
     | 
    
         
            -
                        75000000.0 
     | 
| 
      
 16 
     | 
    
         
            +
                        75000000.0..Float::INFINITY => {percentage: 35, fixed_amount: 21420000, low: 75000000}
         
     | 
| 
       17 
17 
     | 
    
         
             
                      }
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
              private
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
              def self.calculate_monthly_tax(salary)
         
     | 
| 
       22 
     | 
    
         
            -
                salary  
     | 
| 
      
 22 
     | 
    
         
            +
                salary = salary * 12
         
     | 
| 
       23 
23 
     | 
    
         
             
                if salary <= 600000.0
         
     | 
| 
       24 
24 
     | 
    
         
             
                  0
         
     | 
| 
       25 
25 
     | 
    
         
             
                else
         
     | 
| 
       26 
     | 
    
         
            -
                  calculate(salary) / 12.to_f
         
     | 
| 
      
 26 
     | 
    
         
            +
                  number_with_precision((calculate(salary) / 12.to_f), precision: 2)
         
     | 
| 
       27 
27 
     | 
    
         
             
                end
         
     | 
| 
       28 
28 
     | 
    
         
             
              end
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: tax_computation
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.6
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Hamza Alvi
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2021-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-10-13 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
13 
     | 
    
         
             
            description: Write a longer description or delete this line.
         
     | 
| 
       14 
14 
     | 
    
         
             
            email:
         
     | 
| 
         @@ -28,6 +28,14 @@ files: 
     | 
|
| 
       28 
28 
     | 
    
         
             
            - bin/setup
         
     | 
| 
       29 
29 
     | 
    
         
             
            - lib/tax_computation.rb
         
     | 
| 
       30 
30 
     | 
    
         
             
            - lib/tax_computation/version.rb
         
     | 
| 
      
 31 
     | 
    
         
            +
            - tax_computation-0.1.0.gem
         
     | 
| 
      
 32 
     | 
    
         
            +
            - tax_computation-0.1.1.gem
         
     | 
| 
      
 33 
     | 
    
         
            +
            - tax_computation-0.2.0.gem
         
     | 
| 
      
 34 
     | 
    
         
            +
            - tax_computation-0.2.1.gem
         
     | 
| 
      
 35 
     | 
    
         
            +
            - tax_computation-0.2.2.gem
         
     | 
| 
      
 36 
     | 
    
         
            +
            - tax_computation-0.2.3.gem
         
     | 
| 
      
 37 
     | 
    
         
            +
            - tax_computation-0.2.4.gem
         
     | 
| 
      
 38 
     | 
    
         
            +
            - tax_computation-0.2.5.gem
         
     | 
| 
       31 
39 
     | 
    
         
             
            - tax_computation.gemspec
         
     | 
| 
       32 
40 
     | 
    
         
             
            homepage:
         
     | 
| 
       33 
41 
     | 
    
         
             
            licenses: []
         
     |