Files
coolcoth.com/app/Views/psi/sales_order_print.php
2026-08-08 15:53:53 +08:00

34 lines
1.7 KiB
PHP

<?php
/** PSI 销售订单打印正文(由 psi_print_shell 包裹) */
/** @var array $o @var array $items */
$amt = array_sum(array_map(fn($i) => (float)($i['amount'] ?? 0), $items));
$chn = $o['channel'] === 'export' ? '外贸' : '内贸';
?>
<h2>销售订单</h2>
<div class="sub"><?php echo e($o['order_no']); ?></div>
<div class="meta">
<span><b>客户:</b><?php echo e($o['customer']); ?></span>
<span><b>业务员:</b><?php echo e($o['salesman']); ?></span>
<span><b>渠道:</b><?php echo $chn . ($o['region'] ? ' / ' . e($o['region']) : ''); ?></span>
<span><b>交货日期:</b><?php echo e($o['delivery_date'] ?? '—'); ?></span>
<span><b>下单:</b><?php echo e($o['created_at']); ?></span>
</div>
<table>
<thead><tr><th>商品</th><th>规格</th><th>单位</th><th>数量</th><th>单价</th><th>金额</th></tr></thead>
<tbody>
<?php foreach ($items as $it): ?>
<tr>
<td><?php echo e($it['name']); ?></td>
<td><?php echo e($it['spec']); ?></td>
<td><?php echo e($it['unit']); ?></td>
<td><?php echo e($it['qty']); ?></td>
<td>¥<?php echo e(number_format((float)($it['price'] ?? 0), 2)); ?></td>
<td>¥<?php echo e(number_format((float)($it['amount'] ?? 0), 2)); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot><tr><th colspan="5" style="text-align:right">合计</th><th>¥<?php echo e(number_format($amt, 2)); ?></th></tr></tfoot>
</table>
<?php if ($o['remark']): ?><p style="font-size:13px;color:#374151;margin-top:10px"><b>备注:</b><?php echo e($o['remark']); ?></p><?php endif; ?>
<div class="sign"><span>制单:<?php echo e($o['salesman']); ?></span><span>客户签字:____________</span></div>