@extends('includes.extimation') @section('title', 'Receipt') @section('content') @php $userinfo = DB::table('users')->where('id',$payment_history->user_id)->first(); $chitdetailinfo = DB::table('chit_details')->where('id',$payment_history->chit_detail_id)->first(); $regno = ''; //echo "
"; print_r($chitdetailinfo); exit;
if($chitdetailinfo) {
$regno = $chitdetailinfo->regno;
if($chitdetailinfo->scheme_id && $chitdetailinfo->group_id == '') {
$chitinfo = DB::table('chit_scheme')->where('scheme_id',$chitdetailinfo->scheme_id)->first();
$schemeinfo = DB::table('scheme_name')->where('id',$chitdetailinfo->scheme_id)->first();
//print_r($chitinfo);
}
if($chitdetailinfo->scheme_id && $chitdetailinfo->group_id) {
$chitinfo = DB::table('chit_scheme')->where('scheme_id',$chitdetailinfo->scheme_id)->where('id',$chitdetailinfo->group_id)->first();
$schemeinfo = DB::table('scheme_name')->where('id',$chitdetailinfo->scheme_id)->first();
//print_r($chitinfo);
}
}
function getIndianCurrency(float $number)
{
$decimal = round($number - ($no = floor($number)), 2) * 100;
$hundred = null;
$digits_length = 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_length ) {
$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;
}
$Rupees = implode('', array_reverse($str));
$paise = ($decimal > 0) ? "." . ($words[$decimal / 10] . " " . $words[$decimal % 10]) . ' Paise' : '';
return ($Rupees ? $Rupees . 'Rupees ' : '') . $paise;
}
@endphp
SHRI ARTHI JEWELLERY
9/10,CROSS CUT ROAD
GANDHIPURAM
COIMBATORE
Pincode - 641012
04222232710
R. No:
#{{ $payment_history->id }}
Date:
@if($payment_history->payment_date && $payment_history->payment_date!='0000-00-00')
{{ date("d/m/Y",strtotime($payment_history->payment_date))}}
@else
@if($payment_history->created_at)
{{ date("d/m/Y",strtotime($payment_history->created_at))}}
@endif
@endif
SCHEME
GROUP
Ms_No
@if($schemeinfo) {{ isset($schemeinfo->scheme_name)?$schemeinfo->scheme_name:''}} @endif
INS NO: {{ $payment_history->no_of_installments }}
@if($chitinfo->chit_name) {{ $chitinfo->chit_name }} @endif
@if($regno) {{$regno}} @endif
Received with thanks from
@if(isset($userinfo->name)) {{ isset($userinfo->name)?$userinfo->name:'' }} @endif
Amount Recvd Rs {{ (int)$payment_history->amount }} ({{ number_format($payment_history->gold_weight,3) }})
({{isset($payment_history->amount)?getIndianCurrency($payment_history->amount):''}} Only)
{{date('d/m/Y h:i:s')}}
SHRI ARTHI JEWELLERY
9/10,CROSS CUT ROAD
GANDHIPURAM
COIMBATORE
Pincode - 641012
04222232710
R. No:
#{{ $payment_history->id }}
Date:
@if($payment_history->payment_date && $payment_history->payment_date!='0000-00-00')
{{ date("d/m/Y",strtotime($payment_history->payment_date))}}
@else
@if($payment_history->created_at)
{{ date("d/m/Y",strtotime($payment_history->created_at))}}
@endif
@endif
SCHEME
GROUP
Ms_No
@if($schemeinfo) {{ isset($schemeinfo->scheme_name)?$schemeinfo->scheme_name:''}} @endif
INS NO: {{ $payment_history->no_of_installments }}
@if($chitinfo->chit_name) {{ $chitinfo->chit_name }} @endif
@if($regno) {{$regno}} @endif
Received with thanks from
@if(isset($userinfo->name)) {{ isset($userinfo->name)?$userinfo->name:'' }} @endif
Amount Recvd Rs {{ (int)$payment_history->amount }} ({{ number_format($payment_history->gold_weight,3) }})
({{isset($payment_history->amount)?getIndianCurrency($payment_history->amount):0}} Only)
{{date('d/m/Y h:i:s')}}
@endsection