base
parent
ab95f3acf4
commit
4275b90f60
|
|
@ -27,7 +27,7 @@ class OrderPrint
|
||||||
if ($devices->count() > 0 && $templateId) {
|
if ($devices->count() > 0 && $templateId) {
|
||||||
$service = PrintService::make();
|
$service = PrintService::make();
|
||||||
$products = [];
|
$products = [];
|
||||||
foreach($order->products()->get() as $item) {
|
foreach($order->products as $item) {
|
||||||
array_push($products, [
|
array_push($products, [
|
||||||
'name' => $item->name,
|
'name' => $item->name,
|
||||||
'price' => round($item->sell_price / 100, 2, PHP_ROUND_HALF_DOWN),
|
'price' => round($item->sell_price / 100, 2, PHP_ROUND_HALF_DOWN),
|
||||||
|
|
@ -42,7 +42,7 @@ class OrderPrint
|
||||||
'desk' => $desk->name,
|
'desk' => $desk->name,
|
||||||
'products' => json_encode($products),
|
'products' => json_encode($products),
|
||||||
'total' => round($order->total_amount, 2, PHP_ROUND_HALF_DOWN),
|
'total' => round($order->total_amount, 2, PHP_ROUND_HALF_DOWN),
|
||||||
'remarks' => $order->note,
|
'remarks' => $order->note ?: '',
|
||||||
];
|
];
|
||||||
foreach($devices as $item) {
|
foreach($devices as $item) {
|
||||||
$result = $service->template($item->device_no, $templateId, $data);
|
$result = $service->template($item->device_no, $templateId, $data);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue