lucasalary 0.5.0 → 0.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3d46b29fc75775cfd085328382e37a0ab39dc7b3894e6dc522e5432066528c6
4
- data.tar.gz: 79b01908f796138a7b9a12f2db808602091c160aadb55d76951d1d0173bd1dc2
3
+ metadata.gz: d28cd1e6534f228ea827a320c439f6e7a2ab67850ff0a169112ad3631ee822f3
4
+ data.tar.gz: 9333ee5fe244056cc45b0e8aaa188347be9c1e04137ca866550811dc0a4b7dcf
5
5
  SHA512:
6
- metadata.gz: 037ae90e0072d75746b3a3f0a063ff8c6fc1532eae086e247fedc7a985872134643dad43738e5cc674b5f2e1ab1d0d8e1ddb678cbf34f4c2e425005bfbc7023e
7
- data.tar.gz: bbdc6a4a67c4e9bead499016efd3d5076ee1f8a09d99d9faa9218bde77d2b6120cdf083044090f7673ca29ee50056a3409443200abfd71e75286ab5aa2316021
6
+ metadata.gz: f9fac7f7e67b4c07f2273ec4a2b04b4dab01a292ff180b6a9a1f66685cda874a8319c6758ceb48ec5e9b116935fba02c0e07c9fd03f143c8208e1550a2c32048
7
+ data.tar.gz: 4253f665b92b82f5851db0391e7e011c8218e543afc5d9a49498ffa3bdab35a41d3e6f2f2b0731fa7ab3c73c0f89d638567721bb5ad1b29a7b33bd3040871d52
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
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
+
1
6
  ## LucaSalary 0.5.0
2
7
 
3
8
  * `luca-salary` command now searches valid sub directory.
@@ -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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucaSalary
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.0'
5
5
  end
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.5.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: 2023-04-20 00:00:00.000000000 Z
11
+ date: 2024-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lucarecord
@@ -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
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubygems_version: 3.4.10
115
- signing_key:
115
+ signing_key:
116
116
  specification_version: 4
117
117
  summary: Salary calculation framework
118
118
  test_files: []