【发布时间】:2020-11-27 08:19:11
【问题描述】:
在上面我想计算当月的买入和卖出总数。假设在 11 月我要计算卖出行总数、买入行总数和买卖总数。我怎样才能做到这一点 。请帮忙...
**<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>Date</th>
<th>Product Name</th>
<th>Quantity (Stock IN)</th>
<th>Buying Total</th>
<th>Stock</th>
<th>Selling Total</th>
<th>Profit (%)</th>
</tr>
</thead>
<tbody>
@foreach($product_all as $row)
<tr>
<td>{{ $row->buying_date}}</td>
<td>{{ $row->product_name}}</td>
<td>{{ $row->stock_in }}</td>
<td>{{ $row->buying_price*$row->stock_in }}</td> *********
<td>{{ $row->total_stock }}</td>
<td>{{ $row->selling_price*($row->stock_in-$row->total_stock)}}</td> ********
<td>{{ ($row->buying_price*$row->stock_in) - ($row->selling_price*($row->stock_in-$row->total_stock)) }}</td>
</tr>
@endforeach
</tbody>
</table>**
<h4 style="color: #ff3939; text-align: center;">November Total Invest : {{ #### }} <span> Sell : {{ #### }}</span></h4>
【问题讨论】:
-
您的问题有两个答案。如果任何一个答案解决了您的问题,请记住标记为已接受,以使后续用户受益,尤其是新手,他们觉得接受的答案以首选方式解决了问题。如果答案不能解决您的问题,至少让答案作者知道您遇到了什么错误或为什么答案不能解决您的问题
标签: laravel count calculation