shish před 5 měsíci
rodič
revize
cd053b9f0f

+ 0 - 3
app-ghs/controllers/OrderController.php

@@ -1305,9 +1305,6 @@ class OrderController extends BaseController
             if ($hasPay == 0) {
             if ($hasPay == 0) {
                 util::fail('扫码付不能选订单日期');
                 util::fail('扫码付不能选订单日期');
             }
             }
-            if (strtotime($historyDate) > strtotime(date("Y-m-d"))) {
-                util::fail('订单日期只能选历史时间');
-            }
         }
         }
 
 
         $callErrand = $post['callErrand'] ?? 0;
         $callErrand = $post['callErrand'] ?? 0;

+ 33 - 16
app-ghs/controllers/ProductController.php

@@ -200,26 +200,43 @@ class ProductController extends BaseController
             $unit = '若干' . $info->smallUnit . '装';
             $unit = '若干' . $info->smallUnit . '装';
         }
         }
         $p->times = $num;
         $p->times = $num;
-        if (stringUtil::getWordNum($name) > 8) {
-            $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
-        } else {
-            $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
+
+        if($priceOption == 2){
+            // 每7个汉字截取一次(支持汉字、字母、数字混合),多处需要同步修改,关键词 label_print_substr
+            $content = '';
+            $len = mb_strlen($name, 'UTF-8');
+            $baseNum = 30;
+            $u = 0;
+            for ($i = 0; $i < $len; $i += 7) {
+                $currentName = mb_substr($name, $i, 7, 'UTF-8');
+                $number = $baseNum + 110*$u;
+                $u++;
+                $content .= '<TEXT x="30" y="' . $number . '" font="12" w="2" h="2" r="0">' . $currentName . '</TEXT>';
+            }
+        }else{
+            if (stringUtil::getWordNum($name) > 8) {
+                $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
+            } else {
+                $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
+            }
         }
         }
 
 
         if ($type == 0) {
         if ($type == 0) {
-            //打标签
-            $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
-            if (in_array($mainId, [52, 1459])) {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
-            } elseif ($mainId == 16948) {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
-            } elseif ($mainId == 72057) {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里小榄店</TEXT>';
-            } else {
-                if ($priceOption == 0) {
-                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
+            if($priceOption != 2) {
+                //打标签
+                $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
+                if (in_array($mainId, [52, 1459])) {
+                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
+                } elseif ($mainId == 16948) {
+                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
+                } elseif ($mainId == 72057) {
+                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里小榄店</TEXT>';
                 } else {
                 } else {
-                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . ' ' . $price . '元</TEXT>';
+                    if ($priceOption == 0) {
+                        $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
+                    } else {
+                        $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . ' ' . $price . '元</TEXT>';
+                    }
                 }
                 }
             }
             }
         } else {
         } else {

+ 33 - 85
app-ghs/controllers/PurchaseOrderController.php

@@ -234,27 +234,43 @@ class PurchaseOrderController extends BaseController
                 $hyPrice = floatval($hyPrice);
                 $hyPrice = floatval($hyPrice);
             }
             }
 
 
-            if (stringUtil::getWordNum($name) > 8) {
-                $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
+            if ($priceOption == 2) {
+                // 每7个汉字截取一次(支持汉字、字母、数字混合),多处需要同步修改,关键词 label_print_substr
+                $content = '';
+                $len = mb_strlen($name, 'UTF-8');
+                $baseNum = 30;
+                $u = 0;
+                for ($i = 0; $i < $len; $i += 7) {
+                    $currentName = mb_substr($name, $i, 7, 'UTF-8');
+                    $number = $baseNum + 110 * $u;
+                    $u++;
+                    $content .= '<TEXT x="30" y="' . $number . '" font="12" w="2" h="2" r="0">' . $currentName . '</TEXT>';
+                }
             } else {
             } else {
-                $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
-            }
-            if ($key % 2 == 1) {
-                $content .= '<TEXT x="415" y="20" font="12" w="2" h="2" r="0">.</TEXT>';
+                if (stringUtil::getWordNum($name) > 8) {
+                    $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
+                } else {
+                    $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
+                }
+                if ($key % 2 == 1) {
+                    $content .= '<TEXT x="415" y="20" font="12" w="2" h="2" r="0">.</TEXT>';
+                }
             }
             }
             if ($type == 0) {
             if ($type == 0) {
-                $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
-                if (in_array($mainId, [52, 1459])) {
-                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
-                } elseif ($mainId == 16948) {
-                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
-                } elseif ($mainId == 72057) {
-                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里小榄店</TEXT>';
-                } else {
-                    if ($priceOption == 0) {
-                        $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
+                if ($priceOption != 2) {
+                    $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
+                    if (in_array($mainId, [52, 1459])) {
+                        $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
+                    } elseif ($mainId == 16948) {
+                        $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
+                    } elseif ($mainId == 72057) {
+                        $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里小榄店</TEXT>';
                     } else {
                     } else {
-                        $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . ' ' . $price . '元</TEXT>';
+                        if ($priceOption == 0) {
+                            $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
+                        } else {
+                            $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . ' ' . $price . '元</TEXT>';
+                        }
                     }
                     }
                 }
                 }
             } else {
             } else {
@@ -280,74 +296,6 @@ class PurchaseOrderController extends BaseController
         util::complete();
         util::complete();
     }
     }
 
 
-    //打印全部 ssh 20220
-    public function actionPrintItem()
-    {
-        $get = Yii::$app->request->get();
-        $id = $get['id'] ?? 0;
-        $type = $get['type'] ?? 0;
-        $item = PurchaseOrderItemClass::getById($id, true);
-        if (empty($item)) {
-            util::fail('没有找到花材');
-        }
-        $name = $item->name ?? '';
-        $num = !empty($item->itemNum) ? floatval($item->itemNum) : 0;
-        if (empty($num)) {
-            util::fail('没有花材数量');
-        }
-        $orderSn = $item->orderSn ?? '';
-        $order = PurchaseOrderClass::getByCondition(['orderSn' => $orderSn], true);
-        $mainId = $order->mainId ?? 0;
-
-        $ext = $this->shopExt;
-        $printLabelSn = $ext->printLabelSn ?? '';
-        if (empty($printLabelSn)) {
-            util::fail('请设置标签打印机');
-        }
-        $p = new printUtil($printLabelSn);
-
-        $productId = $item->productId ?? 0;
-        $product = ProductClass::getById($productId, true);
-        $smallUnit = $product->smallUnit ?? '';
-        $bigUnit = $product->bigUnit ?? '';
-        $ratio = $product->ratio ?? 20;
-        $ratioType = $product->ratioType ?? 0;
-        if ($ratioType == 1) {
-            $unit = '若干' . $smallUnit . '/' . $bigUnit;
-        } else {
-            $unit = $ratio . $smallUnit . '/' . $bigUnit;
-        }
-
-        $ptItemId = $item->itemId ?? '';
-
-        $p->times = $num;
-
-        if (stringUtil::getWordNum($name) > 7) {
-            $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
-        } else {
-            $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
-        }
-
-        if ($type == 0) {
-            $content .= '<BC128 x="30" y="100" h="70" s="1" r="0" n="4" w="11">' . $ptItemId . '</BC128>';
-            if (in_array($mainId, [52, 1459])) {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
-            } elseif ($mainId == 16948) {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
-            } elseif ($mainId == 72057) {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里小榄店</TEXT>';
-            } else {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
-            }
-        } else {
-            $content .= '<QR x="35"  y="100"  e="L"  w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $productId . '</QR>';
-            $content .= '<TEXT x="40" y="270" font="12" w="1" h="1" r="0">扫码看价格</TEXT>';
-        }
-
-        $p->printLabelMsg($content);
-        util::complete();
-    }
-
     //取消入库单 ssh 20221211
     //取消入库单 ssh 20221211
     public function actionCancel()
     public function actionCancel()
     {
     {

+ 0 - 3
app-ghs/models/order/CreateOrderForm.php

@@ -110,9 +110,6 @@ class CreateOrderForm extends BaseForm
                  return;
                  return;
             }
             }
 
 
-            if (strtotime($this->historyDate) > strtotime(date("Y-m-d"))) {
-                $this->addError($attribute, '订单日期只能选历史时间');
-            }
         }
         }
     }
     }
 }
 }

+ 0 - 33
app-hd/controllers/PlantCgController.php

@@ -51,39 +51,6 @@ class PlantCgController extends BaseController
         util::complete();
         util::complete();
     }
     }
 
 
-    //打印全部 ssh 20220
-    public function actionPrintItem()
-    {
-        $get = Yii::$app->request->get();
-        $id = $get['id'] ?? 0;
-        $item = PlantCgItemClass::getById($id, true);
-        if (empty($item)) {
-            util::fail('没有找到花材');
-        }
-        $name = $item->name ?? '';
-        $num = !empty($item->num) ? floatval($item->num) : 0;
-        if (empty($num)) {
-            util::fail('没有花材数量');
-        }
-
-        $shopId = $this->shopId;
-        $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
-        $printLabelSn = $ext->printLabelSn ?? '';
-        if (empty($printLabelSn)) {
-            util::fail('请设置标签打印机');
-        }
-        $p = new printUtil($printLabelSn);
-
-        $goodsSn = $item->goodsSn ?? '';
-        //$price = floatval($item->price) ?? 0;
-        $content = '<TEXT x="30" y="45" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
-        $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $goodsSn . '</BC128>';
-        //$content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $price . '</TEXT>';
-        $p->times = $num;
-        $p->printLabelMsg($content);
-        util::complete();
-    }
-
     //采购详情 ssh 2020521
     //采购详情 ssh 2020521
     public function actionDetail()
     public function actionDetail()
     {
     {

+ 30 - 13
app-hd/controllers/ProductController.php

@@ -205,23 +205,40 @@ class ProductController extends BaseController
             $unit = '若干' . $info->smallUnit . '/' . $info->bigUnit;
             $unit = '若干' . $info->smallUnit . '/' . $info->bigUnit;
         }
         }
         $p->times = $num;
         $p->times = $num;
-        if (stringUtil::getWordNum($name) > 8) {
-            $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
+
+        if ($priceOption == 2) {
+            // 每7个汉字截取一次(支持汉字、字母、数字混合),多处需要同步修改,关键词 label_print_substr
+            $content = '';
+            $len = mb_strlen($name, 'UTF-8');
+            $baseNum = 30;
+            $u = 0;
+            for ($i = 0; $i < $len; $i += 7) {
+                $currentName = mb_substr($name, $i, 7, 'UTF-8');
+                $number = $baseNum + 110 * $u;
+                $u++;
+                $content .= '<TEXT x="30" y="' . $number . '" font="12" w="2" h="2" r="0">' . $currentName . '</TEXT>';
+            }
         } else {
         } else {
-            $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
+            if (stringUtil::getWordNum($name) > 8) {
+                $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
+            } else {
+                $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
+            }
         }
         }
 
 
         if ($type == 0) {
         if ($type == 0) {
-            //打标签
-            $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
-            if (in_array($mainId, [52, 1459])) {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
-            } elseif ($mainId == 16948) {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
-            } elseif ($mainId == 72057) {
-                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里小榄店</TEXT>';
-            } else {
-                $content .= '<TEXT x="30" y="250" font="12" w="1" h="1" r="0">' . $unit . '</TEXT>';
+            if ($priceOption != 2) {
+                //打标签
+                $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
+                if (in_array($mainId, [52, 1459])) {
+                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
+                } elseif ($mainId == 16948) {
+                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
+                } elseif ($mainId == 72057) {
+                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里小榄店</TEXT>';
+                } else {
+                    $content .= '<TEXT x="30" y="250" font="12" w="1" h="1" r="0">' . $unit . '</TEXT>';
+                }
             }
             }
         } else {
         } else {
             if (getenv('YII_ENV') == 'production') {
             if (getenv('YII_ENV') == 'production') {