@extends('admin.layout.master') @section('title','Ledger Report') @section('custom_style') @endsection @section ('content') @section ('content')
| DATE | VOUCHER NO | PARTICULERS | NOTE | DR | CR | BALANCE | ||
|---|---|---|---|---|---|---|---|---|
| {{ date('d-m-Y',strtotime(Request()->start_date)) }} | {{'--'}} | {{'Beginning Balance'}} | @if($b_balance>=0) {{number_format($b_balance,2)}} @php $d_amount+=$b_balance; $amount+=$b_balance; @endphp @endif | @if($b_balance<0) @php $minusTrimedBalance=abs($b_balance); $c_amount+=$minusTrimedBalance; $amount-=$minusTrimedBalance; @endphp {{-- {{ abs($b_balance) }} --}} {{number_format($minusTrimedBalance,2)}} @endif | @if($r_type==1){{ $amount>=0?number_format($amount,2).'(dr)':(number_format(abs($amount),2)).' (cr)'}} | @else{{ $amount>=0?number_format($amount,2):'('.(number_format(abs($amount),2)).')'}} | @endif||
| {{date('d-m-Y',strtotime($jr->date))}} | {{$jr->voucher->voucher_no}} |
@if($jr->type==0)
{{-- @dd($jr->voucher->journals->where('type',1)->where('amount',$jr->amount)) --}}
{{-- {{$jr->voucher->journals->where('type',1)->first()->ledger->name}} --}}
@php
$creditLedger=$jr->oppsiteJr->where('type',1);
$drCounter=count($jr->oppsiteJr->where('type',0));
$groupType=$creditLedger->where('group_type',$jr->group_type);
$str='';
if(count($groupType)>0){
if($show_multiple && $drCounter==1){
foreach($groupType as $opp){
$str.=$opp->globalLedger?$opp->globalLedger->name:'Ledger Missing';
if(count($groupType)>1){
$str.=' - '.$opp->amount.' '; } } }else{ $str.=$groupType->first()->globalLedger?$groupType->first()->globalLedger->name:'Ledger Missing'; } }elseif(count($creditLedger)>0){ if($show_multiple && $drCounter==1){ foreach($creditLedger as $ocl){ $str.=$ocl->globalLedger?$ocl->globalLedger->name:'Ledger Missing'; if(count($creditLedger)>1){ $str.=' - '.(number_format($ocl->amount,2)).' '; } } }else{ $str.=$creditLedger->first()->globalLedger?$creditLedger->first()->globalLedger->name:'Ledger Missing'; } } @endphp {!!$str!!} @else @php $debitLedger=$jr->oppsiteJr->where('type',0); $crCounter=count($jr->oppsiteJr->where('type',1)); $drGroupType=$debitLedger->where('group_type',$jr->group_type); $str=''; if(count($drGroupType)>0){ if($show_multiple && $crCounter==1){ foreach($drGroupType as $opp){ $str.=$opp->globalLedger?$opp->globalLedger->name:'Ledger Missing'; if(count($drGroupType)>1){ $str.=' - '.(number_format($opp->amount,2)).' '; } } }else{ $str.=$drGroupType->first()->globalLedger?$drGroupType->first()->globalLedger->name:'Ledger Missing'; } }elseif(count($debitLedger)>0){ if($show_multiple && $crCounter==1){ foreach($debitLedger as $ocl){ $str.=$ocl->globalLedger?$ocl->globalLedger->name:'Ledger Missing'; if(count($debitLedger)>1){ $str.=' - '.$ocl->amount.' '; } } }else{ $str.=$debitLedger->first()->globalLedger?$debitLedger->first()->globalLedger->name:'Ledger Missing'; } } @endphp {!!$str!!} {{-- {{count($drGroupType)>0?($drGroupType->first()->ledger?$drGroupType->first()->ledger->name:'Ledger Missing'):(count($debitLedger)>0 && $debitLedger->first()->ledger?$debitLedger->first()->ledger->name:'Ledger Missing')}} --}} {{-- {{$jr->voucher->journals->where('type',0)->first()->ledger->name}} --}} @endif |
@if($jr->voucher->bill_date){{$jr->voucher->bill_date?'Bill Date : '.date('d-m-Y',strtotime($jr->voucher->bill_date)).'Bill No : '.$jr->voucher->bill_no:''}} @endif{{$jr->note??$jr->voucher->note}} |
@if($jr->type==0) {{number_format($jr->amount,2)}} @php $d_amount+=$jr->amount; $amount+=$jr->amount; @endphp @endif | @if($jr->type==1) {{number_format($jr->amount,2)}} @php $c_amount+=$jr->amount; $amount-=$jr->amount; @endphp @endif | @if($r_type==1){{ $amount>=0?number_format($amount,2).'(dr)':(number_format(abs($amount),2)).' (cr)'}} | @else{{ $amount>=0?number_format($amount,2):'('.(number_format(abs($amount),2)).')'}} | @endif|
| {{'TOTAL '}} | {{number_format($d_amount,2)}} | {{number_format($c_amount,2)}} | @if($r_type==1){{ $amount=0 ? '': ($amount > 0?number_format($amount,2).'(dr)':(number_format(abs($amount),2)).' (cr)')}} | @else{{ $amount>=0?number_format($amount,2):'('.(number_format(abs($amount),2)).')'}} | @endif {{--{{ $amount>=0?number_format($amount,2):'('.(number_format(abs($amount),2)).')'}} | --}}|||