@extends(isset($input['print']) && $input['print']==1 ? 'layouts.general' : 'layouts.app') @section('link') @if(isset($input) && (!isset($input['print']) || $input['print']==1)) @endif @endsection @section('style') @endsection @section('content') @include('shared.messages')

{{__('texte.references_arr.purchases.purchases_by_supplier_product')}}
@if(!isset($input['print']) || $input['print']!=1) {{__('texte.references_arr.purchases.references')}} @endif


{{ csrf_field() }}

{{__('texte.references_arr.purchases.general_filters')}}

@if(!isset($input['print']) || $input['print']!=1)
@endif
@include('references.filters.product_filters') @if(!isset($input['print']) || $input['print']!=1)
@endif
@if(isset($doc_rows) && count($doc_rows) > 0) @foreach($doc_rows as $index=>$doc_row) @if($index==0 || ($index>0 && $doc_rows[$index]->supplier_name!=$doc_rows[$index-1]->supplier_name)) @endif @if(!isset($doc_rows[$index+1]) || $doc_rows[$index+1]->category!=$doc_rows[$index]->category) @endif @endforeach
{{__('texte.references_arr.purchases.supplier')}} {{__('texte.references_arr.purchases.count_products')}} {{__('texte.references_arr.purchases.quantity')}} {{__('texte.references_arr.purchases.in_kg')}} {{__('texte.references_arr.purchases.total_amount')}} {{__('texte.references_arr.purchases.average_price')}} {{__('texte.references_arr.purchases.buyings')}}
{{$doc_row->supplier_name}} {{$doc_rows->where('supplier_name',$doc_row->supplier_name)->unique('category')->sum('product_count')}} {{number_format($doc_rows->where('supplier_name',$doc_row->supplier_name)->sum('quantity'),3)}} {{number_format($doc_rows->where('supplier_name',$doc_row->supplier_name)->sum('total_weight'),3,'.','')}} {{number_format($doc_rows->where('supplier_name',$doc_row->supplier_name)->sum('total_amount'),2,'.','')}} {{number_format($doc_rows->where('supplier_name',$doc_row->supplier_name)->sum('quantity')!=0 ? $doc_rows->where('supplier_name',$doc_row->supplier_name)->sum('total_amount')/$doc_rows->where('supplier_name',$doc_row->supplier_name)->sum('quantity') : 0,5,'.','')}} {{$doc_row->count_purchases}}
{{$doc_row->product_id}} {{$doc_row->product_name}} {{number_format($doc_row->quantity,3)}} {{number_format($doc_row->total_weight,3,'.','')}} {{number_format($doc_row->total_amount,2,'.','')}} {{number_format($doc_row->quantity!=0 ? $doc_row->total_amount/$doc_row->quantity : 0,5,'.','')}} {{$doc_row->count_purchases}}
{{$doc_row->category}} {{$doc_row->product_count}} {{number_format($doc_rows->where('supplier_name',$doc_row->supplier_name)->where('category',$doc_row->category)->sum('quantity'),3)}} {{number_format($doc_rows->where('supplier_name',$doc_row->supplier_name)->where('category',$doc_row->category)->sum('total_weight'),3,'.','')}} {{number_format($doc_rows->where('supplier_name',$doc_row->supplier_name)->where('category',$doc_row->category)->sum('total_amount'),2,'.','')}} {{number_format($doc_rows->where('supplier_name',$doc_row->supplier_name)->where('category',$doc_row->category)->sum('quantity')!=0 ? $doc_rows->where('supplier_name',$doc_row->supplier_name)->where('category',$doc_row->category)->sum('total_amount')/$doc_rows->where('supplier_name',$doc_row->supplier_name)->where('category',$doc_row->category)->sum('quantity') : 0,5,'.','')}} {{$doc_row->count_purchases}}
{{__('texte.references_arr.purchases.total')}}: {{$doc_rows->unique('category')->sum('product_count')}} {{number_format($doc_rows->sum('quantity'),3,'.','')}} {{number_format($doc_rows->sum('total_weight'),3,'.','')}} {{number_format($doc_rows->sum('total_amount'),2,'.','')}} {{$doc_rows->unique('supplier_name')->sum('count_purchases')}}
@endif
@if(!isset($input['print']) || $input['print']!=1) @endif @endsection