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
                 styleFile.open(1);
712
                 styleFile.open(1);
713
                 output.writeTextElement("style", styleFile.readToString());
713
                 output.writeTextElement("style", styleFile.readToString());
714
                 styleFile.close();
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
                 output.writeStartElement("script");
721
                 output.writeStartElement("script");
716
                 scriptFile = new QFile(QSettings.value("config") + "/Scripts/qrcode.js");
722
                 scriptFile = new QFile(QSettings.value("config") + "/Scripts/qrcode.js");
717
                 scriptFile.open(1);
723
                 scriptFile.open(1);
718
                 output.writeCDATA(scriptFile.readToString());
724
                 output.writeCDATA(scriptFile.readToString());
719
                 scriptFile.close();
725
                 scriptFile.close();
720
                 output.writeEndElement();
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
                 output.writeEndElement();
735
                 output.writeEndElement();
722
                 output.writeStartElement("body");
736
                 output.writeStartElement("body");
723
                 output.writeStartElement("h1");
737
                 output.writeStartElement("h1");
726
                 output.writeTextElement("span", "Roasted at: " + timefield.text);
740
                 output.writeTextElement("span", "Roasted at: " + timefield.text);
727
                 output.writeTextElement("span", "On machine: " + machine.text);
741
                 output.writeTextElement("span", "On machine: " + machine.text);
728
                 output.writeTextElement("span", "Batch file: " + filenofield.text);
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
                 output.writeStartElement("div");
758
                 output.writeStartElement("div");
730
                 output.writeAttribute("id", "container");
759
                 output.writeAttribute("id", "container");
731
                 output.writeEndElement();
760
                 output.writeEndElement();

Loading…
Cancel
Save