@extends('layouts.main') @section('main-container')
Table no. 1.1 - Farmer Profile
@if($baseline->upload_respondent_photo) @endif
Application Number {{ $baseline->application_code ?? 'N/A' }} Respondent Photo
Name of TSF Operational Area/Unit {{ $baseline->unit->name ?? 'N/A' }}
State Name {{ $baseline->state->name ?? 'N/A' }}
Date of Survey {{ \Carbon\Carbon::parse($baseline->date_of_survey)->format('d-m-Y') ?? 'N/A' }}
Year of Baseline Survey {{ $baseline->financialYear->name ?? 'N/A' }}
District Name {{ $baseline->district->name ?? 'N/A' }}
Block Name {{ $baseline->block->name ?? 'N/A' }}
Panchayat Name {{ $baseline->panchayat->name ?? 'N/A' }}
Village Name {{ $baseline->village->name ?? 'N/A' }}
WHS (Project Type) {{ $baseline->projectType->name ?? 'N/A' }}
Name of Respondent {{ $baseline->name_of_respondent ?? 'N/A' }}
Mobile Number {{ $baseline->mobile_number ?? 'N/A' }}
Alternate Mobile Number {{ $baseline->alternet_mobile_number ?? 'N/A' }}
Table 1.2 - Family Members
@if($baseline->households->count())
@foreach ($baseline->households as $member) @endforeach
Name Age Gender Category Education Level
{{ $member->name ?? 'N/A' }} {{ $member->age ?? 'N/A' }} {{ ucfirst($member->gender) ?? 'N/A' }} {{ $member->category ?? 'N/A' }} {{ $member->education_level ?? 'N/A' }}
@else

No family members recorded.

@endif
{{-- Table 1.3: Land Holding Information --}}
Table 1.3 - Land Holding Information
@if($baseline->lands && $baseline->lands->count()) @foreach($baseline->lands as $land) @endforeach
Plot/Khata Type of Land Total Area (Acre) Irrigated Area (Acre) Non-Irrigated Area (Acre) Sources of Irrigation
{{ $land->plot_khata }} {{ $land->land_type }} {{ $land->area }} {{ $land->irrigated_area }} {{ $land->non_irrigated_area }} @if(is_array($land->irrigation_sources)) {{ implode(', ', $land->irrigation_sources) }} @else {{ $land->irrigation_sources }} @endif
Total Land: {{ number_format($baseline->lands->sum('area'), 2) }} Acre
@else

No land information available.

@endif
{{-- Repeat similar blocks for livestocks, waterUserGroups, etc. --}}
Table 1.4 - Water Harvesting Structures Planning
@foreach ($baseline->waterHarvestingStructuresPlanning as $waterHarvesting) @endforeach
Type of Structure Length (m) Width (m) Depth/Height (m) Latitude Longitude Geotagged Pre-Photos
{{ $waterHarvesting->projectType->name ?? '-' }} {{ $waterHarvesting->length ?? 'N/A' }} {{ $waterHarvesting->width ?? 'N/A' }} {{ $waterHarvesting->depth_or_height ?? 'N/A' }} {{ isset($waterHarvesting->latitude) ? number_format($waterHarvesting->latitude, 6) : 'N/A' }} {{ $waterHarvesting->longitude ?? 'N/A' }} @if ($waterHarvesting->geotagged_file) View Photo @else N/A @endif
Uploaded Documents
@if(optional($baseline->documentUpload)->beneficiary_agreement) View PDF @else

Not Uploaded

@endif
@if(optional($baseline->documentUpload)->khata_document) View PDF @else

Not Uploaded

@endif
@if(optional($baseline->documentUpload)->other_document) View PDF @else

Not Uploaded

@endif
Table 1.5: WHS Technical Feasibility
Catchment Area (ha) Land Slope Geological Location Hydrological Location Distance from Drainage (m) LULC
{{ $baseline->TechnicalFeasibility->catchment_area ?? 'N/A' }} {{ $baseline->TechnicalFeasibility->land_slope ?? 'N/A' }} {{ $baseline->TechnicalFeasibility->geological_location ?? 'N/A' }} {{ $baseline->TechnicalFeasibility->hydrological_location ?? 'N/A' }} {{ $baseline->TechnicalFeasibility->distance_from_drainage_line ?? 'N/A' }} {{ isset($baseline->TechnicalFeasibility->lulc) ? Str::ucfirst($baseline->TechnicalFeasibility->lulc) : 'N/A' }}
Total Score: {{ $baseline->TechnicalFeasibility->technical_feasibility_score ?? '0.00' }}
Table 1.6: Water User Group
@php $totalLand = 0; @endphp @foreach ($baseline->waterUserGroups as $index => $group) @php $landArea = $group->land_comment ?? 0; $totalLand += $landArea; @endphp @endforeach
S.No. Name of Beneficiary Category Plot/Khata No. Land Area (Acre) Type of Farmer Potential Irrigation (Acre)
{{ $index + 1 }} {{ \Illuminate\Support\Str::title($group->name_of_beneficiary ?? 'N/A') }} {{ $group->category ?? 'N/A' }} {{ $group->plot_khata_no ?? 'N/A' }} {{ number_format($landArea, 2) }} @if($landArea > 0 && $landArea <= 2.5) Marginal Farmer @elseif($landArea > 2.5 && $landArea <= 5) Small Farmer @elseif($landArea > 5 && $landArea <= 10) Medium Farmer @elseif($landArea > 10) Big Farmer @else N/A @endif {{ number_format($group->potential_irrigation ?? 0, 2) }}
Total Land (Acre) {{ number_format($totalLand, 2) }}
Table 1.7: Crop Details
@php $totalIncome = 0; // Group crops by beneficiary $groupedCrops = $baseline->croppings->groupBy(function($item) { return $item->WaterUserGroup->name_of_beneficiary ?? 'N/A'; }); $serial = 1; @endphp @foreach($groupedCrops as $beneficiary => $crops) @php $rowspan = $crops->count(); $first = true; @endphp @foreach($crops as $crop) @php $totalIncome += $crop->profit ?? 0; @endphp @if($first) @php $first = false; @endphp @endif @endforeach @endforeach
S.No. Farmer's name Season Category Crop Area (Acre) Production (Qtl) Productivity Market Rate (₹/Qtl) Total Income (₹) Cost (₹) Net Income (₹)
{{ $serial++ }} {{ $beneficiary }}{{ $crop->season->name ?? 'N/A' }} {{ $crop->category->name ?? 'N/A' }} {{ $crop->crop->name ?? 'N/A' }} {{ $crop->cultivation ?? 'N/A' }} {{ $crop->production ?? 'N/A' }} {{ $crop->productivity ?? 'N/A' }} {{ $crop->market_rate ?? 'N/A' }} {{ number_format($crop->total_income ?? 0, 2) }} {{ number_format($crop->cost ?? 0, 2) }} {{ number_format($crop->profit ?? 0, 2) }}
Total Net Income (₹) {{ number_format($totalIncome, 2) }}
Table 1.8: Livestock Details
@php $totalNetIncome = 0; $serial = 1; // Group livestocks by beneficiary $groupedLivestocks = $baseline->livestocks->groupBy(function($item) { return $item->WaterUserGroup->name_of_beneficiary ?? 'N/A'; }); @endphp @foreach($groupedLivestocks as $beneficiary => $livestocks) @php $rowCount = $livestocks->count(); @endphp @foreach($livestocks as $index => $livestock) @php $netIncome = ($livestock->total_income ?? 0) - ($livestock->cost_rearing ?? 0); $totalNetIncome += $netIncome; @endphp @if($index === 0) @endif @endforeach @endforeach
S.No. Farmer's Name Name of Livestock Number Purpose of Rearing Total Income (₹) Cost of Rearing (₹) Net Income (₹)
{{ $serial++ }} {{ $beneficiary }}{{ $livestock->name ?? 'N/A' }} {{ $livestock->number ?? 'N/A' }} {{ $livestock->purpose_rearing ?? 'N/A' }} {{ number_format($livestock->total_income ?? 0, 2) }} {{ number_format($livestock->cost_rearing ?? 0, 2) }} {{ number_format($netIncome, 2) }}
Total Net Income (₹) {{ number_format($totalNetIncome, 2) }}
Table 1.9: Other Allied Sector Report
@php $serial = 1; $grouped = $baseline->alliedsectors->groupBy(function($item) { return optional($item->WaterUserGroup)->name_of_beneficiary; }); @endphp @foreach($grouped as $beneficiary => $sectors) @foreach($sectors as $rowIndex => $sector) @if($rowIndex === 0) @endif @endforeach @endforeach
S.No. Farmer's Name Allied Sector Annual Production Unit of Measurement Market Rate (₹) Total Income (₹) Annual Expenditure (₹) Net Income (₹)
{{ $serial++ }} {{ $beneficiary ?? 'N/A' }}{{ $sector->sector_name ?? 'N/A' }} {{ $sector->annual_production ?? 'N/A' }} {{ $sector->unit_of_measurement ?? 'N/A' }} {{ number_format($sector->market_rate ?? 0, 2) }} {{ number_format($sector->total_income ?? 0, 2) }} {{ number_format($sector->annual_expenditure ?? 0, 2) }} {{ number_format($sector->net_income ?? 0, 2) }}
Total Net Income (₹) {{ number_format($baseline->alliedsectors->sum('net_income'), 2) }}
Table 1.9 - Micro Enterprises / Small Business
@if($baseline->microEnterprises->count())
@php $serial = 1; $grouped = $baseline->microEnterprises->groupBy(function($item) { return optional($item->waterUserGroup)->name_of_beneficiary; }); @endphp @foreach($grouped as $beneficiary => $enterprises) @foreach($enterprises as $index => $enterprise) @if($index === 0) @endif @endforeach @endforeach
S.No. Farmer's Name Business Name Entrepreneur Name Persons Employed Total Income Annual Expenditure Net Income Registration Status
{{ $serial++ }} {{ $beneficiary ?? 'N/A' }}{{ $enterprise->business_name ?? 'N/A' }} {{ $enterprise->entrepreneur_name ?? 'N/A' }} {{ $enterprise->persons_employed ?? 'N/A' }} {{ number_format($enterprise->total_income ?? 0, 2) }} {{ number_format($enterprise->annual_expenditure ?? 0, 2) }} {{ number_format($enterprise->net_income ?? 0, 2) }} {{ $enterprise->registration_status ?? 'N/A' }}
Total Net Income (₹) {{ number_format(optional($baseline->microEnterprises)->sum('net_income') ?? 0, 2) }}
@else
No data available. This household is not engaged in any Micro Enterprises or Small Business.
@endif
Table 1.10: Daily Wage Labor
@if($baseline->dailyWageLabors->count())
@php $serial = 1; $totalNetIncome = 0; // Group labor records by beneficiary name $grouped = $baseline->dailyWageLabors->groupBy(function($item) { return optional($item->waterUserGroup)->name_of_beneficiary; }); @endphp @foreach($grouped as $beneficiary => $labors) @foreach($labors as $index => $labor) @php $totalNetIncome += $labor->net_income ?? 0; @endphp @if($index === 0) @endif @endforeach @endforeach
S.No. Farmer's Name No. of Family Members Working Days Seasonal / Year-round Distance from Home (km) Wage Rate (₹) Net Income (₹)
{{ $serial++ }} {{ $beneficiary ?? 'N/A' }}{{ $labor->no_of_family_members ?? 'N/A' }} {{ $labor->working_days ?? 'N/A' }} {{ $labor->seasonal_or_year_round ?? 'N/A' }} {{ $labor->distance_from_home_km ?? 'N/A' }} {{ number_format($labor->wage_rate ?? 0, 2) }} {{ number_format($labor->net_income ?? 0, 2) }}
Total Net Income (₹) {{ number_format($totalNetIncome, 2) }}
@else
No data available: This household has no Daily Wage Labor records.
@endif
Table 1.11 - Source of Family Income
@if($baseline->sourceOfFamilyIncome->count())
@php // Group income sources by beneficiary name $groupedSources = $baseline->sourceOfFamilyIncome->groupBy(function($item) { return $item->waterUserGroup->name_of_beneficiary ?? 'N/A'; }); $serial = 1; // Calculate total annual income $totalAnnualIncome = $baseline->sourceOfFamilyIncome->sum('annual_income'); @endphp @foreach($groupedSources as $beneficiary => $sources) @php $rowspan = $sources->count(); $first = true; @endphp @foreach($sources as $source) @if($first) @php $first = false; @endphp @endif @endforeach @endforeach
S.No. Farmer's Name Occupation Source Type No of Days Engagement Member Involved Annual Income (₹)
{{ $serial++ }} {{ $beneficiary }}{{ $source->occupation ?? 'N/A' }} {{ $source->source_type ?? 'N/A' }} {{ $source->no_of_days_engagement ?? 'N/A' }} {{ $source->member_involved ?? 'N/A' }} {{ number_format($source->annual_income ?? 0, 2) }}
Total Income (₹) {{ number_format($totalAnnualIncome, 2) }}
@else
No data available. This household has no sources of family income.
@endif
@endsection