{{-- This is all Customer Page --}} @extends('layouts.vertical', ['title' => 'All Departments']) @push('head-script') @endpush @push('head-scriptTwo') @endpush @section('content')

All Departments

{{-- @can('add-customer') --}} {{-- --}} {{-- @endcan --}}
@if (session('success')) @endif @php $i = 1; @endphp @forelse ($departments as $department) @empty @endforelse
No. Name Status Options
{{ $i++ }} {{ $department->name }} @if ($department->status == 1) Active @else Inactive @endif {{-- Edit Button --}} {{-- Delete Button --}}
@csrf @method('DELETE')
No departments available.
{{-- @foreach ($customers as $item) {{ $loop->iteration }} {{ $item->company }}
{{ $item->contact_person }} @php $amount = 0; $amount1 = 0; $amount2 = 0; $ledger = App\Models\Account\LedgerAccount::where('customer_id', $item->id)->first(); $amount1 = App\Models\Account\Transaction::where('ledger_id', $ledger->id) ->where('type', 1) ->sum('amount'); $amount2 = App\Models\Account\Transaction::where('ledger_id', $ledger->id) ->where('type', 2) ->sum('amount'); $projects = App\Models\Project::where('customer_id', $item->id)->count(); $amount = $amount2 - $amount1; @endphp {{ 'Tsh ' . number_format($amount, 2) }} {{ $item->abbreviation }} {{-- {{ $item->email }} {{ $item->phone }} {{-- {{ $item->address }} - @can('view-customer')
@endcan @can('edit-customer') @endcan @can('delete-customer') @if ($projects == 0) @endif @endcan @endforeach --}}
@include('department.add-department') @endsection