@extends('layouts.app') @section('title') {{'Damage Return Report'}} @endsection @section('content') @php function numberTowords($num) { $ones = array( 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( 1 => "TEN", 2 => "TWENTY", 3 => "THIRTY", 4 => "FORTY", 5 => "FIFTY", 6 => "SIXTY", 7 => "SEVENTY", 8 => "EIGHTY", 9 => "NINETY" ); $hundreds = array( "HUNDRED", "THOUSAND", "MILLION", "BILLION", "TRILLION", "QUARDRILLION" ); $num = number_format($num,2,".",","); $num_arr = explode(".",$num); $wholenum = $num_arr[0]; $decnum = $num_arr[1]; $whole_arr = array_reverse(explode(",",$wholenum)); krsort($whole_arr); $words = ""; foreach($whole_arr as $key => $i) { if($i == 0) { continue; } if($i < 20) { $words .= $ones[intval($i)]; } elseif($i < 100) { if(substr($i,0,1) == 0 && strlen($i) == 3) { $words .= $tens[substr($i,1,1)]; if(substr($i,2,1) != 0) { $words .= " ".$ones[substr($i,2,1)]; } } else { $words .= $tens[substr($i,0,1)]; if(substr($i,1,1) != 0) { $words .= " ".$ones[substr($i,1,1)]; } } } else { // $words .= $ones[substr($i,0,1)]." ".$hundreds[0]; if(substr($i,1,1) != 0 || substr($i,2,1) != 0) { $words .= $ones[substr($i,0,1)]." ".$hundreds[0]; } else { $words .= $ones[substr($i,0,1)]." ".$hundreds[0]; } if(substr($i,1,2) < 20 && substr($i,1,1) != 0) { $words .= " ".$ones[(substr($i,1,2))]; } else { if(substr($i,1,1) != 0) { $words .= " ".$tens[substr($i,1,1)]; } if(substr($i,2,1) != 0) { $words .= " ".$ones[substr($i,2,1)]; } } } if($key > 0) { $words .= " ".$hundreds[$key]." "; } } $words .= " TAKA "; if($decnum > 0) { $words .= " AND "; if($decnum < 20) { $words .= $ones[intval($decnum)]; } elseif($decnum < 100) { $words .= $tens[substr($decnum,0,1)]; if(substr($decnum,1,1) != 0) { $words .= " ".$ones[substr($decnum,1,1)]; } } $words .= $subunit??' PAISA ONLY.'; } else{ $words .= "ONLY."; } return $words; } if(isset($_GET["s_type"])) { $s_type = @$_GET['s_type']; } else{ $s_type = "In"; } @endphp
|
Customer Name : {{ $supplier_list[0]->id }} - {{ $supplier_list[0]->name }}
|
|||||||||||
|
Contact Person : {{ $supplier_list[0]->person_name }}
|
|||||||||||
|
Address : {{ $supplier_list[0]->address }}
|
|||||||||||
|
Mobile No. : {{ $supplier_list[0]->mobile }}
|
Customer Name : {{ isset($_GET['id']) && $_GET['id'] == "All" ? "All" : "Summary" }}
|
@endif
||||||||||
| S.L. | ID | Item Name | Unit | Damage Return Qty | Amount | Comm. Tk. | Total | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Date: {!! date('d-F-Y', strtotime($txn_date)) !!} | |||||||||||
| DRI#{{ $return_id }} {{'- - -'}}Customer Name : {{ $catrow->id }} - {{ $catrow->name }} | |||||||||||
| '. $i++ .' | '; echo ''. $product_id .' | '; echo ''. $product_name .' | '; echo ''. $pack_type .' | '; echo ''. $product_qty .' | '; echo ''. number_format($amount,2) .' | '; echo ''. number_format($commission_tk,2) .' | '; echo ''. number_format($total_value,2) .' | '; echo '||||
| Voucher Total = | {!! number_format($voucher_qty) !!} | {!! number_format($voucher_total,2) !!} | {!! number_format($voucher_commission_tk,2) !!} | {!! number_format($voucher_total_value,2) !!} | |||||||
| Sub Total = | {!! number_format($sub_grand_qty) !!} | {!! number_format($sub_grand_total,2) !!} | {!! number_format($sub_grand_commission_tk,2) !!} | {!! number_format($sub_grand_total_value,2) !!} | |||||||
| DRI#{{ $catrow->return_id }} - - - Date: {!! date('d-F-Y', strtotime($catrow->txn_date)) !!} | |||||||||||
| '. $i++ .' | '; echo ''. $product_id .' | '; echo ''. $product_name .' | '; echo ''. $pack_type .' | '; echo ''. $product_qty .' | '; echo ''. number_format($amount,2) .' | '; echo ''. number_format($commission_tk,2) .' | '; echo ''. number_format($total_value,2) .' | '; echo '||||
| Sub Total = | {!! number_format($sub_torder_quantity) !!} | {!! number_format($sub_total_price,2) !!} | {!! number_format($sub_commission_tk,2) !!} | {!! number_format($sub_total_value,2) !!} | |||||||
| '. $i++ .' | '; echo ''. $info['product_id'] .' | '; echo ''. $info['product_name'] .' | '; echo ''. $info['pack_type'] .' | '; echo ''. $info['product_qty'] .' | '; echo ''. number_format($info['amount'],2) .' | '; echo ''. number_format($info['commission_tk'],2) .' | '; echo ''. number_format($info['total_value'],2) .' | '; echo '||||
| Grand Total = | {!! number_format($grand_torder_quantity) !!} | {{ number_format($grand_total_price,2) }} | {{ number_format($grand_total_commission_tk,2) }} | {{ number_format($grand_total_value,2) }} | |||||||
| IN WORDS : {!! numberTowords($grand_total_value) !!} | |||||||||||