rails_admin_telnet_print 1.2.9 → 1.2.10
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 +4 -4
- data/app/jobs/print_it_job.rb +6 -4
- data/lib/rails_admin_telnet_print/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68f75ab65fe51fafb1e637192412ae8e0953de8a
|
4
|
+
data.tar.gz: adf9f0291d9470944ac40c89936118bb19780ea6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 486631a89bc2b5ff28cacc4469f281768471795d253fec046624d4e8c348a0b455350305bb750bd5dc567ff45fe805a346fde1c08a51db83d521b86654e1f6a8
|
7
|
+
data.tar.gz: 498abd8bc6b5d57fd83deea965cc7b0a388b93065fad60a90bb80ff27b9b1ae0537a2f5b14e5538fb6b3df69c1919501fef561c4e852108665e0db89a23fcd2f
|
data/app/jobs/print_it_job.rb
CHANGED
@@ -13,12 +13,12 @@ class PrintItJob < ApplicationJob
|
|
13
13
|
# Do something later
|
14
14
|
printer = Printer.find(printer_id.to_i)
|
15
15
|
print_template = printer.print_template
|
16
|
-
|
16
|
+
Rails.logger.info "PrintItJob: PRINTING MODEL: #{model_name.constantize.inspect}"
|
17
17
|
header = model_name.constantize.find(id)
|
18
18
|
items = header.records_for_print(id).order(code: :asc)
|
19
19
|
|
20
20
|
pivot = []
|
21
|
-
@pjob = PrintJob.create(printer_id: printer.id, finished: false, iserror: false, total:
|
21
|
+
@pjob = PrintJob.create(printer_id: printer.id, finished: false, iserror: false, total: 0, printed: 0)
|
22
22
|
# Spezzetto l'array degli items in gruppi di number_of_barcodes
|
23
23
|
# Rails.logger.info "BELLAAAAAAA! #{items.group_by.with_index{|_, i| i % print_template.number_of_barcodes}.values.inspect}"
|
24
24
|
items.each_slice(print_template.number_of_barcodes) do |item_group|
|
@@ -32,8 +32,10 @@ class PrintItJob < ApplicationJob
|
|
32
32
|
# Rails.logger.info "RISULTATO: #{result}"
|
33
33
|
end
|
34
34
|
|
35
|
+
Rails.logger.info "PrintItJob: SENDING TO PRINTER, TEXT TO PRINT IS:\n #{pivot.inspect}"
|
35
36
|
result = pivot.empty? ? false : send_to_printer(printer.ip, pivot.join(""))
|
36
|
-
@pjob.update(printed: pivot.length)
|
37
|
+
@pjob.update(printed: (result ? pivot.length : 0)) # Se risultato true, allora ha stampato tutto, altrimenti non ha stampato nulla
|
38
|
+
@pjob.update(total: pivot.length) # In realtà è inutile, ora manda tutto quello che può alla stampante, solo lei può andare storta
|
37
39
|
@pjob.update(finished: result)
|
38
40
|
end
|
39
41
|
|
@@ -72,7 +74,7 @@ class PrintItJob < ApplicationJob
|
|
72
74
|
break if response.count == 3
|
73
75
|
end
|
74
76
|
s.close
|
75
|
-
|
77
|
+
Rails.logger.info response.inspect
|
76
78
|
first = response[0].split(",")
|
77
79
|
second = response[1].split(",")
|
78
80
|
return "HEAD UP" if second[2].to_i == 1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_telnet_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: thecore_background_jobs
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.1'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.1'
|
41
27
|
description: The set of printers must be present in the database.
|
42
28
|
email:
|
43
29
|
- gabrieletassoni@taris.it
|