@extends('admin.layout.master') @section('title','Ledger Report') @section('custom_style') @endsection @section ('content') @section ('content')
@include('admin.layout.title_header', ['title'=>'LEDGER REPORT'])
{{-- --}}
{{--
--}} {{--
--}}
TO
@if(Request()->ledger_id)
@php $r_type=1; $printData['start_date']=Request()->start_date?date('d-M-Y',strtotime(Request()->start_date)):date('d-M-Y'); $printData['end_date']=Request()->end_date?date('d-M-Y',strtotime(Request()->end_date)):date('d-M-Y'); $printData['ledger_name']=$ledger?$ledger->name:''; $routeName=Route::currentRouteName(); $printData=getPrintData($routeName,$printData); @endphp {!!$printData['head']!!}
@php $c_amount=0; $d_amount=0; $amount=0; $show_multiple=0; $code=$ledger?$ledger->auto_code:null; @endphp @if($code==null || $code[0]<3) @if($r_type==1) @else @endif @endif @forelse ($vouchers as $jr) @php $reff=$jr->voucher->reffInvoice??$jr->voucher->reffFgInvoice; $printUrlArray=['','purchase-print?id=','purchase-print?id=','sell-print?id=','sell-print?id=','adjustment-print?id=','adjustment-print?id=','adjustment-print?id=','issue-print?id=','issue-print?id=','store_transfer-print?model=0&store_invoice_id=', 'store_transfer-print?model=1&store_invoice_id=', 'production-print?id=', 'opening-print?id=','','','adjustment-print?id=', 'purchase-contract-print?id=', 'sales-contract-print?id=']; @endphp @if($r_type==1) @else @endif @empty @endforelse @if($r_type==1) @else @endif @if($r_type==1) @else @endif {{-- --}}
DATE VOUCHER NO PARTICULERS Reff 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 {{ $amount>=0?number_format($amount,2).'(dr)':(number_format(abs($amount),2)).' (cr)'}}{{ $amount>=0?number_format($amount,2):'('.(number_format(abs($amount),2)).')'}}
{{date('d-m-Y',strtotime($jr->date))}} @if(checkAuthPermission('voucher.voucher_edit') && $jr->voucher->reff_voucher_id==null) @endif {{$jr->voucher->voucher_no}} @if($jr->type==0) @php $creditLedger=$jr->opposite_posting->where('type',1); $drCounter=count($jr->opposite_posting->where('type',0)); $groupType=$creditLedger->where('group_type',$jr->group_type); $str=''; $noteStr=''; if(count($groupType)>0){ if($show_multiple || $drCounter==1){ foreach($groupType as $opp){ $str.=$opp->ledger?$opp->ledger->name:'Ledger Missing'; if(count($groupType)>1){ $str.=' - '.(number_format($opp->amount,2)).'
'; $noteStr.=$opp->note.'
'; } } }else{ $str.=$groupType->first()->ledger?$groupType->first()->ledger->name:'Ledger Missing'; $noteStr.=$groupType->first()->note; } }elseif(count($creditLedger)>0){ if($show_multiple || $drCounter==1){ foreach($creditLedger as $ocl){ $str.=$ocl->ledger?$ocl->ledger->name:'Ledger Missing'; if(count($creditLedger)>1){ $str.=' - '.(number_format($ocl->amount,2)).'
'; $noteStr.=$ocl->note.'
'; } } }else{ $str.=$creditLedger->first()->ledger?$creditLedger->first()->ledger->name:'Ledger Missing'; $noteStr.=$creditLedger->first()->note; } } @endphp @else @php $debitLedger=$jr->opposite_posting->where('type',0); $crCounter=count($jr->opposite_posting->where('type',1)); $drGroupType=$debitLedger->where('group_type',$jr->group_type); $str=''; $noteStr=''; if(count($drGroupType)>0){ if($show_multiple || $crCounter==1){ foreach($drGroupType as $opp){ $str.=$opp->ledger?$opp->ledger->name:'Ledger Missing'; if(count($drGroupType)>1){ $str.=' - '.(number_format($opp->amount,2)).'
'; $noteStr.=$opp->note.'
'; } } }else{ $str.=$drGroupType->first()->ledger?$drGroupType->first()->ledger->name:'Ledger Missing'; $noteStr.=$drGroupType->first()->note; } }elseif(count($debitLedger)>0){ if($show_multiple || $crCounter==1){ foreach($debitLedger as $ocl){ $str.=$ocl->ledger?$ocl->ledger->name:'Ledger Missing'; if(count($debitLedger)>1){ $str.=' - '.$ocl->amount.'
'; $noteStr.=$ocl->note.'
'; } } }else{ $str.=$debitLedger->first()->ledger?$debitLedger->first()->ledger->name:'Ledger Missing'; $noteStr.=$debitLedger->first()->note; } } @endphp @endif {!!$str!!}
@if($reff) @if(!$reff->ref_type) @endif {{$reff->invoice_no}} @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 @if($noteStr) {!!$noteStr!!} @else {{$jr->note??$jr->voucher->note}} @endif
@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 {{ $amount>=0?number_format($amount,2).'(dr)':(number_format(abs($amount),2)).' (cr)'}}{{ $amount>=0?number_format($amount,2):'('.(number_format(abs($amount),2)).')'}}
{{'TOTAL'}} {{'OPENING'}} {{ $b_balance==0 ? '': ($b_balance > 0?number_format($b_balance,2).'(dr)':(number_format(abs($b_balance),2)).' (cr)')}}{{ $b_balance>=0?number_format($b_balance,2):'('.(number_format(abs($b_balance),2)).')'}} {{number_format($d_amount,2)}} {{number_format($c_amount,2)}} {{ $amount==0 ? '': ($amount > 0?number_format($amount,2).'(dr)':(number_format(abs($amount),2)).' (cr)')}}{{ $amount>=0?number_format($amount,2):'('.(number_format(abs($amount),2)).')'}}{{ $amount>=0?number_format($amount,2):'('.(number_format(abs($amount),2)).')'}}
{{-- --}}
{!!$printData['foot']!!}
{{-- --}}
@endif
@endsection @section('script') @stop