@extends('layouts.fixed') @section('title', 'All Units Summary') @section('css') @stop @section('content')

Product Summary

{{-- start --}}
{{ Form::open(['route' => 'all-units-item-summary', 'method' => 'get']) }}
{{-- {{ Form::select('product_id',$products,null,['class'=>'form-control select2','placeholder'=>'All Units']) }} --}}
{{ Form::close() }}
{{-- end --}}
@if ($item != null)

Consolidated Product Summary

Product Name: {{ $item->name }}
{{-- view start --}} @if ($units != null) @foreach ($units as $key => $unit) @php $abalavailqty = App\GoodsinProduct::where('unit_id', $unit->id) ->where('product_id', $item->id) ->sum('qty') - App\GoodsIssueProduct::where('unit_id', $unit->id) ->where('product_id', $item->id) ->sum('qty'); $count = App\GoodsinProduct::where('unit_id', $unit->id) ->where('product_id', $item->id) ->count('qty'); if ($count != 0) { $price = App\GoodsinProduct::where('unit_id', $unit->id) ->where('product_id', $item->id) ->sum('price') / $count; if ($abalavailqty != 0) { $averageprice = $price; } else { $averageprice = 0; } } else { $averageprice = 0; } $totalprice = $averageprice * $abalavailqty; @endphp @endforeach @endif {{-- --}}
#SL Unit Name Avalable Qty Avarage Price Value
{{ $key + 1 }} {{ $unit->name }}{{ $abalavailqty }} {{ round($averageprice, 2) }} {{ round($totalprice, 2) }}
Grand Total (BDT) {{ number_format($total_cash,2) }} {{ number_format($total_credit,2) }} {{ number_format($total_cash + $total_credit,2) }}
@endif @stop @section('style') @stop @section('plugin') @stop @section('script') @stop