@extends('layouts.report') @section('title', '得意先別月間推移表') @section('content') @php $RECORDS_PER_PAGE = 35; $pages = []; $page = []; $total = []; $total['件数'] = 0; $total['計11月'] = 0; $total['計12月'] = 0; $total['計01月'] = 0; $total['計02月'] = 0; $total['計03月'] = 0; $total['計04月'] = 0; $total['計05月'] = 0; $total['計06月'] = 0; $total['計07月'] = 0; $total['計08月'] = 0; $total['計09月'] = 0; $total['計10月'] = 0; $total['年間売上'] = 0; foreach($viewdata['customers'] as $customer) { $page[] = $customer; $total['件数'] += 1; $total['計11月'] += $customer['計11月']; $total['計12月'] += $customer['計12月']; $total['計01月'] += $customer['計01月']; $total['計02月'] += $customer['計02月']; $total['計03月'] += $customer['計03月']; $total['計04月'] += $customer['計04月']; $total['計05月'] += $customer['計05月']; $total['計06月'] += $customer['計06月']; $total['計07月'] += $customer['計07月']; $total['計08月'] += $customer['計08月']; $total['計09月'] += $customer['計09月']; $total['計10月'] += $customer['計10月']; $total['年間売上'] += $customer['年間売上']; if (count($page) >= $RECORDS_PER_PAGE) { $pages[] = $page; $page = []; } } if (count($page) > 0) { $pages[] = $page; $page = []; } @endphp @foreach($pages as $i => $page) @include('monthly/sales03-01',[ 'pagenum' => ($i + 1), 'pagetotal' => count($pages), 'record_per_page' => $RECORDS_PER_PAGE, 'pagedata'=>$page, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection