@extends('layouts.report') @section('title', '売掛残高順位表(決算)') @section('content') @php $RECORDS_PER_PAGE = 25; $pages = []; $page = []; $total = []; $total['件数'] = 0; $total['売掛残高'] = 0; foreach($viewdata['customers'] as $customer) { $page[] = $customer; $total['件数'] += 1; $total['売掛残高'] += $customer['売掛残高']; if (count($page) >= $RECORDS_PER_PAGE) { $pages[] = $page; $page = []; } } $total['売掛残高'] += $viewdata['others']['売掛残高']; if (count($page) > 0) { $pages[] = $page; $page = []; } @endphp @foreach($pages as $i => $page) @include('monthly/receivable02-01',[ 'pagenum' => ($i + 1), 'pagetotal' => count($pages), 'record_per_page' => $RECORDS_PER_PAGE, 'pagedata'=>$page, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection