@extends('layouts.report') @section('title', '入金一覧日報') @section('content') @php $RECORDS_PER_PAGE = 27; $pages = []; $page = []; $total = []; $total['実入金金額'] = 0; $total['入金値引額'] = 0; $total['その他マイナス'] = 0; $total['合計'] = 0; $printday = date("Y.m.d"); $closingdate = $viewdata['closingdate']; foreach($viewdata['deposits'] as $dailynyu) { $page[] = $dailynyu; if ($dailynyu['deposit_type'] == 7) { // 入金値引額 $total['入金値引額'] += $dailynyu['money']; } else { if ($dailynyu['deposit_kind_surplus'] == 1) { $total['実入金金額'] += $dailynyu['money']; } else { $total['その他マイナス'] += $dailynyu['money']; } } $total['合計'] += $dailynyu['money']; if (count($page) >= $RECORDS_PER_PAGE) { $pages[] = $page; $page = []; } } if (count($page) > 0) { $pages[] = $page; $page = []; } @endphp @foreach($pages as $i => $page) @include('dailyuri/report03-01',[ 'pagenum' => ($i + 1), 'pagedata'=>$page, 'printday' => $printday, 'closingdate' => $closingdate, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection