|
@@ -54,10 +54,10 @@ class Goods extends Core
|
|
|
if (isset($v['price_array'])) {
|
|
|
$pdf->br()->left($v['name'], 150);
|
|
|
foreach ($v['price_array'] as $k1 => $v1) {
|
|
|
- $pdf->br()->left('----' . $v1['name'], 150)->right('X' . $v1['total'], 40);
|
|
|
+ $pdf->br()->left('----' . $v1['name'], 150)->right('x ' . $v1['total'], 40);
|
|
|
}
|
|
|
} else {
|
|
|
- $pdf->br()->left($v['name'], 150)->right('X' . $v['total'], 40);
|
|
|
+ $pdf->br()->left($v['name'], 150)->right('x ' . $v['total'], 40);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -77,4 +77,54 @@ class Goods extends Core
|
|
|
|
|
|
$pdf->out('库存清单');
|
|
|
}
|
|
|
+
|
|
|
+ # 打印
|
|
|
+ public function printer()
|
|
|
+ {
|
|
|
+ $id = Dever::input('printer_id');
|
|
|
+ if (!$id) {
|
|
|
+ Dever::alert('请选择打印机');
|
|
|
+ }
|
|
|
+ $where['id'] = $id;
|
|
|
+ $where['shop_id'] = $this->shop_id;
|
|
|
+ $info = Dever::db('shop/print')->find($where);
|
|
|
+ if (!$info) {
|
|
|
+ Dever::alert('请选择打印机');
|
|
|
+ }
|
|
|
+
|
|
|
+ $manage_config = Dever::db('main/manage_config')->find();
|
|
|
+ $sell_config = Dever::db('main/sell_config')->find();
|
|
|
+ $config = Dever::db('main/config')->find();
|
|
|
+ $data = Dever::load('shop/lib/info')->getGoodsSku($this->shop_id);
|
|
|
+
|
|
|
+ $content = '--------------'.$main_config['name'].'------------<BR><BR>';
|
|
|
+ $content .= '门店名称:'.$this->shop['name'].'<BR>';
|
|
|
+ $content .= '制单人:'.$this->user['name'].'<BR>';
|
|
|
+ $content .= '制单时间:'.date('Y-m-d H:i:s').'<BR>';
|
|
|
+
|
|
|
+ if ($data) {
|
|
|
+ $orderInfo .= '--------------------------------<BR>';
|
|
|
+ $orderInfo .= '名称 数量<BR>';
|
|
|
+ foreach ($data as $k => $v) {
|
|
|
+ if (isset($v['price_array'])) {
|
|
|
+ $orderInfo .= $v['name'] . ' <BR>';
|
|
|
+ $orderInfo .= '----' . $v1['name'] . ' '.$v['total'].'<BR>';
|
|
|
+ } else {
|
|
|
+ $orderInfo .= $v['name'] . ' '.$v['total'].'<BR>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $orderInfo .= '--------------------------------<BR>';
|
|
|
+ }
|
|
|
+
|
|
|
+ $content .= '<C>如遇任何问题请致电客服</C><BR>';
|
|
|
+ $content .= '<C>电话:'.$factory_config['phone'].'</C><BR>';
|
|
|
+ $content .= '<C>'.$main_config['worktime'].'</C><BR>';
|
|
|
+ //$content .= '<QR>http://www.feieyun.com</QR>';//把二维码字符串用标签套上即可自动生成二维码
|
|
|
+
|
|
|
+ echo $content;die;
|
|
|
+ Dever::load('mshop/lib/feieyun')->printOrder($info['number'], $content, 1);
|
|
|
+
|
|
|
+ return 'ok';
|
|
|
+ }
|
|
|
}
|