lucasalary 0.1.29 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/exe/luca-salary +10 -0
- data/lib/luca_salary/monthly.rb +2 -2
- data/lib/luca_salary/total.rb +3 -3
- data/lib/luca_salary/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d28cd1e6534f228ea827a320c439f6e7a2ab67850ff0a169112ad3631ee822f3
|
4
|
+
data.tar.gz: 9333ee5fe244056cc45b0e8aaa188347be9c1e04137ca866550811dc0a4b7dcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9fac7f7e67b4c07f2273ec4a2b04b4dab01a292ff180b6a9a1f66685cda874a8319c6758ceb48ec5e9b116935fba02c0e07c9fd03f143c8208e1550a2c32048
|
7
|
+
data.tar.gz: 4253f665b92b82f5851db0391e7e011c8218e543afc5d9a49498ffa3bdab35a41d3e6f2f2b0731fa7ab3c73c0f89d638567721bb5ad1b29a7b33bd3040871d52
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## LucaSalary 0.6.0
|
2
|
+
|
3
|
+
* BREAKING: monthly payment now passes calculation date to local modules.
|
4
|
+
* BREAKING: year total calculation now passes profiles to local modules.
|
5
|
+
|
6
|
+
## LucaSalary 0.5.0
|
7
|
+
|
8
|
+
* `luca-salary` command now searches valid sub directory.
|
9
|
+
|
1
10
|
## LucaSalary 0.1.29
|
2
11
|
|
3
12
|
* `luca-salary payment list` supports interactive `--explore` w/nushell.
|
data/exe/luca-salary
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
unless Dir.exist?('data') || ARGV[0] == 'new'
|
5
|
+
target = 'profiles'
|
6
|
+
Dir.glob('*').reject { |f| File.symlink?(f) }
|
7
|
+
.find { |f| File.directory?("#{f}/data/#{target}") }.tap do |d|
|
8
|
+
abort "No valid data directory, exit..." if d.nil?
|
9
|
+
|
10
|
+
Dir.chdir(d)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
4
14
|
require 'json'
|
5
15
|
require 'optparse'
|
6
16
|
require 'luca_salary'
|
data/lib/luca_salary/monthly.rb
CHANGED
@@ -25,12 +25,12 @@ module LucaSalary
|
|
25
25
|
country = @driver.new(@pjdir, @config, @date)
|
26
26
|
# TODO: handle retirement
|
27
27
|
LucaSalary::Profile.all do |profile|
|
28
|
-
current_profile = parse_current(profile)
|
28
|
+
current_profile = parse_current(Profile.find_secure(profile['id']))
|
29
29
|
if self.class.search(@date.year, @date.month, @date.day, current_profile['id']).count > 0
|
30
30
|
puts "payment record already exists: #{current_profile['id']}"
|
31
31
|
return nil
|
32
32
|
end
|
33
|
-
h = country.calc_payment(current_profile)
|
33
|
+
h = country.calc_payment(current_profile, @date)
|
34
34
|
h['profile_id'] = current_profile['id']
|
35
35
|
self.class.create(h, date: @date, codes: Array(current_profile['id']))
|
36
36
|
end
|
data/lib/luca_salary/total.rb
CHANGED
@@ -29,17 +29,17 @@ module LucaSalary
|
|
29
29
|
payment, _count = accumulate(slips)
|
30
30
|
payment['id'] = id
|
31
31
|
date = Date.new(year, 12, 31)
|
32
|
-
payment = local_convert(payment, date)
|
32
|
+
payment = local_convert(Profile.find_secure(id), payment, date)
|
33
33
|
upsert(payment, basedir: "payments/total/#{year}#{LucaSupport::Code.encode_month(12)}")
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
def self.local_convert(payment, date)
|
37
|
+
def self.local_convert(profile, payment, date)
|
38
38
|
return payment if CONFIG['country'].nil?
|
39
39
|
|
40
40
|
require "luca_salary/#{CONFIG['country'].downcase}"
|
41
41
|
klass = Kernel.const_get("LucaSalary::#{CONFIG['country'].capitalize}")
|
42
|
-
klass.year_total(payment, date)
|
42
|
+
klass.year_total(profile, payment, date)
|
43
43
|
rescue NameError
|
44
44
|
return payment
|
45
45
|
end
|
data/lib/luca_salary/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucasalary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lucarecord
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.6.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,7 +96,7 @@ metadata:
|
|
96
96
|
homepage_uri: https://github.com/chumaltd/luca/tree/master/lucasalary
|
97
97
|
source_code_uri: https://github.com/chumaltd/luca/tree/master/lucasalary
|
98
98
|
changelog_uri: https://github.com/chumaltd/luca/tree/master/lucasalary/CHANGELOG.md
|
99
|
-
post_install_message:
|
99
|
+
post_install_message:
|
100
100
|
rdoc_options: []
|
101
101
|
require_paths:
|
102
102
|
- lib
|
@@ -104,15 +104,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
104
|
requirements:
|
105
105
|
- - ">="
|
106
106
|
- !ruby/object:Gem::Version
|
107
|
-
version:
|
107
|
+
version: 3.0.0
|
108
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
115
|
-
signing_key:
|
114
|
+
rubygems_version: 3.4.10
|
115
|
+
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Salary calculation framework
|
118
118
|
test_files: []
|