Browse Source

Add CODE128 barcode in batch tag printed from New Batch window

Neal Wilson 7 years ago
parent
commit
16aa5767ed
1 changed files with 29 additions and 0 deletions
  1. 29
    0
      config/Windows/newbatch.xml

+ 29
- 0
config/Windows/newbatch.xml View File

@@ -712,12 +712,26 @@
712 712
                 styleFile.open(1);
713 713
                 output.writeTextElement("style", styleFile.readToString());
714 714
                 styleFile.close();
715
+                
716
+                styleFile = new QFile(QSettings.value("config") + "/Scripts/barcode.css");
717
+                styleFile.open(1);
718
+                output.writeTextElement("style", styleFile.readToString());
719
+                styleFile.close();
720
+                
715 721
                 output.writeStartElement("script");
716 722
                 scriptFile = new QFile(QSettings.value("config") + "/Scripts/qrcode.js");
717 723
                 scriptFile.open(1);
718 724
                 output.writeCDATA(scriptFile.readToString());
719 725
                 scriptFile.close();
720 726
                 output.writeEndElement();
727
+                
728
+                output.writeStartElement("script");
729
+                scriptFile = new QFile(QSettings.value("config") + "/Scripts/barcode.js");
730
+                scriptFile.open(1);
731
+                output.writeCDATA(scriptFile.readToString());
732
+                scriptFile.close();
733
+                output.writeEndElement();
734
+                
721 735
                 output.writeEndElement();
722 736
                 output.writeStartElement("body");
723 737
                 output.writeStartElement("h1");
@@ -726,6 +740,21 @@
726 740
                 output.writeTextElement("span", "Roasted at: " + timefield.text);
727 741
                 output.writeTextElement("span", "On machine: " + machine.text);
728 742
                 output.writeTextElement("span", "Batch file: " + filenofield.text);
743
+                
744
+                output.writeStartElement("div");
745
+                output.writeAttribute("id", "barcode");
746
+                output.writeAttribute("class", "barcode128h");
747
+                output.writeAttribute("align", "center");
748
+                output.writeEndElement();
749
+                
750
+                output.writeStartElement("script");
751
+                var c128data = 'var strBarcodeHTML = code128("';
752
+                c128data += filenofield.text;
753
+                c128data += '", "C");'
754
+                c128data += 'document.getElementById("barcode").innerHTML = strBarcodeHTML;';
755
+                output.writeCDATA(c128data);
756
+                output.writeEndElement();
757
+                
729 758
                 output.writeStartElement("div");
730 759
                 output.writeAttribute("id", "container");
731 760
                 output.writeEndElement();

Loading…
Cancel
Save