@extends('layouts.report') @section('title', '得意先別売掛残高順位表') @section('content') @php $RECORDS_PER_PAGE = 35; $pages = []; $page = []; $total = []; $total['件数'] = 0; $total['指定月請求額'] = 0; $total['指定月売掛金合計'] = 0; $total['指定月入金合計'] = 0; $total['今期請求額累計'] = 0; $total['今期消費税額累計'] = 0; $total['売掛残高'] = 0; $total['年間売上額'] = 0; foreach($viewdata['customers'] as $customer) { $page[] = $customer; $total['件数'] += 1; $total['指定月請求額'] += $customer['指定月請求額']; $total['指定月売掛金合計'] += $customer['指定月売掛金合計']; $total['指定月入金合計'] += $customer['指定月入金合計']; $total['今期請求額累計'] += $customer['今期請求額累計']; $total['今期消費税額累計'] += $customer['今期消費税額累計']; $total['売掛残高'] += $customer['売掛残高']; $total['年間売上額'] += floor($customer['今期請求額累計'] * 1.1); if (count($page) >= $RECORDS_PER_PAGE) { $pages[] = $page; $page = []; } } if (count($page) > 0) { $pages[] = $page; $page = []; } @endphp @foreach($pages as $i => $page) @include('monthly/receivable01-01',[ 'pagenum' => ($i + 1), 'pagetotal' => count($pages), 'record_per_page' => $RECORDS_PER_PAGE, 'pagedata'=>$page, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection