pais_legacy 0.9.1 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39e1f89020868a562e4492b21b02e7a3621ec6eff3cd8ed5d28d41d01fac248e
4
- data.tar.gz: 8f62839b4046d6f9a8fca8d168bc05291a81fa4669d9ff0bafd2655404b63a6b
3
+ metadata.gz: 290af19c91f86a3e75aac7a9980e2ec07da8068b5bc72d5bb6686f4e867011e9
4
+ data.tar.gz: f42120a6b2fd3d144a04a720276883594bd4f3a09d5cf92cb68da2d0fad38dc0
5
5
  SHA512:
6
- metadata.gz: 27b5747587a37ae781fcf3e146215008b8a9bd2e453353d865626a02dfb45a137953809e8c23a5a1a8be44ece0eba2cd26f19e4a7860ca4d19b6b1571f34beda
7
- data.tar.gz: a096ed87d7df0c267845e430e10d4a1a7b9dee39b6c6b0e92effea12df06af5c2a2e1edf5bced6fa1178c42186d32dc749f65d678048ad50b5c05460f60397b2
6
+ metadata.gz: 7c39d63e4c9285f26c431b790654bce5e7af8eb46c6e93181ccdbfff999334dd598ec5bf84f5980a3fe0a011df7ecba3edb93cf0517a7764ba4230b41ca0f02f
7
+ data.tar.gz: f43081fd71570cd11921b6971ec79e028b84ea16dfd851111d351dde5d91c9a41d832bcc71b0f2306539446f086a7b0ab9a5284ac6172650d5318b1b36830a9c
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PaisLegacy
4
- VERSION = "0.9.1"
4
+ VERSION = "0.9.3"
5
5
  end
data/lib/pais_legacy.rb CHANGED
@@ -53,26 +53,66 @@ module PaisLegacy
53
53
  JSON.parse(out)
54
54
  end
55
55
 
56
+ # '\SCREEN \T1 \336 \spar \N \2 \1 \2 \3 \4 \5 \01/07/2021 \30/06/2022 '
57
+
58
+ # --------------------------------------------------------------------------------
59
+ # Performance Report
60
+ # --------------------------------------------------------------------------------
61
+ def self.get_performance(ledger = "1", date_to = "30/06/2022",prior=false,from=1,to=9999)
62
+ program="rglch10a"
63
+
64
+ date_to = Date.parse(date_to)
65
+ date_to = Date.parse("30/06/#{date_to.year}")
66
+ date_from = Date.parse("01/07/#{date_to.year - 1}")
67
+
68
+ cmd = ssh + ' "bash -l -c \"'+ fglgo("rptrun") +' pgs 1 pais {{program}} \'\{{printer}} \{{ccode}} \{{ledger}} \spar \N \2 \1 \2 \3 \4 \5 \{{date_from}} \{{date_to}} \' \""'
69
+ .gsub("{{program}}",program)
70
+ .gsub("{{printer}}","SCREEN")
71
+ .gsub("{{ccode}}","T1")
72
+ .gsub("{{ledger}}",ledger)
73
+ .gsub("{{account_from}}",from.to_s)
74
+ .gsub("{{account_to}}",to.to_s)
75
+ .gsub("{{date_from}}",date_from.strftime("%d/%m/%Y") || "01/07/2021")
76
+ .gsub("{{date_to}}",date_to.strftime("%d/%m/%Y") || "30/06/2022")
77
+ .gsub("{{report_type}}","1")
78
+ .gsub("{{subaccs}}","N")
79
+
80
+ out,_,_=Open3.capture2(cmd)
81
+ [out]
82
+ end
83
+
56
84
  # --------------------------------------------------------------------------------
57
85
  # Trial Balance
58
86
  # --------------------------------------------------------------------------------
59
87
  def self.get_trial_balance(ledger = "1", date_to = "30/06/2021",prior=false,from=1,to=9999)
60
88
  if prior
61
- cmd=rptrun(ledger,date_to,from,to,"rglch01p")
89
+ program="rglch01p"
62
90
  else
63
- cmd=rptrun(ledger,date_to,from,to)
91
+ program="rglch01a"
64
92
  end
93
+
94
+ cmd = ssh + ' "bash -l -c \"'+ fglgo("rptrun") +' pgs 1 pais {{program}} \'\{{printer}} \{{ccode}} \{{ledger}} \spar \{{account_from}} \{{account_to}} \{{date}}\ \1 \N\' \""'
95
+ .gsub("{{program}}",program)
96
+ .gsub("{{printer}}","SCREEN")
97
+ .gsub("{{ccode}}","T1")
98
+ .gsub("{{ledger}}",ledger)
99
+ .gsub("{{account_from}}",from.to_s)
100
+ .gsub("{{account_to}}",to.to_s)
101
+ .gsub("{{date}}",Date.parse(date_to).strftime("%d/%m/%Y") || "30/06/2021")
102
+ .gsub("{{report_type}}","1")
103
+ .gsub("{{subaccs}}","N")
104
+
65
105
  out,_,_=Open3.capture2(cmd)
66
106
 
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
107
+ # if from and to
108
+ # out.split("\n").each_with_index do |line,index|
109
+ # if index >= from and index <= to
110
+ # puts "#{index}-#{line}"
111
+ # end
112
+ # end
113
+ # end
74
114
 
75
- out.split("\n")
115
+ [out]
76
116
  end
77
117
 
78
118
  # Get the accounts using the trial balance
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.1
4
+ version: 0.9.3
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-17 00:00:00.000000000 Z
11
+ date: 2023-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug