@php $catCount = count($mfnSamityCategories); // $catCount = 1; // for testing only $catCount > 1 ? $colspan = 2 : $colspan = 1; @endphp
{!! Form::open(array('url' => '', 'id' => 'budget-form', 'role' => 'form')) !!} @foreach($mfnSamityCategories as $samityCatId => $samityProductCategories) @foreach($samityProductCategories->productCategories as $key => $categoryName) @php $firstProductCat = key($samityProductCategories->productCategories); @endphp {{-- @php $firstProductCat = array_key_first($samityProductCategories->productCategories); @endphp --}} @foreach($particularsName as $opKey => $opName) @if ($catCount > 1) @if($firstProductCat == $key && $opKey == 'add') @elseif($firstProductCat == $key && $opKey == 'add') @endif @endif @if($opKey == 'add') @endif @if($opKey == 'add') @endif @php if($opKey == 'add') { $prevLastFyClosing = 0; $lastFyClosing = $openingData[$key]['lastFyAdd']; } if($opKey == 'cancellation' || $opKey == 'total_recovery' ) { $prevLastFyClosing = 0; $lastFyClosing = $openingData[$key]['lastFyCancellation']; } if($opKey == 'net') { $prevLastFyClosing = 0; $lastFyClosing = $openingData[$key]['lastFyNet']; } if($opKey == 'closing') { $prevLastFyClosing = $openingData[$key]['prevLastFyClosing']; $lastFyClosing = $openingData[$key]['lastFyClosing']; } @endphp @if($opKey == 'closing') @else @endif @if ($opKey == 'new_recovery' || $opKey == 'old_recovery' || $opKey == 'due_recovery') @else @endif @if ($opKey == 'new_recovery' || $opKey == 'old_recovery' || $opKey == 'due_recovery') @php $i = 1; @endphp @foreach ($fyMonths as $monthKey=>$fyMonth) @php $i++; @endphp @endforeach @else @for ($i = 1; $i <= 12; $i++) @endfor @endif @endforeach {{-- particularsName --}} @endforeach {{-- productCategories --}} {{-- SUB TOTAL --}} @if ($catCount > 1) @foreach($particularsName as $opKey => $opName) @if($opKey == 'add') @endif @if($opKey == 'add') @endif @php if($opKey == 'add') $subtotalLastFy = $samityProductCategories->totalLastFyAdd; if($opKey == 'total_recovery') $subtotalLastFy = $samityProductCategories->totalLastFyCancellation; if($opKey == 'cancellation') $subtotalLastFy = $samityProductCategories->totalLastFyCancellation; if($opKey == 'net') $subtotalLastFy = $samityProductCategories->totalLastFyNet; if($opKey == 'closing') $subtotalLastFy = $samityProductCategories->totalLastFyClosing; $subtotalPrevLastFyClosing = $samityProductCategories->totalPrevLastFyClosing; @endphp @if($opKey == 'closing') @endif @if ($opKey == 'new_recovery' || $opKey == 'old_recovery' || $opKey == 'due_recovery') @else @endif @for ($i = 1; $i <= 12; $i++) @endfor @endforeach @endif {{-- SUB TOTAL END --}} @endforeach {{-- samityCategories --}} {{-- GRAND TOTAL --}} @foreach($particularsName as $opKey => $opName) @if($opKey == 'add') @endif @if($opKey == 'add') @endif @php if($opKey == 'add') $totalLastFy = $totalLastFyAdd; if($opKey == 'total_recovery') $totalLastFy = $totalLastFyCancellation; if($opKey == 'cancellation') $totalLastFy = $totalLastFyCancellation; if($opKey == 'net') $totalLastFy = $totalLastFyNet; if($opKey == 'closing') $totalLastFy = $totalLastFyClosing; @endphp @if($opKey == 'closing') @endif @if ($opKey == 'new_recovery' || $opKey == 'old_recovery' || $opKey == 'due_recovery') @else @endif @for ($i = 1; $i <= 12; $i++) @endfor @endforeach
Components {{ $prevLastFy }} {{ $lastFy }} {{ $fiscalyear }} {{ $fiscalyear }}
Jul, {{ $partOfyear[0] }} Aug, {{ $partOfyear[0] }} Sep, {{ $partOfyear[0] }} Oct, {{ $partOfyear[0] }} Nov, {{ $partOfyear[0] }} Dec, {{ $partOfyear[0] }} Jan, {{ $partOfyear[1] }} Feb, {{ $partOfyear[1] }} Mar, {{ $partOfyear[1] }} Apr, {{ $partOfyear[1] }} May, {{ $partOfyear[1] }} Jun, {{ $partOfyear[1] }} Total
{{$samityCategories[$samityProductCategories->samityCategoryId]->categoryName}}{{$samityCategories[$samityProductCategories->samityCategoryId]->categoryName}}{{ $categoryName }} {{ $particularsName[$opKey] }} $i) readonly @endif onclick='checkelement(this)' @if (isset($openingData[$key][$opKey][$monthKey])) @if ($opKey == "due_recovery") value="{{round($openingData[$key][$opKey][$monthKey])}}" @else value="{{round($openingData[$key][$opKey][$monthKey]->oldRecoverable)}}" @endif @else value="0" @endif id="{{ $opKey }}_{{ $key }}_{{ $i }}" name="{{ $opKey }}_{{ $key }}_{{ $i }}" class="form-control {{ $textStyle }}" {{ ($opKey == 'new_recovery') ? '' : 'readonly' }}/> $i) readonly @endif onclick='checkelement(this)' value="0" id="{{ $opKey }}_{{ $key }}_{{ $i }}" name="{{ $opKey }}_{{ $key }}_{{ $i }}" class="form-control {{ $textStyle }}" {{ ($opKey == 'add') ? '' : 'readonly' }}/>
Sub Total {{ $particularsName[$opKey] }} {{ number_format($subtotalPrevLastFyClosing) }}{{ 0 }}{{ number_format($subtotalLastFy) }}00 0
Grand Total {{ $particularsName[$opKey] }} {{ number_format($totalPrevLastFyClosing) }}{{ 0 }}{{ number_format($totalLastFy) }}00 0
{!! Form::submit('Save', ['id' => 'budgetSubmit', 'class' => 'btn btn-primary btn-md', 'style'=>'font-size:12px']); !!}
{!! Form::close() !!}