@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);
}
}
function numberToWords($number) {
$no = floor($number);
$point = round($number - $no, 2) * 100;
$hundred = null;
$digits_1 = strlen($no);
$i = 0;
$str = array();
$words = 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', '20' => 'Twenty', '30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty', '60' => 'Sixty', '70' => 'Seventy',
'80' => 'Eighty', '90' => 'Ninety'
);
$digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');
while ($i < $digits_1) {
$divider = ($i == 2) ? 10 : 100;
$number = floor($no % $divider);
$no = floor($no / $divider);
$i += ($divider == 10) ? 1 : 2;
if ($number) {
$plural = (($counter = count($str)) && $number > 9) ? 's' : null;
$hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
$str [] = ($number < 21) ? $words[$number] .
" " . $digits[$counter] . $plural . " " . $hundred
:
$words[floor($number / 10) * 10]
. " " . $words[$number % 10] . " "
. $digits[$counter] . $plural . " " . $hundred;
} else $str[] = null;
}
$str = array_reverse($str);
$result = implode('', $str);
$points = ($point) ?
"." . $words[$point / 10] . " " .
$words[$point = $point % 10] : '';
echo $result . "Rupees ";
// echo $result . "Rupees " . $points . " Paise";
}
//$copies = isset($_GET['copies'])?$_GET['copies']:'consignor';
// BREAK $copies INTO ARRAY
//$copies = explode(',', $copies);
@endphp
{{ $voucher->voucher_number }}
|
The SUM of Rupees : {{ $voucher->total_dr_amount }} |
|
By Cash/Cheque No : {{ $voucher->cheque_number }} |
Dated : {{ formatDate($voucher->cheque_date) }} |
on account of : |
|
Rs. {{ $voucher->total_dr_amount }}/- |
|
|
|
Voucher Type - {{ $voucher->voucher_name }}
{{ $company->company_name }}
|
|
Voucher No. : |
{{ $voucher->voucher_number }} |
Dated : |
{{ formatDate($voucher->voucher_date) }} |
|
P A R T I C U L A R S
|
|
DEBIT |
@foreach($voucher->voucher_acc_details as $detail)
@if($detail->nature == 'dr')
@php
$dr_amount = explode('.', number_format($detail->dr_amount, 2, '.', ''));
$dr_rupees = $dr_amount[0];
$dr_paise = $dr_amount[1];
@endphp
{{ $detail->account['account_name'] }}
|
{{ $dr_rupees }}
|
{{ $dr_paise }}
|
{{ $detail->account['party']?'Account No : '.$detail->account['party']['account_number']:'' }} |
@endif
@endforeach
[{{ $voucher->narration }} {{ $voucher->cheque_number }} ] |
|
|
|
|
|
|
@php
$total_dr_amount = explode('.', number_format($voucher->total_dr_amount, 2, '.', ''));
$total_dr_rupees = $total_dr_amount[0];
$total_dr_paise = $total_dr_amount[1];
@endphp
Rs. {{ numberToWords($voucher->total_dr_amount) }}/-Total Rs. |
{{ $total_dr_rupees }} |
{{ $total_dr_paise }} |
CREDIT |
|
|
@foreach($voucher->voucher_acc_details as $detail)
@if($detail->nature == 'cr')
@php
$cr_amount = explode('.', number_format($detail->cr_amount, 2, '.', ''));
$cr_rupees = $cr_amount[0];
$cr_paise = $cr_amount[1];
@endphp
{{ $detail->account['account_name'] }}
|
{{ $cr_rupees }}
|
{{ $cr_paise }}
|
@endif
@endforeach
|
|
@php
$total_cr_amount = explode('.', number_format($voucher->total_cr_amount, 2, '.', ''));
$total_cr_rupees = $total_cr_amount[0];
$total_cr_paise = $total_cr_amount[1];
@endphp
Rs. {{ numberToWords($voucher->total_cr_amount) }} Only/-Total Rs. |
{{ $total_cr_rupees }} |
{{ $total_cr_paise }} |
|
|
{{-- Approved by ________________________________ | --}}
|
Signature ________________________________ |
Receiver's Signature |
|
|
|