@php function formatDate($date) { // Check if the date is valid if (!strtotime($date)) { return ''; } return date('d-m-Y', strtotime($date)); } function printTillSpecificLength($string, $maxLength) { // Check if the length of the string is less than or equal to the maxLength if (strlen($string) <= $maxLength) { echo $string; } else { // If the length exceeds maxLength, print only up to maxLength characters echo substr($string, 0, $maxLength); } } function numberToWords($number) { $no = floor($number); $point = round($number - $no, 2) * 100; $hundred = null; $digits_1 = strlen($no); $i = 0; $str = array(); $words = array( '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' ); $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore'); while ($i < $digits_1) { $divider = ($i == 2) ? 10 : 100; $number = floor($no % $divider); $no = floor($no / $divider); $i += ($divider == 10) ? 1 : 2; if ($number) { $plural = (($counter = count($str)) && $number > 9) ? 's' : null; $hundred = ($counter == 1 && $str[0]) ? ' and ' : null; $str [] = ($number < 21) ? $words[$number] . " " . $digits[$counter] . $plural . " " . $hundred : $words[floor($number / 10) * 10] . " " . $words[$number % 10] . " " . $digits[$counter] . $plural . " " . $hundred; } else $str[] = null; } $str = array_reverse($str); $result = implode('', $str); $points = ($point) ? "." . $words[$point / 10] . " " . $words[$point = $point % 10] : ''; echo $result . "Rupees "; // echo $result . "Rupees " . $points . " Paise"; } $copies = isset($_GET['copies'])?$_GET['copies']:'consignor'; // BREAK $copies INTO ARRAY $copies = explode(',', $copies); @endphp {{ $lorry_hire->lh_number }} (LHS)

{{ $company->jurisdiction }}

LORRY HIRE CHALLAN

{{$company->company_name}}

{{$company->address1}}

Mobile : {{$company->mob1}},{{$company->mob2}}

Email: {{$company->email}}

PAN NO : {{$company->pan_number}},   GSTIN NO : {{$company->gst_number}}

Date : {{formatDate($lorry_hire->lh_date)}}

FREIGHT MEMO NO : {{$lorry_hire->lh_number}}

TRIP DURATION
LOADING DATE UNLOAD DATE
{{formatDate($lorry_hire->load_date)}} {{formatDate($lorry_hire->unload_date)}}
SOURCE DESTINATION
{{$lorry_hire->source->station_name}} {{$lorry_hire->destination->station_name}}
@foreach($lorry_hire->lorry_hire_desc as $desc_item) @endforeach

VEHICLE DETAILS

VEHICLE NO. VEHICLE TYPE CN/LS NO. Date WEIGHT
{{ $desc_item['vehicle'] }} {{ $desc_item['vehicle_type'] }} {{ $desc_item['against_number'] }} {{ formatDate($desc_item['date']) }} {{ $desc_item['loaded_wt'] }} MT
@php // Recalculate $top_total $total_amt = 0; $top_total = $lorry_hire->balance; @endphp

TO BE FILLED AT FINAL PAYMENT DESTINATION

DEBIT VOUCHER

AMOUNT PAID TO THIS LORRY HIRE CHALLAN AS NOTED

DETAILS : Truck No. : {{$lorry_hire->vehicle_number}}

@foreach($lorry_hire->voucher_desc as $voucher_des) @endforeach
Voucher Date Amount
{{ $voucher_des['voucher_number'] }} {{ formatDate($voucher_des['voucher']['voucher_date']) }} {{ $voucher_des['receipt_amt'] }}
Total {{ $total_amt }}
@if($lorry_hire->diesel_party1 && $lorry_hire->diesel_amt1) @endif @if($lorry_hire->diesel_party2 && $lorry_hire->diesel_amt2) @endif @if($lorry_hire->diesel_party3 && $lorry_hire->diesel_amt3) @endif
Diesel Date Amount
{{ $lorry_hire->diesel_party1['account_name'] }} {{ formatDate($lorry_hire->diesel_date1) }} {{ $lorry_hire->diesel_amt1 }}
{{ $lorry_hire->diesel_party2['account_name'] }} {{ formatDate($lorry_hire->diesel_date2) }} {{ $lorry_hire->diesel_amt2 }}
{{ $lorry_hire->diesel_party3['account_name'] }} {{ formatDate($lorry_hire->diesel_date3) }} {{ $lorry_hire->diesel_amt3 }}
Total {{ $total_fuel_amt }}

 

 

 

 

 

 

 

PASSED BY CASHIER Revenue
Stamp
         
PKT :- {{$lorry_hire->total_pkg}}
FREIGHT :- {{$lorry_hire->freight}}
RATE :- {{$lorry_hire->rate}}
MUNSHIANA :- {{$lorry_hire->munshiana}}
LOADING (-) :- {{$lorry_hire->loading_labour}}
COMMISSION (-) :- {{$lorry_hire->collection_chg}}
DETENTION ( Loading Point ) :- {{$lorry_hire->loading_detention}}
DETENTION ( Unloading Point ) :- {{$lorry_hire->unloading_detention}}
Balance :- {{ number_format($top_total - $total_amt, 2) }}

AMOUNT IN WORDS RS.