@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); } } $copies = isset($_GET['copies'])?$_GET['copies']:'consignor'; // BREAK $copies INTO ARRAY $copies = explode(',', $copies); @endphp {{ $gr->gr_number }} @php $dynamic_fields = json_decode($gr->payment_dynamic_fields); @endphp @foreach($copies as $copy)
GSTIN: {{ $company->gst_number }} All Subject to Allahabad Jurisdiction
{{ $company->company_name }}
FLEET OWNER & TRANSPORT CONTRACTOR
Auth. Transporter: {{ $company->address2 }}
{{ $company->address1 }}
DECLARATION
WE HAVE REGISTERED UNDER
FORWARDING CHARGES OUR
GSTIN: {{ $company->gst_number }}
CONSIGNOR
{{ printTillSpecificLength($consignor_string, 50) }}
Grinding Cement Manufacturing Unit
Khasra No. 441,448,450,451
Village Ledar, Tehsil: Bara, District - {{$gr->consignor ? $gr->consignor['city'] :''}}
U.P. India Pin- {{$gr->consignor ? $gr->consignor['pincode'] :''}}, GSTIN: {{$gr->consignor ? $gr->consignor['gst_number'] :''}}
Freight Details
{{$gr->pay_mode}}
D. I. No. Invoice No. @if(isset($gr->gr_desc)) @foreach($gr->gr_desc as $desc_item) {{ $desc_item->invoice_number??'' }}     @endforeach @endif
Cash Advance RTGS Advance
Party Order No. Date {{ formatDate($gr->gr_date) }}
{{$gr->do_number}} L. R. No. {{ $gr->gr_number }}
SAP Code: 220000137 From: {{ $gr->source?$gr->source['station_name']:$gr->source_name }} To:{{ $gr->destination?$gr->destination['station_name']:$gr->destination_name }}
CONSIGNEE
{{ printTillSpecificLength($consignee_string, 50) }} District - {{$gr->consignee ? $gr->consignee['city'] :''}} Pin- {{$gr->consignee ? $gr->consignee['pincode'] :''}}, GSTIN: {{$gr->consignee ? $gr->consignee['gst_number'] :''}}
Sap Delivery No. M.T. Bags Truck/Trailot No.
{{ isset($gr->gr_desc[0]) ? $gr->gr_desc[0]->chg_unit : ''}} {{ isset($gr->gr_desc[0]) ? $gr->gr_desc[0]->pkg : ''}} {{ $gr->vehicle?$gr->vehicle['vehicle_number']:'' }}
Grade Stamps Value Unit Stamp
{{ $gr->grand_total}}
Diesel
Truck Owner Name
Driver Name
{{$gr->driver_name}}
DL
{{ $gr->driver?$gr->driver['license_number']:'' }}
Acknowledgement Consignee with Signature & Stamp Signature Driver/Truck Owner For {{ $company->company_name }}
@endforeach