@extends('layouts.report') @section('title', '仕入日次明細一覧表') @section('content') @php $RECORDS_PER_PAGE = 40; $pages = []; $page = []; $total = []; $total['件数'] = 0; $total['仕入金額合計'] = 0; $printday = date("Y.m.d"); $closingdate = $viewdata['closingdate']; foreach($viewdata['dailyshis'] as $dailyshi) { $page[] = $dailyshi; $total['件数'] += 1; $total['仕入金額合計'] += $dailyshi['仕入金額']; if (count($page) >= $RECORDS_PER_PAGE) { $pages[] = $page; $page = []; } } if (count($page) > 0) { $pages[] = $page; $page = []; } @endphp @foreach($pages as $i => $page) @include('dailyuri/report04-01',[ 'pagenum' => ($i + 1), 'pagedata'=>$page, 'printday' => $printday, 'closingdate' => $closingdate, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection