@extends('layouts.master') @section('title', 'Receive-Payment') @section('page-header') Receive-Payment @stop @push('style') @endpush @section('content')
@include('partials._alert_message') @php $from = request('from', date('Y-m-d')); $to = request('to', date('Y-m-d')); @endphp

@yield('page-header')

{{-- @include('includes.input-groups.date-field', ['date' => $from, 'is_read_only' => true])--}} {{-- OLD CODE --}} {{-- @include('includes.input-groups.date-range', ['date' => $from, 'is_read_only' => true])--}} {{-- New CODE --}} @php $date1 = isset($from) ? $from : ''; $date2 = isset($to) ? $to : ''; $isReadOnly = isset($is_read_only) ? $is_read_only : false; @endphp
Date {{-- --}}

Receive-Payment Report

@if(request('to') && request('from'))

From : {{ fdate(request('from'), 'd/m/Y') }}

To : {{ fdate(request('to'), 'd/m/Y') }}

{{-- @elseif(fdate(request('to') ?? today(), 'd/m/Y'))--}} {{--

As On {{ fdate(request('to') ?? today(), 'd/m/Y') }}

--}} @endif
@php $totalPayments = 0; $totalReceive = 0; $totalPayments_previous = 0; $totalReceive_previous = 0; $diff_payment = 0; $diff_receive = 0; foreach ($previous_accountGroups as $group) { foreach ($group->accountControls as $control) { foreach ($control->accountSubsidiaries as $subsidiary) { foreach ($subsidiary->accounts as $account) { $totalPayments_previous += $account->payments; $totalReceive_previous += $account->receive; } } } } @endphp @if(($totalReceive_previous >= $totalPayments_previous)) @elseif($totalReceive_previous <= $totalPayments_previous) @endif @foreach($accountGroups as $group) @foreach($group->accountControls as $control) @foreach($control->accountSubsidiaries as $subsidiary) @foreach($subsidiary->accounts->where('account_subsidiary_id','!=',112) as $account) @php $totalPayments += $account->payments; $totalReceive += $account->receive; @endphp @if($account->payments > 0 || $account->receive > 0) @endif @endforeach @endforeach @endforeach @endforeach @php $diff_receive = max($totalReceive - $totalPayments, 0); $diff_payment = max($totalPayments - $totalReceive, 0); @endphp {{-- @if(($totalReceive >= $totalPayments))--}} {{-- @php--}} {{-- $diff_receive = $totalReceive - $totalPayments;--}} {{-- @endphp--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @elseif($totalReceive <= $totalPayments)--}} {{-- @php--}} {{-- $diff_payment = $totalPayments - $totalReceive;--}} {{-- @endphp--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @endif--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}}
Account Code Account Name Receive Payments
Opening CashInHand:
Opening CashAtBank: {{number_format($totalReceive_previous - $totalPayments_previous, 2)}}
Opening CashInHand:
Opening CashAtBank: {{number_format($totalPayments_previous - $totalReceive_previous , 2)}}
{{ $account->account_code ?? '' }} {{ $account->name }} {{ number_format($account->receive, 2) }} {{ number_format($account->payments, 2) }}
Closing CashInHand:
Closing CashAtBank:{{number_format($diff_receive , 2)}}
Closing CashInHand:
Closing CashAtBank:{{number_format($diff_payment,2)}}
Total{{ $totalReceive }}{{ $totalPayments + $diff_receive}}
Closing CashInHand:
Closing CashAtBank: {{ number_format($diff_receive > 0 ? $diff_receive : $diff_payment, 2) }}
Total {{ $totalReceive }} {{ $totalPayments + $diff_receive }}

@endsection @section('js') @endsection