diff --git a/app/Helpers/PeriodeHelper.php b/app/Helpers/PeriodeHelper.php
new file mode 100644
index 0000000..e4c1870
--- /dev/null
+++ b/app/Helpers/PeriodeHelper.php
@@ -0,0 +1,19 @@
+startOfDay();
+ $end = $start->copy()->addMonth()->subDay()->endOfDay();
+
+ return [$start, $end];
+ }
+}
diff --git a/app/Helpers/WhatsappHelper.php b/app/Helpers/WhatsappHelper.php
index fa6e2d0..06b35c2 100644
--- a/app/Helpers/WhatsappHelper.php
+++ b/app/Helpers/WhatsappHelper.php
@@ -249,7 +249,6 @@ class WhatsappHelper
return $response->getBody()->getContents();
} catch (\Exception $e) {
AuditTrailHelper::AddAuditTrail('Error', 'Failed to send WhatsApp message at Form (' . $expense_number . ')');
- dd($e);
return null;
}
}
diff --git a/app/Http/Controllers/Backend/ReportController.php b/app/Http/Controllers/Backend/ReportController.php
index eeba15c..a44ac81 100644
--- a/app/Http/Controllers/Backend/ReportController.php
+++ b/app/Http/Controllers/Backend/ReportController.php
@@ -21,6 +21,7 @@ use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Schema;
use App\Models\Kategori;
use App\Models\BudgetControlLog;
+use App\Helpers\PeriodeHelper;
class ReportController extends Controller
{
@@ -621,53 +622,60 @@ class ReportController extends Controller
]);
}
- public function generateJurnal() {
+
+ public function generateJurnal()
+ {
$params = request()->all();
$kategoris = Kategori::all();
$kategori_bca = Kategori::where('name', 'Cash in Bank BCA')->first();
- $cabang = Cabang::with('cost')->where('code', $params['cabang'])->first();
+ $cabang = Cabang::with('cost')->where('code', $params['cabang'])->firstOrFail();
$year = $params['year'];
- $month = $params['month'];
+ $month = $params['month']; // format: angka atau teks bulan (pastikan valid)
- // get last data
- $budget = BudgetControlLog::where('cabang_id', $cabang->id)->where('periode_year', $year)->where('periode_month', $month)->orderBy('created_at', 'desc')->first();
+ // Hitung range periode (11 bulan_ini - 10 bulan_depan)
+ [$startDate, $endDate] = PeriodeHelper::getPeriodeRange($month, $year);
+
+ // Ambil data terakhir dari log budget
+ $budget = BudgetControlLog::where('cabang_id', $cabang->id)
+ ->where('periode_year', $year)
+ ->where('periode_month', $month)
+ ->orderBy('created_at', 'desc')
+ ->first();
$userIds = UserHasCabang::where('cabang_id', $cabang->id)->pluck('user_id');
- // Fetch all relevant forms in one batch
+ // Fetch semua forms berdasarkan periode range
$forms = [
'Up Country' => FormUpCountry::whereIn('user_id', $userIds)
- ->whereMonth('tanggal', '=', date('m', strtotime($month)))
- ->whereYear('tanggal', '=', $year)
- ->whereIn('status', ['Approved', 'Closed'])
+ ->whereBetween('tanggal', [$startDate, $endDate])
+ ->whereIn('status', ['Approved', 'On Progress'])
->get(),
+
'Vehicle Running Cost' => FormVehicleRunningCost::whereIn('user_id', $userIds)
- ->whereMonth('tanggal', '=', date('m', strtotime($month)))
- ->whereYear('tanggal', '=', $year)
- ->whereIn('status', ['Approved', 'Closed'])
+ ->whereBetween('tanggal', [$startDate, $endDate])
+ ->whereIn('status', ['Approved', 'On Progress'])
->get(),
+
'Entertainment' => FormEntertaimentPresentation::whereIn('user_id', $userIds)
- ->whereMonth('tanggal', '=', date('m', strtotime($month)))
- ->whereYear('tanggal', '=', $year)
- ->whereIn('status', ['Approved', 'Closed'])
+ ->whereBetween('tanggal', [$startDate, $endDate])
+ ->whereIn('status', ['Approved', 'On Progress'])
->get(),
+
'Meeting / Seminar' => FormMeetingSeminar::whereIn('user_id', $userIds)
- ->whereMonth('created_at', '=', date('m', strtotime($month)))
- ->whereYear('created_at', '=', $year)
- ->whereIn('status', ['Approved', 'Closed'])
+ ->whereBetween('created_at', [$startDate, $endDate])
+ ->whereIn('status', ['Approved', 'On Progress'])
->get(),
];
- // Fetch 'Others' forms by kategori
+ // Forms "Others" dikelompokkan berdasarkan kategori
$otherForms = FormOthers::whereIn('user_id', $userIds)
- ->whereMonth('tanggal', '=', date('m', strtotime($month)))
- ->whereYear('tanggal', '=', $year)
- ->whereIn('status', ['Approved', 'Closed'])
+ ->whereBetween('tanggal', [$startDate, $endDate])
+ ->whereIn('status', ['Approved', 'On Progress'])
->get();
- // Precompute totals for each category
+ // Total nominal per kategori
$nominals = [];
foreach ($kategoris as $item) {
if (isset($forms[$item->name])) {
@@ -687,7 +695,7 @@ class ReportController extends Controller
'month' => $month,
'kategori_bca' => $kategori_bca,
'nominals' => $nominals,
- 'budget' => $budget
+ 'budget' => $budget,
]);
}
}
diff --git a/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php b/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php
index 153efbe..c7f6f91 100644
--- a/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php
+++ b/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php
@@ -28,6 +28,7 @@ use App\Helpers\BudgetHelper;
use App\Helpers\NotificationHelper;
use Illuminate\Support\Facades\Log;
use App\Services\BrevoService;
+use Carbon\Carbon;
class FormEntertainmentPresentationController extends Controller
{
@@ -36,10 +37,26 @@ class FormEntertainmentPresentationController extends Controller
$this->checkAuthorization(auth()->user(), ['forms.entertainment.view']);
$role = auth()->user()->getRoleNames()[0];
- $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
+ $startDay = (int) env('STARTING_DATE', 11);
+ $closingDay = (int) env('CLOSING_DATE', 10);
- $forms = FormEntertaimentPresentation::whereBetween('tanggal', [$startDate, $closingDateNextMonth])
+ // Referensi waktu sekarang
+ $now = Carbon::now();
+
+ // Tentukan periode
+ if ($now->day >= $startDay) {
+ // Mulai dari tanggal START bulan ini
+ $startDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay();
+ // Sampai tanggal CLOSING bulan depan
+ $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay();
+ } else {
+ // Mulai dari tanggal START bulan lalu
+ $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay();
+ // Sampai tanggal CLOSING bulan ini
+ $closingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay();
+ }
+
+ $forms = FormEntertaimentPresentation::whereBetween('tanggal', [$startDate, $closingDate])
->orderBy('tanggal', 'desc')
->with('user')
->get();
@@ -128,11 +145,25 @@ class FormEntertainmentPresentationController extends Controller
'bukti_total' => ['nullable', 'file', 'max:51200'],
]);
- $startDate = date('Y-m-' . env('STARTING_DATE'));
- $closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
+ $tanggal = Carbon::parse($request->tanggal);
+ $startDay = (int) env('STARTING_DATE', 11);
+ $closingDay = (int) env('CLOSING_DATE', 10);
- if ($request->tanggal < $startDate || $request->tanggal > $closingDateNextMonth) {
- session()->flash('error', 'Gagal, Input expense sudah melewati periode input 12-10');
+ // Ambil tanggal sekarang untuk tentukan periode berjalan
+ $now = Carbon::now();
+
+ if ($now->day >= $startDay) {
+ // Periode berjalan dari bulan ini sampai bulan depan
+ $startDate = Carbon::create($now->year, $now->month, $startDay);
+ $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay);
+ } else {
+ // Periode berjalan dari bulan lalu sampai bulan ini
+ $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay);
+ $closingDate = Carbon::create($now->year, $now->month, $closingDay);
+ }
+
+ if ($tanggal->lt($startDate) || $tanggal->gt($closingDate)) {
+ session()->flash('error', "Gagal, tanggal tidak berada dalam periode input: {$startDate->format('d M')} - {$closingDate->format('d M')}");
return redirect()->back();
}
diff --git a/app/Http/Controllers/Forms/FormMeetingSeminarController.php b/app/Http/Controllers/Forms/FormMeetingSeminarController.php
index 1c23a62..ec263aa 100644
--- a/app/Http/Controllers/Forms/FormMeetingSeminarController.php
+++ b/app/Http/Controllers/Forms/FormMeetingSeminarController.php
@@ -28,6 +28,7 @@ use App\Helpers\BudgetHelper;
use App\Helpers\NotificationHelper;
use Illuminate\Support\Facades\Log;
use App\Services\BrevoService;
+use Carbon\Carbon;
class FormMeetingSeminarController extends Controller
{
@@ -36,10 +37,26 @@ class FormMeetingSeminarController extends Controller
$this->checkAuthorization(auth()->user(), ['forms.meeting.view']);
$role = auth()->user()->getRoleNames()[0];
- $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
+ $startDay = (int) env('STARTING_DATE', 11);
+ $closingDay = (int) env('CLOSING_DATE', 10);
- $forms = FormMeetingSeminar::whereBetween('tanggal', [$startDate, $closingDateNextMonth])
+ // Referensi waktu sekarang
+ $now = Carbon::now();
+
+ // Tentukan periode
+ if ($now->day >= $startDay) {
+ // Mulai dari tanggal START bulan ini
+ $startDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay();
+ // Sampai tanggal CLOSING bulan depan
+ $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay();
+ } else {
+ // Mulai dari tanggal START bulan lalu
+ $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay();
+ // Sampai tanggal CLOSING bulan ini
+ $closingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay();
+ }
+
+ $forms = FormMeetingSeminar::whereBetween('tanggal', [$startDate, $closingDate])
->orderBy('tanggal', 'desc')
->with('user')
->get();
@@ -131,12 +148,25 @@ class FormMeetingSeminarController extends Controller
'bukti_hotel' => ['nullable', 'file', 'max:51200'],
]);
- $currentDate = $request->tanggal;
- $startDate = date('Y-m-' . env('STARTING_DATE'));
- $closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
+ $tanggal = Carbon::parse($request->tanggal);
+ $startDay = (int) env('STARTING_DATE', 11);
+ $closingDay = (int) env('CLOSING_DATE', 10);
- if ($currentDate < $startDate || $currentDate > $closingDateNextMonth) {
- session()->flash('error', 'Gagal, Input expense sudah melewati periode input 12-10');
+ // Ambil tanggal sekarang untuk tentukan periode berjalan
+ $now = Carbon::now();
+
+ if ($now->day >= $startDay) {
+ // Periode berjalan dari bulan ini sampai bulan depan
+ $startDate = Carbon::create($now->year, $now->month, $startDay);
+ $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay);
+ } else {
+ // Periode berjalan dari bulan lalu sampai bulan ini
+ $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay);
+ $closingDate = Carbon::create($now->year, $now->month, $closingDay);
+ }
+
+ if ($tanggal->lt($startDate) || $tanggal->gt($closingDate)) {
+ session()->flash('error', "Gagal, tanggal tidak berada dalam periode input: {$startDate->format('d M')} - {$closingDate->format('d M')}");
return redirect()->back();
}
diff --git a/app/Http/Controllers/Forms/FormOtherController.php b/app/Http/Controllers/Forms/FormOtherController.php
index ef047b2..d5c391a 100644
--- a/app/Http/Controllers/Forms/FormOtherController.php
+++ b/app/Http/Controllers/Forms/FormOtherController.php
@@ -25,6 +25,7 @@ use App\Helpers\NotificationHelper;
use App\Models\Cabang;
use Illuminate\Support\Facades\Log;
use App\Services\BrevoService;
+use Carbon\Carbon;
class FormOtherController extends Controller
{
@@ -33,10 +34,27 @@ class FormOtherController extends Controller
$this->checkAuthorization(auth()->user(), ['forms.other.view']);
$role = auth()->user()->getRoleNames()[0];
- $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
+ $startDay = (int) env('STARTING_DATE', 11);
+ $closingDay = (int) env('CLOSING_DATE', 10);
- $forms = FormOthers::whereBetween('tanggal', [$startDate, $closingDateNextMonth])
+ // Referensi waktu sekarang
+ $now = Carbon::now();
+
+ // Tentukan periode
+ if ($now->day >= $startDay) {
+ // Mulai dari tanggal START bulan ini
+ $startDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay();
+ // Sampai tanggal CLOSING bulan depan
+ $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay();
+ } else {
+ // Mulai dari tanggal START bulan lalu
+ $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay();
+ // Sampai tanggal CLOSING bulan ini
+ $closingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay();
+ }
+
+ // Query data berdasarkan periode
+ $forms = FormOthers::whereBetween('tanggal', [$startDate, $closingDate])
->orderBy('tanggal', 'desc')
->with('user')
->get();
@@ -126,11 +144,25 @@ class FormOtherController extends Controller
'bukti_total' => ['nullable', 'file', 'max:51200'],
]);
- $startDate = date('Y-m-' . env('STARTING_DATE'));
- $closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
+ $tanggal = Carbon::parse($request->tanggal);
+ $startDay = (int) env('STARTING_DATE', 11);
+ $closingDay = (int) env('CLOSING_DATE', 10);
- if ($request->tanggal < $startDate || $request->tanggal > $closingDateNextMonth) {
- session()->flash('error', 'Gagal, Input expense sudah melewati periode input 12-10');
+ // Ambil tanggal sekarang untuk tentukan periode berjalan
+ $now = Carbon::now();
+
+ if ($now->day >= $startDay) {
+ // Periode berjalan dari bulan ini sampai bulan depan
+ $startDate = Carbon::create($now->year, $now->month, $startDay);
+ $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay);
+ } else {
+ // Periode berjalan dari bulan lalu sampai bulan ini
+ $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay);
+ $closingDate = Carbon::create($now->year, $now->month, $closingDay);
+ }
+
+ if ($tanggal->lt($startDate) || $tanggal->gt($closingDate)) {
+ session()->flash('error', "Gagal, tanggal tidak berada dalam periode input: {$startDate->format('d M')} - {$closingDate->format('d M')}");
return redirect()->back();
}
diff --git a/app/Http/Controllers/Forms/FormUpCountryController.php b/app/Http/Controllers/Forms/FormUpCountryController.php
index 323e514..079bd63 100644
--- a/app/Http/Controllers/Forms/FormUpCountryController.php
+++ b/app/Http/Controllers/Forms/FormUpCountryController.php
@@ -28,6 +28,7 @@ use App\Helpers\BudgetHelper;
use App\Helpers\NotificationHelper;
use Illuminate\Support\Facades\Log;
use App\Services\BrevoService;
+use Carbon\Carbon;
class FormUpCountryController extends Controller
{
@@ -36,10 +37,26 @@ class FormUpCountryController extends Controller
$this->checkAuthorization(auth()->user(), ['forms.country.view']);
$role = auth()->user()->getRoleNames()[0];
- $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
+ $startDay = (int) env('STARTING_DATE', 11);
+ $closingDay = (int) env('CLOSING_DATE', 10);
- $forms = FormUpCountry::whereBetween('tanggal', [$startDate, $closingDateNextMonth])
+ // Referensi waktu sekarang
+ $now = Carbon::now();
+
+ // Tentukan periode
+ if ($now->day >= $startDay) {
+ // Mulai dari tanggal START bulan ini
+ $startDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay();
+ // Sampai tanggal CLOSING bulan depan
+ $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay();
+ } else {
+ // Mulai dari tanggal START bulan lalu
+ $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay();
+ // Sampai tanggal CLOSING bulan ini
+ $closingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay();
+ }
+
+ $forms = FormUpCountry::whereBetween('tanggal', [$startDate, $closingDate])
->orderBy('tanggal', 'desc')
->with(['rayon', 'user'])
->get();
@@ -143,11 +160,25 @@ class FormUpCountryController extends Controller
'bukti_hotel' => ['nullable', 'file', 'max:51200'],
]);
- $startDate = date('Y-m-' . env('STARTING_DATE'));
- $closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
+ $tanggal = Carbon::parse($request->tanggal);
+ $startDay = (int) env('STARTING_DATE', 11);
+ $closingDay = (int) env('CLOSING_DATE', 10);
- if ($request->tanggal < $startDate || $request->tanggal > $closingDateNextMonth) {
- session()->flash('error', 'Gagal, Input expense sudah melewati periode input 12-10');
+ // Ambil tanggal sekarang untuk tentukan periode berjalan
+ $now = Carbon::now();
+
+ if ($now->day >= $startDay) {
+ // Periode berjalan dari bulan ini sampai bulan depan
+ $startDate = Carbon::create($now->year, $now->month, $startDay);
+ $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay);
+ } else {
+ // Periode berjalan dari bulan lalu sampai bulan ini
+ $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay);
+ $closingDate = Carbon::create($now->year, $now->month, $closingDay);
+ }
+
+ if ($tanggal->lt($startDate) || $tanggal->gt($closingDate)) {
+ session()->flash('error', "Gagal, tanggal tidak berada dalam periode input: {$startDate->format('d M')} - {$closingDate->format('d M')}");
return redirect()->back();
}
diff --git a/app/Http/Controllers/Forms/FormVehicleController.php b/app/Http/Controllers/Forms/FormVehicleController.php
index b1c0aec..0e9d561 100644
--- a/app/Http/Controllers/Forms/FormVehicleController.php
+++ b/app/Http/Controllers/Forms/FormVehicleController.php
@@ -28,6 +28,7 @@ use App\Helpers\BudgetHelper;
use App\Helpers\NotificationHelper;
use Illuminate\Support\Facades\Log;
use App\Services\BrevoService;
+use Carbon\Carbon;
class FormVehicleController extends Controller
{
@@ -36,10 +37,26 @@ class FormVehicleController extends Controller
$this->checkAuthorization(auth()->user(), ['forms.vehicle.view']);
$role = auth()->user()->getRoleNames()[0];
- $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
+ $startDay = (int) env('STARTING_DATE', 11);
+ $closingDay = (int) env('CLOSING_DATE', 10);
- $forms = FormVehicleRunningCost::whereBetween('tanggal', [$startDate, $closingDateNextMonth])
+ // Referensi waktu sekarang
+ $now = Carbon::now();
+
+ // Tentukan periode
+ if ($now->day >= $startDay) {
+ // Mulai dari tanggal START bulan ini
+ $startDate = Carbon::create($now->year, $now->month, $startDay)->startOfDay();
+ // Sampai tanggal CLOSING bulan depan
+ $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay)->endOfDay();
+ } else {
+ // Mulai dari tanggal START bulan lalu
+ $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay)->startOfDay();
+ // Sampai tanggal CLOSING bulan ini
+ $closingDate = Carbon::create($now->year, $now->month, $closingDay)->endOfDay();
+ }
+
+ $forms = FormVehicleRunningCost::whereBetween('tanggal', [$startDate, $closingDate])
->orderBy('tanggal', 'desc')
->with('user')
->get();
@@ -129,11 +146,25 @@ class FormVehicleController extends Controller
'bukti_total' => ['nullable', 'file', 'max:51200'],
]);
- $startDate = date('Y-m-' . env('STARTING_DATE'));
- $closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
+ $tanggal = Carbon::parse($request->tanggal);
+ $startDay = (int) env('STARTING_DATE', 11);
+ $closingDay = (int) env('CLOSING_DATE', 10);
- if ($request->tanggal < $startDate || $request->tanggal > $closingDateNextMonth) {
- session()->flash('error', 'Gagal, Input expense sudah melewati periode input 12-10');
+ // Ambil tanggal sekarang untuk tentukan periode berjalan
+ $now = Carbon::now();
+
+ if ($now->day >= $startDay) {
+ // Periode berjalan dari bulan ini sampai bulan depan
+ $startDate = Carbon::create($now->year, $now->month, $startDay);
+ $closingDate = Carbon::create($now->copy()->addMonth()->year, $now->copy()->addMonth()->month, $closingDay);
+ } else {
+ // Periode berjalan dari bulan lalu sampai bulan ini
+ $startDate = Carbon::create($now->copy()->subMonth()->year, $now->copy()->subMonth()->month, $startDay);
+ $closingDate = Carbon::create($now->year, $now->month, $closingDay);
+ }
+
+ if ($tanggal->lt($startDate) || $tanggal->gt($closingDate)) {
+ session()->flash('error', "Gagal, tanggal tidak berada dalam periode input: {$startDate->format('d M')} - {$closingDate->format('d M')}");
return redirect()->back();
}
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
index 205818b..9a5f7ad 100644
--- a/resources/views/layouts/app.blade.php
+++ b/resources/views/layouts/app.blade.php
@@ -209,7 +209,7 @@
month: 'short',
day: 'numeric',
hour: '2-digit',
- minute: '2-digit',
+ minute: '2-digit',
})}
@@ -270,16 +270,6 @@
.catch(error => {
console.error('Error checking notifications:', error);
});
-
- const periode = document.getElementById('periode');
- const date = new Date();
-
- const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
- const month = months[date.getMonth()]; // Get the current month's short name
- const nextMonth = months[(date.getMonth() + 1) % 12]; // Get the next month's short name, wrapping around if necessary
- const year = date.getFullYear();
-
- periode.textContent = `${month} (11 ${month} - 10 ${nextMonth} ${year})`;
+
+