@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; $total['当月仕入合計'] = 0; $total['当月繰越'] = 0; $total['年間仕入高'] = 0; foreach($viewdata['supplierledger'] as $supplierledger) { $page[] = $supplierledger; $total['件数'] += 1; //$total['材料仕入'] += $payable['材料仕入']; //$total['商品仕入'] += $payable['商品仕入']; //$total['消耗品その他'] += $payable['消耗品その他']; //$total['消費税計'] += $payable['消費税計']; //if (count($page) >= $RECORDS_PER_PAGE) //{ $pages[] = $page; $page = []; //} } //if (count($page) > 0) //{ // $pages[] = $page; // $page = []; //} @endphp @foreach($pages as $i => $page) @include('monthlypurchase/ledgerist01-01',[ 'pagenum' => ($i + 1), 'pagetotal' => count($pages), 'record_per_page' => $RECORDS_PER_PAGE, 'pagedata'=>$page, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection