@extends('admin.layout.master') @section('title','Ledger Report') @section('custom_style') @endsection @section ('content') @section ('content')
| 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 | @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))}} | @if(checkAuthPermission('voucher.voucher_edit')||checkAuthPermission('voucher.journal_vouchers')) @if($jr->voucher->reff_transaction_id==null) {{-- @elseif(($jr->voucher->reffParentVoucher==null)) --}} @endif @endif {{$jr->voucher->voucher_no}} |
{{-- @if($jr->type==0) --}}
@php
$creditLedger=$jr->opposite_posting->where('type',$jr->type==0?1:0);//->where('id','>',$jr->id);
$drCounter=count($jr->opposite_posting->where('type',$jr->type));
$groupType=$creditLedger->where('group_type',$jr->group_type)->whereNotIn('id',$placed_id);
$str='';
$noteStr='';
if(count($groupType)>0){
if($show_multiple || $drCounter==1){
foreach($groupType as $opp){
//$str.=$opp->ledger?$opp->ledger->name:'Ledger Missing';
$jrV=$opp;
$str.=$jrV->globalLedger?$jrV->globalLedger->name:'Ledger Missing';
$str.=ledgerReffName($jrV);
if(count($groupType)>1){
$str.=' - '.(number_format($opp->amount,2)).' '; $noteStr.=$opp->note.' '; } } }else{ $jrV=$groupType->first(); $str.=$jrV->globalLedger?$jrV->globalLedger->name:'Ledger Missing'; $str.=ledgerReffName($jrV); array_push($placed_id,$jrV->id); $noteStr.=$jrV->note; } }elseif(count($creditLedger)>0){ if($show_multiple || $drCounter==1){ foreach($creditLedger as $ocl){ //$str.=$ocl->ledger?$ocl->ledger->name:'Ledger Missing'; $jrV=$ocl; $str.=$jrV->globalLedger?$jrV->globalLedger->name:'Ledger Missing'; $str.=ledgerReffName($jrV); if(count($creditLedger)>1){ $str.=' - '.(number_format($ocl->amount,2)).' '; $noteStr.=$ocl->note.' '; } } }else{ $jrV=$creditLedger->first(); $str.=$jrV->globalLedger?$jrV->globalLedger->name:'Ledger Missing'; $str.=ledgerReffName($jrV); array_push($placed_id,$jrV->id); $noteStr.=$jrV->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)->whereNotIn('id',$placed_id); $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'; // array_push($placed_id,$drGroupType->first()->id); // $noteStr.=$drGroupType->first()->note; $jrV=$drGroupType->first(); $str.=$jrV->ledger?$jrV->ledger->name:'Ledger Missing'; if($jrV->voucher->reffParentVoucher){ $str.=' [ '.getNameLedgerName($jrV->voucher->reffParentVoucher,$jrV->type,$jrV->reff_jr_id).']'; }else{ $str.=((($jrV->refLedger && ($jrV->ledger_id!=$jrV->reff_no))? ' [ '.$jrV->refLedger->name.' ]':'')); } array_push($placed_id,$jrV->id); $noteStr.=$jrV->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'; // array_push($placed_id,$debitLedger->first()->id); // $noteStr.=$debitLedger->first()->note; $jrV=$debitLedger->first(); $str.=$jrV->ledger?$jrV->ledger->name:'Ledger Missing'; if($jrV->voucher->reffParentVoucher){ $str.=' [ '.getNameLedgerName($jrV->voucher->reffParentVoucher,$jrV->type,$jrV->reff_jr_id).']'; }else{ $str.=((($jrV->refLedger && ($jrV->ledger_id!=$jrV->reff_no))? ' [ '.$jrV->refLedger->name.' ]':'')); } array_push($placed_id,$jrV->id); $noteStr.=$jrV->note; } } @endphp --}} {{-- @endif --}} {!!$str!!} |
@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($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 | @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'}} | {{'OPENING'}} | @if($r_type==1){{ $b_balance==0 ? '': ($b_balance > 0?number_format($b_balance,2).'(dr)':(number_format(abs($b_balance),2)).' (cr)')}} | @else{{ $b_balance>=0?number_format($b_balance,2):'('.(number_format(abs($b_balance),2)).')'}} | @endif{{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)).')'}} | --}}||