@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.sales.title3')}}
@if(!isset($input['print']) || $input['print']!=1) {{__('texte.references_arr.sales.references')}} @endif


{{ csrf_field() }}

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

@if(!isset($input['print']) || $input['print']!=1)
@endif
@include('references.filters.object_filters') @include('references.filters.document_filters') @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]->contragent_name!=$doc_rows[$index-1]->contragent_name)) @endif @if($index==0 || ($index>0 && $doc_rows[$index]->object_name!=$doc_rows[$index-1]->object_name)) @endif @if($index==0 || ($index>0 && $doc_rows[$index]->document_id!=$doc_rows[$index-1]->document_id)) @endif @if(!isset($doc_rows[$index+1]) || ($doc_rows[$index]->object_name!=$doc_rows[$index+1]->object_name)) @endif @endforeach
{{__('texte.references_arr.sales.client')}} {{__('texte.references_arr.sales.object')}} {{__('texte.references_arr.sales.in_kg')}} {{__('texte.references_arr.sales.total_amount')}} {{__('texte.references_arr.sales.count_orders')}}
{{$doc_row->contragent_name}} {{number_format($doc_rows->where('contragent_name',$doc_row->contragent_name)->sum('total_weight'),3,'.','')}} {{number_format($doc_rows->where('contragent_name',$doc_row->contragent_name)->sum('total_amount'),2,'.','')}} {{$doc_rows->where('contragent_name',$doc_row->contragent_name)->unique('object_name')->sum('count_orders')}}
{{$doc_row->contragent_name}} {{$doc_row->object_id}} - {{$doc_row->object_name}}
{{date('d.m.Y',strtotime($doc_row->date))}} {{$doc_row->number}} {{$doc_row->title}} {{number_format($doc_rows->where('document_id',$doc_row->document_id)->sum('total_weight'),3,'.','')}} {{number_format($doc_rows->where('document_id',$doc_row->document_id)->sum('total_amount'),3,'.','')}}
{{__('texte.references_arr.sales.code')}} {{__('texte.references_arr.sales.product')}} {{__('texte.references_arr.sales.quantity')}} {{__('texte.references_arr.sales.in_kg')}} {{__('texte.references_arr.sales.total_amount')}} {{__('texte.references_arr.sales.average_price')}}
{{$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->total_amount/$doc_row->quantity,5,'.','')}}
{{$doc_row->contragent_name}} {{$doc_row->object_name}} {{number_format($doc_rows->where('object_name',$doc_row->object_name)->sum('total_weight'),3,'.','')}} {{number_format($doc_rows->where('object_name',$doc_row->object_name)->sum('total_amount'),2,'.','')}} {{$doc_row->count_orders}}
{{__('texte.references_arr.sales.total')}}: {{count($doc_rows)}} {{number_format($doc_rows->sum('total_weight'),3,'.','')}} {{number_format($doc_rows->sum('total_amount'),2,'.','')}} {{$doc_rows->unique('object_name')->sum('count_orders')}}
@endif
@if(!isset($input['print']) || $input['print']!=1) @endif @endsection