@extends('admin.layout.master') @section('title','Ledger Report') @section('custom_style') @endsection @section ('content') @section ('content')
@include('admin.layout.title_header', ['title'=>'LEDGER REPORT'])
{{__('obs.date_to')}}
@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:'ledger not found'; $routeName=Route::currentRouteName(); $printData=getPrintData($routeName,$printData); @endphp {!!$printData['head']!!}
@php $c_amount=0; $d_amount=0; $amount=0; $show_multiple=0; $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 @forelse ($vouchers as $jr) @php $reff=$jr->voucher->reffInvoice??$jr->voucher->reffFgInvoice; $creditLedger=$jr->oppsiteJr->where('type',$jr->type==0?1:0); $drCounter=count($jr->oppsiteJr->where('type',$jr->type)); $groupType=$creditLedger->where('group_type',$jr->group_type); $str=''; $rowspan=1; $tr=''; if(count($groupType)>0){ if($show_multiple && $drCounter==1){ foreach($groupType as $opp){ if($rowspan==1){ $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 @if($r_type==1) @else @endif @empty @endforelse @if($r_type==1) @else @endif {{-- --}}
{{__('obs.date')}} {{__('obs.voucher_no')}} {{__('obs.particulars')}} {{__('obs.reff')}} {{__('obs.note')}} {{__('obs.dr')}} {{__('obs.cr')}} {{__('obs.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 {{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))}} {{$jr->voucher->voucher_no}} {!!$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{{$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 {{ $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 '}} {{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']!!}
{{-- --}}
@endsection @section('script') @stop