@php /** * Convert an integer to words (up to millions for simplicity). * Adjust or extend as needed for bigger numbers. */ function numberToWords($num) { // Basic arrays for ones and teens $ones = [ 0 => "Zero", 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" ]; // Tens $tens = [ 2 => "Twenty", 3 => "Thirty", 4 => "Forty", 5 => "Fifty", 6 => "Sixty", 7 => "Seventy", 8 => "Eighty", 9 => "Ninety" ]; // Handle simple cases quickly if ($num < 20) { return $ones[$num]; } elseif ($num < 100) { $t = floor($num / 10); $r = $num % 10; return $tens[$t] . ($r ? " " . $ones[$r] : ""); } elseif ($num < 1000) { $h = floor($num / 100); $r = $num % 100; return $ones[$h] . " Hundred" . ($r ? " " . numberToWords($r) : ""); } elseif ($num < 1000000) { $th = floor($num / 1000); $r = $num % 1000; return numberToWords($th) . " Thousand" . ($r ? " " . numberToWords($r) : ""); } elseif ($num < 1000000000) { $m = floor($num / 1000000); $r = $num % 1000000; return numberToWords($m) . " Million" . ($r ? " " . numberToWords($r) : ""); } else { return "Number too large"; // Extend logic if needed } } @endphp
CLEARING FORWARDING & SHIPPING AGENTS
{{ $_s['address'] }}
Email Address: {{ $_s['email_address'] }}
Our Sales Tax Red # : {{ $_s['our_sales_tax_red'] }}
Bill #: {{$model->id}}
PG #:
Our NTN #: {{ $_s['nth'] }}
Date #: {{ \Carbon\Carbon::parse($model->date)->format('d-M-Y') }}
Ref No: {{$model->consignment->job_number_prefix}}
Tax Invoice for the Clearance of
{{$model->consignment->package_type}}
S.S.: {{$model->consignment->vessel}}
IGM No.: {{$model->consignment->igmno}}
DT.: {{\Carbon\Carbon::parse($model->consignment->igm_date)->format('d-M-Y')}}
Index No: {{$model->consignment->index_no}}
Customer B/E No.: {{$model->consignment->machine_number}}
DT.: {{ \Carbon\Carbon::parse($model->consignment->job_date)->format('d-M-Y')}}
L/C No: {{$model->consignment->lc}}
Import Value: 23423
For OCEANIC LOGISTICS
____________________________
Authorized Signature