@extends('layouts.app') @section('title') {{'Customer Ledger Report'}} @endsection @section('content')
Customer Ledger Report Back
Search By Customer
Start Date
End Date

 

@if(isset($supplier_id) && $supplier_id !='')

@include('layouts.head')

Customer's Ledger

{!! date('d-F-Y', strtotime($start_date)) !!} to {!! date('d-F-Y', strtotime($end_date)) !!}

@if(isset($day_book_list[0]->name))
Customer Name : {!! $day_book_list[0]->supplier_id !!} - {!! $day_book_list[0]->name !!}

Proprietor : {!! $day_book_list[0]->person_name !!}

Address : {!! $day_book_list[0]->address !!}

Contact No. : {!! $day_book_list[0]->mobile !!}
@endif

@php $i=0; $opening_balance_query = $opening_amount[0]->bill_amount - $opening_amount[0]->payment_amount; if($opening_balance_query != '') { $opening_balance = $opening_balance_query; }else{ $opening_balance = 0; } $payment_total =0; $billed_total =0; $balance_total =0; $usd_total =0; @endphp @if(isset($day_book_list[0]->name)) @foreach($day_book_list as $row) @php $i++; if(isset($row->db_types) && ($row->db_types =='Payment' || $row->db_types =='Received' || $row->db_types =='Purchase' || $row->db_types =='Damage Return' || $row->db_types =='Sales Return' || $row->db_types =='Commission')){ $payment_amount = $row->amount; $bill_amount = 0; }else{ $payment_amount = 0; $bill_amount = $row->amount; } $payment_total += $payment_amount; $billed_total += $bill_amount; $total_balance = $opening_balance + $billed_total - $payment_total ; $usd_balance = $total_balance ; if($total_balance>0) { $amnt_sign = 'Dr'; } else { $amnt_sign = 'Cr'; } @endphp @endforeach @endif
S.N. Date Description (Bill#, Challan#) Vch No. Vch Type Debit (Tk.) Credit (Tk.) Balance (Tk.)
0 {!! date('d-m-Y', strtotime($start_date))!!} Opening Balance -- -- -- -- 0.00 Dr
{{ $i }} {{ date('d-m-Y', strtotime($row->txn_date)) }} {{ $row->values }} ( {{ $row->remarks }} ) @if($row->db_types =='Received') RV# @elseif($row->db_types =='Commission') CN# @elseif($row->db_types =='Damage Return') DR# @elseif($row->db_types =='Sales') SI# @elseif($row->db_types =='Sales Return') SRI# @endif {{ $row->voucher_no }} {{ $row->db_types }} {{ number_format($bill_amount,2) }} {{ number_format($payment_amount,2) }} {{ number_format($total_balance,2) }} {{ $amnt_sign }}
# {!! date('d-m-Y', strtotime($end_date))!!} Closing Balance -- -- {{ number_format($billed_total,2) }} {{ number_format($payment_total,2) }} {{ number_format($total_balance,2) }} {{ $amnt_sign }}
@endif
@endsection