@extends('../layout/' . $layout)
@section('subhead')
Atarud MIS - Charts of Accounts
@endsection
@section('subcontent')
@php
$total = 0; $payment =0;
@endphp
Payables Reports
@include('../pages/account/reports/sidebar')
Report Content
@if(isset($startofmonth) && isset($endofmonth))
@endif
@if(isset($data['employees']))
Employees Payables
# |
Name |
Salary |
Payment |
Remaining |
@php $totalEmpSalary = 0; @endphp
@foreach($data['employees'] as $row)
@php
$completeSalary = App\Models\Salary::where('emp_id', $row->id)->
where('payment_status', 'complete')->
whereBetween('date', [ $data['startofmonth'], $data['endofmonth']])->first();
if($completeSalary != null) continue;
$half = App\Models\Salary::where('emp_id', $row->id)->
where('payment_status', 'half')->
whereBetween('date', [ $data['startofmonth'], $data['endofmonth']])->first();
if($half != null ){
$paid = $half->payable_amount - $half->payment;
$totalEmpSalary += $paid;
}else{
$paid = $row->emp_salary_amount;
$totalEmpSalary += $paid;
}
// $total += $row->payable_amount;
@endphp
{{++$loop->index}} |
{{$row->emp_fname}} |
{{$row->emp_salary_amount}} |
{{$half != null ? $half->payment : 0}} |
{{$paid}} |
@endforeach
';
Remaining |
{{$totalEmpSalary }} |
@php $total += $totalEmpSalary; @endphp
@endif
@if(isset($data))
Teachers Payables
# |
Name |
Salary |
Payment |
Remaining |
@php $totalTeaSalary = 0; @endphp
@foreach($data['teachers'] as $row)
@php
$completeSalary = App\Models\Salary::where('teacher_id', $row->id)->
where('payment_status', 'complete')->
whereBetween('date', [ $data['startofmonth'], $data['endofmonth']])->first();
if($completeSalary != null) continue;
$half = App\Models\Salary::where('teacher_id', $row->id)->
where('payment_status', 'half')->
whereBetween('date', [ $data['startofmonth'], $data['endofmonth']])->first();
// $startMonth = $data['startofmonth']; $endMonth=$data['endofmonth'];
$paid = '';
if($half != null ){
$payment = $half->payable_amount;
$paid = $half->payable_amount - $half->payment;
$totalTeaSalary += $paid;
}else{
$contract = getTeacherSalary($row, $data['startofmonth'], $data['endofmonth']);
if($contract[0] == null) continue;
$paid = $contract[0]->salary_type == 'fixed' ? $contract[0]->salary : $contract[2];
$paid = $contract[0]->salary_type == 'fixed' ? $payment = $contract[0]->salary :$payment = $contract[2];
$totalTeaSalary += $paid;
}
// $total += $row->payable_amount;
@endphp
{{++$loop->index}} |
{{$row->name}} |
{{round($payment)}} |
{{$half != null ? round($half->payment) : 0}} |
{{round($paid)}} |
@endforeach
';
Remaining |
{{round($totalTeaSalary) }} |
@php $total += $totalTeaSalary; @endphp
@endif
@if(isset($vouchers))
Voucher Payables
# |
Name |
Account |
Amount |
Payment |
Remaining |
@php
$totalVoucher = 0;
@endphp
@foreach($vouchers as $row)
@php
$account = App\Models\ChartofAccount::where('id', $row->account_id)->first();
$totalAmount = 0;
$totalPayment = 0;
$totalAmount += $row->v_amount;
$totalPayment += $row->v_paid;
$totalVoucher += $row->v_amount - $row->v_paid;
@endphp
{{++$loop->index}} |
{{$row->v_title}} |
{{$account->name}} |
{{$row->v_amount}} |
{{$row->v_paid}} |
{{$row->v_amount - $row->v_paid}} |
@endforeach
@php $total += $totalVoucher; @endphp
';
Remaining |
{{$totalVoucher }} |
@endif
@if(isset($transactions))
Other Payables
# |
Name |
Account |
Amount |
Payment |
Remaining |
@php
$totalOther = 0;
@endphp
@foreach($transactions as $row)
@php
$account = App\Models\ChartofAccount::where('id', $row->account_id)->first();
$totalAmount = 0;
$totalPayment = 0;
$totalAmount += $row->amount;
$totalPayment += $row->payment;
$totalOther += $row->amount - $row->payment;
@endphp
{{++$loop->index}} |
{{$row->title}} |
{{$account->name}} |
{{$row->amount}} |
{{$row->payment}} |
{{$row->amount - $row->payment}} |
@endforeach
@php $total += $totalOther; @endphp
';
Remaining |
{{$totalOther }} |
';
Total Remaining |
{{round($total) }} |
@endif
@endsection
@section('script')
@endsection