@extends('layouts.home_layout') @php $pageTitle = "Cattle Wise Cost History"; @endphp @section('title', $pageTitle) @section('style') @endsection @section('content') @php // dd($list); @endphp

{{$pageTitle}}

@include('common.print_css') @php $fullColspan = 4; $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 = 2; $lastColspan = ($fullColspan - $firstColspan); $animalIdColspan = 2; $totalColspan = 3; @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 $dewormingCost = json_decode($dewormingCost); $vaccinationCost = json_decode($vaccinationCost); $treatmentCost = json_decode($treatmentCost); $feedingCost = json_decode($feedingCost); $othersCost = json_decode($othersCost); @endphp @foreach ($list as $key => $v) @php $i = 1; $cattleTotalCost = $v->purchase_cost; $dw_arr = array_values(array_filter($dewormingCost, function($dw) use($v) { return $dw->cattle_id == $v->cattle_id; })); @endphp @if ($dw_arr) @foreach ($dw_arr as $d) @php $cattleTotalCost += $d->deworming_cost; @endphp @endforeach @endif @php $vacc_arr = array_values(array_filter($vaccinationCost, function($vacc) use($v) { return $vacc->cattle_id == $v->cattle_id; })); @endphp @if ($vacc_arr) @foreach ($vacc_arr as $d) @php $cattleTotalCost += $d->vaccine_cost; @endphp @endforeach @endif @php $treat_arr = array_values(array_filter($treatmentCost, function($treat) use($v) { return $treat->cattle_id == $v->cattle_id; })); @endphp @if ($treat_arr) @foreach ($treat_arr as $d) @php $cattleTotalCost += $d->treatment_cost; @endphp @endforeach @endif @php $feed_arr = array_values(array_filter($feedingCost, function($feed) use($v) { return $feed->cattle_id == $v->cattle_id; })); @endphp @if ($feed_arr) @foreach ($feed_arr as $d) @php $cattleTotalCost += $d->feeding_cost; @endphp @endforeach @endif @php $other_arr = array_values(array_filter($othersCost, function($other) use($v) { return $other->cattle_id == $v->cattle_id; })); @endphp @if ($other_arr) @foreach ($other_arr as $d) @php $cattleTotalCost += $d->other_cost; @endphp @endforeach @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')}}
Animal ID Cattle Name Purchase Cost
{{$v->id_prefix ? $v->id_prefix.' - ' : ''}}{{$v->cattle_id_no}} {{$v->cattle_name_en}} {{number_format($v->purchase_cost, 2)}}
# Date Cost Description Cost
{{$i++}} {{date('d-M-Y', strtotime($d->deworming_date))}} Deworming : {{$d->medicine_name_en}} {{($d->deworming_cost != 0) ? number_format($d->deworming_cost, 2) : ''}}
{{$i++}} {{date('d-M-Y', strtotime($d->vaccine_date))}} Vaccination : {{$d->medicine_name_en}} {{($d->vaccine_cost != 0) ? number_format($d->vaccine_cost, 2) : ''}}
{{$i++}} {{date('d-M-Y', strtotime($d->treatment_date))}} Treatment : {{$d->medicine_id}} {{($d->treatment_cost != 0) ? number_format($d->treatment_cost, 2) : ''}}
{{$i++}} {{date('d-M-Y', strtotime($d->entry_date))}} Feed : {{$d->feed_name_en}} {{($d->feeding_cost != 0) ? number_format($d->feeding_cost, 2) : ''}}
{{$i++}} {{date('d-M-Y', strtotime($d->entry_date))}} {{$d->cost_description}} {{($d->other_cost != 0) ? number_format($d->other_cost, 2) : ''}}
Total Cost {{number_format($cattleTotalCost, 2)}}
{{-- Modal Start id="modal" --}} {{-- Modal End --}}
@endsection @section('script') @endsection