@extends('layouts.home_layout') @php $pageTitle = "Cattle Information Details"; @endphp @section('title', $pageTitle) @section('style') {{-- --}} @endsection @section('content')

{{$pageTitle}}

@include('common.print_css') @php $imageRowspan = 8; $fullColspan = 8; $firstColspan = 2; $secondColspan = 3; $thirdColspan = 4; $otherColspan = 6; $totalColspan = 7; @endphp @php $i = 1; $weight_record = json_decode($weightRecord); $total_cost = 0; $t_deworming_cost = 0; @endphp @if ($row->deworming_status == 2) @endif @foreach ($deworming as $v) @endforeach @php $j = 1; $t_vaccine_cost = 0; @endphp @foreach ($vaccination as $v) @endforeach @php $j = 1; $t_treatment_cost = 0; @endphp @foreach ($treatement as $v) @endforeach @php $j = 1; $t_feeding_cost = 0; @endphp @foreach ($feeding as $v) @php $feeding_cost = $v->feeding_cost; $t_feeding_cost += $feeding_cost; $total_cost += $feeding_cost; @endphp @endforeach @php $j = 1; @endphp @foreach ($weightRecord as $v) @endforeach @php $j = 1; $total_cost += $row->purchase_cost ? $row->purchase_cost : 0; @endphp @foreach ($otherCost as $v) @php $total_cost += $v->other_cost; @endphp @endforeach @php $sales_price = $row->sales_price ? $row->sales_price : 0; // $profit = ($total_cost - $sales_price); $profit = ($sales_price - $total_cost); @endphp
Cattle No {{$row->cattle_id_no}} @if ($row->cattle_photo) {{$row->cattle_id_no}} @endif @if ($row->housing_image) {{$row->cattle_id_no}} @endif
Cattle Name (English) {{$row->cattle_name_en}}
Cattle Name (Bangla) {{$row->cattle_name_bn}}
Animal Type {{$row->type_name}}
Cattle Gender {{$row->gender_name}}
Breed Name {{$row->breed_name_en}}
Cattle Color {{$row->cattle_color}}
Date of Birth {{$row->date_of_birth ? date('d-M-Y', strtotime($row->date_of_birth)) : ''}}
Partner Name {{$row->partner_name_en}} Partner Code {{$row->partner_code}}
Cooperative Name {{$row->cp_name_en}} Cooperative Code {{$row->cp_code}}
 

Farmer Information

Farmer Name {{$row->farmer_name_en}} Farmer Code {{$row->farmer_code}}
Farmer Group Name {{$row->group_name_en}} Farmer Group Code {{$row->group_code}}
 

Deworming Information

SL Medicine name Age (months) Weight (kg) Date of deworming Next dose date Deworming cost
{{$i++}} N/A @php $deworming_date = $row->deworming_date ? date('d-M-Y', strtotime($row->deworming_date)) : ''; $next_dose_date = $row->deworming_date ? date('d-M-Y', strtotime($row->deworming_date. ' + 120 days')) : ''; if($row->date_of_birth) { if($row->deworming_date) { $ageCalculateDate = date("d-m-Y", strtotime($row->deworming_date)); } else { $ageCalculateDate = date("d-m-Y"); } $ageText = cattleAge($row->date_of_birth, $ageCalculateDate, $returnData = 'month'); } else { $ageText = 'Birth Day is Empty'; } @endphp {{$ageText}} {{$row->cattle_weight}} {{$deworming_date}} {{$next_dose_date}}
{{$i++}} {{$v->medicine_name_en}} @php if($row->date_of_birth) { $ageCalculateDate = date("d-m-Y", strtotime($v->deworming_date)); $ageText = cattleAge($row->date_of_birth, $ageCalculateDate, $returnData = 'month'); } else { $ageText = 'Birth Day is Empty'; } $deworming_cost = $v->deworming_cost; $t_deworming_cost += $deworming_cost; $total_cost += $deworming_cost; @endphp {{$ageText}} @php $c_weight = 0; $weight_arr = array_values(array_filter($weight_record, function($wr) use($v) { return $wr->entry_date <= $v->deworming_date; })); if($weight_arr) { $lastKey = (sizeof($weight_arr) - 1); $c_weight = $weight_arr[$lastKey]->scale_weight ? $weight_arr[$lastKey]->scale_weight : $weight_arr[$lastKey]->weight; } @endphp {{$c_weight}} {{date('d-M-Y', strtotime($v->deworming_date))}} {{date('d-M-Y', strtotime($v->next_deworming_date))}} {{number_format($deworming_cost, 2)}}
Total Deworming Cost {{number_format($t_deworming_cost, 2)}}
 

Vaccination Information

SL Vaccine name Age (months) Weight (kg) Date of vaccination Next dose date Vaccination cost
{{$j++}} {{$v->medicine_name_en}} @php if($row->date_of_birth) { $ageCalculateDate = date("d-m-Y", strtotime($v->vaccine_date)); $ageText = cattleAge($row->date_of_birth, $ageCalculateDate, $returnData = 'month'); } else { $ageText = 'Birth Day is Empty'; } $vaccine_cost = $v->vaccine_cost; $t_vaccine_cost += $vaccine_cost; $total_cost += $vaccine_cost; @endphp {{$ageText}} @php $c_weight = 0; $weight_arr = array_values(array_filter($weight_record, function($wr) use($v) { return $wr->entry_date <= $v->vaccine_date; })); if($weight_arr) { $lastKey = (sizeof($weight_arr) - 1); $c_weight = $weight_arr[$lastKey]->scale_weight ? $weight_arr[$lastKey]->scale_weight : $weight_arr[$lastKey]->weight; } @endphp {{$c_weight}} {{date('d-M-Y', strtotime($v->vaccine_date))}} {{date('d-M-Y', strtotime($v->next_vaccine_date))}} {{number_format($vaccine_cost, 2)}}
Total Vaccination Cost {{number_format($t_vaccine_cost, 2)}}
 

Treatment Information

SL Disease name Medicine name Date of treatment Withdrawal date Age (months) Weight (kg) Treatment cost
{{$j++}} {{$v->disease_name_en}} {{$v->medicine_id}} {{date('d-M-Y', strtotime($v->treatment_date))}} {{date('d-M-Y', strtotime($v->treatment_date.' + '.$v->withdrawal_days.' days'))}} @php if($row->date_of_birth) { $ageCalculateDate = date("d-m-Y", strtotime($v->treatment_date)); $ageText = cattleAge($row->date_of_birth, $ageCalculateDate, $returnData = 'month'); } else { $ageText = 'Birth Day is Empty'; } $treatment_cost = $v->treatment_cost; $t_treatment_cost += $treatment_cost; $total_cost += $treatment_cost; @endphp {{$ageText}} @php $c_weight = 0; $weight_arr = array_values(array_filter($weight_record, function($wr) use($v) { return $wr->entry_date <= $v->treatment_date; })); if($weight_arr) { $lastKey = (sizeof($weight_arr) - 1); $c_weight = $weight_arr[$lastKey]->scale_weight ? $weight_arr[$lastKey]->scale_weight : $weight_arr[$lastKey]->weight; } @endphp {{$c_weight}} {{number_format($treatment_cost, 2)}}
Total Treatment Cost {{number_format($t_treatment_cost, 2)}}
 

Feeding Information

SL Name of Feed Total Given (Kg) Feeding cost
{{$j++}} {{$v->feed_name_en}} {{number_format($v->given_qty, 3)}} {{number_format($feeding_cost, 2)}}
Total Feeding Cost {{number_format($t_feeding_cost, 2)}}
 

Weight Record Information

SL Date of Record Body Length (X Ins) Chest Round (X Ins) Manual Weight (Kg) Scale Weight (Kg)
{{$j++}} {{date('d-M-Y', strtotime($v->entry_date))}} {{$v->body_length}} {{$v->chest_length}} {{$v->weight}} {{$v->scale_weight ? $v->scale_weight : $v->weight}}
 

Cattle Other Cost

{{$j++}} Purchase Cost {{number_format($row->purchase_cost, 2)}}
{{$j++}} {{$v->cost_description}} {{number_format($v->other_cost, 2)}}
Total Cost {{number_format($total_cost, 2)}}
Sales Price {{number_format($sales_price, 2)}}
Profit {{number_format($profit, 2)}}
{{-- Modal Start id="modal" --}} {{-- Modal End --}}
@endsection @section('script') {{-- --}} @endsection