added reject & tanggal on meeting seminar
This commit is contained in:
@@ -38,8 +38,8 @@ class FormMeetingSeminarController extends Controller
|
|||||||
$startDate = date('Y-m-' . env('STARTING_DATE')); // Starting date from .env for the current month
|
$startDate = date('Y-m-' . env('STARTING_DATE')); // Starting date from .env for the current month
|
||||||
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE'); // Closing date for the next month
|
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE'); // Closing date for the next month
|
||||||
|
|
||||||
$forms = FormMeetingSeminar::whereBetween('created_at', [$startDate, $closingDateNextMonth])
|
$forms = FormMeetingSeminar::whereBetween('tanggal', [$startDate, $closingDateNextMonth])
|
||||||
->orderBy('created_at', 'desc')
|
->orderBy('tanggal', 'desc')
|
||||||
->with('user')
|
->with('user')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
@@ -121,6 +121,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
$this->checkAuthorization(auth()->user(), ['forms.meeting.create']);
|
$this->checkAuthorization(auth()->user(), ['forms.meeting.create']);
|
||||||
|
|
||||||
$request->validate([
|
$request->validate([
|
||||||
|
'tanggal' => 'required|date',
|
||||||
'allowance' => 'nullable|numeric',
|
'allowance' => 'nullable|numeric',
|
||||||
'transport_ankot' => 'nullable|numeric',
|
'transport_ankot' => 'nullable|numeric',
|
||||||
'hotel' => 'nullable|numeric',
|
'hotel' => 'nullable|numeric',
|
||||||
@@ -129,7 +130,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
'bukti_hotel' => ['nullable', 'file', 'max:51200', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
|
'bukti_hotel' => ['nullable', 'file', 'max:51200', new FileType(['php', 'exe', 'js', 'sh', 'bat', 'exe', 'sh', 'php', 'vbs'])],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$currentDate = date('Y-m-d');
|
$currentDate = $request->tanggal;
|
||||||
$startDate = date('Y-m-' . env('STARTING_DATE'));
|
$startDate = date('Y-m-' . env('STARTING_DATE'));
|
||||||
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
|
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
|
||||||
|
|
||||||
@@ -204,6 +205,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
$form = FormMeetingSeminar::create([
|
$form = FormMeetingSeminar::create([
|
||||||
'expense_number' => $expense_number,
|
'expense_number' => $expense_number,
|
||||||
'user_id' => auth()->user()->id,
|
'user_id' => auth()->user()->id,
|
||||||
|
'tanggal' => $request->tanggal,
|
||||||
'allowance' => $data_nominal['allowance'],
|
'allowance' => $data_nominal['allowance'],
|
||||||
'transport_ankot' => $data_nominal['transport_ankot'],
|
'transport_ankot' => $data_nominal['transport_ankot'],
|
||||||
'hotel' => $data_nominal['hotel'],
|
'hotel' => $data_nominal['hotel'],
|
||||||
@@ -216,7 +218,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$name = auth()->user()->name;
|
$name = auth()->user()->name;
|
||||||
$tanggal = $form->created_at;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->total;
|
||||||
|
|
||||||
// Send notification to MIS and Admin Region and Area Manager Cabang
|
// Send notification to MIS and Admin Region and Area Manager Cabang
|
||||||
@@ -311,6 +313,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
$form = FormMeetingSeminar::findOrfail($id);
|
$form = FormMeetingSeminar::findOrfail($id);
|
||||||
|
|
||||||
$request->validate([
|
$request->validate([
|
||||||
|
'tanggal' => 'required|date',
|
||||||
'allowance' => 'nullable|numeric',
|
'allowance' => 'nullable|numeric',
|
||||||
'transport_ankot' => 'nullable|numeric',
|
'transport_ankot' => 'nullable|numeric',
|
||||||
'hotel' => 'nullable|numeric',
|
'hotel' => 'nullable|numeric',
|
||||||
@@ -384,6 +387,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
|
|
||||||
// Save the form data
|
// Save the form data
|
||||||
$form->update([
|
$form->update([
|
||||||
|
'tanggal' => $request->tanggal,
|
||||||
'allowance' => $data_nominal['allowance'],
|
'allowance' => $data_nominal['allowance'],
|
||||||
'transport_ankot' => $data_nominal['transport_ankot'],
|
'transport_ankot' => $data_nominal['transport_ankot'],
|
||||||
'hotel' => $data_nominal['hotel'],
|
'hotel' => $data_nominal['hotel'],
|
||||||
@@ -423,7 +427,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
|
|
||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->created_at;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
@@ -508,7 +512,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
|
|
||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->created_at;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->total;
|
||||||
|
|
||||||
$roles = ['Marketing Information System', 'Area Manager Cabang', 'Marketing Operational Manager Region', 'Head of Sales Marketing'];
|
$roles = ['Marketing Information System', 'Area Manager Cabang', 'Marketing Operational Manager Region', 'Head of Sales Marketing'];
|
||||||
@@ -604,7 +608,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
|
|
||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->created_at;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->approved_total;
|
$total = $form->approved_total;
|
||||||
|
|
||||||
$roles = ['Head of Sales Marketing', 'Marketing Operational Manager Region'];
|
$roles = ['Head of Sales Marketing', 'Marketing Operational Manager Region'];
|
||||||
@@ -681,7 +685,7 @@ class FormMeetingSeminarController extends Controller
|
|||||||
$heads = $form->user->getCabangAndRegionHead();
|
$heads = $form->user->getCabangAndRegionHead();
|
||||||
$name = $form->user->name;
|
$name = $form->user->name;
|
||||||
$expense_number = $form->expense_number;
|
$expense_number = $form->expense_number;
|
||||||
$tanggal = $form->created_at;
|
$tanggal = $form->tanggal;
|
||||||
$total = $form->total;
|
$total = $form->total;
|
||||||
|
|
||||||
// Collect all recipients
|
// Collect all recipients
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class FormMeetingSeminar extends Model
|
|||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'expense_number',
|
'expense_number',
|
||||||
'user_id',
|
'user_id',
|
||||||
|
'tanggal',
|
||||||
'allowance',
|
'allowance',
|
||||||
'transport_ankot',
|
'transport_ankot',
|
||||||
'hotel',
|
'hotel',
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('budget_control', function (Blueprint $table) {
|
||||||
|
// Hapus foreign key jika sudah ada
|
||||||
|
DB::statement('ALTER TABLE budget_control DROP FOREIGN KEY IF EXISTS budget_control_cabang_id_foreign');
|
||||||
|
DB::statement('ALTER TABLE budget_control DROP FOREIGN KEY IF EXISTS budget_control_sender_id_foreign');
|
||||||
|
DB::statement('ALTER TABLE budget_control DROP FOREIGN KEY IF EXISTS budget_control_receiver_id_foreign');
|
||||||
|
|
||||||
|
// Tambahkan foreign key dengan ON DELETE CASCADE
|
||||||
|
DB::statement('ALTER TABLE budget_control ADD CONSTRAINT budget_control_cabang_id_foreign FOREIGN KEY (cabang_id) REFERENCES cabang(id) ON DELETE CASCADE');
|
||||||
|
DB::statement('ALTER TABLE budget_control ADD CONSTRAINT budget_control_sender_id_foreign FOREIGN KEY (sender_id) REFERENCES admins(id) ON DELETE CASCADE');
|
||||||
|
DB::statement('ALTER TABLE budget_control ADD CONSTRAINT budget_control_receiver_id_foreign FOREIGN KEY (receiver_id) REFERENCES admins(id) ON DELETE CASCADE');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('budget_control', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('budget_control_log', function (Blueprint $table) {
|
||||||
|
DB::statement('ALTER TABLE budget_control_log DROP FOREIGN KEY IF EXISTS budget_control_log_cabang_id_foreign');
|
||||||
|
DB::statement('ALTER TABLE budget_control_log DROP FOREIGN KEY IF EXISTS budget_control_log_sender_id_foreign');
|
||||||
|
DB::statement('ALTER TABLE budget_control_log DROP FOREIGN KEY IF EXISTS budget_control_log_receiver_id_foreign');
|
||||||
|
|
||||||
|
// Tambahkan foreign key dengan ON DELETE CASCADE
|
||||||
|
DB::statement('ALTER TABLE budget_control_log ADD CONSTRAINT budget_control_log_cabang_id_foreign FOREIGN KEY (cabang_id) REFERENCES cabang(id) ON DELETE CASCADE');
|
||||||
|
DB::statement('ALTER TABLE budget_control_log ADD CONSTRAINT budget_control_log_sender_id_foreign FOREIGN KEY (sender_id) REFERENCES admins(id) ON DELETE CASCADE');
|
||||||
|
DB::statement('ALTER TABLE budget_control_log ADD CONSTRAINT budget_control_log_receiver_id_foreign FOREIGN KEY (receiver_id) REFERENCES admins(id) ON DELETE CASCADE');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('budget_control_log', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?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('form_meeting_seminar', function (Blueprint $table) {
|
||||||
|
$table->date('tanggal')->after('user_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('form_meeting_seminar', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('tanggal');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -89,8 +89,24 @@
|
|||||||
<a href="{{ route('forms.entertainment') }}" class="btn btn-secondary">Kembali</a>
|
<a href="{{ route('forms.entertainment') }}" class="btn btn-secondary">Kembali</a>
|
||||||
@if (auth()->user()->can('approval.approve') && $form->status == 'On Progress')
|
@if (auth()->user()->can('approval.approve') && $form->status == 'On Progress')
|
||||||
<button type="button" class="btn btn-success final-approve-modal" data-id="{{ route('forms.entertainment.approve', $form->id) }}">Approve 1</button>
|
<button type="button" class="btn btn-success final-approve-modal" data-id="{{ route('forms.entertainment.approve', $form->id) }}">Approve 1</button>
|
||||||
|
|
||||||
|
<form action="{{ route('forms.entertainment.reject', $item->id) }}" method="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(auth()->user()->can('approval2.approve') && $form->status == 'Approved 1')
|
@elseif(auth()->user()->can('approval2.approve') && $form->status == 'Approved 1')
|
||||||
<button type="button" class="btn btn-success open-approve-modal" data-id="{{ route('forms.entertainment.approve2', $form->id) }}">Approve 2</button>
|
<button type="button" class="btn btn-success open-approve-modal" data-id="{{ route('forms.entertainment.approve2', $form->id) }}">Approve 2</button>
|
||||||
|
|
||||||
|
<form action="{{ route('forms.entertainment.reject', $item->id) }}" method="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(auth()->user()->can('final_approval.approve') && $form->status == 'Approved 2')
|
@elseif(auth()->user()->can('final_approval.approve') && $form->status == 'Approved 2')
|
||||||
<button type="button" class="btn btn-primary open-approve-modal" data-id="{{ route('forms.entertainment.final-approve', $form->id) }}">Final Approve</button>
|
<button type="button" class="btn btn-primary open-approve-modal" data-id="{{ route('forms.entertainment.final-approve', $form->id) }}">Final Approve</button>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@@ -50,6 +50,10 @@
|
|||||||
@include('backend.layouts.partials.messages')
|
@include('backend.layouts.partials.messages')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Tanggal <span class="font-italic font-weight-normal">(required)</span></label>
|
||||||
|
<input type="date" class="form-control" name="tanggal" id="tanggal" value="{{ old('tanggal') }}">
|
||||||
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Allowance <span class="font-italic font-weight-normal">(optional)</span></label>
|
<label class="form-label">Allowance <span class="font-italic font-weight-normal">(optional)</span></label>
|
||||||
<input type="text" class="form-control" name="allowance" id="allowance" value="{{ old('allowance') }}">
|
<input type="text" class="form-control" name="allowance" id="allowance" value="{{ old('allowance') }}">
|
||||||
@@ -62,13 +66,13 @@
|
|||||||
<label class="form-label">Transport Antar Kota <span class="font-italic font-weight-normal">(optional)</span></label>
|
<label class="form-label">Transport Antar Kota <span class="font-italic font-weight-normal">(optional)</span></label>
|
||||||
<input type="text" class="form-control" name="transport_ankot" id="transport_ankot" value="{{ old('transport_ankot') }}">
|
<input type="text" class="form-control" name="transport_ankot" id="transport_ankot" value="{{ old('transport_ankot') }}">
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-6">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Bukti Transport Antar Kota <span class="font-italic font-weight-normal">(optional)</span></label>
|
<label class="form-label">Bukti Transport Antar Kota <span class="font-italic font-weight-normal">(optional)</span></label>
|
||||||
<input type="file" class="form-control" name="bukti_transport_ankot" value="{{ old('bukti_transport_ankot') }}">
|
<input type="file" class="form-control" name="bukti_transport_ankot" value="{{ old('bukti_transport_ankot') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-lg-6">
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Hotel <span class="font-italic font-weight-normal">(optional)</span></label>
|
<label class="form-label">Hotel <span class="font-italic font-weight-normal">(optional)</span></label>
|
||||||
<input type="text" class="form-control" name="hotel" id="hotel" value="{{ old('hotel') }}">
|
<input type="text" class="form-control" name="hotel" id="hotel" value="{{ old('hotel') }}">
|
||||||
|
|||||||
@@ -51,6 +51,10 @@
|
|||||||
@include('backend.layouts.partials.messages')
|
@include('backend.layouts.partials.messages')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Tanggal <span class="font-italic font-weight-normal">(required)</span></label>
|
||||||
|
<input type="date" class="form-control" name="tanggal" id="tanggal" value="{{ $form->tanggal }}">
|
||||||
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Allowance <span class="font-italic font-weight-normal">(optional)</span></label>
|
<label class="form-label">Allowance <span class="font-italic font-weight-normal">(optional)</span></label>
|
||||||
<input type="text" class="form-control" name="allowance" id="allowance" value="{{ $form->allowance }}">
|
<input type="text" class="form-control" name="allowance" id="allowance" value="{{ $form->allowance }}">
|
||||||
@@ -63,13 +67,13 @@
|
|||||||
<label class="form-label">Transport Antar Kota <span class="font-italic font-weight-normal">(optional)</span></label>
|
<label class="form-label">Transport Antar Kota <span class="font-italic font-weight-normal">(optional)</span></label>
|
||||||
<input type="text" class="form-control" name="transport_ankot" id="transport_ankot" value="{{ $form->transport_ankot }}">
|
<input type="text" class="form-control" name="transport_ankot" id="transport_ankot" value="{{ $form->transport_ankot }}">
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-6">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Bukti Transport Antar Kota <span class="font-italic font-weight-normal">(optional)</span></label>
|
<label class="form-label">Bukti Transport Antar Kota <span class="font-italic font-weight-normal">(optional)</span></label>
|
||||||
<input type="file" class="form-control" name="bukti_transport_ankot" value="{{ old('bukti_transport_ankot') }}">
|
<input type="file" class="form-control" name="bukti_transport_ankot" value="{{ old('bukti_transport_ankot') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-lg-6">
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Hotel <span class="font-italic font-weight-normal">(optional)</span></label>
|
<label class="form-label">Hotel <span class="font-italic font-weight-normal">(optional)</span></label>
|
||||||
<input type="text" class="form-control" name="hotel" id="hotel" value="{{ $form->hotel }}">
|
<input type="text" class="form-control" name="hotel" id="hotel" value="{{ $form->hotel }}">
|
||||||
|
|||||||
@@ -131,7 +131,7 @@
|
|||||||
<td>{{ $item->expense_number }}</td>
|
<td>{{ $item->expense_number }}</td>
|
||||||
<td>{{ $item->user->name }}</td>
|
<td>{{ $item->user->name }}</td>
|
||||||
<td>{{ $item->user->cabang->cabang->name }}</td>
|
<td>{{ $item->user->cabang->cabang->name }}</td>
|
||||||
<td>{{ \Carbon\Carbon::parse($item->created_at)->locale('id')->isoFormat('D MMMM Y') }}</td>
|
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('D MMMM Y') }}</td>
|
||||||
<td>{{ number_format($item->allowance, 0, ',', '.') }}</td>
|
<td>{{ number_format($item->allowance, 0, ',', '.') }}</td>
|
||||||
<td>{{ number_format($item->transport_ankot, 0, ',', '.') }}</td>
|
<td>{{ number_format($item->transport_ankot, 0, ',', '.') }}</td>
|
||||||
<td>{{ number_format($item->hotel, 0, ',', '.') }}</td>
|
<td>{{ number_format($item->hotel, 0, ',', '.') }}</td>
|
||||||
@@ -490,7 +490,7 @@
|
|||||||
// Detail data
|
// Detail data
|
||||||
$('#user').text(data.user.name);
|
$('#user').text(data.user.name);
|
||||||
$('#expense_number').text(data.expense_number);
|
$('#expense_number').text(data.expense_number);
|
||||||
$('#tanggal').text(new Date(data.created_at).toLocaleDateString('id-ID', {
|
$('#tanggal').text(new Date(data.tanggal).toLocaleDateString('id-ID', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'long',
|
month: 'long',
|
||||||
day: 'numeric'
|
day: 'numeric'
|
||||||
@@ -544,7 +544,7 @@
|
|||||||
// Detail data
|
// Detail data
|
||||||
$('#final_user').text(data.user.name);
|
$('#final_user').text(data.user.name);
|
||||||
$('#final_expense_number').text(data.expense_number);
|
$('#final_expense_number').text(data.expense_number);
|
||||||
$('#final_tanggal').text(new Date(data.created_at).toLocaleDateString('id-ID', {
|
$('#final_tanggal').text(new Date(data.tanggal).toLocaleDateString('id-ID', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'long',
|
month: 'long',
|
||||||
day: 'numeric'
|
day: 'numeric'
|
||||||
|
|||||||
@@ -35,6 +35,10 @@
|
|||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">No Expense</label>
|
<label class="form-label">No Expense</label>
|
||||||
<input type="text" class="form-control" name="expense_number" value="{{ $form->expense_number }}" readonly>
|
<input type="text" class="form-control" name="expense_number" value="{{ $form->expense_number }}" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Tanggal <span class="font-italic font-weight-normal">(required)</span></label>
|
||||||
|
<input type="date" class="form-control" name="tanggal" id="tanggal" value="{{ $form->tanggal }}" readonly>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Allowance</label>
|
<label class="form-label">Allowance</label>
|
||||||
@@ -48,13 +52,13 @@
|
|||||||
<label class="form-label">Transport Antar Kota</label>
|
<label class="form-label">Transport Antar Kota</label>
|
||||||
<input type="text" class="form-control" name="transport_ankot" id="transport_ankot" value="{{ $form->transport_ankot }}" readonly>
|
<input type="text" class="form-control" name="transport_ankot" id="transport_ankot" value="{{ $form->transport_ankot }}" readonly>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
|
||||||
<label class="form-label">Bukti Transport Antar Kota</label><br>
|
|
||||||
<a href="{{ $form->bukti_transport_ankot }}" target="_blank">Lihat Bukti</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Bukti Transport Antar Kota</label><br>
|
||||||
|
<a href="{{ $form->bukti_transport_ankot }}" target="_blank">Lihat Bukti</a>
|
||||||
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Hotel</label>
|
<label class="form-label">Hotel</label>
|
||||||
<input type="text" class="form-control" name="hotel" id="hotel" value="{{ $form->hotel }}" readonly>
|
<input type="text" class="form-control" name="hotel" id="hotel" value="{{ $form->hotel }}" readonly>
|
||||||
@@ -81,8 +85,24 @@
|
|||||||
<a href="{{ route('forms.meeting') }}" class="btn btn-secondary">Kembali</a>
|
<a href="{{ route('forms.meeting') }}" class="btn btn-secondary">Kembali</a>
|
||||||
@if (auth()->user()->can('approval.approve') && $form->status == 'On Progress')
|
@if (auth()->user()->can('approval.approve') && $form->status == 'On Progress')
|
||||||
<button type="button" class="btn btn-success final-approve-modal" data-id="{{ route('forms.meeting.approve', $form->id) }}">Approve 1</button>
|
<button type="button" class="btn btn-success final-approve-modal" data-id="{{ route('forms.meeting.approve', $form->id) }}">Approve 1</button>
|
||||||
|
|
||||||
|
<form action="{{ route('forms.meeting.reject', $item->id) }}" method="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(auth()->user()->can('approval2.approve') && $form->status == 'Approved 1')
|
@elseif(auth()->user()->can('approval2.approve') && $form->status == 'Approved 1')
|
||||||
<button type="button" class="btn btn-success open-approve-modal" data-id="{{ route('forms.meeting.approve2', $form->id) }}">Approve 2</button>
|
<button type="button" class="btn btn-success open-approve-modal" data-id="{{ route('forms.meeting.approve2', $form->id) }}">Approve 2</button>
|
||||||
|
|
||||||
|
<form action="{{ route('forms.meeting.reject', $item->id) }}" method="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(auth()->user()->can('final_approval.approve') && $form->status == 'Approved 2')
|
@elseif(auth()->user()->can('final_approval.approve') && $form->status == 'Approved 2')
|
||||||
<button type="button" class="btn btn-primary open-approve-modal" data-id="{{ route('forms.meeting.final-approve', $form->id) }}">Final Approve</button>
|
<button type="button" class="btn btn-primary open-approve-modal" data-id="{{ route('forms.meeting.final-approve', $form->id) }}">Final Approve</button>
|
||||||
@endif
|
@endif
|
||||||
@@ -318,7 +338,7 @@
|
|||||||
// Detail data
|
// Detail data
|
||||||
$('#user').text(data.user.name);
|
$('#user').text(data.user.name);
|
||||||
$('#expense_number').text(data.expense_number);
|
$('#expense_number').text(data.expense_number);
|
||||||
$('#tanggal').text(new Date(data.created_at).toLocaleDateString('id-ID', {
|
$('#tanggal').text(new Date(data.tanggal).toLocaleDateString('id-ID', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'long',
|
month: 'long',
|
||||||
day: 'numeric'
|
day: 'numeric'
|
||||||
@@ -372,7 +392,7 @@
|
|||||||
// Detail data
|
// Detail data
|
||||||
$('#final_user').text(data.user.name);
|
$('#final_user').text(data.user.name);
|
||||||
$('#final_expense_number').text(data.expense_number);
|
$('#final_expense_number').text(data.expense_number);
|
||||||
$('#final_tanggal').text(new Date(data.created_at).toLocaleDateString('id-ID', {
|
$('#final_tanggal').text(new Date(data.tanggal).toLocaleDateString('id-ID', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'long',
|
month: 'long',
|
||||||
day: 'numeric'
|
day: 'numeric'
|
||||||
|
|||||||
@@ -79,8 +79,24 @@
|
|||||||
<a href="{{ route('forms.other') }}" class="btn btn-secondary">Kembali</a>
|
<a href="{{ route('forms.other') }}" class="btn btn-secondary">Kembali</a>
|
||||||
@if (auth()->user()->can('approval.approve') && $form->status == 'On Progress')
|
@if (auth()->user()->can('approval.approve') && $form->status == 'On Progress')
|
||||||
<button type="button" class="btn btn-success final-approve-modal" data-id="{{ route('forms.other.approve', $form->id) }}">Approve 1</button>
|
<button type="button" class="btn btn-success final-approve-modal" data-id="{{ route('forms.other.approve', $form->id) }}">Approve 1</button>
|
||||||
|
|
||||||
|
<form action="{{ route('forms.other.reject', $item->id) }}" method="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(auth()->user()->can('approval2.approve') && $form->status == 'Approved 1')
|
@elseif(auth()->user()->can('approval2.approve') && $form->status == 'Approved 1')
|
||||||
<button type="button" class="btn btn-success open-approve-modal" data-id="{{ route('forms.other.approve2', $form->id) }}">Approve 2</button>
|
<button type="button" class="btn btn-success open-approve-modal" data-id="{{ route('forms.other.approve2', $form->id) }}">Approve 2</button>
|
||||||
|
|
||||||
|
<form action="{{ route('forms.other.reject', $item->id) }}" method="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(auth()->user()->can('final_approval.approve') && $form->status == 'Approved 2')
|
@elseif(auth()->user()->can('final_approval.approve') && $form->status == 'Approved 2')
|
||||||
<button type="button" class="btn btn-primary open-approve-modal" data-id="{{ route('forms.other.final-approve', $form->id) }}">Final Approve</button>
|
<button type="button" class="btn btn-primary open-approve-modal" data-id="{{ route('forms.other.final-approve', $form->id) }}">Final Approve</button>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@@ -108,8 +108,24 @@
|
|||||||
<a href="{{ route('forms.up-country') }}" class="btn btn-secondary">Kembali</a>
|
<a href="{{ route('forms.up-country') }}" class="btn btn-secondary">Kembali</a>
|
||||||
@if (auth()->user()->can('approval.approve') && $form->status == 'On Progress')
|
@if (auth()->user()->can('approval.approve') && $form->status == 'On Progress')
|
||||||
<button type="button" class="btn btn-success final-approve-modal" data-id="{{ route('forms.up-country.approve', $form->id) }}">Approve 1</button>
|
<button type="button" class="btn btn-success final-approve-modal" data-id="{{ route('forms.up-country.approve', $form->id) }}">Approve 1</button>
|
||||||
|
|
||||||
|
<form action="{{ route('forms.up-country.reject', $item->id) }}" method="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(auth()->user()->can('approval2.approve') && $form->status == 'Approved 1')
|
@elseif(auth()->user()->can('approval2.approve') && $form->status == 'Approved 1')
|
||||||
<button type="button" class="btn btn-success open-approve-modal" data-id="{{ route('forms.up-country.approve2', $form->id) }}">Approve 2</button>
|
<button type="button" class="btn btn-success open-approve-modal" data-id="{{ route('forms.up-country.approve2', $form->id) }}">Approve 2</button>
|
||||||
|
|
||||||
|
<form action="{{ route('forms.up-country.reject', $item->id) }}" method="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(auth()->user()->can('final_approval.approve') && $form->status == 'Approved 2')
|
@elseif(auth()->user()->can('final_approval.approve') && $form->status == 'Approved 2')
|
||||||
<button type="button" class="btn btn-primary open-approve-modal" data-id="{{ route('forms.up-country.final-approve', $form->id) }}">Final Approve</button>
|
<button type="button" class="btn btn-primary open-approve-modal" data-id="{{ route('forms.up-country.final-approve', $form->id) }}">Final Approve</button>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@@ -85,8 +85,24 @@
|
|||||||
<a href="{{ route('forms.vehicle') }}" class="btn btn-secondary">Kembali</a>
|
<a href="{{ route('forms.vehicle') }}" class="btn btn-secondary">Kembali</a>
|
||||||
@if (auth()->user()->can('approval.approve') && $form->status == 'On Progress')
|
@if (auth()->user()->can('approval.approve') && $form->status == 'On Progress')
|
||||||
<button type="button" class="btn btn-success final-approve-modal" data-id="{{ route('forms.vehicle.approve', $form->id) }}">Approve 1</button>
|
<button type="button" class="btn btn-success final-approve-modal" data-id="{{ route('forms.vehicle.approve', $form->id) }}">Approve 1</button>
|
||||||
|
|
||||||
|
<form action="{{ route('forms.vehicle.reject', $item->id) }}" method="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(auth()->user()->can('approval2.approve') && $form->status == 'Approved 1')
|
@elseif(auth()->user()->can('approval2.approve') && $form->status == 'Approved 1')
|
||||||
<button type="button" class="btn btn-success open-approve-modal" data-id="{{ route('forms.vehicle.approve2', $form->id) }}">Approve 2</button>
|
<button type="button" class="btn btn-success open-approve-modal" data-id="{{ route('forms.vehicle.approve2', $form->id) }}">Approve 2</button>
|
||||||
|
|
||||||
|
<form action="{{ route('forms.vehicle.reject', $item->id) }}" method="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(auth()->user()->can('final_approval.approve') && $form->status == 'Approved 2')
|
@elseif(auth()->user()->can('final_approval.approve') && $form->status == 'Approved 2')
|
||||||
<button type="button" class="btn btn-primary open-approve-modal" data-id="{{ route('forms.vehicle.final-approve', $form->id) }}">Final Approve</button>
|
<button type="button" class="btn btn-primary open-approve-modal" data-id="{{ route('forms.vehicle.final-approve', $form->id) }}">Final Approve</button>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
Reference in New Issue
Block a user