@extends('layouts.report') @section('title', '受取手形一覧表(2)') @section('content') @php $RECORDS_PER_PAGE = 35; $pages = []; $page = []; $total = []; $total['件数'] = 0; foreach($viewdata['header']['Prices'] as $YM => $val) { $total[$YM] = 0; } $total['客計'] = 0; foreach($viewdata['customers'] as $customer) { $page[] = $customer; $total['件数'] += 1; foreach($viewdata['header']['Prices'] as $YM => $val) { $total[$YM] += $customer['Prices'][$YM]; } $total['客計'] += $customer['TotalPrice']; if (count($page) >= $RECORDS_PER_PAGE) { $pages[] = $page; $page = []; } } if (count($page) > 0) { $pages[] = $page; $page = []; } @endphp @foreach($pages as $i => $page) @include('monthly/bill02-01',[ 'pagenum' => ($i + 1), 'pagetotal' => count($pages), 'record_per_page' => $RECORDS_PER_PAGE, 'pagedata'=>$page, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection