Path : /var/www/html/thb_loan_system/resources/views/accounting/ |
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
Current File : /var/www/html/thb_loan_system/resources/views/accounting/ledger.blade.php |
@extends('layouts.master') @section('title') {{translate('ledger')}} @endsection @section('content') <div class="panel panel-white"> <div class="panel-heading"> <h6 class="panel-title"> {{translate('ledger')}} @if(!empty($start_date)) for period: <b>{{$start_date}} to {{$end_date}}</b> @endif </h6> <div class="heading-elements"> <button class="btn btn-sm btn-info hidden-print" onclick="window.print()">Print</button> </div> </div> <div class="panel-body hidden-print"> {!! Form::open(array('url' => Request::url(), 'method' => 'post','class'=>'form-horizontal', 'name' => 'form')) !!} <div class="row"> <div class="col-xs-5"> <x-forms.date-range-picker name="date_range" :start-date="$start_date" :end-date="$end_date" /> </div> </div> <div class="panel-body"> <div class="row"> <div class="col-xs-2"> <span class="input-group-btn"> <button type="submit" class="btn btn-info">{{translate('search')}}! </button> </span> <span class="input-group-btn"> <a href="{{Request::url()}}" class="btn bg-purple btn-flat pull-right">{{translate('reset')}}!</a> </span> </div> </div> </div> {!! Form::close() !!} </div> <!-- /.panel-body --> </div> <!-- /.box --> @if(!empty($start_date)) <div class="panel panel-white"> <div class="panel-body table-responsive no-padding"> <table class="table table-bordered table-condensed table-hover"> <thead> <tr style="background-color: #D1F9FF"> <th>#</th> <th>{{translate('gl_code')}}</th> <th>{{translate('account')}}</th> <th>{{translate('debit')}}</th> <th>{{translate('credit')}}</th> <th>{{translate('balance')}}</th> </tr> </thead> <tbody> <?php $credit_total = 0; $debit_total = 0; ?> @foreach(\App\Models\ChartOfAccount::orderBy('gl_code','asc')->get() as $index=> $key) <?php $cr = 0; $dr = 0; $cr = \App\Models\JournalEntry::where('account_id', $key->id)->whereBetween('date', [$start_date, $end_date])->sum('credit'); $dr = \App\Models\JournalEntry::where('account_id', $key->id)->whereBetween('date', [$start_date, $end_date])->sum('debit'); $credit_total = $credit_total + $cr; $debit_total = $debit_total + $dr; ?> <tr> <td>{{$index+1}}</td> <td>{{ $key->gl_code }}</td> <td> {{$key->name}} </td> <td class="credit">{{ currency_converter($dr) }}</td> <td class="credit">{{ currency_converter($cr) }}</td> <td class="credit"> @if($dr>$cr) {{currency_converter($dr-$cr)}} Dr @elseif($cr>$dr) {{currency_converter($cr-$dr)}} Cr @else 0 @endif </td> </tr> @endforeach </tbody> <tfoot> <tr> <td colspan="3" style="text-align:center;"><b>{{translate('total')}}</b></td> <td class="credit">{{currency_converter($debit_total)}}</td> <td class="credit">{{currency_converter($credit_total)}}</td> <td></td> </tr> </tfoot> </table> </div> </div> @else <div class="panel panel-white"> <div class="panel-body table-responsive no-padding"> <table class="table table-bordered table-condensed table-hover"> <thead> <tr style="background-color: #D1F9FF"> <th>{{translate('gl_code')}}</th> <th>{{translate('account')}}</th> <th>{{translate('debit')}}</th> <th>{{translate('credit')}}</th> <th>{{translate('balance')}}</th> </tr> </thead> <tbody> <?php $credit_total = 0; $debit_total = 0; ?> @foreach(\App\Models\ChartOfAccount::orderBy('gl_code','asc')->get() as $key) <?php $cr = 0; $dr = 0; $cr = \App\Models\JournalEntry::where('account_id', $key->id)->sum('credit'); $dr = \App\Models\JournalEntry::where('account_id', $key->id)->sum('debit'); $credit_total = $credit_total + $cr; $debit_total = $debit_total + $dr; ?> <tr> <td>{{ $key->gl_code }}</td> <td> {{$key->name}} </td> <td>{{ currency_converter($dr) }}</td> <td>{{ currency_converter($cr) }}</td> <td> @if($dr>$cr) {{currency_converter($dr-$cr)}} Dr @elseif($cr>$dr) {{currency_converter($cr-$dr)}} Cr @else 0 @endif </td> </tr> @endforeach </tbody> <tfoot> <tr> <td colspan="2"><b>{{translate('total')}}</b></td> <td>{{currency_converter($debit_total)}}</td> <td>{{currency_converter($credit_total)}}</td> <td></td> </tr> </tfoot> </table> </div> </div> @endif @endsection @section('footer-scripts') @endsection