pais_legacy 0.7.3 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -10
- data/lib/pais_legacy/version.rb +1 -1
- data/lib/pais_legacy.rb +44 -6
- data/readme.org +8 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a271fa80d4f7ea154b131a7695b455b65ddbfe75813bb8cbe8b9247587448c83
|
4
|
+
data.tar.gz: 14d557ae225384b1af472fd842f3b7d51de17ae6188c9d36be62f5603dbfd7b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 986967d1aab1e1442e293ddec3065021b1f8333e3a87df288a8630b6f3d80911540d7a5fc8978cabd3319f68805b351cdc384cc77ab0a117a03c46365de19d5b
|
7
|
+
data.tar.gz: 120ea35099f45316ed8b4bb481c9ba286cdcb17c9a2bb7c3acaeedb3861228552a6898de83c5e15ee4abebad5c72c40488de81dd2339ff4986c53eec05a421a7
|
data/Gemfile.lock
CHANGED
@@ -13,11 +13,11 @@ GEM
|
|
13
13
|
specs:
|
14
14
|
ast (2.4.2)
|
15
15
|
byebug (11.1.3)
|
16
|
-
json (2.6.
|
17
|
-
minitest (5.
|
16
|
+
json (2.6.3)
|
17
|
+
minitest (5.17.0)
|
18
18
|
mocha (1.16.1)
|
19
19
|
parallel (1.22.1)
|
20
|
-
parser (3.
|
20
|
+
parser (3.2.0.0)
|
21
21
|
ast (~> 2.4.1)
|
22
22
|
pastel (0.8.0)
|
23
23
|
tty-color (~> 0.5)
|
@@ -25,22 +25,22 @@ GEM
|
|
25
25
|
rake (13.0.6)
|
26
26
|
regexp_parser (2.6.1)
|
27
27
|
rexml (3.2.5)
|
28
|
-
rubocop (1.
|
28
|
+
rubocop (1.43.0)
|
29
29
|
json (~> 2.3)
|
30
30
|
parallel (~> 1.10)
|
31
|
-
parser (>= 3.
|
31
|
+
parser (>= 3.2.0.0)
|
32
32
|
rainbow (>= 2.2.2, < 4.0)
|
33
33
|
regexp_parser (>= 1.8, < 3.0)
|
34
34
|
rexml (>= 3.2.5, < 4.0)
|
35
|
-
rubocop-ast (>= 1.
|
35
|
+
rubocop-ast (>= 1.24.1, < 2.0)
|
36
36
|
ruby-progressbar (~> 1.7)
|
37
|
-
unicode-display_width (>=
|
38
|
-
rubocop-ast (1.
|
37
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
38
|
+
rubocop-ast (1.24.1)
|
39
39
|
parser (>= 3.1.1.0)
|
40
40
|
ruby-progressbar (1.11.0)
|
41
|
-
timecop (0.9.
|
41
|
+
timecop (0.9.6)
|
42
42
|
tty-color (0.6.0)
|
43
|
-
unicode-display_width (2.
|
43
|
+
unicode-display_width (2.4.2)
|
44
44
|
|
45
45
|
PLATFORMS
|
46
46
|
x86_64-linux
|
data/lib/pais_legacy/version.rb
CHANGED
data/lib/pais_legacy.rb
CHANGED
@@ -48,11 +48,23 @@ module PaisLegacy
|
|
48
48
|
map{|line| {value: line[0], text: "#{line[0]}-#{line[1]}"}}
|
49
49
|
end
|
50
50
|
|
51
|
+
def self.glch_read_all(ledger)
|
52
|
+
out,_,_=Open3.capture2(glch_read_cmd(ledger.to_s))
|
53
|
+
|
54
|
+
out.
|
55
|
+
split("\n").
|
56
|
+
map{|line| line.split(",")}
|
57
|
+
end
|
58
|
+
|
51
59
|
# --------------------------------------------------------------------------------
|
52
60
|
# Trial Balance
|
53
61
|
# --------------------------------------------------------------------------------
|
54
|
-
def self.get_trial_balance(ledger = "1", date_to = "30/06/2021",
|
55
|
-
|
62
|
+
def self.get_trial_balance(ledger = "1", date_to = "30/06/2021",prior=false,from=1,to=9999)
|
63
|
+
if prior
|
64
|
+
cmd=rptrun(ledger,date_to,from,to,"rglch01p")
|
65
|
+
else
|
66
|
+
cmd=rptrun(ledger,date_to,from,to)
|
67
|
+
end
|
56
68
|
out,_,_=Open3.capture2(cmd)
|
57
69
|
|
58
70
|
if from and to
|
@@ -67,10 +79,36 @@ module PaisLegacy
|
|
67
79
|
end
|
68
80
|
|
69
81
|
# Get the accounts using the trial balance
|
70
|
-
def self.get_trial_balance_accounts(ledger = "1", date_to = "30/06/2021", from=1,to=9999)
|
71
|
-
|
72
|
-
|
73
|
-
|
82
|
+
def self.get_trial_balance_accounts(ledger = "1", date_to = "30/06/2021", periods=1,from=1,to=9999)
|
83
|
+
|
84
|
+
results = []
|
85
|
+
|
86
|
+
periods.times do |period|
|
87
|
+
|
88
|
+
date_to = Date.parse(date_to)
|
89
|
+
date_to = date_to.strftime("%d/%m/") + (date_to.year.to_i - period).to_s
|
90
|
+
|
91
|
+
report = get_trial_balance(ledger,date_to,period>0,from,to)
|
92
|
+
tb = PaisLegacy::TrialBalance.new(report)
|
93
|
+
results << tb.accounts_from_trial_balance
|
94
|
+
end
|
95
|
+
|
96
|
+
results_merged = []
|
97
|
+
results.each_with_index do |result,i|
|
98
|
+
if i == 0
|
99
|
+
results_merged = result
|
100
|
+
else
|
101
|
+
result.each do |account|
|
102
|
+
hash=results_merged.find {|r| r[:code] == account[:code]}
|
103
|
+
|
104
|
+
hash = {code: account[:code], name: account[:name]} unless hash
|
105
|
+
hash["dr#{i}".to_sym] = account[:dr]
|
106
|
+
hash["cr#{i}".to_sym] = account[:cr]
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
results_merged
|
74
112
|
end
|
75
113
|
|
76
114
|
# --------------------------------------------------------------------------------
|
data/readme.org
CHANGED
@@ -99,6 +99,14 @@ After checking out the repo, run `bin/setup` to install dependencies. You can al
|
|
99
99
|
|
100
100
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
101
101
|
|
102
|
+
*** Publish version
|
103
|
+
1. Adjust lib/pais_legacy/version.rb
|
104
|
+
2. Commit changes 'Bump <version number>'
|
105
|
+
3. Gem build
|
106
|
+
: gem build pais_legacy.gemspec
|
107
|
+
4. Push
|
108
|
+
: gem push pais_legacy-0.7.3.gem
|
109
|
+
|
102
110
|
** Contributing
|
103
111
|
|
104
112
|
Bug reports and pull requests are welcome on GitHub at https://github.com/map7/pais_legacy.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pais_legacy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Pope
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -103,7 +103,7 @@ licenses:
|
|
103
103
|
- MIT
|
104
104
|
metadata:
|
105
105
|
homepage_uri: https://github.com/map7/pais_legacy
|
106
|
-
post_install_message:
|
106
|
+
post_install_message:
|
107
107
|
rdoc_options: []
|
108
108
|
require_paths:
|
109
109
|
- lib
|
@@ -118,8 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
122
|
-
signing_key:
|
121
|
+
rubygems_version: 3.4.7
|
122
|
+
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: PAIS Legacy API Wrapper
|
125
125
|
test_files: []
|