SIIT Consulting Center
Sirindhorn International Institute of Technology
Thammasat University - Rangsit Campus
99 Moo 18, Km. 41, Khlong Luang,
Pathum Thani 12120, Thailand
QUOTATION
Quotation Date: {{ date('d F Y', strtotime($quotation->quotation_date)) }}
Expiration Date: {{ $quotation->quotation_exp_date ? date('d F Y', strtotime($quotation->quotation_exp_date)) : '-' }}
Quotation No.: {{ $quotation->quotation_no }}
{{ $quotation->quotation_attention }}
{!! nl2br(e($quotation->quotation_attention_detail)) !!}
{{ $quotation->quotation_project_name }}
{!! nl2br(e($quotation->quotation_project_duration)) !!}
Description Amount THB
{{ $quotation->quotation_main_description }}
@php $sub_services = json_decode($quotation->quotation_sub_services, true); @endphp @if(!empty($sub_services)) @foreach($sub_services as $index => $sub) {{ $sub }} @endforeach @endif @if($quotation->quotation_discount_value > 0)
Special Discount {{ $quotation->quotation_discount_type == 'percent' ? $quotation->quotation_discount_value.'%' : '' }}
@endif
{{ number_format((float)$quotation->quotation_amount, 2) }}



@php $amount = (float)$quotation->quotation_amount; $disc_val = (float)$quotation->quotation_discount_value; $discount = ($quotation->quotation_discount_type == 'percent') ? ($amount * $disc_val / 100) : $disc_val; $net_total = $amount - $discount; function numberToWord($num) { $ones = 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" ); $tens = array( 0 => "", 2 => "twenty", 3 => "thirty", 4 => "forty", 5 => "fifty", 6 => "sixty", 7 => "seventy", 8 => "eighty", 9 => "ninety" ); $hundreds = array("", "thousand", "million", "billion"); $num = number_format($num, 2, ".", ","); $num_arr = explode(".", $num); $wholenum = $num_arr[0]; // เลขหลักบาท $decnum = (int)$num_arr[1]; // เลขสตางค์ $whole_arr = array_reverse(explode(",", $wholenum)); krsort($whole_arr); $rettxt = ""; foreach($whole_arr as $key => $i) { $i = (int)$i; if($i == 0) continue; $temp = ""; if($i < 20) { $temp = $ones[$i]; } elseif($i < 100) { $temp = $tens[substr($i,0,1)]; if(substr($i,1,1) != "0") $temp .= "-".$ones[substr($i,1,1)]; } else { $temp = $ones[substr($i,0,1)]." hundred"; $rem = (int)substr($i,1); if($rem > 0 && $rem < 20) { $temp .= " and ".$ones[$rem]; } elseif($rem >= 20) { $temp .= " and ".$tens[substr($i,1,1)]; if(substr($i,2,1) != "0") $temp .= "-".$ones[substr($i,2,1)]; } } $rettxt .= $temp . " " . $hundreds[$key] . " "; } $res = trim($rettxt) . " baht"; // ถ้ามีสตางค์ if($decnum > 0) { $res .= " and " . $decnum . "/100"; } else { $res .= " only"; } return $res; } @endphp @if($discount > 0)
({{ number_format($discount, 2) }})
@endif
(Amount in words)
{{-- ใส่ฟังก์ชันแปลงตัวเลขตรงนี้ --}} {{ \Illuminate\Support\Str::title(numberToWord($net_total)) }}
{{ number_format($net_total, 2) }}
@php // ดึงข้อมูล Flow จาก Controller $flow_pdf_id = $workflow_approve->pluck('workflow_approve_id_flow_pdf')->first(); $flow_wf_id = $workflow_approve->pluck('workflow_approve_id_flow')->first(); // echo $flow_wf_id; // echo 'xxxx'; // echo $manage_flow_pdf_id; $flowHtml = app('App\Http\Controllers\PDF_wfController')->pdf_wf($flow_wf_id, $flow_pdf_id,$id); @endphp {{-- --}}