@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['payments'] as $payment) { $total['現金・小切手'] = $payment['現金・小切手']; $total['振込'] = $payment['振込']; $total['相殺・その他'] = $payment['相殺・その他']; $total['手形'] = $payment['手形']; $total['支払合計'] = $total['現金・小切手'] + $total['振込'] + $total['相殺・その他'] + $total['手形']; } foreach($viewdata['producttypes'] as $producttype) { $page[] = $producttype; $total['件数'] += 1; $total['当月仕入合計'] += $producttype['月計金額']; $total['年間仕入合計'] += $producttype['年計金額']; if (count($page) >= $RECORDS_PER_PAGE) { $pages[] = $page; $page = []; } } if (count($page) > 0) { $pages[] = $page; $page = []; } @endphp @foreach($pages as $i => $page) @include('monthlypurchase/monthlyList01-01',[ 'pagenum' => ($i + 1), 'pagetotal' => count($pages), 'record_per_page' => $RECORDS_PER_PAGE, 'pagedata'=>$page, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection