|
|
@@ -293,4 +293,47 @@ class StockOutOrderClass extends BaseClass
|
|
|
return self::$statusMap[$status] ?? '';
|
|
|
}
|
|
|
|
|
|
+ public static function printOrder()
|
|
|
+ {
|
|
|
+
|
|
|
+ $content .= '<BR>';
|
|
|
+ $content .= '商品 数量/单价 金额 <BR>';
|
|
|
+ $content .= '--------------------------------<BR>';
|
|
|
+
|
|
|
+ if (isset($respond['product']) && !empty($respond['product'])) {
|
|
|
+ foreach ($respond['product'] as $current) {
|
|
|
+ $content = self::printGroup($current, $content, $showPrice, $fontSizeType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function printGroup($current, $content, $showPrice = 1, $fontSizeType = 0)
|
|
|
+ {
|
|
|
+ //58mm的机器,一行打印16个汉字,32个字母
|
|
|
+ $productPrice = $current['price'] ?? '';
|
|
|
+ $name = $current['name'] ?? '';
|
|
|
+ if (floatval($productPrice) == 0.01) {
|
|
|
+ $name = $name . '(送)';
|
|
|
+ }
|
|
|
+ $productNum = $current['num'] ?? '';
|
|
|
+ $itemNum = $current['itemNum'] ?? 0;
|
|
|
+ $refundNum = $current['refundNum'] ?? 0;
|
|
|
+ $unitName = $current['unitName'] ?? '扎';
|
|
|
+
|
|
|
+ $lastNum = bcsub($itemNum, $refundNum);
|
|
|
+
|
|
|
+ $show = $name . ' ' . $lastNum . $unitName;
|
|
|
+
|
|
|
+ $content .= '<B>' . $show . '</B><BR>';
|
|
|
+ if ($refundNum > 0) {
|
|
|
+ $content .= '(买' . $itemNum . $unitName . ' 退' . $refundNum . $unitName . ')<BR>';
|
|
|
+ }
|
|
|
+ if ($showPrice == 1) {
|
|
|
+ $content .= $productNum . ' = ' . $productPrice . '元<BR>';
|
|
|
+ }
|
|
|
+ $content .= '--------------------------------<BR>';
|
|
|
+ return $content;
|
|
|
+ }
|
|
|
+
|
|
|
}
|