@extends('layouts.report') @section('title', '得意先別売上管理表') @section('content') @php $RECORDS_PER_PAGE = 35; $pages = []; $page = []; $total = []; $total['件数'] = 0; $total['得意先NO'] = 0; $total['得意先名'] = 0; $total['前月繰越額'] = 0; $total['現金・振込'] = 0; $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['差引繰越'] += $customer['差引繰越']; $total['当月売上'] += $customer['当月売上']; $total['消費税'] += $customer['消費税']; $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/sales01-01',[ 'pagenum' => ($i + 1), 'pagetotal' => count($pages), 'record_per_page' => $RECORDS_PER_PAGE, 'pagedata'=>$page, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection