問(wèn)題說(shuō)明:小票打印金額展示不明確
修改文件: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>單價(jià)</td><td>數(shù)量</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
桌碼編號(hào): {$Info['table_number']} \r
日 期: {$timeYmd}\r
時(shí) 間: {$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);
}