@extends('backend.layouts.master') @section('section-title', 'Supplier') @section('page-title', 'Supplier List') @if (check_permission('supplier.store')) @section('action-button') Add Supplier @endsection @endif @section('content')
@php $supliers = App\Models\Supplier::get(); @endphp
Reset Print
@php $total_amount = 0; $total_paid = 0; $total_due = 0; $personal_balance = 0; $total_count = 0; @endphp @forelse($suppliers as $data) @php $count_sup = App\Models\Purchase::where('supplier_id', $data->id)->count(); $count_tra = App\Models\Transaction::where('supplier_id', $data->id)->count(); $open_balance = open_balance_supplier( $data->id, $data->due_amount, $data->advance_amount, ); $pur_total = App\Models\Purchase::where('supplier_id', $data->id)->sum( 'total_amount', ); $pur_paid = App\Models\Purchase::where('supplier_id', $data->id)->sum( 'total_paid', ); $pur_due = App\Models\Purchase::where('supplier_id', $data->id)->sum( 'total_due', ); $total_amount += $pur_total; $total_paid += $pur_paid; $total_due += $pur_due; $personal_balance += $open_balance; @endphp {{-- edit modal --}} @csrf @method('PUT') @if (auth()->user()->branch_id == 1) @foreach ($allBranch as $branch) @endforeach @endif {{-- delete modal --}} @csrf @method('DELETE') @empty @endforelse
#SL Name & Email & Phone Branch Total Purchase Purchase Paid Purchase Due Personal Balance Action
{{ $loop->index + 1 }} {{ $data->name }}
{{ $data->phone }}
{{ $data->email == null ? 'NULL' : $data->email }}
{{ $data->branch?->name }} {{ $pur_total }} {{ empty(get_setting('com_currency')) ?: get_setting('com_currency') }} {{ $pur_paid }} {{ empty(get_setting('com_currency')) ?: get_setting('com_currency') }} {{ $pur_due }} {{ empty(get_setting('com_currency')) ?: get_setting('com_currency') }} {{ $open_balance }} {{ empty(get_setting('com_currency')) ?: get_setting('com_currency') }}
No Data Available
Total({{ count($suppliers) }}): {{ number_format($total_amount, 2) }}{{ empty(get_setting('com_currency')) ?: get_setting('com_currency') }} {{ number_format($total_paid, 2) }}{{ empty(get_setting('com_currency')) ?: get_setting('com_currency') }} {{ number_format($total_due, 2) }}{{ empty(get_setting('com_currency')) ?: get_setting('com_currency') }} {{ number_format($personal_balance, 2) }}{{ empty(get_setting('com_currency')) ?: get_setting('com_currency') }}
{{ $suppliers->onEachSide(1)->links() }}
{{-- Add Modal --}}
@csrf @if (auth()->user()->branch_id == 1) @foreach ($allBranch as $data) @endforeach @endif
@endsection