@extends('layouts.report') @section('title', '請求一覧表') @section('content') @php $RECORDS_PER_PAGE = 30; $pages = []; $page = []; $total = []; $total['件数'] = 0; $total['前回御請求額'] = 0; $total['入金額'] = 0; $total['入金値引額'] = 0; $total['差引繰越高'] = 0; $total['当月売上高'] = 0; $total['当月返品値引'] = 0; $total['当月純売上高'] = 0; $total['消費税額'] = 0; $total['当月御請求高'] = 0; foreach($viewdata['billingCustomers'] as $billingCustomer) { $page[] = $billingCustomer; $total['件数'] += 1; $total['前回御請求額'] += $billingCustomer['前回御請求額']; $total['入金額'] += $billingCustomer['入金額']; $total['入金値引額'] += $billingCustomer['入金値引額']; $total['差引繰越高'] += $billingCustomer['差引繰越高']; $total['当月売上高'] += $billingCustomer['当月売上高']; $total['当月返品値引'] += $billingCustomer['当月返品値引']; $total['当月純売上高'] += $billingCustomer['当月純売上高']; $total['消費税額'] += $billingCustomer['消費税額']; $total['当月御請求高'] += $billingCustomer['当月御請求高']; if (count($page) >= $RECORDS_PER_PAGE) { $pages[] = $page; $page = []; } } if (count($page) > 0) { $pages[] = $page; $page = []; } @endphp @foreach($pages as $i => $page) @include('closing/report01-01',[ 'pagenum' => ($i + 1), 'pagetotal' => count($pages), 'pagedata'=>$page, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection