rails_admin_telnet_print 1.2.9 → 1.2.10

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
  SHA1:
3
- metadata.gz: 19be9e11aa1d67ab5f02487e19e268f61e151e47
4
- data.tar.gz: 930b1588c1f6bd9fd77f7bc5a4c523b90ff06ea0
3
+ metadata.gz: 68f75ab65fe51fafb1e637192412ae8e0953de8a
4
+ data.tar.gz: adf9f0291d9470944ac40c89936118bb19780ea6
5
5
  SHA512:
6
- metadata.gz: cbdc26b7e4108e271d3178ea74f47061855aad70fbd170ba1d513522747dfd426e993cf75d0d79d22123100e19144f6a5dee0ade0c6b80ded5abfbbd96a0b136
7
- data.tar.gz: fcbc1cc98f72717373df46bd5192e2d0853ebaccae93de64cc9475a6cee068892ce9852c24fe9f31cf253bf0b63d4144bf18978dbb1fc6ba8ea0ed34e2321a88
6
+ metadata.gz: 486631a89bc2b5ff28cacc4469f281768471795d253fec046624d4e8c348a0b455350305bb750bd5dc567ff45fe805a346fde1c08a51db83d521b86654e1f6a8
7
+ data.tar.gz: 498abd8bc6b5d57fd83deea965cc7b0a388b93065fad60a90bb80ff27b9b1ae0537a2f5b14e5538fb6b3df69c1919501fef561c4e852108665e0db89a23fcd2f
@@ -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
- #Rails.logger.info "MOMERDA 2: #{model_name.constantize.inspect}"
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: ((items.count.to_f / print_template.number_of_barcodes).ceil rescue 0), printed: @printed)
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
- puts response.inspect
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
@@ -1,3 +1,3 @@
1
1
  module RailsAdminTelnetPrint
2
- VERSION = '1.2.9'.freeze
2
+ VERSION = '1.2.10'.freeze
3
3
  end
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.9
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-01-08 00:00:00.000000000 Z
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