问题说明:小票打印金额展示不明确
修改文件:crmeb\services\printer\storage\YiLianYun
修改方法:setPrinterTableContent()
public function setPrinterTableContent(array $config): self
{
$timeYmd = date('Y-m-d', time());
$timeHis = date('H:i:s', time());
$goodsStr = '<table><tr><td>商品名称</td><td>单价</td><td>数量</td><td>金额</td></tr>';
$product = $config['product'];
$sumPrice = 0;
foreach ($product as $item) {
$goodsStr .= '<tr>';
$price = bcmul((string)$item['cart_num'], (string)$item['truePrice'], 2);
$goodsStr .= "<td>{$item['productInfo']['store_name']}|{$item['productInfo']['attrInfo']['suk']}</td><td>{$item['truePrice']}</td><td>{$item['cart_num']}</td><td>{$price}</td>";
$goodsStr .= '</tr>';
$sumPrice = bcadd((string)$sumPrice, (string)$price, 2);
unset($price);
}
$goodsStr .= '</table>';
$tableInfo = $config['tableInfo'];
$name = $config['name'];
/** @var TableQrcodeServices $qrcodeService */
$qrcodeService = app()->make(TableQrcodeServices::class);
$Info = $qrcodeService->getQrcodeyInfo((int)$tableInfo['qrcode_id'], ['category']);
$this->printerContent = <<<CONTENT
<FB><center> ** {$name} **</center></FB>
<FH2><FW2>----------------</FW2></FH2>
桌码流水:{$tableInfo['serial_number']}\r
桌码分类: {$Info['category']['name']} \r
桌码编号: {$Info['table_number']} \r
日 期: {$timeYmd}\r
时 间: {$timeHis}\r
*************商品***************\r
{$goodsStr}
********************************\r
<FH>
<right>商品金额:¥{$sumPrice}</right>
</FH>
<FS><center> ** 完 **</center></FS>
CONTENT;
return $this;
}
修改文件:crmeb\services\printer\storage\FeiEYun
修改方法:setPrinterTableContent()
foreach ($product as $item) {
$price = bcmul((string)$item['cart_num'], (string)$item['truePrice'], 2);
$sumPrice = bcadd((string)$sumPrice, (string)$price, 2);
unset($price);
}