@extends('layouts.default') @section('header-links') @include('accounts.reports.management.selector') @endsection @section('title', isset($title)?$title:'') @section('content')
{!! Form::open(['method' => 'POST', 'url' => '/reports/management/consultant-vendor-payments', 'class' => 'form-horizontal', 'id'=>'form1']) !!}
{!! Form::label('year', 'Select Year', ['class' => 'col-sm-3 control-label']) !!}
{!! Form::selectYear('year', date('Y') - 6, date('Y'), date('Y'), ['class' => 'selectpicker', 'required' => 'required', 'onchange'=>'formSubmit();', 'style'=>'width: 100%;']) !!} {{ $errors->first('year') }}
{!! Form::close() !!}
@php $months = config('custom_config.months_names'); @endphp @foreach($months as $m) @endforeach @foreach($months as $m) @endforeach @php $arr1 = []; $arr2 = []; $arr3 = []; $arr4 = []; $arr5 = []; $arr6 = []; $arr7 = []; $arr8 = []; $arr9 = []; $arr10 = []; $arr11 = []; $arr12 = []; $gtotal1 = []; $ttotal1 = []; $timearr1 = []; $timearr2 = []; $timearr3 = []; $timearr4 = []; $timearr5 = []; $timearr6 = []; $timearr7 = []; $timearr8 = []; $timearr9 = []; $timearr10 = []; $timearr11 = []; $timearr12 = []; $ttotal1 = []; @endphp @foreach ($list as $li) @php $gtotal = 0; $ttotal = 0; @endphp @if(count($li['childs']) > 0) @foreach ($li['childs'] as $record) @for ($j = 1; $j < 13; $j++) @php // Timesheet Totals if(isset($record['timetotals'][$j])) { $timesttl = json_decode($record['timetotals'][$j]); $timesttl = ($timesttl[0])->regular + ($timesttl[0])->ot; $ttotal = $ttotal + $timesttl; } else { $nttotal = 0; $timesttl = 0; } $nttotal = $timesttl; $tname = 'timearr'.$j; array_push($$tname, $nttotal); // Vendor Payrates if($record['months']['month'] == $j) { $ntotal = $record['months']['total']; $gtotal = $gtotal + $ntotal; } else { $gtotal = $gtotal + 0; $ntotal = 0; } $aname = 'arr'.$j; array_push($$aname, $ntotal); @endphp @endfor @php array_push($gtotal1, $gtotal); $gtotal = 0; array_push($ttotal1, $ttotal); $ttotal = 0; @endphp @endforeach @endif @endforeach
Vendor Consultant{{ $m }}Totals
Vendor ConsultantVendor Payments Consultant PayroleVendor Payment Total Consultant Payrole Total
{!! str_limit($li['name'], 15) !!} {!! str_limit($record['name'], 15) !!}@if($ntotal != 0) @money($ntotal, 'USD', true) @endif @if($timesttl != 0) @money($timesttl, 'USD', true) @endif@if($gtotal != 0) @money($gtotal, 'USD', true) @endif @if($ttotal != 0) @money($ttotal, 'USD', true) @endif
{!! 'Vendor' !!} {!! 'Consultant' !!} @money(array_sum($arr1), 'USD', true) @money(array_sum($timearr1), 'USD', true) @money(array_sum($arr2), 'USD', true) @money(array_sum($timearr2), 'USD', true) @money(array_sum($arr3), 'USD', true) @money(array_sum($timearr3), 'USD', true) @money(array_sum($arr4), 'USD', true) @money(array_sum($timearr4), 'USD', true) @money(array_sum($arr5), 'USD', true) @money(array_sum($timearr5), 'USD', true) @money(array_sum($arr6), 'USD', true) @money(array_sum($timearr6), 'USD', true) @money(array_sum($arr7), 'USD', true) @money(array_sum($timearr7), 'USD', true) @money(array_sum($arr8), 'USD', true) @money(array_sum($timearr8), 'USD', true) @money(array_sum($arr9), 'USD', true) @money(array_sum($timearr9), 'USD', true) @money(array_sum($arr10), 'USD', true) @money(array_sum($timearr10), 'USD', true) @money(array_sum($arr11), 'USD', true) @money(array_sum($timearr11), 'USD', true) @money(array_sum($arr12), 'USD', true) @money(array_sum($timearr12), 'USD', true) @money(array_sum($gtotal1), 'USD', true) @money(array_sum($ttotal1), 'USD', true)
@endsection