@extends('layouts.home_layout') @php $pageTitle = "Sales And Stock (Cooperative Wise)"; @endphp @section('title', $pageTitle) @section('style') @endsection @section('content') @php // dd($list); @endphp

{{$pageTitle}}

@include('common.print_css') @php $fullColspan = 10; $partner_id = request()->get('partner_id'); $cooperative_id = request()->get('cooperative_id'); $group_id = request()->get('group_id'); $farmer_id = request()->get('farmer_id'); $animal_type_id = request()->get('animal_type_id'); $cattle_gender_id = request()->get('cattle_gender_id'); $livestock_breed_id = request()->get('cattle_gender_id'); $division_id = request()->get('division_id'); $district_id = request()->get('district_id'); $upazilla_id = request()->get('upazilla_id'); $union_id = request()->get('union_id'); $village_id = request()->get('village_id'); $f_date = request()->get('f_date'); $t_date = request()->get('t_date'); $firstColspan = 5; $lastColspan = ($fullColspan - $firstColspan); $cpNameColspan = 6; $totalColspan = 4; @endphp @if ($reportInfo['partners']) @endif {{-- @if ($reportInfo['cooperative']) @endif --}} @if ($reportInfo['group']) @endif @if ($reportInfo['farmer']) @endif @if ($reportInfo['animal_type']) @endif @if ($reportInfo['livestock_breed']) @endif @if ($reportInfo['cattle_gender']) @endif @if ($reportInfo['division']) @endif @if ($reportInfo['district']) @endif @if ($reportInfo['upazilla']) @endif @if ($reportInfo['union']) @endif @if ($reportInfo['village']) @endif @if ($list) @php $i = 1; $readyToSale = json_decode($readyToSale); $soldCattle = json_decode($soldCattle); $onlineSoldCattle = json_decode($onlineSoldCattle); // $soldCattleWeight = json_decode($soldCattleWeight); $t_readyToSale = 0; $t_soldCattle = 0; $t_onlineSoldCattle = 0; $t_remainingCattleForSale = 0; $t_soldCattleAmount = 0; $t_cattleAvgWeight = 0; @endphp @foreach ($list as $key => $v) @php $rowPrintVal = 0; $r_readyToSale = 0; $trs_arr = array_values(array_filter($readyToSale, function($trs) use ($v) { return $trs->cooperative_id == $v->id; })); if($trs_arr) { $r_readyToSale = $trs_arr[0]->totalCattleReadyToSale; } $rowPrintVal += $r_readyToSale; $r_soldCattle = 0; $r_soldCattleAmount = 0; $sc_arr = array_values(array_filter($soldCattle, function($sc) use ($v) { return $sc->cooperative_id == $v->id; })); if($sc_arr) { $r_soldCattle = $sc_arr[0]->totalSoldCattle; $r_soldCattleAmount = $sc_arr[0]->totalSoldAmount; } // online sold $r_onlineSoldCattle = 0; $osc_arr = array_values(array_filter($onlineSoldCattle, function($sc) use ($v) { return $sc->cooperative_id == $v->id; })); if($osc_arr) { $r_onlineSoldCattle = $osc_arr[0]->totalSoldCattle; } $r_remainingCattleForSale = $r_readyToSale; $r_readyToSale += $r_soldCattle; $r_cattleAvgWeight = $soldCattleWeight->where('cooperative_id', $v->id)->avg('cattleWight'); $t_readyToSale += $r_readyToSale; $t_soldCattle += $r_soldCattle; $t_onlineSoldCattle += $r_onlineSoldCattle; $t_remainingCattleForSale += $r_remainingCattleForSale; $t_soldCattleAmount += $r_soldCattleAmount; $t_cattleAvgWeight += $r_cattleAvgWeight; $rowPrintVal += $r_soldCattle; // $scw_arr = array_values(array_filter($soldCattleWeight, function($scw) use ($v) { // return $scw->cooperative_id == $v->id; // })); @endphp @if ($rowPrintVal <> 0) {{-- --}} @endif @endforeach @endif

{{$pageTitle}}

Partner Name {{$reportInfo['partners']->partner_name_en}} {{$reportInfo['partners']->partner_code ? "[{$reportInfo['partners']->partner_code}]" : ''}}
Cooperative Name {{$reportInfo['cooperative']->cp_name_en}} {{$reportInfo['cooperative']->cp_code ? "[{$reportInfo['cooperative']->cp_code}]" : ''}}
Farmer Group Name {{$reportInfo['group']->group_name_en}} {{$reportInfo['group']->group_code ? "[{$reportInfo['group']->group_code}]" : ''}}
Farmer Name {{$reportInfo['farmer']->farmer_name_en}} {{$reportInfo['farmer']->farmer_code ? "[{$reportInfo['farmer']->farmer_code}]" : ''}}
Animal Type Name {{$reportInfo['animal_type']->type_name}}
Livestock Breed Name {{$reportInfo['livestock_breed']->breed_name_en}}
Cattle Gender {{$reportInfo['cattle_gender']->gender_name}}
Division Name {{$reportInfo['division']->name}}
District Name {{$reportInfo['district']->name}}
Upazila Name {{$reportInfo['upazilla']->name}}
Union Name {{$reportInfo['union']->name}}
Village Name {{$reportInfo['village']->en_name}}
Reporting Period {{$reportingPeriod}}
Reporting Date {{date('d-M-Y')}}
# Name of Cooperative Cooperative Code No. of Cattle Ready to Sale No. of Local Market Sold No. of Online Market Sold No. of Cattle Sold Avg. Weight of Sold Cattle (Kg) No. of Remaining Cattle Ready to Sale Total Sold Amount (BDT)
A B C D = (B+C) E F = (A-D) G
{{$i++}} {{$v->cp_name_en}} {{$v->cp_code}} {{number_format($r_readyToSale, 0)}} {{number_format($r_soldCattle - $r_onlineSoldCattle, 0)}} {{number_format($r_onlineSoldCattle, 0)}} {{number_format($r_soldCattle, 0)}} @php print_r($trs_arr); @endphp {{ number_format($r_cattleAvgWeight, 2) }} {{number_format($r_remainingCattleForSale, 0)}} {{number_format($r_soldCattleAmount, 2)}}
Total {{number_format($t_soldCattle - $t_onlineSoldCattle, 0)}} {{number_format($t_onlineSoldCattle, 0)}} {{number_format($t_soldCattle, 0)}} {{number_format($t_cattleAvgWeight, 2)}} {{number_format($t_remainingCattleForSale, 0)}} {{number_format($t_soldCattleAmount, 2)}}
{{-- Modal Start id="modal" --}} {{-- Modal End --}}
@endsection @section('script') @endsection