@extends('layouts/contentLayoutMaster') @section('title', 'Edit General Expense') @section('vendor-style') @endsection @section('content')
@if ($users->contains('_id', auth()->user()->_id) || optional($aoBankAccount)->area_acc_officer === auth()->user()->_id || optional($pettyCashWallet)->user_id === auth()->user()->_id)

Account Balances

@php $bankBalance = $aoBankAccount ? "{$aoBankAccount->bank_acc_title} (Balance: " . ($aoBankAccount->amount ?? 0) . ")" : null; $pettyCashBalance = $pettyCashWallet ? "{$pettyCashWallet->title} (Balance: " . ($pettyCashWallet->amount ?? 0) . ")" : null; @endphp
Bank Balance {{$bankBalance ?? ''}} @if(empty($aoBankAccount)) No record added for bank account. @endif
Petty Cash Balance {{ $pettyCashBalance ?? ''}} @if(empty($pettyCashWallet)) No record added for petty cash. @endif
@endif

Edit General Expense

@if ($message = Session::get('success'))
@endif @if ($errorMessage = Session::get('errorMessage'))
@endif
@csrf @method('PUT')
@error('exp_date') {{ $message }} @enderror
@error('expense_category_id') {{ $message }} @enderror
{{-- @if($generalExpense->level_of_expense == 'mcc') --}}
@error('collection_point_id') {{ $message }} @enderror
{{-- @endif --}}
{{-- onchange="showPettyCashDropdown()" --}} @error('type') {{ $message }} @enderror
@error('bank_id') {{ $message }} @enderror
@error('petty_cash_wallet_id') {{ $message }} @enderror
@error('amount') {{ $message }} @enderror
@error('remarks') {{ $message }} @enderror
Add
{{-- --}} @php $count = count($genExpenseBatch); $totalAmount = 0 @endphp @foreach ($genExpenseBatch as $key => $batch) {{$totalAmount += $batch->amount}} {{-- --}} @endforeach
S.NO.Expense Date Expense Category Level Of Expense Area Office Collection Point Expense From Bank Petty Cash Wallet Amount Remarks Action
{{ $key + 1 }}{{ $batch->exp_date }} {{ $batch->expenseCategory ? $batch->expenseCategory->category_name : 'N/A' }} {{ $batch->level_of_expense == 'area_office' ? 'Area Office' : 'Collection Point'}} {{ $batch->areaOffice ? $batch->areaOffice->ao_name : 'N/A' }} {{ $batch->collectionPoint ? $batch->collectionPoint->name : 'N/A' }} {{ $batch->type == 'bank' ? 'Bank' : 'Petty Cash' }} {{ $batch->bankAccount ? $batch->bankAccount->bank_acc_title : 'N/A' }} {{ $batch->pettyCashWallet ? $batch->pettyCashWallet->title : 'N/A' }} {{ $batch->amount }} {{ $batch->remarks }}
No Data Found
Save as Draft
Total Amount: {{ $totalAmount }}
{{-- Cancel --}}
@error('file') {{ $message }} @enderror

@if (isset($generalExpense->file_url)) @php $fileUrl = $generalExpense->file_url; $fileExtension = pathinfo($fileUrl, PATHINFO_EXTENSION); @endphp @if (in_array($fileExtension, ['jpeg', 'jpg', 'png'])) @elseif ($fileExtension === 'pdf') View Existing PDF @endif @endif
@endsection @section('vendor-script') @endsection @section('page-script') @endsection