From a286e4c28a94a41e660babd2c0bc9f41c864178f Mon Sep 17 00:00:00 2001 From: Jagad R R Date: Thu, 19 Jun 2025 19:39:20 +0700 Subject: [PATCH] added form parking / toll --- ...ormEntertainmentPresentationController.php | 19 ++-- .../Forms/FormMeetingSeminarController.php | 19 ++-- .../Controllers/Forms/FormOtherController.php | 20 ++-- .../Forms/FormUpCountryController.php | 8 +- .../Forms/FormVehicleController.php | 57 +++++----- app/Models/FormVehicleRunningCost.php | 1 + ...add_type_to_vehicle_running_cost_forms.php | 28 +++++ .../pages/forms/vehicle/create.blade.php | 84 +++++++++++---- .../pages/forms/vehicle/edit.blade.php | 100 ++++++++++++++---- .../pages/forms/vehicle/index.blade.php | 20 +++- .../pages/forms/vehicle/view.blade.php | 8 +- 11 files changed, 264 insertions(+), 100 deletions(-) create mode 100644 database/migrations/2025_06_19_121458_add_type_to_vehicle_running_cost_forms.php diff --git a/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php b/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php index c0f43df..8997795 100644 --- a/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php +++ b/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php @@ -42,25 +42,26 @@ class FormEntertainmentPresentationController extends Controller $now = Carbon::now(); - // Tentukan periode aktif (mulai dan tutup) + // Determine the period if ($now->day >= $startDay) { - $startDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay(); - $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay(); + $currentPeriodStartDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay(); + $currentPeriodClosingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay(); } else { - $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay(); - $closingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay(); + $currentPeriodStartDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay(); + $currentPeriodClosingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay(); } - // Ambil nama bulan dan tahun dari $startDate untuk keperluan BudgetHelper - $periodeMonth = strtolower($startDate->format('F')); // ex: 'august' - $periodeYear = (int) $startDate->format('Y'); // ex: 2025 + // Calculate the actual start date for data retrieval (1 month before currentPeriodStartDate) + $dataRetrievalStartDate = $currentPeriodStartDate->copy()->subMonth()->startOfDay(); - $forms = FormEntertaimentPresentation::whereBetween('tanggal', [$startDate, $closingDate]) + $forms = FormEntertaimentPresentation::whereBetween('tanggal', [$dataRetrievalStartDate, $currentPeriodClosingDate]) ->orderBy('tanggal', 'desc') ->with('user') ->get(); $availableBudget = null; + $periodeMonth = strtolower($currentPeriodStartDate->format('F')); + $periodeYear = (int) $currentPeriodStartDate->format('Y'); if ($role == 'Admin Region' || $role == 'Marketing Operational Manager Region') { $region_id = auth()->user()->getMyCabangAndRegionId()['region']; diff --git a/app/Http/Controllers/Forms/FormMeetingSeminarController.php b/app/Http/Controllers/Forms/FormMeetingSeminarController.php index e5e36c1..d397bcb 100644 --- a/app/Http/Controllers/Forms/FormMeetingSeminarController.php +++ b/app/Http/Controllers/Forms/FormMeetingSeminarController.php @@ -43,25 +43,26 @@ class FormMeetingSeminarController extends Controller // Referensi waktu sekarang $now = Carbon::now(); - // Tentukan periode + // Determine the period if ($now->day >= $startDay) { - $startDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay(); - $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay(); + $currentPeriodStartDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay(); + $currentPeriodClosingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay(); } else { - $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay(); - $closingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay(); + $currentPeriodStartDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay(); + $currentPeriodClosingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay(); } - // Ambil bulan dan tahun dari $startDate untuk keperluan budget - $periodeMonth = strtolower($startDate->format('F')); // contoh: 'august' - $periodeYear = (int) $startDate->format('Y'); + // Calculate the actual start date for data retrieval (1 month before currentPeriodStartDate) + $dataRetrievalStartDate = $currentPeriodStartDate->copy()->subMonth()->startOfDay(); - $forms = FormMeetingSeminar::whereBetween('tanggal', [$startDate, $closingDate]) + $forms = FormMeetingSeminar::whereBetween('tanggal', [$dataRetrievalStartDate, $currentPeriodClosingDate]) ->orderBy('tanggal', 'desc') ->with('user') ->get(); $availableBudget = null; + $periodeMonth = strtolower($currentPeriodStartDate->format('F')); + $periodeYear = (int) $currentPeriodStartDate->format('Y'); if ($role == 'Admin Region' || $role == 'Marketing Operational Manager Region') { $region_id = auth()->user()->getMyCabangAndRegionId()['region']; diff --git a/app/Http/Controllers/Forms/FormOtherController.php b/app/Http/Controllers/Forms/FormOtherController.php index df38f9b..2c06e9c 100644 --- a/app/Http/Controllers/Forms/FormOtherController.php +++ b/app/Http/Controllers/Forms/FormOtherController.php @@ -37,27 +37,29 @@ class FormOtherController extends Controller $startDay = (int) env('STARTING_DATE', 11); $closingDay = (int) env('CLOSING_DATE', 10); + // Referensi waktu sekarang $now = Carbon::now(); - // Tentukan periode aktif + // Determine the period if ($now->day >= $startDay) { - $startDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay(); - $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay(); + $currentPeriodStartDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay(); + $currentPeriodClosingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay(); } else { - $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay(); - $closingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay(); + $currentPeriodStartDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay(); + $currentPeriodClosingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay(); } - // Periode untuk keperluan budget - $periodeMonth = strtolower($startDate->format('F')); - $periodeYear = (int) $startDate->format('Y'); + // Calculate the actual start date for data retrieval (1 month before currentPeriodStartDate) + $dataRetrievalStartDate = $currentPeriodStartDate->copy()->subMonth()->startOfDay(); - $forms = FormOthers::whereBetween('tanggal', [$startDate, $closingDate]) + $forms = FormOthers::whereBetween('tanggal', [$dataRetrievalStartDate, $currentPeriodClosingDate]) ->orderBy('tanggal', 'desc') ->with('user') ->get(); $availableBudget = null; + $periodeMonth = strtolower($currentPeriodStartDate->format('F')); + $periodeYear = (int) $currentPeriodStartDate->format('Y'); if ($role == 'Admin Region' || $role == 'Marketing Operational Manager Region') { $region_id = auth()->user()->getMyCabangAndRegionId()['region']; diff --git a/app/Http/Controllers/Forms/FormUpCountryController.php b/app/Http/Controllers/Forms/FormUpCountryController.php index 62cb89a..baa3204 100644 --- a/app/Http/Controllers/Forms/FormUpCountryController.php +++ b/app/Http/Controllers/Forms/FormUpCountryController.php @@ -45,11 +45,11 @@ class FormUpCountryController extends Controller // Determine the period if ($now->day >= $startDay) { - $currentPeriodStartDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay(); - $currentPeriodClosingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay(); + $currentPeriodStartDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay(); + $currentPeriodClosingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay(); } else { - $currentPeriodStartDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay(); - $currentPeriodClosingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay(); + $currentPeriodStartDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay(); + $currentPeriodClosingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay(); } // Calculate the actual start date for data retrieval (1 month before currentPeriodStartDate) diff --git a/app/Http/Controllers/Forms/FormVehicleController.php b/app/Http/Controllers/Forms/FormVehicleController.php index fe1f658..31b4100 100644 --- a/app/Http/Controllers/Forms/FormVehicleController.php +++ b/app/Http/Controllers/Forms/FormVehicleController.php @@ -39,27 +39,30 @@ class FormVehicleController extends Controller $role = auth()->user()->getRoleNames()[0]; $startDay = (int) env('STARTING_DATE', 11); $closingDay = (int) env('CLOSING_DATE', 10); + + // Referensi waktu sekarang $now = Carbon::now(); - // Tentukan periode aktif + // Determine the period if ($now->day >= $startDay) { - $startDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay(); - $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay(); + $currentPeriodStartDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay(); + $currentPeriodClosingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay(); } else { - $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay(); - $closingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay(); + $currentPeriodStartDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay(); + $currentPeriodClosingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay(); } - // Hitung periode untuk keperluan budget - $periodeMonth = strtolower($startDate->format('F')); - $periodeYear = (int) $startDate->format('Y'); + // Calculate the actual start date for data retrieval (1 month before currentPeriodStartDate) + $dataRetrievalStartDate = $currentPeriodStartDate->copy()->subMonth()->startOfDay(); - $forms = FormVehicleRunningCost::whereBetween('tanggal', [$startDate, $closingDate]) + $forms = FormVehicleRunningCost::whereBetween('tanggal', [$dataRetrievalStartDate, $currentPeriodClosingDate]) ->orderBy('tanggal', 'desc') ->with('user') ->get(); $availableBudget = null; + $periodeMonth = strtolower($currentPeriodStartDate->format('F')); + $periodeYear = (int) $currentPeriodStartDate->format('Y'); if ($role === 'Admin Region' || $role === 'Marketing Operational Manager Region') { $region_id = auth()->user()->getMyCabangAndRegionId()['region']; @@ -133,11 +136,12 @@ class FormVehicleController extends Controller $this->checkAuthorization(auth()->user(), ['forms.vehicle.create']); $request->validate([ 'tanggal' => 'required', - 'liter' => 'required', + 'type' => 'required', + 'liter' => 'nullable|numeric|min:0', 'total' => 'required|numeric|min:1', - 'jarak' => 'required', - 'tipe_bensin' => 'required|in:pertalite,pertamax', - 'nopol' => 'required', + 'jarak' => 'nullable|numeric|min:0', + 'tipe_bensin' => 'nullable|in:pertalite,pertamax', + 'nopol' => 'nullable', 'keterangan' => 'required', 'bukti_total' => ['nullable', 'file', 'max:51200'], ]); @@ -215,11 +219,12 @@ class FormVehicleController extends Controller 'expense_number' => $expense_number, 'user_id' => auth()->user()->id, 'tanggal' => $request->tanggal, - 'liter' => $request->liter, + 'type' => $request->type, + 'liter' => $request->liter ?? 0, 'total' => $request->total, - 'jarak' => $request->jarak, - 'tipe_bensin' => $request->tipe_bensin, - 'nopol' => $request->nopol, + 'jarak' => $request->jarak ?? 0, + 'tipe_bensin' => $request->tipe_bensin ?? '-', + 'nopol' => $request->nopol ?? '-', 'keterangan' => $request->keterangan, 'bukti_total' => $filePaths['bukti_total'] ?? null, 'account_number' => $kategori->account_number, @@ -354,11 +359,12 @@ class FormVehicleController extends Controller // Validasi input $request->validate([ 'tanggal' => 'required', - 'liter' => 'required', + 'type' => 'required', + 'liter' => 'nullable|numeric|min:0', 'total' => 'required|numeric|min:1|max:' . $availableBudget, - 'jarak' => 'required', - 'tipe_bensin' => 'required|in:pertalite,pertamax', - 'nopol' => 'required', + 'jarak' => 'nullable|numeric|min:0', + 'tipe_bensin' => 'nullable|in:pertalite,pertamax', + 'nopol' => 'nullable', 'keterangan' => 'required', 'bukti_total' => ['nullable', 'file', 'max:51200'], ]); @@ -391,11 +397,12 @@ class FormVehicleController extends Controller // Save the form data $form->update([ 'tanggal' => $request->tanggal, - 'liter' => $request->liter, + 'type' => $request->type, + 'liter' => $request->liter ?? 0, 'total' => $request->total, - 'jarak' => $request->jarak, - 'tipe_bensin' => $request->tipe_bensin, - 'nopol' => $request->nopol, + 'jarak' => $request->jarak ?? 0, + 'tipe_bensin' => $request->tipe_bensin ?? '-', + 'nopol' => $request->nopol ?? '-', 'keterangan' => $request->keterangan, 'bukti_total' => $filePaths['bukti_total'] ?? $form->bukti_total, 'account_number' => $kategori->account_number, diff --git a/app/Models/FormVehicleRunningCost.php b/app/Models/FormVehicleRunningCost.php index b86633d..4b5bacc 100644 --- a/app/Models/FormVehicleRunningCost.php +++ b/app/Models/FormVehicleRunningCost.php @@ -23,6 +23,7 @@ class FormVehicleRunningCost extends Model 'keterangan', 'bukti_total', 'account_number', + 'type', 'status', 'approved_at', 'approved2_at', diff --git a/database/migrations/2025_06_19_121458_add_type_to_vehicle_running_cost_forms.php b/database/migrations/2025_06_19_121458_add_type_to_vehicle_running_cost_forms.php new file mode 100644 index 0000000..5ce5a60 --- /dev/null +++ b/database/migrations/2025_06_19_121458_add_type_to_vehicle_running_cost_forms.php @@ -0,0 +1,28 @@ +string('type')->nullable()->default('gasoline')->after('id'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('form_vehicle_running_cost', function (Blueprint $table) { + $table->dropColumn('type'); + }); + } +}; diff --git a/resources/views/backend/pages/forms/vehicle/create.blade.php b/resources/views/backend/pages/forms/vehicle/create.blade.php index d65794f..b4d65f2 100644 --- a/resources/views/backend/pages/forms/vehicle/create.blade.php +++ b/resources/views/backend/pages/forms/vehicle/create.blade.php @@ -1,7 +1,7 @@ @extends('layouts.app') @section('title') - Dashboard + Dashboard @endsection @section('admin-content') @@ -16,7 +16,6 @@
@@ -45,7 +44,7 @@
-
+ @csrf @include('backend.layouts.partials.messages')
@@ -55,34 +54,42 @@
+ + +
+ +
- +
- +
-
- +
+
-
+
- +
-
+
- + +
-
+
- +
@@ -92,7 +99,7 @@
- +
@@ -112,7 +119,7 @@ decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal) currencySymbol: 'Rp.', // Simbol mata uang decimalPlaces: 0, // Tidak ada angka desimal - unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan + unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan }); document.getElementById('expense-form').addEventListener('submit', function (e) { @@ -120,5 +127,46 @@ spinnerOverlay.classList.remove('d-none'); // Show overlay spinnerOverlay.classList.add('d-flex'); // Use flexbox for centering }); + + // JavaScript for dynamic field visibility and clearing values + const expenseTypeSelect = document.getElementById('expense_type'); + const gasolineFields = document.querySelectorAll('.gasoline-fields'); + const literInput = document.querySelector('input[name="liter"]'); + const jarakInput = document.querySelector('input[name="jarak"]'); + const tipeBensinSelect = document.getElementById('tipe_bensin'); + const nopolInput = document.getElementById('nopol'); + + function toggleGasolineFields() { + if (expenseTypeSelect.value === 'gasoline') { + gasolineFields.forEach(field => { + field.style.display = 'block'; + }); + literInput.setAttribute('required', 'required'); + jarakInput.setAttribute('required', 'required'); + tipeBensinSelect.setAttribute('required', 'required'); + nopolInput.setAttribute('required', 'required'); + } else { + gasolineFields.forEach(field => { + field.style.display = 'none'; + }); + // --- NEW ADDITION: Clear values when fields are hidden --- + literInput.value = ''; + jarakInput.value = ''; + tipeBensinSelect.value = ''; // Clears selected option + nopolInput.value = ''; + // -------------------------------------------------------- + + literInput.removeAttribute('required'); + jarakInput.removeAttribute('required'); + tipeBensinSelect.removeAttribute('required'); + nopolInput.removeAttribute('required'); + } + } + + // Initial call to set visibility based on initial select value (e.g., from old('expense_type')) + toggleGasolineFields(); + + // Add event listener for when the select box changes + expenseTypeSelect.addEventListener('change', toggleGasolineFields); -@endsection +@endsection \ No newline at end of file diff --git a/resources/views/backend/pages/forms/vehicle/edit.blade.php b/resources/views/backend/pages/forms/vehicle/edit.blade.php index 764ac82..97e5db8 100644 --- a/resources/views/backend/pages/forms/vehicle/edit.blade.php +++ b/resources/views/backend/pages/forms/vehicle/edit.blade.php @@ -1,7 +1,7 @@ @extends('layouts.app') @section('title') - Dashboard + Dashboard @endsection @section('admin-content') @@ -15,7 +15,6 @@
@@ -44,7 +43,7 @@
-
+ @csrf @method('PUT') @include('backend.layouts.partials.messages') @@ -52,48 +51,65 @@
- +
+ {{-- Updated: Expense Type dropdown with name="type" and $form->type for selection --}}
+ + +
+ + {{-- Wrap gasoline-specific fields with .gasoline-fields --}} +
- +
- - + +
- - + + {{-- Display current proof if exists --}} + @if($form->bukti_total) + + @endif +
- +
-
+ {{-- Wrap gasoline-specific fields with .gasoline-fields --}} +
- +
-
+
- + +
-
+
- +
- +
- +
@@ -113,7 +129,7 @@ decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal) currencySymbol: 'Rp.', // Simbol mata uang decimalPlaces: 0, // Tidak ada angka desimal - unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan + unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan }); document.getElementById('expense-form').addEventListener('submit', function (e) { @@ -121,5 +137,45 @@ spinnerOverlay.classList.remove('d-none'); // Show overlay spinnerOverlay.classList.add('d-flex'); // Use flexbox for centering }); + + // JavaScript for dynamic field visibility and clearing values + const expenseTypeSelect = document.getElementById('expense_type'); // Still uses the ID for selection + const gasolineFields = document.querySelectorAll('.gasoline-fields'); + const literInput = document.querySelector('input[name="liter"]'); + const jarakInput = document.querySelector('input[name="jarak"]'); + const tipeBensinSelect = document.getElementById('tipe_bensin'); + const nopolInput = document.getElementById('nopol'); + + function toggleGasolineFields() { + if (expenseTypeSelect.value === 'gasoline') { + gasolineFields.forEach(field => { + field.style.display = 'block'; + }); + literInput.setAttribute('required', 'required'); + jarakInput.setAttribute('required', 'required'); + tipeBensinSelect.setAttribute('required', 'required'); + nopolInput.setAttribute('required', 'required'); + } else { + gasolineFields.forEach(field => { + field.style.display = 'none'; + }); + // Clear values when fields are hidden + literInput.value = ''; + jarakInput.value = ''; + tipeBensinSelect.value = ''; // Clears selected option + nopolInput.value = ''; + + literInput.removeAttribute('required'); + jarakInput.removeAttribute('required'); + tipeBensinSelect.removeAttribute('required'); + nopolInput.removeAttribute('required'); + } + } + + // Initial call to set visibility based on the retrieved form data + toggleGasolineFields(); + + // Add event listener for when the select box changes + expenseTypeSelect.addEventListener('change', toggleGasolineFields); -@endsection +@endsection \ No newline at end of file diff --git a/resources/views/backend/pages/forms/vehicle/index.blade.php b/resources/views/backend/pages/forms/vehicle/index.blade.php index bbdbe53..c53504a 100644 --- a/resources/views/backend/pages/forms/vehicle/index.blade.php +++ b/resources/views/backend/pages/forms/vehicle/index.blade.php @@ -101,6 +101,7 @@ Nama Cabang Tanggal + Type Liter Keterangan Total @@ -135,6 +136,16 @@ {{ $item->user->name }} {{ $item->user->cabang->cabang->name }} {{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('dddd, D MMMM Y HH:mm:ss') }} + + {{-- gunakan badge --}} + @if ($item->type == 'gasoline') + Gasoline + @elseif ($item->type == 'parking_toll') + Parking / Toll + @else + Unknown + @endif + {{ $item->liter }} {{ $item->keterangan }} {{ number_format($item->total, 0, ',', '.') }} @@ -309,7 +320,7 @@ User:
  • - Tipe: Vehicle Running Cost + Tipe:
  • Tanggal & Waktu: @@ -377,7 +388,7 @@ User:
  • - Tipe: Vehicle Running Cost + Tipe:
  • Tanggal & Waktu: @@ -491,6 +502,9 @@ month: 'long', day: 'numeric' })); + + // untuk type gunakan badge + $('#type').html(data.type.split('_').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')); $('#jarak').text(data.jarak); $('#liter').text(data.liter); @@ -545,6 +559,8 @@ day: 'numeric' })); + $('#final_type').html(data.type.split('_').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')); + $('#final_jarak').text(data.jarak); $('#final_liter').text(data.liter); $('#final_tipe_bensin').text(data.tipe_bensin); diff --git a/resources/views/backend/pages/forms/vehicle/view.blade.php b/resources/views/backend/pages/forms/vehicle/view.blade.php index 7e17309..e09d9e6 100644 --- a/resources/views/backend/pages/forms/vehicle/view.blade.php +++ b/resources/views/backend/pages/forms/vehicle/view.blade.php @@ -144,7 +144,7 @@ User:
  • - Tipe: Vehicle Running Cost + Tipe:
  • Tanggal & Waktu: @@ -212,7 +212,7 @@ User:
  • - Tipe: Vehicle Running Cost + Tipe:
  • Tanggal & Waktu: @@ -299,6 +299,8 @@ month: 'long', day: 'numeric' })); + + $('#type').html(data.type.split('_').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')); $('#jarak').text(data.jarak); $('#liter').text(data.liter); @@ -353,6 +355,8 @@ day: 'numeric' })); + $('#final_type').html(data.type.split('_').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')); + $('#final_jarak').text(data.jarak); $('#final_liter').text(data.liter); $('#final_tipe_bensin').text(data.tipe_bensin);