@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); } } if(isset($_GET['copies'])) $copies = $_GET['copies']; else $copies = 'Consignor'; // BREAK $copies INTO ARRAY $copies = explode(',', $copies); @endphp LR Print @php $dynamic_fields = json_decode($gr->payment_dynamic_fields); $gr_copy = json_decode(json_encode($gr), true); @endphp @foreach($copies as $copy)

{{ $company->company_name }}

{{ $company->address2 }}.

Mob.: {{ $company->mob1 }}

GSTIN:   {{ $company->gst_number }}

PAN:              {{ $company->pan_number }}

GR No.:{{$gr->gr_number}}

Delivery From : {{$gr->source_name}}

Date: {{ formatDate($gr->gr_date) }}

Hired From :

{{ isset($gr_copy['lorry_hire_from']) ? $gr_copy['lorry_hire_from']['account_name'] : ''}}

{{ isset($gr_copy['lorry_hire_from']['party']['address1']) ? $gr_copy['lorry_hire_from']['party']['address1'] : '' }}

GSTIN : {{ $gr_copy['lorry_hire_from']['party']['gst_number'] ?? '' }}

Mob No : {{ $gr_copy['lorry_hire_from']['party']['mob_number'] ?? '' }}

To : {{$gr->destination_name}}

{{-- @foreach($gr->gr_desc as $desc_item) @endforeach
Product No. of Bags Weight (MT) Approx Value (Rs.)
{{ $desc_item->material?$desc_item->material['material_name']:'' }} {{ $desc_item->pkg }} {{ $desc_item->material_weight }} {{$gr->total_invoice_value}}
--}}
Truck No. Driver Name Contact No. Driver Sign.
{{$gr->vehicle?$gr->vehicle['vehicle_number']:''}} {{$gr->driver?$gr->driver['emp_name']:$gr->driver_name}} {{$gr->driver?$gr->driver['contact_number']:$gr->driver_mob_number}}  
Hire Total Extra Point Material Cost Loading Labour Loading Detention Unloading Labour Unloading Detention Dala Bilty Chg {{$gr->other_minus_label}} Tds Advance Payment Balance
{{$gr->lh_net_freight}} {{$gr->lh_extra_point}} {{$gr->material_cost}} {{$gr->loading_labour}} {{$gr->loading_detention}} {{$gr->unloading_labour}} {{$gr->unloading_detention}} {{$gr->dala}} {{$gr->bilty_chg}} {{$gr->other_minus}} {{$gr->lh_tds}} {{$gr->lh_advance }} {{ $gr->lh_payment + $gr->lh_payment2 }} {{ $gr->lh_balance }}
Bank Name : {{ $gr_copy['lorry_hire_from']['party']['bank_name'] ?? '' }}
Bank Branch : {{ $gr_copy['lorry_hire_from']['party']['bank_branch'] ?? '' }}
Account No : {{ $gr_copy['lorry_hire_from']['party']['account_number'] ?? '' }}
Ifsc Code : {{ $gr_copy['lorry_hire_from']['party']['ifsc'] ?? '' }}




Sign. & Stamp of Receiver
@if( $company->company_code=='BABA_BMR' ) @endif



Sign. of H&T Agent  
@endforeach