【发布时间】:2021-09-11 04:07:39
【问题描述】:
我的系统会生成一张如图所示的收据:
我的系统中还有一个制造商列表 现在我想像这样修改这张收据,使产品应位于其制造商标题下,该标题还显示该制造商在该订单中销售的产品总量
我的收据代码在这里
<table>
<thead>
<tr>
<th class="item">QTY</th>
<th class="item">BON</th>
<th class="item">TOTAL QTY</th>
<th class="item">PRODUCT</th>
<th class="item">BATCH</th>
<th class="item">TRADE PRICE</th>
<th class="item">GST</th>
<th class="item">DISCOUNT</th>
<th class="item">TOTAL</th>
</tr>
</thead>
@foreach($order->orderItems as $item)
<tbody>
<tr>
<td class="item-list">{{$item->quantity}}</td>
<td class="item-list">{{$item->bonus_items}}</td>
<td class="item-list">{{$item->quantity + $item->bonus_items}}</td>
<td class="item-list">{{strtoupper($item->product->product_name)}}</td>
<td class="item-list">{{$item->product->batch_no}}</td>
<td class="item-list" colspan="2">{{$item->product->selling_price}}</td>
<td class="item-list"></td>
<td class="item-list">{{$item->product->selling_price *$item->quantity}}</td>
</tr>
</tbody>
@endforeach
<tfoot>
<tr class="summary">
<?php
$f = new NumberFormatter("en", NumberFormatter::SPELLOUT);
$words = $f->format($order->total_amount - $order->discount);
?>
<td colspan="4">{{ ucwords($words.' Rupees') }}</td>
<td colspan="2"><strong>TOTAL: <strong>{{$order->total_amount}}</td>
<td colspan="2"><strong>DISCOUNT: <strong>{{ $order->discount }}</td>
<td><strong>TOTAL:<strong>Rs. {{$order->total_amount - $order->discount}}/-</td>
</tr>
</tfoot>
</table>
是否有我必须在这里应用的任何条件或我必须在模型或控制器文件中创建的任何功能。
【问题讨论】:
标签: javascript php laravel laravel-8 php-7.4