Merge branch 'branch-jagad' into 'main'
Branch jagad See merge request fiqhpratama1/xpendify!41
This commit is contained in:
@@ -14,8 +14,11 @@ use App\Models\UserHasCabang;
|
|||||||
class FormHelper
|
class FormHelper
|
||||||
{
|
{
|
||||||
public static function getFormsByUserIds($userIds, $month, $year) {
|
public static function getFormsByUserIds($userIds, $month, $year) {
|
||||||
$startDate = date('Y-m-' . env('STARTING_DATE'));
|
$monthNumber = date('m', strtotime($month . ' 1'));
|
||||||
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
|
$startDate = "$year-$monthNumber-" . env('STARTING_DATE');
|
||||||
|
|
||||||
|
$nextMonthTimestamp = strtotime("first day of next month", strtotime("$year-$monthNumber-01"));
|
||||||
|
$closingDateNextMonth = date('Y-m-', $nextMonthTimestamp) . env('CLOSING_DATE');
|
||||||
|
|
||||||
$users = Admin::with(['region', 'cabang'])
|
$users = Admin::with(['region', 'cabang'])
|
||||||
->whereIn('id', $userIds)
|
->whereIn('id', $userIds)
|
||||||
@@ -98,8 +101,11 @@ class FormHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function getAllForms($month, $year) {
|
public static function getAllForms($month, $year) {
|
||||||
$startDate = date('Y-m-' . env('STARTING_DATE'));
|
$monthNumber = date('m', strtotime($month . ' 1'));
|
||||||
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
|
$startDate = "$year-$monthNumber-" . env('STARTING_DATE');
|
||||||
|
|
||||||
|
$nextMonthTimestamp = strtotime("first day of next month", strtotime("$year-$monthNumber-01"));
|
||||||
|
$closingDateNextMonth = date('Y-m-', $nextMonthTimestamp) . env('CLOSING_DATE');
|
||||||
|
|
||||||
$users = Admin::with(['region', 'cabang'])
|
$users = Admin::with(['region', 'cabang'])
|
||||||
->get();
|
->get();
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class FormOtherController extends Controller
|
|||||||
|
|
||||||
return view('backend.pages.forms.other.view', [
|
return view('backend.pages.forms.other.view', [
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
'kategori' => Kategori::whereNotIn('name', ['Up Country', 'Vehicle Running Cost', 'Entertainment & Presentation', 'Meeting & Seminar'])->get()
|
'kategori' => Kategori::whereNotIn('name', ['Up Country', 'Vehicle Running Cost', 'Entertainment', 'Meeting / Seminar'])->get()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ class FormOtherController extends Controller
|
|||||||
$this->checkAuthorization(auth()->user(), ['forms.other.create']);
|
$this->checkAuthorization(auth()->user(), ['forms.other.create']);
|
||||||
|
|
||||||
return view('backend.pages.forms.other.create', [
|
return view('backend.pages.forms.other.create', [
|
||||||
'kategori' => Kategori::whereNotIn('name', ['Up Country', 'Vehicle Running Cost', 'Entertainment & Presentation', 'Meeting & Seminar'])->get()
|
'kategori' => Kategori::whereNotIn('name', ['Up Country', 'Vehicle Running Cost', 'Entertainment', 'Meeting / Seminar'])->get()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +243,7 @@ class FormOtherController extends Controller
|
|||||||
|
|
||||||
return view('backend.pages.forms.other.edit', [
|
return view('backend.pages.forms.other.edit', [
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
'kategori' => Kategori::whereNotIn('name', ['Up Country', 'Vehicle Running Cost', 'Entertainment & Presentation', 'Meeting & Seminar'])->get()
|
'kategori' => Kategori::whereNotIn('name', ['Up Country', 'Vehicle Running Cost', 'Entertainment', 'Meeting / Seminar'])->get()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach ($categories as $category)
|
@foreach ($categories as $category)
|
||||||
<tr>
|
<tr class="{{ in_array($category->name, ['Up Country', 'Vehicle Running Cost', 'Entertainment', 'Meeting / Seminar']) ? 'bg-secondary' : '' }}">
|
||||||
<td>{{ $loop->index + 1 }}</td>
|
<td>{{ $loop->index + 1 }}</td>
|
||||||
<td>{{ $category->name }}</td>
|
<td>{{ $category->name }}</td>
|
||||||
<td>{{ $category->account_number }}</td>
|
<td>{{ $category->account_number }}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user