pais_legacy 0.9.0 → 0.9.2

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: d5dc86b3a06c60616f9392ca4a37e9fd4ee2d3dd00440c8b03820bef68ad8cbb
4
- data.tar.gz: 8ef641a97b62cdf96c5bb586fea61dad3498421fe0f981bd1c6dc612f51340e8
3
+ metadata.gz: 3e2c0370787b5a04408f023199df9003af302b1d3c03ddd09b9a86d5b28ac822
4
+ data.tar.gz: 7c8f068cb14b3999bd004232e863a64b07edcf2d04439977c82c4eaba7961ed4
5
5
  SHA512:
6
- metadata.gz: '08c88b76b856523f283178bdd25c7fc1607cdd574648a8c7941c76e95ab9940f8f64c70b2c8c6a5d9eab1262727205fade6a9d9393c40dc03e7a71adcb5e0fd5'
7
- data.tar.gz: 24d692517416aa37003c18b25f9e52342babc2f82aa3136a01f803d8259f838e0039e703db45eda7f8e8c31d5850092227d455799c48da80778137918cdb1c87
6
+ metadata.gz: 92b99a653b73724caf8765c8d227842e306bacd7b41f9764404634576691ecfb2c99dcba1193a8341c39be077cf0c96d42cd2c76041190dde479b125243ec1d0
7
+ data.tar.gz: 108f1cacf473484dfcf624f678783be010f0a03c999e8f9b1a210547ce34a58d0b8024fd4fcc69898e730608b67bbad994ae542a022aadbe3705fbe6f1146bcf
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PaisLegacy
4
- VERSION = "0.9.0"
4
+ VERSION = "0.9.2"
5
5
  end
data/lib/pais_legacy.rb CHANGED
@@ -58,21 +58,33 @@ module PaisLegacy
58
58
  # --------------------------------------------------------------------------------
59
59
  def self.get_trial_balance(ledger = "1", date_to = "30/06/2021",prior=false,from=1,to=9999)
60
60
  if prior
61
- cmd=rptrun(ledger,date_to,from,to,"rglch01p")
61
+ program="rglch01p"
62
62
  else
63
- cmd=rptrun(ledger,date_to,from,to)
63
+ program="rglch01a"
64
64
  end
65
+
66
+ cmd = ssh + ' "bash -l -c \"'+ fglgo("rptrun") +' pgs 1 pais {{program}} \'\{{printer}} \{{ccode}} \{{ledger}} \spar \{{account_from}} \{{account_to}} \{{date}}\ \1 \N\' \""'
67
+ .gsub("{{program}}",program)
68
+ .gsub("{{printer}}","SCREEN")
69
+ .gsub("{{ccode}}","T1")
70
+ .gsub("{{ledger}}",ledger)
71
+ .gsub("{{account_from}}",from.to_s)
72
+ .gsub("{{account_to}}",to.to_s)
73
+ .gsub("{{date}}",Date.parse(date_to).strftime("%d/%m/%Y") || "30/06/2021")
74
+ .gsub("{{report_type}}","1")
75
+ .gsub("{{subaccs}}","N")
76
+
65
77
  out,_,_=Open3.capture2(cmd)
66
78
 
67
- if from and to
68
- out.split("\n").each_with_index do |line,index|
69
- if index >= from and index <= to
70
- puts "#{index}-#{line}"
71
- end
72
- end
73
- end
79
+ # if from and to
80
+ # out.split("\n").each_with_index do |line,index|
81
+ # if index >= from and index <= to
82
+ # puts "#{index}-#{line}"
83
+ # end
84
+ # end
85
+ # end
74
86
 
75
- out.split("\n")
87
+ [out]
76
88
  end
77
89
 
78
90
  # Get the accounts using the trial balance
@@ -158,8 +170,10 @@ module PaisLegacy
158
170
  .gsub("{{amount}}",line[8])
159
171
  end
160
172
 
173
+ # Example of P&L for ledger 336 with 2 periods
174
+ # '\SCREEN \T1 \336 \spar \N \2 \1 \Y \3 \4 \5 \N \01/07/2021 \30/06/2022 \N \ALL \ALL \N \2'
161
175
  def self.rptrun(ledger,date_to,from="0001",to="9999",program="rglch01a")
162
- ssh + ' "bash -l -c \"'+ fglgo("rptrun") +' pgs 1 pais {{program}} \'\{{printer}} \{{ccode}} \{{ledger}} \spar \{{account_from}} \{{account_to}} \1 \{{report_type}} \{{subaccs}} \{{date}}\' N\""'
176
+ ssh + ' "bash -l -c \"'+ fglgo("rptrun") +' pgs 1 pais {{program}} \'\{{printer}} \{{ccode}} \{{ledger}} \spar \N \{{account_from}} \{{account_to}} \1 \{{report_type}} \{{subaccs}} \{{date}}\' N\""'
163
177
  .gsub("{{program}}",program)
164
178
  .gsub("{{printer}}","SCREEN")
165
179
  .gsub("{{ccode}}","T1")
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.9.0
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Pope
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-15 00:00:00.000000000 Z
11
+ date: 2023-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug