@extends('frontend.vendor_dashboard.dashboard.layouts.app') @section('content')
Back
Dispatch no.: {{ $VerRelation->chalani_no ?? '' }}
Date: {{ \Carbon\Carbon::parse($VerRelation->date ?? now())->format('d F, Y') }}

{{ $VerRelation->subject ?? 'Annual Income Verification' }}

This is to verify that applicant @if ($VerRelation->gender == 'Male') Mr. @elseif ($VerRelation->gender == 'Female' && $VerRelation->marital_status == 'Married') Mrs. @else Ms. @endif {{ $VerRelation->applicant_name ?? '' }} holder of Nepali Citizenship Certificate No. {{ $VerRelation->applicant_citizen ?? '' }} @if ($VerRelation->applicant_id_no != null) and National ID No. {{ $VerRelation->applicant_id_no }} @endif @if ($VerRelation->applicant_passport != null) and Passport No. {{ $VerRelation->applicant_passport }} @endif @if ($VerRelation->gender == 'Male') grandson @else granddaughter @endif of Mr. {{ $VerRelation->applicant_grandfather ?? '' }}, @if ($VerRelation->gender == 'Male') son @else daughter @endif of Mr. {{ $VerRelation->applicant_father ?? '' }} and Mrs. {{ $VerRelation->applicant_mother ?? '' }}, permanent resident of ward No. {{ $VerRelation->ward->name ?? ($VerRelation->previous_ward_no ?? '') }} @if ($VerRelation->previous_ward_no !== null) (Previous ward No. {{ $VerRelation->previous_ward_no ?? '' }}), @else @endif {{ $VerRelation->municipality->name ?? '' }}, {{ $VerRelation->district ?? '' }}, {{ $VerRelation->provinance ?? '' }}, Nepal. has annual income from various source as below:

@php // Get currency symbol based on currency code $currencySymbols = [ 'ALL' => 'Lek', 'DZD' => 'دج', 'AOA' => 'Kz', 'ARS' => "$", 'AMD' => '֏', 'AWG' => 'ƒ', 'AUD' => "$", 'AZN' => 'm', 'BSD' => "B$", 'BHD' => '.د.ب', 'BDT' => '৳', 'BBD' => "Bds$", 'BYR' => 'Br', 'BEF' => 'fr', 'BZD' => "$", 'BMD' => "$", 'BTN' => 'Nu.', 'BTC' => '฿', 'BOB' => 'Bs.', 'BAM' => 'KM', 'BWP' => 'P', 'BRL' => "R$", 'GBP' => '£', 'BND' => "B$", 'BGN' => 'Лв.', 'BIF' => 'FBu', 'KHR' => 'KHR', 'CAD' => "$", 'CVE' => "$", 'KYD' => "$", 'XOF' => 'CFA', 'XAF' => 'FCFA', 'XPF' => '₣', 'CLP' => "$", 'CLF' => 'CLF', 'CNY' => '¥', 'COP' => "$", 'KMF' => 'CF', 'CDF' => 'FC', 'CRC' => '₡', 'HRK' => 'kn', 'CUC' => "$, CUC", 'CZK' => 'Kč', 'DKK' => 'Kr.', 'DJF' => 'Fdj', 'DOP' => "$", 'XCD' => "$", 'EGP' => 'ج.م', 'ERN' => 'Nfk', 'EEK' => 'kr', 'ETB' => 'Nkf', 'EUR' => '€', 'FKP' => '£', 'FJD' => "FJ$", 'GMD' => 'D', 'GEL' => 'ლ', 'DEM' => 'DM', 'GHS' => 'GH₵', 'GIP' => '£', 'GRD' => '₯, Δρχ, Δρ', 'GTQ' => 'Q', 'GNF' => 'FG', 'GYD' => "$", 'HTG' => 'G', 'HNL' => 'L', 'HKD' => "$", 'HUF' => 'Ft', 'ISK' => 'kr', 'INR' => '₹', 'IDR' => 'Rp', 'IRR' => '﷼', 'IQD' => 'د.ع', 'ILS' => '₪', 'ITL' => 'L,£', 'JMD' => "J$", 'JPY' => '¥', 'JOD' => 'ا.د', 'KZT' => 'лв', 'KES' => 'KSh', 'KWD' => 'ك.د', 'KGS' => 'лв', 'LAK' => '₭', 'LVL' => 'Ls', 'LBP' => '£', 'LSL' => 'L', 'LRD' => "$", 'LYD' => 'د.ل', 'LTC' => 'Ł', 'LTL' => 'Lt', 'MOP' => "$", 'MKD' => 'ден', 'MGA' => 'Ar', 'MWK' => 'MK', 'MYR' => 'RM', 'MVR' => 'Rf', 'MRO' => 'MRU', 'MUR' => '₨', 'MXN' => "$", 'MDL' => 'L', 'MNT' => '₮', 'MAD' => 'MAD', 'MZM' => 'MT', 'MMK' => 'K', 'NAD' => "$", 'NPR' => '₨', 'ANG' => 'ƒ', 'TWD' => "$", 'NZD' => "$", 'NIO' => "C$", 'NGN' => '₦', 'KPW' => '₩', 'NOK' => 'kr', 'OMR' => '.ع.ر', 'PKR' => '₨', 'PAB' => 'B/.', 'PGK' => 'K', 'PYG' => '₲', 'PEN' => 'S/.', 'PHP' => '₱', 'PLN' => 'zł', 'QAR' => 'ق.ر', 'RON' => 'lei', 'RUB' => '₽', 'RWF' => 'FRw', 'SVC' => '₡', 'WST' => 'SAT', 'STD' => 'Db', 'SAR' => '﷼', 'RSD' => 'din', 'SCR' => 'SRe', 'SLL' => 'Le', 'SGD' => "$", 'SKK' => 'Sk', 'SBD' => "Si$", 'SOS' => 'Sh.so.', 'ZAR' => 'R', 'KRW' => '₩', 'SSP' => '£', 'XDR' => 'SDR', 'LKR' => 'Rs', 'SHP' => '£', 'SDG' => '.س.ج', 'SRD' => "$", 'SZL' => 'E', 'SEK' => 'kr', 'CHF' => 'CHf', 'SYP' => 'LS', 'TJS' => 'SM', 'TZS' => 'TSh', 'THB' => '฿', 'TOP' => "$", 'TTD' => "$", 'TND' => 'ت.د', 'TRY' => '₺', 'TMT' => 'T', 'UGX' => 'USh', 'UAH' => '₴', 'AED' => 'إ.د', 'UYU' => "$", 'USD' => "$", 'UZS' => 'лв', 'VUV' => 'VT', 'VEF' => 'Bs', 'VND' => '₫', 'YER' => '﷼', 'ZMK' => 'ZK', ]; $currencyCode = $VerRelation->currency_code ?? 'NPR'; $currencySymbol = $currencySymbols[$currencyCode] ?? $currencyCode; // Decode relations data $relations = is_string($VerRelation->relations) ? json_decode($VerRelation->relations, true) : $VerRelation->relations; // Calculate total income from all sources $totalIncome = 0; // Check if applicant has income field $applicantIncome = $VerRelation->applicant_income ?? 0; // Add applicant's income to total $totalIncome += $applicantIncome; // Create array to store all income sources for display // Process family relations // Process family relations if (isset($relations) && is_array($relations) && count($relations) > 0) { foreach ($relations as $relation) { if ( isset($relation['income_price']) && is_numeric($relation['income_price']) ) { $incomeAmount = floatval($relation['income_price']); $totalIncome += $incomeAmount; $allIncomeSources[] = [ 'earned_by' => $relation['relation_name'] ?? '', 'relation_with_applicant' => $relation['relation'] ?? '', 'gender' => $relation['gender'] ?? 'Male', // Add this 'married_status' => $relation['married_status'] ?? null, // Add this 'source_of_income' => ($relation['income_source'] ?? '') . ($relation['income_place'] ? ' (' . $relation['income_place'] . ')' : ''), 'annual_income' => $incomeAmount, 'remarks' => $relation['income_remark'] ?? '', ]; } } } // Calculate total in foreign currency if applicable $totalInForeignCurrency = 0; $exchangeRate = 0; if ( isset($VerRelation->currency_code) && $VerRelation->currency_code != 'NPR' && isset($VerRelation->currency_rupee) && $VerRelation->currency_rupee > 0 ) { $exchangeRate = $VerRelation->currency_rupee; $totalInForeignCurrency = $totalIncome / $exchangeRate; } // Function to convert number to words in Millions (International System) function convertNumberToWords($number) { if ($number == 0) { return 'Zero'; } $words = [ 0 => '', 1 => 'One', 2 => 'Two', 3 => 'Three', 4 => 'Four', 5 => 'Five', 6 => 'Six', 7 => 'Seven', 8 => 'Eight', 9 => 'Nine', 10 => 'Ten', 11 => 'Eleven', 12 => 'Twelve', 13 => 'Thirteen', 14 => 'Fourteen', 15 => 'Fifteen', 16 => 'Sixteen', 17 => 'Seventeen', 18 => 'Eighteen', 19 => 'Nineteen', 20 => 'Twenty', 30 => 'Thirty', 40 => 'Forty', 50 => 'Fifty', 60 => 'Sixty', 70 => 'Seventy', 80 => 'Eighty', 90 => 'Ninety', ]; $number = round($number, 2); $dollars = floor($number); $cents = round(($number - $dollars) * 100); $dollarsInWords = ''; // Billions if ($dollars >= 1000000000) { $billions = floor($dollars / 1000000000); $dollarsInWords .= convertNumberToWords($billions) . ' Billion '; $dollars %= 1000000000; } // Millions if ($dollars >= 1000000) { $millions = floor($dollars / 1000000); $dollarsInWords .= convertNumberToWords($millions) . ' Million '; $dollars %= 1000000; } // Thousands if ($dollars >= 1000) { $thousands = floor($dollars / 1000); $dollarsInWords .= convertNumberToWords($thousands) . ' Thousand '; $dollars %= 1000; } // Hundreds if ($dollars >= 100) { $hundreds = floor($dollars / 100); $dollarsInWords .= $words[$hundreds] . ' Hundred '; $dollars %= 100; } // Tens and Units if ($dollars > 0) { if ($dollars <= 20) { $dollarsInWords .= $words[$dollars] . ' '; } else { $tens = floor($dollars / 10) * 10; $units = $dollars % 10; $dollarsInWords .= $words[$tens] . ($units ? ' ' . $words[$units] : '') . ' '; } } $result = trim($dollarsInWords); $result = $result ? $result : 'Zero'; if ($cents > 0) { if ($cents <= 20) { $result .= ' and ' . $words[$cents] . ' Paise'; } else { $tens = floor($cents / 10) * 10; $units = $cents % 10; $result .= ' and ' . $words[$tens] . ($units ? ' ' . $words[$units] : '') . ' Paise'; } } return $result; } $totalIncomeInWords = convertNumberToWords($totalIncome); $totalForeignInWords = $totalInForeignCurrency > 0 ? convertNumberToWords($totalInForeignCurrency) : ''; @endphp
@foreach ($allIncomeSources as $index => $source) @endforeach
S.N Earned By Relation Source of Income Income (NRs.) Remarks
{{ $index + 1 }} {{ getTitle($source['gender'] ?? 'Male', $source['married_status'] ?? null) }} {{ $source['earned_by'] ?? '' }} {{ $source['relation_with_applicant'] }} {{ $source['source_of_income'] }} {{ $source['annual_income'] > 0 ? number_format($source['annual_income'], 2) : '-' }} {{ $source['remarks'] }}
TOTAL {{ number_format($totalIncome, 2) }}
TOTAL in {{ $VerRelation->currency_code }} {{ $currencySymbol }} {{ number_format($totalInForeignCurrency, 2) }}

Total Annual Income in Words: {{ $totalIncomeInWords }} Rupees Only

@if ($VerRelation->currency_code && $VerRelation->currency_rupee == null) @else @if (isset($VerRelation->currency_code) && $VerRelation->currency_code != 'NPR')

Equivalent Total Annual Income in {{ $currencyCode }} ({{ $currencySymbol }}): {{ $currencySymbol }} {{ number_format($totalInForeignCurrency, 2) }}

Exchange Rate (Selling Rate) as per Nepal Rastra Bank on {{ \Carbon\Carbon::parse($VerRelation->date ?? now())->format('d F, Y') }}:
1 {{ $currencyCode }} = Rs. {{ number_format($exchangeRate, 2) }}

@endif @endif

This letter is hereby issued in accordance with the Section 12 of the Local Government Operation Act, 2074 BS (2017 AD).

{{ $Wardchairman->name ?? '' }}
{{ $Wardchairman->position ?? 'Ward Chairman' }}
{{ $Wardchairman->municipality->name ?? 'Bhaktapur Municipality' }}, Ward {{ $Wardchairman->ward->name ?? '2' }}
@endsection