lucasalary 0.1.13 → 0.1.14
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/lib/luca_salary/base.rb +20 -5
- data/lib/luca_salary/version.rb +1 -1
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50c263cca4e4786fc11301bdbbab093e69dfd94be7b6f1237c570d2fe6ee6928
|
4
|
+
data.tar.gz: 49569d2fb2145e028a40817e464812ac7ff1e4499b4c49b96509548320924c92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b401890cb3dfa6b822461269750bea5821ee9ebcc55a8094596abff5cc20bd8285d2b37ce7d4354920b89266fee641861fd46bf52fb2c32b0a8e2cec2231eb60
|
7
|
+
data.tar.gz: af95b05c547430062bc0a1fa3242974ed37c899fe8be4607b2c8fcb54fc28f3c1a76a5730852882a8ffea56b14a3590824079559d11ed20658b68fe964639c57
|
data/lib/luca_salary/base.rb
CHANGED
@@ -15,7 +15,7 @@ module LucaSalary
|
|
15
15
|
def initialize(date = nil)
|
16
16
|
@date = date.nil? ? Date.today : Date.parse(date)
|
17
17
|
@pjdir = Pathname(LucaSupport::Config::Pjdir)
|
18
|
-
@config = load_config(@pjdir
|
18
|
+
@config = load_config(@pjdir / 'config.yml')
|
19
19
|
@driver = set_driver
|
20
20
|
@dict = load_dict
|
21
21
|
end
|
@@ -60,17 +60,32 @@ module LucaSalary
|
|
60
60
|
dat.filter { |k, _v| /^#{code}[0-9A-Fa-f]{,3}$/.match(k.to_s) }
|
61
61
|
end
|
62
62
|
|
63
|
+
#
|
64
|
+
# Subtotal each items.
|
65
|
+
# 1::
|
66
|
+
# Base salary or wages.
|
67
|
+
# 2::
|
68
|
+
# Deduction directly related to work payment, including tax, insurance, pension and so on.
|
69
|
+
# 3::
|
70
|
+
# Deduction for miscellaneous reasons.
|
71
|
+
# 4::
|
72
|
+
# Addition for miscellaneous reasons.
|
73
|
+
# 5::
|
74
|
+
# Net payment amount.
|
75
|
+
#
|
63
76
|
def amount_by_code(obj)
|
64
77
|
{}.tap do |h|
|
65
78
|
(1..4).each do |n|
|
66
|
-
|
79
|
+
code = n.to_s
|
80
|
+
h[code] = sum_code(obj, code)
|
67
81
|
end
|
82
|
+
h['5'] = h['1'] - h['2'] - h['3'] + h['4']
|
68
83
|
end
|
69
84
|
end
|
70
85
|
|
71
86
|
def sum_code(obj, code, exclude = nil)
|
72
|
-
target = obj.select { |k,
|
73
|
-
target = target.reject { |k,
|
87
|
+
target = obj.select { |k, _v| /^#{code}[0-9A-Fa-f]{,3}$/.match(k) }
|
88
|
+
target = target.reject { |k, _v| exclude.include?(k) } if exclude
|
74
89
|
target.values.inject(:+) || 0
|
75
90
|
end
|
76
91
|
|
@@ -88,7 +103,7 @@ module LucaSalary
|
|
88
103
|
code = @config['countryCode']
|
89
104
|
if code
|
90
105
|
require "luca_salary/#{code.downcase}"
|
91
|
-
Kernel.const_get "LucaSalary
|
106
|
+
Kernel.const_get "LucaSalary::#{code.upcase}"
|
92
107
|
else
|
93
108
|
nil
|
94
109
|
end
|
data/lib/luca_salary/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucasalary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: lucarecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,7 +87,8 @@ files:
|
|
73
87
|
- lib/luca_salary/profile.rb
|
74
88
|
- lib/luca_salary/version.rb
|
75
89
|
homepage: https://github.com/chumaltd/luca/tree/master/lucasalary
|
76
|
-
licenses:
|
90
|
+
licenses:
|
91
|
+
- GPL
|
77
92
|
metadata:
|
78
93
|
homepage_uri: https://github.com/chumaltd/luca/tree/master/lucasalary
|
79
94
|
source_code_uri: https://github.com/chumaltd/luca/tree/master/lucasalary
|
@@ -86,7 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
86
101
|
requirements:
|
87
102
|
- - ">="
|
88
103
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
104
|
+
version: 2.6.0
|
90
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
106
|
requirements:
|
92
107
|
- - ">="
|