fix some revisi
This commit is contained in:
@@ -181,6 +181,82 @@ class FormHelper
|
||||
});
|
||||
}
|
||||
|
||||
public static function getAllForms2() {
|
||||
// Get all users with eager loading for 'region' and 'cabang'
|
||||
$users = Admin::with(['region', 'cabang'])
|
||||
->get();
|
||||
|
||||
$formUpCountryQuery = FormUpCountry::select(
|
||||
'expense_number',
|
||||
'user_id',
|
||||
'total',
|
||||
'approved_total',
|
||||
'status',
|
||||
'account_number',
|
||||
'created_at',
|
||||
DB::raw("'Up Country' as type")
|
||||
);
|
||||
|
||||
$formVehicleRunningCostQuery = FormVehicleRunningCost::select(
|
||||
'expense_number',
|
||||
'user_id',
|
||||
'total',
|
||||
'approved_total',
|
||||
'status',
|
||||
'account_number',
|
||||
'created_at',
|
||||
DB::raw("'Vehicle Running Cost' as type")
|
||||
);
|
||||
|
||||
$formEntertaimentPresentationQuery = FormEntertaimentPresentation::select(
|
||||
'expense_number',
|
||||
'user_id',
|
||||
'total',
|
||||
'approved_total',
|
||||
'status',
|
||||
'account_number',
|
||||
'created_at',
|
||||
DB::raw("'Entertainment Presentation' as type")
|
||||
);
|
||||
|
||||
$formMeetingSeminarQuery = FormMeetingSeminar::select(
|
||||
'expense_number',
|
||||
'user_id',
|
||||
'total',
|
||||
'approved_total',
|
||||
'status',
|
||||
'account_number',
|
||||
'created_at',
|
||||
DB::raw("'Meeting Seminar' as type")
|
||||
);
|
||||
|
||||
$formOthersQuery = FormOthers::select(
|
||||
'expense_number',
|
||||
'user_id',
|
||||
'total',
|
||||
'approved_total',
|
||||
'status',
|
||||
'account_number',
|
||||
'created_at',
|
||||
DB::raw("'Others' as type")
|
||||
);
|
||||
|
||||
// Combine queries using union
|
||||
$forms = $formUpCountryQuery
|
||||
->union($formVehicleRunningCostQuery)
|
||||
->union($formEntertaimentPresentationQuery)
|
||||
->union($formMeetingSeminarQuery)
|
||||
->union($formOthersQuery)
|
||||
->get();
|
||||
|
||||
// Map users to the forms with eager loaded data
|
||||
return $forms->map(function ($form) use ($users) {
|
||||
$user = $users->firstWhere('id', $form->user_id);
|
||||
$form->user = $user;
|
||||
return $form;
|
||||
});
|
||||
}
|
||||
|
||||
public static function getNominalByFormType($cabang_id, $type, $type_id, $month, $year) {
|
||||
$users = UserHasCabang::where('cabang_id', $cabang_id)->get();
|
||||
$userIds = $users->pluck('user_id')->toArray();
|
||||
|
||||
@@ -104,27 +104,12 @@ class DashboardController extends Controller
|
||||
public function notifications()
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['notification.view']);
|
||||
$role = auth()->user()->getRoleNames()[0];
|
||||
|
||||
// Mulai dengan query dasar
|
||||
$notifications = Notifications::orderBy('created_at', 'desc')
|
||||
->where('receiver_id', auth()->user()->id)
|
||||
->where('is_read', 0);
|
||||
|
||||
// Tambahkan filter berdasarkan role
|
||||
if ($role == 'Admin Region') {
|
||||
$notifications->where('type', 'new_expense');
|
||||
} elseif ($role == 'Marketing Operational Manager Region') {
|
||||
$notifications->where('type', 'approve2_expense');
|
||||
} elseif ($role == 'Area Manager Cabang' || $role == 'Marketing Information System') {
|
||||
$notifications->where('type', 'approve_expense');
|
||||
} elseif ($role == 'Head of Sales Marketing') {
|
||||
$notifications->where('type', 'approve2_expense');
|
||||
} else {
|
||||
// Jika tidak ada role yang sesuai, kembalikan koleksi kosong
|
||||
return response()->json([]);
|
||||
}
|
||||
|
||||
// Ambil data dan kembalikan sebagai JSON
|
||||
return response()->json($notifications->limit(6)->get());
|
||||
}
|
||||
|
||||
@@ -498,7 +498,7 @@ class ReportController extends Controller
|
||||
} else {
|
||||
$cabangs = Cabang::all();
|
||||
$regions = Region::all();
|
||||
$forms = FormHelper::getAllForms($month, $year)->sortByDesc('created_at');
|
||||
$forms = FormHelper::getAllForms2()->sortByDesc('created_at');
|
||||
}
|
||||
|
||||
// get all params in url
|
||||
@@ -565,7 +565,7 @@ class ReportController extends Controller
|
||||
} else {
|
||||
$cabangs = Cabang::all();
|
||||
$regions = Region::all();
|
||||
$forms = FormHelper::getAllForms($month, $year)->sortByDesc('tanggal')->sortByDesc('created_at');
|
||||
$forms = FormHelper::getAllForms($month, $year)->sortByDesc('tanggal')->sortByDesc('created_at');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,30 +114,32 @@ class FormEntertainmentPresentationController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['forms.entertainment.create']);
|
||||
$cabang_id = UserHasCabang::where('user_id', auth()->user()->id)->first()->cabang_id;
|
||||
|
||||
$request->validate([
|
||||
'tanggal' => 'required',
|
||||
'jenis' => 'required|in:entertainment,presentation,sponsorship',
|
||||
'keterangan' => 'required',
|
||||
'total' => 'required|numeric|min:1|max:' . BudgetHelper::getAvailableBudget($cabang_id),
|
||||
'total' => 'required|numeric|min:1',
|
||||
'name' => 'required',
|
||||
'alamat' => 'required',
|
||||
'nik_or_npwp' => 'required',
|
||||
'bukti_total' => ['nullable', 'file', 'max:51200', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
|
||||
]);
|
||||
|
||||
$currentDate = date('Y-m-d');
|
||||
$startDate = date('Y-m-' . env('STARTING_DATE'));
|
||||
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
|
||||
|
||||
if ($currentDate < $startDate || $currentDate > $closingDateNextMonth) {
|
||||
return response()->json([
|
||||
'error' => 'Current date is not within the valid range.'
|
||||
], 400);
|
||||
if ($request->tanggal < $startDate || $request->tanggal > $closingDateNextMonth) {
|
||||
session()->flash('error', 'Gagal, Input expense sudah melewati periode input 12-10');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
|
||||
if($request->total > BudgetHelper::getAvailableBudget($cabang->id)) {
|
||||
session()->flash('error', 'Alokasi budget bulanan cabang tidak mencukupi,silahkan ajukan pada periode expense berikutnya');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$region = Region::where('id', $cabang->region_id)->first();
|
||||
$kategori = Kategori::where('name', 'Entertainment')->first();
|
||||
|
||||
|
||||
@@ -133,9 +133,8 @@ class FormMeetingSeminarController extends Controller
|
||||
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
|
||||
|
||||
if ($currentDate < $startDate || $currentDate > $closingDateNextMonth) {
|
||||
return response()->json([
|
||||
'error' => 'Current date is not within the valid range.'
|
||||
], 400);
|
||||
session()->flash('error', 'Gagal, Input expense sudah melewati periode input 12-10');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
|
||||
@@ -195,9 +194,8 @@ class FormMeetingSeminarController extends Controller
|
||||
];
|
||||
|
||||
// Check if the total nominal exceeds the available budget
|
||||
$cabang_id = UserHasCabang::where('user_id', auth()->user()->id)->first()->cabang_id;
|
||||
if(array_sum($data_nominal) > BudgetHelper::getAvailableBudget($cabang_id)) {
|
||||
session()->flash('error', 'The total nominal exceeds the available budget.');
|
||||
if(array_sum($data_nominal) > BudgetHelper::getAvailableBudget($cabang->id)) {
|
||||
session()->flash('error', 'Alokasi budget bulanan cabang tidak mencukupi,silahkan ajukan pada periode expense berikutnya');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
|
||||
@@ -114,27 +114,29 @@ class FormOtherController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['forms.other.create']);
|
||||
$cabang_id = UserHasCabang::where('user_id', auth()->user()->id)->first()->cabang_id;
|
||||
|
||||
$request->validate([
|
||||
'kategori_id' => 'required',
|
||||
'tanggal' => 'required|date',
|
||||
'keterangan' => 'required',
|
||||
'total' => 'required|numeric|min:1|max:' . BudgetHelper::getAvailableBudget($cabang_id),
|
||||
'total' => 'required|numeric|min:1',
|
||||
'bukti_total' => ['nullable', 'file', 'max:51200', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
|
||||
]);
|
||||
|
||||
$currentDate = date('Y-m-d');
|
||||
$startDate = date('Y-m-' . env('STARTING_DATE'));
|
||||
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
|
||||
|
||||
if ($currentDate < $startDate || $currentDate > $closingDateNextMonth) {
|
||||
return response()->json([
|
||||
'error' => 'Current date is not within the valid range.'
|
||||
], 400);
|
||||
if ($request->tanggal < $startDate || $request->tanggal > $closingDateNextMonth) {
|
||||
session()->flash('error', 'Gagal, Input expense sudah melewati periode input 12-10');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
|
||||
if($request->total > BudgetHelper::getAvailableBudget($cabang->id)) {
|
||||
session()->flash('error', 'Alokasi budget bulanan cabang tidak mencukupi,silahkan ajukan pada periode expense berikutnya');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$region = Region::where('id', $cabang->region_id)->first();
|
||||
$kategori = Kategori::where('id', $request->kategori_id)->first();
|
||||
|
||||
|
||||
@@ -115,9 +115,10 @@ class FormUpCountryController extends Controller
|
||||
public function create()
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['forms.country.create']);
|
||||
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
|
||||
|
||||
return view('backend.pages.forms.upcountry.create', [
|
||||
'rayons' => Rayon::all()
|
||||
'rayons' => Rayon::where('cabang_id', $cabang->id)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -140,14 +141,12 @@ class FormUpCountryController extends Controller
|
||||
'bukti_hotel' => ['nullable', 'file', 'max:51200', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
|
||||
]);
|
||||
|
||||
$currentDate = date('Y-m-d');
|
||||
$startDate = date('Y-m-' . env('STARTING_DATE'));
|
||||
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
|
||||
|
||||
if ($currentDate < $startDate || $currentDate > $closingDateNextMonth) {
|
||||
return response()->json([
|
||||
'error' => 'Current date is not within the valid range.'
|
||||
], 400);
|
||||
if ($request->tanggal < $startDate || $request->tanggal > $closingDateNextMonth) {
|
||||
session()->flash('error', 'Gagal, Input expense sudah melewati periode input 12-10');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
|
||||
@@ -220,9 +219,8 @@ class FormUpCountryController extends Controller
|
||||
];
|
||||
|
||||
// Check if the total nominal exceeds the available budget
|
||||
$cabang_id = UserHasCabang::where('user_id', auth()->user()->id)->first()->cabang_id;
|
||||
if(array_sum($data_nominal) > BudgetHelper::getAvailableBudget($cabang_id)) {
|
||||
session()->flash('error', 'The total nominal exceeds the available budget.');
|
||||
if(array_sum($data_nominal) > BudgetHelper::getAvailableBudget($cabang->id)) {
|
||||
session()->flash('error', 'Alokasi budget bulanan cabang tidak mencukupi,silahkan ajukan pada periode expense berikutnya');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
@@ -307,6 +305,8 @@ class FormUpCountryController extends Controller
|
||||
$this->checkAuthorization(auth()->user(), ['forms.country.edit']);
|
||||
$role = auth()->user()->getRoleNames()[0];
|
||||
|
||||
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
|
||||
|
||||
$form = FormUpCountry::with('rayon')->findOrfail($id);
|
||||
if (($form->status != 'On Progress' && $form->status != 'Rejected') && $role == 'Medical Representatif') {
|
||||
session()->flash('error', 'You cannot edit this form because it has been approved or closed.');
|
||||
@@ -314,7 +314,7 @@ class FormUpCountryController extends Controller
|
||||
}
|
||||
|
||||
return view('backend.pages.forms.upcountry.edit', [
|
||||
'rayons' => Rayon::all(),
|
||||
'rayons' => Rayon::where('cabang_id', $cabang->id)->get(),
|
||||
'form' => $form
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -115,12 +115,11 @@ class FormVehicleController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['forms.vehicle.create']);
|
||||
$cabang_id = UserHasCabang::where('user_id', auth()->user()->id)->first()->cabang_id;
|
||||
|
||||
$request->validate([
|
||||
'tanggal' => 'required',
|
||||
'liter' => 'required',
|
||||
'total' => 'required|numeric|min:1|max:' . BudgetHelper::getAvailableBudget($cabang_id),
|
||||
'total' => 'required|numeric|min:1',
|
||||
'jarak' => 'required',
|
||||
'tipe_bensin' => 'required|in:pertalite,pertamax',
|
||||
'nopol' => 'required',
|
||||
@@ -128,17 +127,20 @@ class FormVehicleController extends Controller
|
||||
'bukti_total' => ['nullable', 'file', 'max:51200', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
|
||||
]);
|
||||
|
||||
$currentDate = date('Y-m-d');
|
||||
$startDate = date('Y-m-' . env('STARTING_DATE'));
|
||||
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
|
||||
|
||||
if ($currentDate < $startDate || $currentDate > $closingDateNextMonth) {
|
||||
return response()->json([
|
||||
'error' => 'Current date is not within the valid range.'
|
||||
], 400);
|
||||
if ($request->tanggal < $startDate || $request->tanggal > $closingDateNextMonth) {
|
||||
session()->flash('error', 'Gagal, Input expense sudah melewati periode input 12-10');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
|
||||
if($request->total > BudgetHelper::getAvailableBudget($cabang->id)) {
|
||||
session()->flash('error', 'Alokasi budget bulanan cabang tidak mencukupi,silahkan ajukan pada periode expense berikutnya');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$region = Region::where('id', $cabang->region_id)->first();
|
||||
$kategori = Kategori::where('name', 'Vehicle Running Cost')->first();
|
||||
|
||||
|
||||
@@ -10,5 +10,5 @@ class Rayon extends Model
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'rayon';
|
||||
protected $fillable = ['code', 'name'];
|
||||
protected $fillable = ['code', 'name', 'cabang_id'];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('rayon', function (Blueprint $table) {
|
||||
$table->foreignId('cabang_id')->nullable()->constrained('cabang')->cascadeOnDelete()->after('id')->default(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('rayon', function (Blueprint $table) {
|
||||
$table->dropForeign(['cabang_id']);
|
||||
$table->dropColumn('cabang_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -109,13 +109,13 @@
|
||||
<th>Bukti</th>
|
||||
<th>Account Number</th>
|
||||
<th>Status</th>
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if (auth()->user()->can('approval.view'))
|
||||
<th>Approval 1</th>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
@if (auth()->user()->can('approval2.view'))
|
||||
<th>Approval 2</th>
|
||||
@endif
|
||||
@if (auth()->user()->can('final_approval.approve'))
|
||||
@if (auth()->user()->can('final_approval.view'))
|
||||
<th>Final Approval</th>
|
||||
@endif
|
||||
<th>Aksi</th>
|
||||
@@ -157,92 +157,87 @@
|
||||
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||
@endif
|
||||
</td>
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if (auth()->user()->can('approval.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'On Progress' || $item->status == 'Rejected')
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.entertainment.approve', $item->id) }}">
|
||||
Approve 1
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.entertainment.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@elseif($item->rejected_at)
|
||||
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'Approved 1' && $item->approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.entertainment.approve2', $item->id) }}">
|
||||
Approve 2
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.entertainment.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->approved2_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@elseif($item->rejected_at)
|
||||
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(auth()->user()->can('final_approval.approve'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm final-approve-modal"
|
||||
data-id="{{ route('forms.entertainment.final-approve', $item->id) }}">
|
||||
Final Approve
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
|
||||
<form action="{{ route('forms.entertainment.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
Open
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if ($item->status == 'On Progress')
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.entertainment.approve', $item->id) }}">
|
||||
Approve 1
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.entertainment.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@elseif ($item->final_approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
@if ($item->status == 'Approved 1' && $item->approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.entertainment.approve2', $item->id) }}">
|
||||
Approve 2
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.entertainment.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved2_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(auth()->user()->can('final_approval.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if(auth()->user()->can('final_approval.approve'))
|
||||
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm final-approve-modal"
|
||||
data-id="{{ route('forms.entertainment.final-approve', $item->id) }}">
|
||||
Final Approve
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
|
||||
<form action="{{ route('forms.entertainment.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
Open
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->final_approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
|
||||
@@ -108,13 +108,13 @@
|
||||
<th>Total Approved</th>
|
||||
<th>Account Number</th>
|
||||
<th>Status</th>
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if (auth()->user()->can('approval.view'))
|
||||
<th>Approval 1</th>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
@if (auth()->user()->can('approval2.view'))
|
||||
<th>Approval 2</th>
|
||||
@endif
|
||||
@if (auth()->user()->can('final_approval.approve'))
|
||||
@if (auth()->user()->can('final_approval.view'))
|
||||
<th>Final Approval</th>
|
||||
@endif
|
||||
<th>Aksi</th>
|
||||
@@ -147,92 +147,87 @@
|
||||
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||
@endif
|
||||
</td>
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if (auth()->user()->can('approval.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'On Progress' || $item->status == 'Rejected')
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.meeting.approve', $item->id) }}">
|
||||
Approve 1
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.meeting.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@elseif($item->rejected_at)
|
||||
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'Approved 1' && $item->approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.meeting.approve2', $item->id) }}">
|
||||
Approve 2
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.meeting.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->approved2_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@elseif($item->rejected_at)
|
||||
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(auth()->user()->can('final_approval.approve'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm final-approve-modal"
|
||||
data-id="{{ route('forms.meeting.final-approve', $item->id) }}">
|
||||
Final Approve
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
|
||||
<form action="{{ route('forms.meeting.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
Open
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if ($item->status == 'On Progress')
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.meeting.approve', $item->id) }}">
|
||||
Approve 1
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.meeting.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@elseif ($item->final_approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
@if ($item->status == 'Approved 1' && $item->approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.meeting.approve2', $item->id) }}">
|
||||
Approve 2
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.meeting.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved2_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(auth()->user()->can('final_approval.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if(auth()->user()->can('final_approval.approve'))
|
||||
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm final-approve-modal"
|
||||
data-id="{{ route('forms.meeting.final-approve', $item->id) }}">
|
||||
Final Approve
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
|
||||
<form action="{{ route('forms.meeting.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
Open
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->final_approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
|
||||
@@ -108,13 +108,13 @@
|
||||
<th>Bukti Total</th>
|
||||
<th>Account Number</th>
|
||||
<th>Status</th>
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if (auth()->user()->can('approval.view'))
|
||||
<th>Approval 1</th>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
@if (auth()->user()->can('approval2.view'))
|
||||
<th>Approval 2</th>
|
||||
@endif
|
||||
@if (auth()->user()->can('final_approval.approve'))
|
||||
@if (auth()->user()->can('final_approval.view'))
|
||||
<th>Final Approval</th>
|
||||
@endif
|
||||
<th>Aksi</th>
|
||||
@@ -155,92 +155,87 @@
|
||||
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||
@endif
|
||||
</td>
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if (auth()->user()->can('approval.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'On Progress' || $item->status == 'Rejected')
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.other.approve', $item->id) }}">
|
||||
Approve 1
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.other.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@elseif($item->rejected_at)
|
||||
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'Approved 1' && $item->approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.other.approve2', $item->id) }}">
|
||||
Approve 2
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.other.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->approved2_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@elseif($item->rejected_at)
|
||||
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(auth()->user()->can('final_approval.approve'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm final-approve-modal"
|
||||
data-id="{{ route('forms.other.final-approve', $item->id) }}">
|
||||
Final Approve
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
|
||||
<form action="{{ route('forms.other.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
Open
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if ($item->status == 'On Progress')
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.other.approve', $item->id) }}">
|
||||
Approve 1
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.other.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@elseif ($item->final_approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
@if ($item->status == 'Approved 1' && $item->approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.other.approve2', $item->id) }}">
|
||||
Approve 2
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.other.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved2_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(auth()->user()->can('final_approval.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if(auth()->user()->can('final_approval.approve'))
|
||||
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm final-approve-modal"
|
||||
data-id="{{ route('forms.other.final-approve', $item->id) }}">
|
||||
Final Approve
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
|
||||
<form action="{{ route('forms.other.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
Open
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->final_approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
|
||||
@@ -108,13 +108,13 @@
|
||||
<th>Total Approved</th>
|
||||
<th>Account Number</th>
|
||||
<th>Status</th>
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if (auth()->user()->can('approval.view'))
|
||||
<th>Approval 1</th>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
@if (auth()->user()->can('approval2.view'))
|
||||
<th>Approval 2</th>
|
||||
@endif
|
||||
@if (auth()->user()->can('final_approval.approve'))
|
||||
@if (auth()->user()->can('final_approval.view'))
|
||||
<th>Final Approval</th>
|
||||
@endif
|
||||
<th>Aksi</th>
|
||||
@@ -153,92 +153,87 @@
|
||||
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||
@endif
|
||||
</td>
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if (auth()->user()->can('approval.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'On Progress' || $item->status == 'Rejected')
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.up-country.approve', $item->id) }}">
|
||||
Approve 1
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.up-country.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@elseif($item->rejected_at)
|
||||
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'Approved 1' && $item->approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.up-country.approve2', $item->id) }}">
|
||||
Approve 2
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.up-country.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->approved2_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@elseif($item->rejected_at)
|
||||
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(auth()->user()->can('final_approval.approve'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm final-approve-modal"
|
||||
data-id="{{ route('forms.up-country.final-approve', $item->id) }}">
|
||||
Final Approve
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
|
||||
<form action="{{ route('forms.up-country.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
Open
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if ($item->status == 'On Progress')
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.up-country.approve', $item->id) }}">
|
||||
Approve 1
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.up-country.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@elseif ($item->final_approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
@if ($item->status == 'Approved 1' && $item->approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.up-country.approve2', $item->id) }}">
|
||||
Approve 2
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.up-country.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved2_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(auth()->user()->can('final_approval.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if(auth()->user()->can('final_approval.approve'))
|
||||
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm final-approve-modal"
|
||||
data-id="{{ route('forms.up-country.final-approve', $item->id) }}">
|
||||
Final Approve
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
|
||||
<form action="{{ route('forms.up-country.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
Open
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->final_approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
|
||||
@@ -110,13 +110,13 @@
|
||||
<th>Bukti</th>
|
||||
<th>Account Number</th>
|
||||
<th>Status</th>
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if (auth()->user()->can('approval.view'))
|
||||
<th>Approval 1</th>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
@if (auth()->user()->can('approval2.view'))
|
||||
<th>Approval 2</th>
|
||||
@endif
|
||||
@if (auth()->user()->can('final_approval.approve'))
|
||||
@if (auth()->user()->can('final_approval.view'))
|
||||
<th>Final Approval</th>
|
||||
@endif
|
||||
<th>Aksi</th>
|
||||
@@ -159,92 +159,87 @@
|
||||
<span class="badge badge-danger text-white">{{ $item->status }}</span>
|
||||
@endif
|
||||
</td>
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if (auth()->user()->can('approval.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'On Progress' || $item->status == 'Rejected')
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.vehicle.approve', $item->id) }}">
|
||||
Approve 1
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.vehicle.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@elseif($item->rejected_at)
|
||||
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'Approved 1' && $item->approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.vehicle.approve2', $item->id) }}">
|
||||
Approve 2
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.vehicle.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->approved2_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@elseif($item->rejected_at)
|
||||
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(auth()->user()->can('final_approval.approve'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm final-approve-modal"
|
||||
data-id="{{ route('forms.vehicle.final-approve', $item->id) }}">
|
||||
Final Approve
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
|
||||
<form action="{{ route('forms.vehicle.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
Open
|
||||
@if (auth()->user()->can('approval.approve'))
|
||||
@if ($item->status == 'On Progress')
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.vehicle.approve', $item->id) }}">
|
||||
Approve 1
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.vehicle.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@elseif ($item->final_approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if (auth()->user()->can('approval2.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if (auth()->user()->can('approval2.approve'))
|
||||
@if ($item->status == 'Approved 1' && $item->approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm open-approve-modal"
|
||||
data-id="{{ route('forms.vehicle.approve2', $item->id) }}">
|
||||
Approve 2
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.vehicle.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved2_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if(auth()->user()->can('final_approval.view'))
|
||||
<td>
|
||||
{{-- approve / reject button --}}
|
||||
@if(auth()->user()->can('final_approval.approve'))
|
||||
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
|
||||
<form action="javascript:void(0);" class="d-inline">
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm final-approve-modal"
|
||||
data-id="{{ route('forms.vehicle.final-approve', $item->id) }}">
|
||||
Final Approve
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
|
||||
<form action="{{ route('forms.vehicle.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
Open
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->final_approved_at)
|
||||
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
|
||||
@@ -149,7 +149,21 @@
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Export Excel',
|
||||
buttons: ['excel', 'csv', 'pdf', 'print', 'colvis'],
|
||||
customize: function (xlsx) {
|
||||
var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
// Add additional information to the Excel sheet
|
||||
var additionalInfo = `
|
||||
Cabang: {{ $cabang->name }}
|
||||
Periode: {{ ucfirst($month) }} {{ $year }}
|
||||
Cost Centre: {{ $cabang->cost->code }}
|
||||
`;
|
||||
var rows = additionalInfo.split('\n').map(function (text) {
|
||||
return `<row><c t="inlineStr"><is><t>${text.trim()}</t></is></c></row>`;
|
||||
}).join('');
|
||||
|
||||
// Inject the additional information at the top of the sheet
|
||||
var data = $(sheet).find('sheetData').prepend(rows);
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'csv',
|
||||
@@ -157,11 +171,10 @@
|
||||
customize: function (csv) {
|
||||
// Add header information to the CSV
|
||||
var additionalInfo = `
|
||||
Cabang: {{ $cabang->name }}
|
||||
Periode: {{ ucfirst($month) }} {{ $year }}
|
||||
Cost Centre: {{ $cabang->cost->code }}
|
||||
|
||||
`;
|
||||
Cabang: {{ $cabang->name }}
|
||||
Periode: {{ ucfirst($month) }} {{ $year }}
|
||||
Cost Centre: {{ $cabang->cost->code }}
|
||||
`;
|
||||
return additionalInfo + csv;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -101,7 +101,10 @@
|
||||
<a class="d-block font-weight-bold" style="font-size: 11px;">
|
||||
{{ Auth::guard('admin')->user()->getRoleNames()[0] }}
|
||||
</a>
|
||||
@if(auth()->user()->getMyCabangAndRegion()['cabang'] != '-' && Auth::guard('admin')->user()->getRoleNames()[0] == 'Medical Representatif')
|
||||
@if(
|
||||
auth()->user()->getMyCabangAndRegion()['cabang'] != '-' &&
|
||||
in_array(Auth::guard('admin')->user()->getRoleNames()[0], ['Medical Representatif', 'Area Manager Cabang'])
|
||||
)
|
||||
<a class="d-block" style="font-size: 14px;">
|
||||
<span class="badge badge-primary">
|
||||
{{ auth()->user()->getMyCabangAndRegion()['cabang'] }}
|
||||
|
||||
Reference in New Issue
Block a user