|
|
|
|
@ -35,35 +35,25 @@
|
|
|
|
|
<th class="p-1" style="white-space: nowrap">客户手机号</th>
|
|
|
|
|
<th class="p-1" style="white-space: nowrap">客户家属</th>
|
|
|
|
|
<th class="p-1" style="white-space: nowrap">截止日期</th>
|
|
|
|
|
<th class="p-1" style="white-space: nowrap">充值汇总</th>
|
|
|
|
|
<th class="p-1" style="white-space: nowrap">退款汇总</th>
|
|
|
|
|
<th class="p-1" style="white-space: nowrap">扣款汇总</th>
|
|
|
|
|
<th class="p-1" style="white-space: nowrap">已到帐未结算余额表</th>
|
|
|
|
|
<th class="p-1" style="white-space: nowrap">未结算余额</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
@foreach($customers as $item)
|
|
|
|
|
@if(!$item->oneBalance)
|
|
|
|
|
@continue
|
|
|
|
|
@elseif (!($item->oneBalance->balance > 0))
|
|
|
|
|
@continue
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="p-1">{{ $loop->iteration }}</td>
|
|
|
|
|
<td class="p-1">{{ $item->mobile }}</td>
|
|
|
|
|
<td class="p-1">{{ $item->patients->count() ? $item->patients->first()->name : "无" }}</td>
|
|
|
|
|
<td class="p-1">{{ $item->patients->count() ? $item->patients->last()->name : "无" }}</td>
|
|
|
|
|
<td class="p-1">{{ date("Y-m-d H:i:s",$before_datetime) }}</td>
|
|
|
|
|
<td class="p-1">{{ $item->balances->filter(function($item) { return $item->belongs_type == "App\Models\Recharge"; })->sum("money") }}</td>
|
|
|
|
|
<td class="p-1">{{ $item->balances->filter(function($item) { return $item->belongs_type == "App\Models\Refund"; })->sum("money") }}</td>
|
|
|
|
|
<td class="p-1">{{ $item->balances->filter(function($item) { return $item->belongs_type == "App\Models\OrderItems"; })->sum("money") }}</td>
|
|
|
|
|
<td class="p-1 {{ $item->balances->sum("money") != $item->balances->first()->balance ? "text-danger" : "" }}">{{ $item->balances->sum("money") }}</td>
|
|
|
|
|
<td class="p-1">{{ $item->oneBalance->balance }}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
@endforeach
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="p-1"> </td>
|
|
|
|
|
<td class="p-1"> </td>
|
|
|
|
|
<td class="p-1"> </td>
|
|
|
|
|
<td class="p-1"> </td>
|
|
|
|
|
<td class="p-1"> </td>
|
|
|
|
|
<td class="p-1"> </td>
|
|
|
|
|
<td class="p-1">总计</td>
|
|
|
|
|
<td class="p-1">{{ $customers->each(function($customer) { $customer->balance = $customer->balances->sum("money"); })->sum("balance") }}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
|