@extends('layouts.admin.index') @section('content') @section('css') @endsection @section('title','Money Receipt')
@include('admin.common.print')

Fanam Real State Ltd.

Money Receipt
{{-- 12Nov2025 Frontend Code Update Starts(Shakib) --}} {{--

MR No : {{ isset($collection)?$collection->collection_prefix.$collection->collection_no:'' }}

--}}

MR No : PFC-{{ isset($collection)?$collection->collection_no:'' }}

{{-- 12Nov2025 Frontend Code Update Ends(Shakib) --}}

Date : {{ isset($collection)?$collection->collection_date:'' }}

{{-- --}} @if($collection->collection_mode == "Cheque") @elseif($collection->collection_mode == "Direct Deposit (Cash)") @elseif($collection->collection_mode == "Direct Deposit (Cheque)") @elseif($collection->collection_mode == "Fund Transfer") @elseif($collection->collection_mode == "Pay Order") @elseif($collection->collection_mode == "Demand Draft") @elseif($collection->collection_mode == "Cash") @endif
Project Name {{ (isset($collection) && $collection->project)?$collection->project->project_name:'' }}
Client Name @if((isset($collection) && $collection->customer)) {{ $collection->customer->firstname??'' }} {{ $collection->customer->lastname??'' }} @endif
Acc/File No @if((isset($collection) && $collection->booking)) {{ $collection->booking->file_no??'' }} @endif
Amount Tk. {{ money_format_bd($collection->collection_amount ?? 0) }}
In wordsTk. {{ convert_number_to_words($collection->collection_amount??0) }} Tk. @php $amount = $collection->collection_amount ?? 0; // Check if decimal part is zero if (strpos($amount, '.') !== false) { list($intPart, $fraction) = explode('.', $amount); if ((int)$fraction === 0) { $amount_in_words = convert_number_to_words($intPart); } else { $amount_in_words = convert_number_to_words($amount); } } else { $amount_in_words = convert_number_to_words($amount); } @endphp {{ $amount_in_words }} Taka only
Deposit Purpose {{-- 12Nov2025 Html Code & Backend Code Starts(Shakib) --}} @if($collection && $collection->details) @php $downPayments = []; $installments = []; $booking = []; // প্রতিটি schedule_id অনুযায়ী total paid বের করো একবারে $scheduleSums = \Illuminate\Support\Facades\DB::table('collection_details') ->select('payment_schedule_detail_id', \Illuminate\Support\Facades\DB::raw('SUM(schedule_amount) as total_paid')) ->groupBy('payment_schedule_detail_id') ->pluck('total_paid', 'payment_schedule_detail_id') ->toArray(); @endphp @foreach ($collection->details as $collection_detail) @php $payment_id = $collection_detail->payment_schedule_detail_id; $type = $collection_detail?->paymentSchedule?->payment_type; $name = $collection_detail?->paymentSchedule?->payment_name; $total_amount = $collection_detail?->paymentSchedule?->payment_amount; $date = date('d-M-y', strtotime($collection->collection_date)); // এই schedule এর মোট কত টাকা দেওয়া হয়েছে $amount_paid = $scheduleSums[$payment_id] ?? 0; // check করো এই record টা last payment কিনা $last_payment = \App\PaymentCollectionDetails::where('payment_schedule_detail_id', $payment_id) ->orderBy('id', 'desc') ->first(); if ($last_payment && $last_payment->id == $collection_detail->id && $amount_paid == $total_amount) { $text = $name . " (Rest)/" . $date; // শেষ payment ও পুরো পরিমাণ } else { $text = $name . " (Par)/" . $date; // partial payment } // Type অনুযায়ী array তে রাখো if($type == "DP") { $downPayments[$payment_id] = $text; } elseif($type == "installment") { $installments[$payment_id] = $text; } elseif($type == "Booking") { $booking[$payment_id] = $text; } @endphp @endforeach {{-- Down Payments --}} @if(count($downPayments) > 0) {{ implode(', ', array_unique($downPayments)) }} @endif {{-- Installments --}} @if(count($installments) > 0) @if(count($downPayments) > 0), @endif {{ implode(', ', array_unique($installments)) }} @endif {{-- Booking --}} @if(count($booking) > 0) @if(count($downPayments) > 0 || count($installments) > 0), @endif {{ implode(', ', array_unique($booking)) }} @endif @endif {{-- 12Nov2025 Html Code & Backend Code Starts(Shakib) --}}
Payment Mode {{ $collection->collection_mode??'' }}
Cash/CHQ/DD/POCheque No : {{ $collection->cheque_no }} Date : {{ $collection->cheque_date }}
Bank : {{ $collection->cheque->bank_name }} Routing No : {{ $collection->cheque_details }}
Bank : {{ $collection->dpCash->bank_name }} Date : {{ $collection->dep_cash_date }}
DP Slip No : {{ $collection->dep_cash_slip_no }}
Bank : {{ $collection->dpCheque->bank_name }} Date : {{ $collection->dep_cheque_date }}
DP Slip No : {{ $collection->dep_cheque_slip_no }}
From Bank : {{ $collection->fundTrFrom->bank_name }} To Bank : {{ $collection->fundTrTo->bank_name }}
Transfer Date : {{ $collection->fund_trans_date }}
Bank : {{ $collection->payOrder->bank_name }} Pay Order Date : {{ $collection->pay_order_date }}
Pay Order No : {{ $collection->pay_order_no }}
Bank : {{ $collection->demandDraft->bank_name }} Draft Date : {{ $collection->demand_draft_date }}- -
- -
Remarks {{ $collection->remarks??'' }}
Prepared By Deposited By
{{-- @if($collection && $collection->details) @foreach ($collection->details as $collection_detail) @endforeach @endif --}}
MR Details
{{ $collection_detail?->paymentSchedule?->payment_name }} Tk. {{ $collection_detail?->schedule_amount??'' }}
1000X
500X
100X
50X
20X
10X
5X
2X
1X
Cash Amount Tk. {{ isset($collection) ? money_format_bd($collection->collection_mode == 'Cash' ? $collection->collection_amount : 0) : money_format_bd(0) }}
Chq/PO/DD Amount Tk.  {{ isset($collection) ? money_format_bd($collection->collection_mode == 'Cheque' ? $collection->collection_amount : 0) : money_format_bd(0) }}
Total Tk. {{ isset($collection) ? money_format_bd($collection->collection_amount ?? 0) : money_format_bd(0) }}
{{-- 12Nov2025 Html Code Starts(Shakib) --}}

N.B: This money receipt will be valid subject to encashment of Cheque / P.O / D.D.

{{-- 12Nov2025 Html Code Ends(Shakib) --}}

Customer Copy


Fanam Real State Ltd.

Money Receipt
{{-- 12Nov2025 Frontend Code Update Starts(Shakib) --}} {{--

MR No : {{ isset($collection)?$collection->collection_prefix.$collection->collection_no:'' }}

--}}

MR No : PFC-{{ isset($collection)?$collection->collection_no:'' }}

{{-- 12Nov2025 Frontend Code Update Ends(Shakib) --}}

Date : {{ isset($collection)?$collection->collection_date:'' }}

{{-- --}} @if($collection->collection_mode == "Cheque") @elseif($collection->collection_mode == "Direct Deposit (Cash)") @elseif($collection->collection_mode == "Direct Deposit (Cheque)") @elseif($collection->collection_mode == "Fund Transfer") @elseif($collection->collection_mode == "Pay Order") @elseif($collection->collection_mode == "Demand Draft") @elseif($collection->collection_mode == "Cash") @endif
Project Name {{ (isset($collection) && $collection->project)?$collection->project->project_name:'' }}
Client Name @if((isset($collection) && $collection->customer)) {{ $collection->customer->firstname??'' }} {{ $collection->customer->lastname??'' }} @endif
Acc/File No @if((isset($collection) && $collection->booking)) {{ $collection->booking->file_no??'' }} @endif
Amount Tk. {{ money_format_bd($collection->collection_amount ?? 0) }}
In words Tk. @php $amount = $collection->collection_amount ?? 0; // Check if decimal part is zero if (strpos($amount, '.') !== false) { list($intPart, $fraction) = explode('.', $amount); if ((int)$fraction === 0) { $amount_in_words = convert_number_to_words($intPart); } else { $amount_in_words = convert_number_to_words($amount); } } else { $amount_in_words = convert_number_to_words($amount); } @endphp {{ $amount_in_words }} Taka only
Deposit Purpose {{-- 12Nov2025 Html Code & Backend Code Starts(Shakib) --}} @if($collection && $collection->details) @php $downPayments = []; $installments = []; $booking = []; // প্রতিটি schedule_id অনুযায়ী total paid বের করো একবারে $scheduleSums = \Illuminate\Support\Facades\DB::table('collection_details') ->select('payment_schedule_detail_id', \Illuminate\Support\Facades\DB::raw('SUM(schedule_amount) as total_paid')) ->groupBy('payment_schedule_detail_id') ->pluck('total_paid', 'payment_schedule_detail_id') ->toArray(); @endphp @foreach ($collection->details as $collection_detail) @php $payment_id = $collection_detail->payment_schedule_detail_id; $type = $collection_detail?->paymentSchedule?->payment_type; $name = $collection_detail?->paymentSchedule?->payment_name; $total_amount = $collection_detail?->paymentSchedule?->payment_amount; $date = date('d-M-y', strtotime($collection->collection_date)); // এই schedule এর মোট কত টাকা দেওয়া হয়েছে $amount_paid = $scheduleSums[$payment_id] ?? 0; // check করো এই record টা last payment কিনা $last_payment = \App\PaymentCollectionDetails::where('payment_schedule_detail_id', $payment_id) ->orderBy('id', 'desc') ->first(); if ($last_payment && $last_payment->id == $collection_detail->id && $amount_paid == $total_amount) { $text = $name . " (Rest)/" . $date; // শেষ payment ও পুরো পরিমাণ } else { $text = $name . " (Par)/" . $date; // partial payment } // Type অনুযায়ী array তে রাখো if($type == "DP") { $downPayments[$payment_id] = $text; } elseif($type == "installment") { $installments[$payment_id] = $text; } elseif($type == "Booking") { $booking[$payment_id] = $text; } @endphp @endforeach {{-- Down Payments --}} @if(count($downPayments) > 0) {{ implode(', ', array_unique($downPayments)) }} @endif {{-- Installments --}} @if(count($installments) > 0) @if(count($downPayments) > 0), @endif {{ implode(', ', array_unique($installments)) }} @endif {{-- Booking --}} @if(count($booking) > 0) @if(count($downPayments) > 0 || count($installments) > 0), @endif {{ implode(', ', array_unique($booking)) }} @endif @endif {{-- 12Nov2025 Html Code & Backend Code Starts(Shakib) --}}
Payment Mode {{ $collection->collection_mode??'' }}
Cash/CHQ/DD/PO - -
- -
Cash/CHQ/DD/POCheque No : {{ $collection->cheque_no }} Date : {{ $collection->cheque_date }}
Bank : {{ $collection->cheque->bank_name }} Routing No : {{ $collection->cheque_details }}
Bank : {{ $collection->dpCash->bank_name }} Date : {{ $collection->dep_cash_date }}
DP Slip No : {{ $collection->dep_cash_slip_no }}
Bank : {{ $collection->dpCheque->bank_name }} Date : {{ $collection->dep_cheque_date }}
DP Slip No : {{ $collection->dep_cheque_slip_no }}
From Bank : {{ $collection->fundTrFrom->bank_name }} To Bank : {{ $collection->fundTrTo->bank_name }}
Transfer Date : {{ $collection->fund_trans_date }}
Bank : {{ $collection->payOrder->bank_name }} Pay Order Date : {{ $collection->pay_order_date }}
Pay Order No : {{ $collection->pay_order_no }}
Bank : {{ $collection->demandDraft->bank_name }} Draft Date : {{ $collection->demand_draft_date }}- -
- -
Remarks {{ $collection->remarks??'' }}
Prepared By Deposited By
{{--

N.B: This money receipt will be valid subject to encashment of Cheque / P.O / D.D.

--}}
{{-- @if($collection && $collection->details) @foreach ($collection->details as $collection_detail) @endforeach @endif --}}
MR Details
{{ $collection_detail?->paymentSchedule?->payment_name }} Tk. {{ $collection_detail?->schedule_amount??'' }}
1000X
500X
100X
50X
20X
10X
5X
2X
1X
Cash Amount Tk. {{ isset($collection) ? money_format_bd($collection->collection_mode == 'Cash' ? $collection->collection_amount : 0) : money_format_bd(0) }}
Chq/PO/DD Amount Tk. {{ isset($collection) ? money_format_bd($collection->collection_mode == 'Cheque' ? $collection->collection_amount : 0) : money_format_bd(0) }}
Total Tk. {{ isset($collection) ? money_format_bd($collection->collection_amount ?? 0) : money_format_bd(0) }}
{{-- 12Nov2025 Html Code Starts(Shakib) --}}

N.B: This money receipt will be valid subject to encashment of Cheque / P.O / D.D.

{{-- 12Nov2025 Html Code Ends(Shakib) --}}

Office Copy


Fanam Real State Ltd.

Money Receipt
{{-- 12Nov2025 Frontend Code Update Starts(Shakib) --}} {{--

MR No : {{ isset($collection)?$collection->collection_prefix.$collection->collection_no:'' }}

--}}

MR No : PFC-{{ isset($collection)?$collection->collection_no:'' }}

{{-- 12Nov2025 Frontend Code Update Ends(Shakib) --}}

Date : {{ isset($collection)?$collection->collection_date:'' }}

@if($collection->collection_mode == "Cheque") @elseif($collection->collection_mode == "Direct Deposit (Cash)") @elseif($collection->collection_mode == "Direct Deposit (Cheque)") @elseif($collection->collection_mode == "Fund Transfer") @elseif($collection->collection_mode == "Pay Order") @elseif($collection->collection_mode == "Demand Draft") @elseif($collection->collection_mode == "Cash") @endif
Project Name {{ (isset($collection) && $collection->project)?$collection->project->project_name:'' }}
Client Name @if((isset($collection) && $collection->customer)) {{ $collection->customer->firstname??'' }} {{ $collection->customer->lastname??'' }} @endif
Acc/File No @if((isset($collection) && $collection->booking)) {{ $collection->booking->file_no??'' }} @endif
Amount Tk. {{ money_format_bd($collection->collection_amount ?? 0) }}
In words Tk. @php $amount = $collection->collection_amount ?? 0; // Check if decimal part is zero if (strpos($amount, '.') !== false) { list($intPart, $fraction) = explode('.', $amount); if ((int)$fraction === 0) { $amount_in_words = convert_number_to_words($intPart); } else { $amount_in_words = convert_number_to_words($amount); } } else { $amount_in_words = convert_number_to_words($amount); } @endphp {{ $amount_in_words }} Taka only
Deposit Purpose {{-- 12Nov2025 Html Code & Backend Code Starts(Shakib) --}} @if($collection && $collection->details) @php $downPayments = []; $installments = []; $booking = []; // প্রতিটি schedule_id অনুযায়ী total paid বের করো একবারে $scheduleSums = \Illuminate\Support\Facades\DB::table('collection_details') ->select('payment_schedule_detail_id', \Illuminate\Support\Facades\DB::raw('SUM(schedule_amount) as total_paid')) ->groupBy('payment_schedule_detail_id') ->pluck('total_paid', 'payment_schedule_detail_id') ->toArray(); @endphp @foreach ($collection->details as $collection_detail) @php $payment_id = $collection_detail->payment_schedule_detail_id; $type = $collection_detail?->paymentSchedule?->payment_type; $name = $collection_detail?->paymentSchedule?->payment_name; $total_amount = $collection_detail?->paymentSchedule?->payment_amount; $date = date('d-M-y', strtotime($collection->collection_date)); // এই schedule এর মোট কত টাকা দেওয়া হয়েছে $amount_paid = $scheduleSums[$payment_id] ?? 0; // check করো এই record টা last payment কিনা $last_payment = \App\PaymentCollectionDetails::where('payment_schedule_detail_id', $payment_id) ->orderBy('id', 'desc') ->first(); if ($last_payment && $last_payment->id == $collection_detail->id && $amount_paid == $total_amount) { $text = $name . " (Rest)/" . $date; // শেষ payment ও পুরো পরিমাণ } else { $text = $name . " (Par)/" . $date; // partial payment } // Type অনুযায়ী array তে রাখো if($type == "DP") { $downPayments[$payment_id] = $text; } elseif($type == "installment") { $installments[$payment_id] = $text; } elseif($type == "Booking") { $booking[$payment_id] = $text; } @endphp @endforeach {{-- Down Payments --}} @if(count($downPayments) > 0) {{ implode(', ', array_unique($downPayments)) }} @endif {{-- Installments --}} @if(count($installments) > 0) @if(count($downPayments) > 0), @endif {{ implode(', ', array_unique($installments)) }} @endif {{-- Booking --}} @if(count($booking) > 0) @if(count($downPayments) > 0 || count($installments) > 0), @endif {{ implode(', ', array_unique($booking)) }} @endif @endif {{-- 12Nov2025 Html Code & Backend Code Starts(Shakib) --}}
Payment Mode {{ $collection->collection_mode??'' }}
Cash/CHQ/DD/POCheque No : {{ $collection->cheque_no }} Date : {{ $collection->cheque_date }}
Bank : {{ $collection->cheque->bank_name }} Routing No : {{ $collection->cheque_details }}
Bank : {{ $collection->dpCash->bank_name }} Date : {{ $collection->dep_cash_date }}
DP Slip No : {{ $collection->dep_cash_slip_no }}
Bank : {{ $collection->dpCheque->bank_name }} Date : {{ $collection->dep_cheque_date }}
DP Slip No : {{ $collection->dep_cheque_slip_no }}
From Bank : {{ $collection->fundTrFrom->bank_name }} To Bank : {{ $collection->fundTrTo->bank_name }}
Transfer Date : {{ $collection->fund_trans_date }}
Bank : {{ $collection->payOrder->bank_name }} Pay Order Date : {{ $collection->pay_order_date }}
Pay Order No : {{ $collection->pay_order_no }}
Bank : {{ $collection->demandDraft->bank_name }} Draft Date : {{ $collection->demand_draft_date }}- -
- -
Remarks {{ $collection->remarks??'' }}
Prepared By Deposited By
{{--

N.B: This money receipt will be valid subject to encashment of Cheque / P.O / D.D.

--}}
{{-- @if($collection && $collection->details) @foreach ($collection->details as $collection_detail) @endforeach @endif --}}
MR Details
{{ $collection_detail?->paymentSchedule?->payment_name }} Tk. {{ $collection_detail?->schedule_amount??'' }}
1000X
500X
100X
50X
20X
10X
5X
2X
1X
Cash Amount Tk. {{ isset($collection) ? money_format_bd($collection->collection_mode == 'Cash' ? $collection->collection_amount : 0) : money_format_bd(0) }}
Chq/PO/DD Amount Tk. {{ isset($collection) ? money_format_bd($collection->collection_mode == 'Cheque' ? $collection->collection_amount : 0) : money_format_bd(0) }}
Total Tk. {{ isset($collection) ? money_format_bd($collection->collection_amount ?? 0) : money_format_bd(0) }}
{{-- 12Nov2025 Html Code Starts(Shakib) --}}

N.B: This money receipt will be valid subject to encashment of Cheque / P.O / D.D.

{{-- 12Nov2025 Html Code Ends(Shakib) --}}

Accounts Copy

@endsection