浏览代码

Printer infos

Robert Bedner 2 年之前
父节点
当前提交
5f527bbeb4
共有 1 个文件被更改,包括 8 次插入9 次删除
  1. 8 9
      api/controllers/RequestController.php

+ 8 - 9
api/controllers/RequestController.php

@@ -254,23 +254,22 @@ class RequestController
 		$ptr = "/dev/usb/lp0";
 
         printer_write($ptr, $this->project['print_header']);
-        printer_write($ptr, str_repeat("\r\n", 2));
+        printer_write($ptr, str_repeat("\n", 1));
         
-        printer_write($ptr, "Rechn.-Nr. " . $result['invoice_number'] . "\r\n");
-        printer_write($ptr, "Kasse " . $result['pos_id'] . ", " . $result['cashier'] . "\r\n");
-        printer_write($ptr, "\r\n");
+        printer_write($ptr, "Rechn.-Nr. " . $result['invoice_number']);
+        printer_write($ptr, "Kasse " . $result['pos_id'] . ", " . $result['cashier']);
 
         $result['details'] = array_reverse($result['details']);
 
         foreach ($result['details'] as $entry) {
-            printer_write($ptr, "#" . str_pad(str_replace(".",",",$entry['line_number']), 2, " ", STR_PAD_LEFT) .  ": " . $entry['item'] . "" . str_pad(str_replace(".",",",$entry['price']), 19, " ", STR_PAD_LEFT) .  "\r\n");
+            printer_write($ptr, "#" . str_pad(str_replace(".",",",$entry['line_number']), 2, " ", STR_PAD_LEFT) .  ": " . $entry['item'] . "" . str_pad(str_replace(".",",",$entry['price']), 19, " ", STR_PAD_LEFT));
         }
 
-        printer_write($ptr, "________________________________\r\n");
-        printer_write($ptr, str_pad(str_replace(".",",",$result['total']), 31, " ", STR_PAD_LEFT) . "\r\n");
+        printer_write($ptr, "________________________________");
+        printer_write($ptr, str_pad(str_replace(".",",",$result['total']), 31, " ", STR_PAD_LEFT));
 
         printer_write($ptr, $this->project['print_footer']);
-        printer_write($ptr, str_repeat("\r\n", 7));
+        printer_write($ptr, str_repeat("\n", 7));
         // printer_close($ptr);
 
         return $result;
@@ -424,4 +423,4 @@ class RequestController
 				return ' - Unknown error';
 		}
 	}
-}
+}