@extends('admin.layout.master') @section('title', 'Agent Advance List') @section('custom_style') @endsection @section('content') @include('flash-message')
{{__('obs.agent_advance_list')}}
@if (count($errors) > 0)
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
{{__('obs.invoice')}} {{__('obs.no')}}
{{-- --}}
@if ($agent_advance_lists) @if (count($agent_advance_lists) > 0)

{{__('obs.agent_advance_list')}}

@php $i = 1; $total_amount = 0; $total_refund = 0; $total_advance_adjusted = 0; $total_remaining_amount= 0; @endphp @foreach ($agent_advance_lists as $list) {{-- @dd(resevationHistory(null,null,$list->id)['advance_deduct']->sum('amount')) --}} @php $advance_history = resevationHistory_multi_warehouse(null,null,$list->fd_invoice_id,null); $advance_refund = $advance_history['advance_refund']; $advance_deduct = $advance_history['advance_deduct']; $advance_refund_amount = $advance_refund->sum('amount'); $advance_adjust_amount = $advance_deduct->sum('amount'); $after_refund_advance = $list->amount - $advance_refund_amount; $remaining_amount = $after_refund_advance - $advance_adjust_amount; $total_amount += $list->amount; $total_refund += $advance_refund_amount; $total_advance_adjusted += $advance_adjust_amount; $total_remaining_amount += $remaining_amount; @endphp @endforeach
{{__('obs.sl')}} {{__('obs.agent')}} {{__('obs.received_by')}} {{__('obs.voucher_no')}} {{__('obs.date')}} {{__('obs.method')}} {{__('obs.amount')}} {{__('obs.refund')}} {{__('obs.adjusted_amount')}} {{__('obs.remaining_amount')}} {{__('obs.details')}}
{{$i++}} {{party_name($list->party_id)}} {{user_name($list->created_by)}} {{$list->fd_invoice->invoice_no}} {{$list->date}} {{cash_bank_name($list->ledger_id)}} {{$list->amount}} {{$advance_refund_amount}} {{$advance_adjust_amount}} {{$remaining_amount}} @if($advance_adjust_amount > 0) @endif
{{__('obs.total')}} {{$total_amount}} {{$total_refund}} {{$total_advance_adjusted}} {{$total_remaining_amount}}
@else

{{__('obs.no_data')}}

@endif @endif @endsection @section('script') @endsection