added generate reports
This commit is contained in:
@@ -11,13 +11,139 @@ use App\Models\FormEntertaimentPresentation;
|
|||||||
use App\Models\FormMeetingSeminar;
|
use App\Models\FormMeetingSeminar;
|
||||||
use App\Models\FormVehicleRunningCost;
|
use App\Models\FormVehicleRunningCost;
|
||||||
use App\Models\FormOthers;
|
use App\Models\FormOthers;
|
||||||
|
use App\Models\UserHasCabang;
|
||||||
|
use App\Models\Cabang;
|
||||||
|
|
||||||
class ReportController extends Controller
|
class ReportController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return view('backend.pages.report.index', [
|
$role = auth()->user()->getRoleNames()[0];
|
||||||
|
$cabangs = [];
|
||||||
|
$forms = [];
|
||||||
|
|
||||||
|
if ($role == 'Admin Region' || $role == 'Marketing Operational Manager Region') {
|
||||||
|
$region_id = auth()->user()->getMyCabangAndRegionId()['region'];
|
||||||
|
|
||||||
|
if ($region_id) {
|
||||||
|
$users = UserHasCabang::whereHas('cabang', function ($query) use ($region_id) {
|
||||||
|
$query->where('region_id', $region_id);
|
||||||
|
})->get();
|
||||||
|
|
||||||
|
$userIds = $users->pluck('user_id')->toArray();
|
||||||
|
|
||||||
|
$cabangs = Cabang::where('region_id', $region_id)->get();
|
||||||
|
$forms = [
|
||||||
|
'form_up_country' => FormUpCountry::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_entertainment_presentation' => FormEntertaimentPresentation::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_vehicle_running_cost' => FormVehicleRunningCost::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_others' => FormOthers::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_meeting_seminar' => FormMeetingSeminar::whereIn('user_id', $userIds)->get(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
} else if ($role == 'Area Manager Cabang') {
|
||||||
|
$cabang_id = auth()->user()->getMyCabangAndRegionId()['cabang'];
|
||||||
|
|
||||||
|
if ($cabang_id) {
|
||||||
|
$users = UserHasCabang::where('cabang_id', $cabang_id)->get();
|
||||||
|
$userIds = $users->pluck('user_id')->toArray();
|
||||||
|
|
||||||
|
$cabangs = Cabang::where('id', $cabang_id)->get();
|
||||||
|
$forms = [
|
||||||
|
'form_up_country' => FormUpCountry::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_entertainment_presentation' => FormEntertaimentPresentation::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_vehicle_running_cost' => FormVehicleRunningCost::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_others' => FormOthers::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_meeting_seminar' => FormMeetingSeminar::whereIn('user_id', $userIds)->get(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
} else if ($role == 'Medical Representatif') {
|
||||||
|
$userId = auth()->user()->id;
|
||||||
|
|
||||||
|
$cabangs = null;
|
||||||
|
$forms = [
|
||||||
|
'form_up_country' => FormUpCountry::where('user_id', $userId)->get(),
|
||||||
|
'form_entertainment_presentation' => FormEntertaimentPresentation::where('user_id', $userId)->get(),
|
||||||
|
'form_vehicle_running_cost' => FormVehicleRunningCost::where('user_id', $userId)->get(),
|
||||||
|
'form_others' => FormOthers::where('user_id', $userId)->get(),
|
||||||
|
'form_meeting_seminar' => FormMeetingSeminar::where('user_id', $userId)->get(),
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$cabangs = Cabang::all();
|
||||||
|
$forms = [
|
||||||
|
'form_up_country' => FormUpCountry::all(),
|
||||||
|
'form_entertainment_presentation' => FormEntertaimentPresentation::all(),
|
||||||
|
'form_vehicle_running_cost' => FormVehicleRunningCost::all(),
|
||||||
|
'form_others' => FormOthers::all(),
|
||||||
|
'form_meeting_seminar' => FormMeetingSeminar::all(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// get all params in url
|
||||||
|
$params = request()->all();
|
||||||
|
|
||||||
|
if($params) {
|
||||||
|
if ($params['cabang']) {
|
||||||
|
$cabang = Cabang::where('code', $params['cabang'])->first();
|
||||||
|
$users = UserHasCabang::where('cabang_id', $cabang->id)->get();
|
||||||
|
$userIds = $users->pluck('user_id')->toArray();
|
||||||
|
|
||||||
|
$forms = [
|
||||||
|
'form_up_country' => FormUpCountry::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_entertainment_presentation' => FormEntertaimentPresentation::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_vehicle_running_cost' => FormVehicleRunningCost::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_others' => FormOthers::whereIn('user_id', $userIds)->get(),
|
||||||
|
'form_meeting_seminar' => FormMeetingSeminar::whereIn('user_id', $userIds)->get(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if($params['start_date'] && $params['end_date']) {
|
||||||
|
$forms = [
|
||||||
|
'form_up_country' => FormUpCountry::whereBetween('tanggal', [$params['start_date'], $params['end_date']])->get(),
|
||||||
|
'form_entertainment_presentation' => FormEntertaimentPresentation::whereBetween('tanggal', [$params['start_date'], $params['end_date']])->get(),
|
||||||
|
'form_vehicle_running_cost' => FormVehicleRunningCost::whereBetween('tanggal', [$params['start_date'], $params['end_date']])->get(),
|
||||||
|
'form_others' => FormOthers::whereBetween('tanggal', [$params['start_date'], $params['end_date']])->get(),
|
||||||
|
'form_meeting_seminar' => FormMeetingSeminar::whereBetween('created_at', [$params['start_date'], $params['end_date']])->get(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if($params['start_date'] && !$params['end_date']) {
|
||||||
|
$forms = [
|
||||||
|
'form_up_country' => FormUpCountry::where('tanggal', $params['start_date'])->get(),
|
||||||
|
'form_entertainment_presentation' => FormEntertaimentPresentation::where('tanggal', $params['start_date'])->get(),
|
||||||
|
'form_vehicle_running_cost' => FormVehicleRunningCost::where('tanggal', $params['start_date'])->get(),
|
||||||
|
'form_others' => FormOthers::where('tanggal', $params['start_date'])->get(),
|
||||||
|
'form_meeting_seminar' => FormMeetingSeminar::where('created_at', $params['start_date'])->get(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$params['start_date'] && $params['end_date']) {
|
||||||
|
$forms = [
|
||||||
|
'form_up_country' => FormUpCountry::where('tanggal', $params['end_date'])->get(),
|
||||||
|
'form_entertainment_presentation' => FormEntertaimentPresentation::where('tanggal', $params['end_date'])->get(),
|
||||||
|
'form_vehicle_running_cost' => FormVehicleRunningCost::where('tanggal', $params['end_date'])->get(),
|
||||||
|
'form_others' => FormOthers::where('tanggal', $params['end_date'])->get(),
|
||||||
|
'form_meeting_seminar' => FormMeetingSeminar::where('created_at', $params['end_date'])->get(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if($params['status']) {
|
||||||
|
$forms = [
|
||||||
|
'form_up_country' => FormUpCountry::where('status', $params['status'])->get(),
|
||||||
|
'form_entertainment_presentation' => FormEntertaimentPresentation::where('status', $params['status'])->get(),
|
||||||
|
'form_vehicle_running_cost' => FormVehicleRunningCost::where('status', $params['status'])->get(),
|
||||||
|
'form_others' => FormOthers::where('status', $params['status'])->get(),
|
||||||
|
'form_meeting_seminar' => FormMeetingSeminar::where('status', $params['status'])->get(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('backend.pages.report.index', [
|
||||||
|
'pageInfo' => [
|
||||||
|
'title' => 'Generate Reports',
|
||||||
|
],
|
||||||
|
'forms' => $forms,
|
||||||
|
'cabang' => $cabangs
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 mt-5">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h4 class="header-title float-left">{{ $pageInfo['title'] }}</h4>
|
<h4 class="header-title float-left">{{ $pageInfo['title'] }}</h4>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
|
|
||||||
@section('title')
|
@section('title')
|
||||||
Dashboard
|
{{ $pageInfo['title'] }}
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('admin-content')
|
@section('admin-content')
|
||||||
@@ -9,113 +9,135 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<h1>Active Budgets</h1>
|
<h1>{{ $pageInfo['title'] }}</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<ol class="breadcrumb float-sm-right">
|
<ol class="breadcrumb float-sm-right">
|
||||||
<li class="breadcrumb-item"><a href="{{ route('dashboard.index') }}">Dashboard</a></li>
|
<li class="breadcrumb-form"><a href="{{ route('admin.dashboard') }}">{{ __('Dashboard') }}</a> / </li>
|
||||||
</li>
|
<li class="breadcrumb-form active"> {{ $pageInfo['title'] }}</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="row mt-4">
|
||||||
</section>
|
<div class="col-md-12">
|
||||||
<section class="content">
|
<div class="card">
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-4 col-6">
|
|
||||||
<div class="small-box bg-info">
|
|
||||||
<div class="inner">
|
|
||||||
<h3>Rp {{ number_format(2000000, 0, ',', '.') }}</h3>
|
|
||||||
<p>Total Budget Bulan Ini</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="fas fa-wallet"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-4 col-6">
|
|
||||||
<div class="small-box bg-success">
|
|
||||||
<div class="inner">
|
|
||||||
<h3>Rp {{ number_format(2000000, 0, ',', '.') }}</h3>
|
|
||||||
<p>Total Budget Tersedia</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="fas fa-check-circle"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-4 col-6">
|
|
||||||
<div class="small-box bg-danger">
|
|
||||||
<div class="inner">
|
|
||||||
<h3 class="text-white">Rp {{ number_format(2000000, 0, ',', '.') }}</h3>
|
|
||||||
<p class="text-white">Total Budget Terpakai</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="fas fa-times"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="content">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="card card-primary card-outline">
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h4 class="header-title float-left">Current Active Budget</h4>
|
<form action="{{ route('reports') }}" method="GET">
|
||||||
<div class="clearfix"></div>
|
<div class="d-flex">
|
||||||
<div class="dataTables_wrapper dt-bootstrap4 mt-2">
|
<div class="col-md-3">
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<label for="cabang">Pilih Cabang</label>
|
||||||
|
<select name="cabang" id="cabang" class="form-control">
|
||||||
|
<option value="">Semua Cabang</option>
|
||||||
|
@foreach ($cabang as $cabang)
|
||||||
|
<option value="{{ $cabang->code }}" {{ request()->cabang == $cabang->code ? 'selected' : '' }}>
|
||||||
|
{{ $cabang->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<label for="status">Start Date</label>
|
||||||
|
<input type="date" name="start_date" class="form-control" value="{{ request()->start_date }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<label for="status">End Date</label>
|
||||||
|
<input type="date" name="end_date" class="form-control" value="{{ request()->end_date }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<label for="status">Status</label>
|
||||||
|
<select name="status" id="status" class="form-control">
|
||||||
|
<option value="">Semua Status</option>
|
||||||
|
<option value="On Progress" {{ request()->status == 'On Progress' ? 'selected' : '' }}>On Progress</option>
|
||||||
|
<option value="Approved" {{ request()->status == 'Approved' ? 'selected' : '' }}>Approved</option>
|
||||||
|
<option value="Closed" {{ request()->status == 'Closed' ? 'selected' : '' }}>Closed</option>
|
||||||
|
<option value="Rejected" {{ request()->status == 'Rejected' ? 'selected' : '' }}>Rejected</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{-- submit button --}}
|
||||||
|
<div class="form-group">
|
||||||
|
<button type="submit" class="btn btn-primary">Filter</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
@php
|
||||||
|
use App\Helpers\NextCloudHelper;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<!-- Form Up Country Table -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="header-title">Form Up Country</h4>
|
||||||
|
<div class="data-tables">
|
||||||
@include('backend.layouts.partials.messages')
|
@include('backend.layouts.partials.messages')
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table id="dataTable"
|
<table id="dataTable-form_up_country">
|
||||||
class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
|
|
||||||
style="width:100%">
|
|
||||||
<thead class="bg-light text-capitalize">
|
<thead class="bg-light text-capitalize">
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Penerima</th>
|
<th>No Expense</th>
|
||||||
|
<th>Nama</th>
|
||||||
<th>Cabang</th>
|
<th>Cabang</th>
|
||||||
<th>Pengirim</th>
|
<th>Rayon</th>
|
||||||
|
<th>Tanggal</th>
|
||||||
|
<th>Tujuan</th>
|
||||||
|
<th>Jarak</th>
|
||||||
<th>Total</th>
|
<th>Total</th>
|
||||||
<th>Keterangan</th>
|
<th>Total Approved</th>
|
||||||
<th>Periode</th>
|
<th>Account Number</th>
|
||||||
<th>Tanggal Closing</th>
|
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Aksi</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach ($data as $item)
|
@foreach ($forms['form_up_country'] as $index => $item)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $loop->iteration }}</td>
|
<td>{{ $loop->iteration }}</td>
|
||||||
<td>{{ $item->receiver->name }}</td>
|
<td>{{ $item->expense_number }}</td>
|
||||||
<td>{{ $item->cabang->name }}</td>
|
<td>{{ $item->user->name }}</td>
|
||||||
<td>{{ $item->sender->name }}</td>
|
<td>{{ $item->user->cabang->cabang->name }}</td>
|
||||||
<td>{{ number_format($item->amount, 0, ',', '.') }}</td>
|
<td>{{ $item->rayon->code }}</td>
|
||||||
<td>{{ $item->remarks }}</td>
|
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('D MMMM Y') }}</td>
|
||||||
<td>{{ strtoupper($item->periode_month) }} {{ $item->periode_year }}</td>
|
<td>{{ $item->tujuan }}</td>
|
||||||
<td>{{ \Carbon\Carbon::parse($item->closing_at)->locale('id')->isoFormat('D MMMM Y H:mm') }}</td>
|
<td>{{ $item->jarak }} km</td>
|
||||||
|
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
|
||||||
<td>
|
<td>
|
||||||
@if ($item->status == 'Unassigned')
|
@if ($item->approved_total)
|
||||||
|
{{ number_format($item->approved_total, 0, ',', '.') }}
|
||||||
|
@else
|
||||||
|
-
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>{{ $item->account_number }}</td>
|
||||||
|
<td>
|
||||||
|
@if ($item->status == 'On Progress')
|
||||||
<span class="badge badge-warning text-white">{{ $item->status }}</span>
|
<span class="badge badge-warning text-white">{{ $item->status }}</span>
|
||||||
@elseif ($item->status == 'Assigned')
|
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
|
||||||
<span class="badge badge-success text-white">{{ $item->status }}</span>
|
<span class="badge badge-success text-white">{{ $item->status }}</span>
|
||||||
@else
|
@else
|
||||||
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
@if (auth()->user()->can('budget_control.delete'))
|
|
||||||
<form action="{{ route('budget_control.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
|
||||||
@csrf
|
|
||||||
@method('DELETE')
|
|
||||||
<button type="submit" class="btn btn-danger btn-sm">
|
|
||||||
<i class="fas fa-trash"></i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -125,19 +147,306 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Form Vehicle Running Cost Table -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="header-title">Form Vehicle Running Cost</h4>
|
||||||
|
<div class="data-tables">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table id="dataTable-form_vehicle_running_cost">
|
||||||
|
<thead class="bg-light text-capitalize">
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Nama</th>
|
||||||
|
<th>Cabang</th>
|
||||||
|
<th>Tanggal</th>
|
||||||
|
<th>Liter</th>
|
||||||
|
<th>Total</th>
|
||||||
|
<th>Total Approved</th>
|
||||||
|
<th>Jarak</th>
|
||||||
|
<th>Tipe Bensin</th>
|
||||||
|
<th>Nomor Polisi</th>
|
||||||
|
<th>Bukti</th>
|
||||||
|
<th>Account Number</th>
|
||||||
|
<th>Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach ($forms['form_vehicle_running_cost'] as $index => $item)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $loop->iteration }}</td>
|
||||||
|
<td>{{ $item->user->name }}</td>
|
||||||
|
<td>{{ $item->user->cabang->cabang->name }}</td>
|
||||||
|
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('dddd, D MMMM Y HH:mm:ss') }}</td>
|
||||||
|
<td>{{ $item->liter }}</td>
|
||||||
|
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
|
||||||
|
<td>{{ number_format($item->approved_total, 0, ',', '.') }}</td>
|
||||||
|
<td>{{ $item->jarak }} km</td>
|
||||||
|
<td>{{ $item->tipe_bensin }}</td>
|
||||||
|
<td>{{ $item->nopol }}</td>
|
||||||
|
<td>
|
||||||
|
@if ($item->bukti_total)
|
||||||
|
<a href="{{ NextCloudHelper::getFileUrl($item->bukti_total) }}" target="_blank">
|
||||||
|
Download
|
||||||
|
</a>
|
||||||
|
@else
|
||||||
|
-
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>{{ $item->account_number }}</td>
|
||||||
|
<td>
|
||||||
|
@if ($item->status == 'On Progress')
|
||||||
|
<span class="badge badge-warning text-white">{{ $item->status }}</span>
|
||||||
|
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
|
||||||
|
<span class="badge badge-success text-white">{{ $item->status }}</span>
|
||||||
|
@else
|
||||||
|
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Form Entertainment Presentation Table -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="header-title">Form Entertainment Presentation</h4>
|
||||||
|
<div class="data-tables">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table id="dataTable-form_entertainment_presentation">
|
||||||
|
<thead class="bg-light text-capitalize">
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>User</th>
|
||||||
|
<th>Cabang</th>
|
||||||
|
<th>Nama Penerima</th>
|
||||||
|
<th>Tanggal</th>
|
||||||
|
<th>Jenis</th>
|
||||||
|
<th>Keterangan</th>
|
||||||
|
<th>Total</th>
|
||||||
|
<th>Total Approved</th>
|
||||||
|
<th>Bukti</th>
|
||||||
|
<th>Account Number</th>
|
||||||
|
<th>Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach ($forms['form_entertainment_presentation'] as $index => $item)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $loop->iteration }}</td>
|
||||||
|
<td>{{ $item->user->name }}</td>
|
||||||
|
<td>{{ $item->user->cabang->cabang->name }}</td>
|
||||||
|
<td>{{ $item->name }}</td>
|
||||||
|
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('D MMMM Y') }}</td>
|
||||||
|
<td>{{ $item->jenis }}</td>
|
||||||
|
<td>{{ $item->keterangan }}</td>
|
||||||
|
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
|
||||||
|
<td>{{ number_format($item->approved_total, 0, ',', '.') }}</td>
|
||||||
|
<td>
|
||||||
|
@if ($item->bukti_total)
|
||||||
|
<a href="{{ NextCloudHelper::getFileUrl($item->bukti_total) }}" target="_blank">
|
||||||
|
Download
|
||||||
|
</a>
|
||||||
|
@else
|
||||||
|
-
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>{{ $item->account_number }}</td>
|
||||||
|
<td>
|
||||||
|
@if ($item->status == 'On Progress')
|
||||||
|
<span class="badge badge-warning text-white">{{ $item->status }}</span>
|
||||||
|
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
|
||||||
|
<span class="badge badge-success text-white">{{ $item->status }}</span>
|
||||||
|
@else
|
||||||
|
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Form Meeting Seminar Table -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="header-title">Form Meeting Seminar</h4>
|
||||||
|
<div class="data-tables">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table id="dataTable-form_meeting_seminar">
|
||||||
|
<thead class="bg-light text-capitalize">
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>No Expense</th>
|
||||||
|
<th>Nama</th>
|
||||||
|
<th>Cabang</th>
|
||||||
|
<th>Tanggal</th>
|
||||||
|
<th>Allowance</th>
|
||||||
|
<th>Transport Ankot</th>
|
||||||
|
<th>Hotel</th>
|
||||||
|
<th>Total</th>
|
||||||
|
<th>Total Approved</th>
|
||||||
|
<th>Account Number</th>
|
||||||
|
<th>Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach ($forms['form_meeting_seminar'] as $index => $item)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $loop->iteration }}</td>
|
||||||
|
<td>{{ $item->expense_number }}</td>
|
||||||
|
<td>{{ $item->user->name }}</td>
|
||||||
|
<td>{{ $item->user->cabang->cabang->name }}</td>
|
||||||
|
<td>{{ \Carbon\Carbon::parse($item->created_at)->locale('id')->isoFormat('D MMMM Y') }}</td>
|
||||||
|
<td>{{ number_format($item->allowance, 0, ',', '.') }}</td>
|
||||||
|
<td>{{ number_format($item->transport_ankot, 0, ',', '.') }}</td>
|
||||||
|
<td>{{ number_format($item->hotel, 0, ',', '.') }}</td>
|
||||||
|
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
|
||||||
|
<td>{{ number_format($item->approved_total, 0, ',', '.') }}</td>
|
||||||
|
<td>{{ $item->account_number }}</td>
|
||||||
|
<td>
|
||||||
|
@if ($item->status == 'On Progress')
|
||||||
|
<span class="badge badge-warning text-white">{{ $item->status }}</span>
|
||||||
|
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
|
||||||
|
<span class="badge badge-success text-white">{{ $item->status }}</span>
|
||||||
|
@else
|
||||||
|
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Form Others Table -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="header-title">Form Others</h4>
|
||||||
|
<div class="data-tables">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table id="dataTable-form_others">
|
||||||
|
<thead class="bg-light text-capitalize">
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Nama</th>
|
||||||
|
<th>Cabang</th>
|
||||||
|
<th>Tanggal</th>
|
||||||
|
<th>Jenis</th>
|
||||||
|
<th>Keterangan</th>
|
||||||
|
<th>Total</th>
|
||||||
|
<th>Bukti Total</th>
|
||||||
|
<th>Account Number</th>
|
||||||
|
<th>Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach ($forms['form_others'] as $index => $item)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $loop->iteration }}</td>
|
||||||
|
<td>{{ $item->user->name }}</td>
|
||||||
|
<td>{{ $item->user->cabang->cabang->name }}</td>
|
||||||
|
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('D MMMM Y') }}</td>
|
||||||
|
<td>{{ $item->kategori->name }}</td>
|
||||||
|
<td>{{ $item->keterangan }}</td>
|
||||||
|
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
|
||||||
|
<td>
|
||||||
|
@if ($item->bukti_total)
|
||||||
|
<a href="{{ NextCloudHelper::getFileUrl($item->bukti_total) }}" target="_blank">
|
||||||
|
Download
|
||||||
|
</a>
|
||||||
|
@else
|
||||||
|
-
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>{{ $item->account_number }}</td>
|
||||||
|
<td>
|
||||||
|
@if ($item->status == 'On Progress')
|
||||||
|
<span class="badge badge-warning text-white">{{ $item->status }}</span>
|
||||||
|
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
|
||||||
|
<span class="badge badge-success text-white">{{ $item->status }}</span>
|
||||||
|
@else
|
||||||
|
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('scripts')
|
@section('scripts')
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
// Initialize DataTables for each table
|
||||||
if ($('#dataTable').length) {
|
if ($('#dataTable-form_up_country').length) {
|
||||||
$('#dataTable').DataTable({
|
$('#dataTable-form_up_country').DataTable({
|
||||||
responsive: false,
|
responsive: false,
|
||||||
dom: 'Bfrtip',
|
dom: 'Bfrtip',
|
||||||
buttons: ['excel', 'pdf', 'print']
|
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if ($('#dataTable-form_vehicle_running_cost').length) {
|
||||||
|
$('#dataTable-form_vehicle_running_cost').DataTable({
|
||||||
|
responsive: false,
|
||||||
|
dom: 'Bfrtip',
|
||||||
|
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
if ($('#dataTable-form_entertainment_presentation').length) {
|
||||||
|
$('#dataTable-form_entertainment_presentation').DataTable({
|
||||||
|
responsive: false,
|
||||||
|
dom: 'Bfrtip',
|
||||||
|
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if ($('#dataTable-form_meeting_seminar').length) {
|
||||||
|
$('#dataTable-form_meeting_seminar').DataTable({
|
||||||
|
responsive: false,
|
||||||
|
dom: 'Bfrtip',
|
||||||
|
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if ($('#dataTable-form_others').length) {
|
||||||
|
$('#dataTable-form_others').DataTable({
|
||||||
|
responsive: false,
|
||||||
|
dom: 'Bfrtip',
|
||||||
|
buttons: ['excel', 'pdf', 'print', 'colvis'],
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
Reference in New Issue
Block a user