thecore_print_commons 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/api/printer.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d1b92c4037ed26563a1e1d0e5f25f227031ff4c0a8e53dc10f17eedb99b10f5
|
4
|
+
data.tar.gz: deacf2f9bbcd581b3b333aac24ed4e70dd257f86f5dad91adad804be6a9e245b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0b8a1316816c8f56fc18b7e16044c97ae191c98f5f269c5839bf273e7ac6e031caf04e18b212184269f7511ff907759903d4b28f595b0bc10d86fe812e84497
|
7
|
+
data.tar.gz: 07e92ae60c6d391b40220e21e349bf14635b45e1fb2344c8008ac0c1dae72a5ddc4abd8407c5f2107ab3bf0d15b2c45389d5d24db2eea3382686f66c4e1ca4c5
|
@@ -27,7 +27,7 @@ module Api::Printer
|
|
27
27
|
# { test: [ :first, :second, :third ], id: id, params: params}
|
28
28
|
# end
|
29
29
|
|
30
|
-
def self.custom_action_print_single_barcode
|
30
|
+
def self.custom_action_print_single_barcode params
|
31
31
|
# Example Usage:
|
32
32
|
# item = ::Item.joins(:projects).where(projects: {id: params[:order_id].to_i}).first
|
33
33
|
# printer = ::Printer.where(supplier_id: current_user.supplier_id, default: true).first
|
@@ -36,7 +36,7 @@ module Api::Printer
|
|
36
36
|
# # Preso l'ordine mi recupero l'item e ne stampo la quantità richiesta
|
37
37
|
# ::PrintWorker.perform_async(printer.ip, text)
|
38
38
|
|
39
|
-
printer = Printer.find(id)
|
39
|
+
printer = Printer.find(params[:id])
|
40
40
|
text = printer.print_template.template.gsub(printer.print_template.translation_matrix.lines.first, params[:barcode])
|
41
41
|
::PrintWorker.perform_async(printer.ip, printer.port, text)
|
42
42
|
{ info: "Print job sent in background to #{printer.ip} on port #{printer.port}" }
|