|
|
@@ -906,21 +906,23 @@ class OrderClass extends BaseClass
|
|
|
return $list;
|
|
|
}
|
|
|
|
|
|
- public static function printGroup($current, $content)
|
|
|
+ public static function printGroup($current, $content, $showPrice = 1)
|
|
|
{
|
|
|
//58mm的机器,一行打印16个汉字,32个字母
|
|
|
$name = $current['name'] ?? '';
|
|
|
$productNum = $current['num'] ?? '';
|
|
|
$count = $current['count'] ?? '';
|
|
|
$content .= '<B>' . $name . ' ' . $count . '</B><BR>';
|
|
|
- $productPrice = $current['price'] ?? '';
|
|
|
- $content .= $productNum . '=' . $productPrice . '<BR>';
|
|
|
+ if ($showPrice == 1) {
|
|
|
+ $productPrice = $current['price'] ?? '';
|
|
|
+ $content .= $productNum . '=' . $productPrice . '<BR>';
|
|
|
+ }
|
|
|
$content .= '--------------------------------<BR>';
|
|
|
return $content;
|
|
|
}
|
|
|
|
|
|
//云打印 ssh 20210709
|
|
|
- public static function onlinePrint($orderInfo)
|
|
|
+ public static function onlinePrint($orderInfo, $showPrice = 1)
|
|
|
{
|
|
|
$showItem = OrderClass::getShowItem(true, $orderInfo);
|
|
|
|
|
|
@@ -971,7 +973,7 @@ class OrderClass extends BaseClass
|
|
|
|
|
|
if (isset($respond['product']) && !empty($respond['product'])) {
|
|
|
foreach ($respond['product'] as $current) {
|
|
|
- $content = self::printGroup($current, $content);
|
|
|
+ $content = self::printGroup($current, $content, $showPrice);
|
|
|
}
|
|
|
$content .= '--------------------------------<BR>';
|
|
|
}
|
|
|
@@ -983,42 +985,45 @@ class OrderClass extends BaseClass
|
|
|
$name = $current['name'] ?? '';
|
|
|
$count = $current['count'] ?? '';
|
|
|
$content .= '<B>' . $name . ' ' . $count . '</B><BR>';
|
|
|
- $productNum = $current['num'] ?? '';
|
|
|
- $productPrice = $current['price'] ?? '';
|
|
|
- $content .= $productNum . '=' . $productPrice . '<BR>';
|
|
|
+ if ($showPrice == 1) {
|
|
|
+ $productNum = $current['num'] ?? '';
|
|
|
+ $productPrice = $current['price'] ?? '';
|
|
|
+ $content .= $productNum . '=' . $productPrice . '<BR>';
|
|
|
+ }
|
|
|
}
|
|
|
$content .= '--------------------------------<BR>';
|
|
|
$content .= '--------------------------------<BR>';
|
|
|
}
|
|
|
|
|
|
- if (isset($orderInfo['itemPrice']) && $orderInfo['itemPrice'] > 0) {
|
|
|
- $content .= '商品金额:' . floatval($orderInfo['itemPrice']) . '<BR>';
|
|
|
- }
|
|
|
- if (isset($respond['sendCost']) && $respond['sendCost'] > 0) {
|
|
|
- $content .= ' 运费:' . floatval($respond['sendCost']) . '<BR>';
|
|
|
- }
|
|
|
- if (isset($orderInfo['packCost']) && $orderInfo['packCost'] > 0) {
|
|
|
- $content .= ' 打包费:' . floatval($orderInfo['packCost']) . '<BR>';
|
|
|
- }
|
|
|
- $content .= '合计金额:' . floatval($respond['prePrice']) . '<BR>';
|
|
|
- if (isset($respond['discountAmount']) && !empty($respond['discountAmount']) && $respond['discountAmount'] > 0) {
|
|
|
- $content .= '优惠扣除:-' . floatval($respond['discountAmount']) . '<BR>';
|
|
|
- }
|
|
|
+ if ($showPrice == 1) {
|
|
|
+ if (isset($orderInfo['itemPrice']) && $orderInfo['itemPrice'] > 0) {
|
|
|
+ $content .= '商品金额:' . floatval($orderInfo['itemPrice']) . '<BR>';
|
|
|
+ }
|
|
|
+ if (isset($respond['sendCost']) && $respond['sendCost'] > 0) {
|
|
|
+ $content .= ' 运费:' . floatval($respond['sendCost']) . '<BR>';
|
|
|
+ }
|
|
|
+ if (isset($orderInfo['packCost']) && $orderInfo['packCost'] > 0) {
|
|
|
+ $content .= ' 打包费:' . floatval($orderInfo['packCost']) . '<BR>';
|
|
|
+ }
|
|
|
+ $content .= '合计金额:' . floatval($respond['prePrice']) . '<BR>';
|
|
|
+ if (isset($respond['discountAmount']) && !empty($respond['discountAmount']) && $respond['discountAmount'] > 0) {
|
|
|
+ $content .= '优惠扣除:-' . floatval($respond['discountAmount']) . '<BR>';
|
|
|
+ }
|
|
|
|
|
|
- if (isset($respond['refundPrice']) && $respond['refundPrice'] > 0) {
|
|
|
- $content .= '退款金额:' . floatval($respond['refundPrice']) . '<BR>';
|
|
|
- }
|
|
|
+ if (isset($respond['refundPrice']) && $respond['refundPrice'] > 0) {
|
|
|
+ $content .= '退款金额:' . floatval($respond['refundPrice']) . '<BR>';
|
|
|
+ }
|
|
|
|
|
|
- $content .= '<B>订单金额:' . floatval($respond['realPrice']) . '</B><BR>';
|
|
|
- if (isset($respond['debt']) && $respond['debt'] == 1) {
|
|
|
- $content .= '实付金额:0<BR>';
|
|
|
- } else {
|
|
|
- $content .= '实付金额:' . floatval($respond['realPrice']) . '<BR>';
|
|
|
- }
|
|
|
- if ($debtAmount > 0) {
|
|
|
- $content .= '累计欠款:' . floatval($debtAmount) . '<BR>';
|
|
|
+ $content .= '<B>订单金额:' . floatval($respond['realPrice']) . '</B><BR>';
|
|
|
+ if (isset($respond['debt']) && $respond['debt'] == 1) {
|
|
|
+ $content .= '实付金额:0<BR>';
|
|
|
+ } else {
|
|
|
+ $content .= '实付金额:' . floatval($respond['realPrice']) . '<BR>';
|
|
|
+ }
|
|
|
+ if ($debtAmount > 0) {
|
|
|
+ $content .= '累计欠款:' . floatval($debtAmount) . '<BR>';
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
$shopId = $orderInfo['shopId'] ?? 0;
|
|
|
$shop = ShopClass::getById($shopId, true);
|
|
|
$sjId = $shop->sjId ?? 0;
|