@extends('layouts.report') @section('title', '仕入・支払日報') @section('content') @php $RECORDS_PER_PAGE = 40; $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; $total['入金_入金合計'] = 0; $printday = date("Y.m.d"); $closingdate = $viewdata['closingdate']; foreach($viewdata['supply'] as $dailyshi) { $page[] = $dailyshi; $total['仕入金額合計'] += $dailyshi['仕入金額合計']; if (count($page) >= $RECORDS_PER_PAGE) { $pages[] = $page; $page = []; } } if (count($page) > 0) { $pages[] = $page; $page = []; } foreach($viewdata['payments'] as $payment) { switch($payment['payment_type']) { case '1': $total['入金_現金'] = $payment['total_money']; break; case '2': $total['入金_手形'] = $payment['total_money']; break; case '3': $total['入金_小切手'] = $payment['total_money']; break; case '4': $total['入金_振込'] = $payment['total_money']; break; case '5': $total['入金_振込手数料'] = $payment['total_money']; break; case '6': $total['入金_相殺'] = $payment['total_money']; break; case '7': $total['入金_入金値引'] = $payment['total_money']; break; case '8': $total['入金_その他'] = $payment['total_money']; break; case '9': $total['入金_振込消費税'] = $payment['total_money']; break; } } $total['入金_支払計'] = $total['入金_現金'] + $total['入金_手形'] + $total['入金_小切手'] + $total['入金_振込'] + $total['入金_振込手数料'] + $total['入金_相殺'] + $total['入金_入金値引'] + $total['入金_その他'] + $total['入金_振込消費税']; @endphp @foreach($pages as $i => $page) @include('dailyuri/report05-01',[ 'pagenum' => ($i + 1), 'pagedata'=>$page, 'printday' => $printday, 'closingdate' => $closingdate, 'total' => (($i == count($pages) - 1) ? $total : null), ]) @endforeach @endsection