@extends('main') @section('css') @endsection @section('content')

RECEIVE
{{number_format($vars['serviceOrders']?->sum('amount'), 2)}} /=
PAY
{{number_format($vars['serviceOrdersCustomer']?->sum('amount'), 2)}} /=
WALLET
{{number_format($vars['customer']?->wallet?->amount, 2)}} /=
DISCOUNT INFO
{{number_format($vars['customer']?->discounts?->sum('amount'), 2)}} /=
@if(isset($vars['serviceOrders']) && $vars['serviceOrders']?->count() > 0)

Company Payment

@foreach ($vars['serviceOrders'] as $row) @include('payments.renders.service_tr') @endforeach
Date Of Service Name Amount Discount Paid Amount Due Amount Payment
@endif @if(isset($vars['serviceOrdersCustomer']) && $vars['serviceOrdersCustomer']->count() > 0)

Customer Payment

@foreach ($vars['serviceOrdersCustomer'] as $row) @include('payments.renders.service_to_pay_tr') @endforeach
Date Of Service Name Amount Discount Paid Amount Due Amount Payment
@endif
@if(isset($vars['serviceOrder']))
@csrf
@isset($vars['wallet_id']) @endisset
@include('reusable.inputText', ["colDiv" =>'col-md-3', 'label' =>' Reference', 'className'=>'reference', "name" =>'reference','inputType'=>'text',"required" =>'required']) @include('reusable.inputText', ["colDiv" =>'col-md-3', 'label' =>' Amount', 'value'=>$vars['amount'], 'className'=>'amount policy_amount', "name" =>'amount',"readonly" => 'readonly', 'inputType'=>'text'])
@else
@csrf
@endif
@if(isset($vars['wallets']) && $vars['wallets']?->count() > 0)

Wallets

@foreach ($vars['wallets'] as $index => $row) @include('payments.renders.wallet_tr') @endforeach
S/N Date Of Service Name Amount Reference Actions
@endif @if($vars['payments']?->count() > 0)

Payments

@php $summation = 0; @endphp @foreach ($vars['payments'] as $index => $row) @php $policy = $row?->belong?->belong; if($row->pay_type == "Cash Out"){ $summation = $summation - $row->amount; }else{$summation = $summation + $row->amount;} @endphp @include('payments.renders.payment_tr') @endforeach
S/N Date Name Policy Reference Status Amount Total
@endif
{{--Modal For the Payment--}} @endsection @section('js') @endsection