Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mileage-claim
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
trainee
mileage-claim
Commits
93a00a5e
Commit
93a00a5e
authored
Jun 26, 2026
by
Muhammad Iz'aan bin suhaimi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HOD skrin
queryform auditquery serviceprovider
parent
033376d3
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1381 additions
and
443 deletions
+1381
-443
database/migrations/2026_06_23_032334_add_hod_comment_to_mileage_claim_main_table.php
+22
-0
database/migrations/2026_06_23_065423_create_audit_query_table.php
+35
-0
database/migrations/2026_06_23_065556_add_query_status_to_mileage_claim_main.php
+32
-0
database/migrations/2026_06_23_065706_drop_mm_hod_comment_from_mileage_claim_main.php
+32
-0
database/migrations/2026_06_25_022839_create_mileage_claim_attachments_table.php
+34
-0
packages/portal/mileage/resources/views/HOD/index.blade.php
+55
-148
packages/portal/mileage/resources/views/HOD/show.blade.php
+280
-109
packages/portal/mileage/resources/views/mileage/form.blade.php
+170
-30
packages/portal/mileage/resources/views/mileage/list.blade.php
+16
-10
packages/portal/mileage/resources/views/mileage/queryForm.blade.php
+329
-0
packages/portal/mileage/routes/web.php
+8
-2
packages/portal/mileage/src/Data/Repo/HODRepo.php
+80
-0
packages/portal/mileage/src/Data/Repo/MileageRepo.php
+107
-6
packages/portal/mileage/src/Http/Controllers/HODController.php
+19
-99
packages/portal/mileage/src/Http/Controllers/MileageController.php
+54
-0
packages/portal/mileage/src/Model/AuditQuery.php
+28
-0
packages/portal/mileage/src/Model/MileageClaimAttachment.php
+21
-0
packages/portal/mileage/src/Model/MileageClaimMain.php
+14
-0
packages/portal/mileage/src/ServiceProvider.php
+41
-35
packages/portal/overtime/src/ServiceProvider.php
+4
-4
No files found.
database/migrations/2026_06_23_032334_add_hod_comment_to_mileage_claim_main_table.php
0 → 100644
View file @
93a00a5e
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
public
function
up
()
{
Schema
::
table
(
'mileage_claim_main'
,
function
(
Blueprint
$table
)
{
$table
->
text
(
'mm_hod_comment'
)
->
nullable
()
->
after
(
'status'
);
});
}
public
function
down
()
{
Schema
::
table
(
'mileage_claim_main'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'mm_hod_comment'
);
});
}
};
database/migrations/2026_06_23_065423_create_audit_query_table.php
0 → 100644
View file @
93a00a5e
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'audit_query'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
integer
(
'fk_main'
)
->
index
();
$table
->
integer
(
'user_id'
)
->
index
();
$table
->
text
(
'comment'
)
->
nullable
();
$table
->
text
(
'response'
)
->
nullable
();
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'audit_query'
);
}
};
database/migrations/2026_06_23_065556_add_query_status_to_mileage_claim_main.php
0 → 100644
View file @
93a00a5e
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'mileage_claim_main'
,
function
(
Blueprint
$table
)
{
$table
->
integer
(
'query_status'
)
->
nullable
()
->
after
(
'status'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'mileage_claim_main'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'query_status'
);
});
}
};
database/migrations/2026_06_23_065706_drop_mm_hod_comment_from_mileage_claim_main.php
0 → 100644
View file @
93a00a5e
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'mileage_claim_main'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'mm_hod_comment'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'mileage_claim_main'
,
function
(
Blueprint
$table
)
{
$table
->
text
(
'mm_hod_comment'
)
->
nullable
()
->
after
(
'query_status'
);
});
}
};
database/migrations/2026_06_25_022839_create_mileage_claim_attachments_table.php
0 → 100644
View file @
93a00a5e
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'mileage_claim_attachments'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
unsignedBigInteger
(
'fk_main'
)
->
index
();
$table
->
string
(
'file_name'
);
$table
->
string
(
'file_path'
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'mileage_claim_attachments'
);
}
};
packages/portal/mileage/resources/views/HOD/index.blade.php
View file @
93a00a5e
<title>
HOD Dashboard
</title>
@
extends
(
'ui::layouts.app'
)
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
@
section
(
'content'
)
<style
type=
"text/css"
>
body
{
background-color
:
#f0f2f5
;
}
.ui.container
{
<
div
class
="
ui
segment
">
max-width
:
100%
!important
;
<a class="
ui
violet
left
ribbon
label
">HOD Dashboard - Tuntutan Mileage</a><br/>
overflow-x
:
hidden
;
<div class="
ui
segment
">
padding
:
0
5rem
0
2rem
;
box-sizing
:
border-box
;
}
.ui.segments
{
@if(session('success'))
margin-top
:
2rem
;
<div class="
ui
success
message
">{{ session('success') }}</div>
}
@endif
@if(session('error'))
.ui.segment
{
<div class="
ui
error
message
">{{ session('error') }}</div>
box-shadow
:
0
4px
6px
rgba
(
0
,
0
,
0
,
0.1
);
@endif
}
/* .ui.celled.table {
table-layout: fixed; /* ensures column widths respect CSS widths */
/* width: 100%;
}
.ui.celled.table th,
.ui.celled.table td {
word-wrap: break-word;
}
.ui.celled.table th:nth-last-child(1),
.ui.celled.table td:nth-last-child(1) {
width: 25%; /* make Tindakan column longest */
/* }
.ui.celled.table th:nth-last-child(2),
.ui.celled.table td:nth-last-child(2) {
width: 10%; /* for Status */
/* } */
@keyframes
spin
{
to
{
transform
:
rotate
(
360deg
);
}
}
#loader
{
position
:
fixed
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
display
:
none
;
align-items
:
center
;
justify-content
:
center
;
background
:
rgba
(
0
,
0
,
0
,
0.5
);
z-index
:
9999
;
}
#loader
div
{
margin-top
:
20%
;
margin-left
:
45%
;
width
:
60px
;
height
:
60px
;
border
:
6px
solid
#fff
;
border-top
:
6px
solid
transparent
;
border-radius
:
50%
;
animation
:
spin
1s
linear
infinite
;
}
</style>
<div
class=
"ui container mt-5"
>
<form method="
GET
" action="
{{
route
(
'mileage::HOD.index'
)
}}
" class="
ui
form
" style="
margin
-
bottom
:
1
rem
;
">
<h2
class=
"ui header"
>
Head of Department Dashboard
</h2>
<div class="
ui
action
input
">
<input type="
text
" name="
search
" value="
{{
request
(
'search'
)
}}
" placeholder="
Cari
no
.
permohonan
...
">
<button type="
submit
" class="
ui
violet
button
">Cari</button>
@if(request('search'))
<a href="
{{
route
(
'mileage::HOD.index'
)
}}
" class="
ui
button
">Reset</a>
@endif
</div>
</form>
{{-- Pending Claims --}}
<h3
class=
"ui dividing header"
>
Pending Verification Claims
</h3>
<table class="
ui
celled
table
">
<table class="
ui
celled
table
">
<thead>
<thead>
<tr>
<tr>
<th
style =
"text-align: center; width: 40px;"
>
#
</th>
<th>No</th>
<th
style =
"width: 15%;"
>
Staff
</th>
<th>No. Permohonan</th>
<th>
Tarikh
</th>
<th>Nama Pemohon</th>
<th>
Butiran Projek
</th>
<th>Bulan</th>
<th>
Jarak Layak (KM)
</th>
<th>Tarikh Hantar</th>
<th>
Jumlah Tuntutan (RM)
</th>
<th>Status</th>
<th>Status</th>
<th>Tindakan</th>
<th>Tindakan</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
@forelse(
$list
as
$index
=>
$claim
)
@php
@php
$pendingClaims = $claims->where('status', 'Diproses');
$refId
=
$claim->lkpStatus
?->ref_id ?? 0;
$color
= match(
$refId
) {
1 => 'grey',
2 => 'blue',
3 => 'yellow',
4 => 'red',
5 => 'olive',
6, 8, 10 => 'orange',
7 => 'teal',
9 => 'green',
default => 'grey',
};
$bulan
= [
1=>'Januari', 2=>'Februari', 3=>'Mac', 4=>'April',
5=>'Mei', 6=>'Jun', 7=>'Julai', 8=>'Ogos',
9=>'September', 10=>'Oktober', 11=>'November', 12=>'Disember'
];
@endphp
@endphp
@forelse($pendingClaims as $claim)
<tr>
<tr>
<td
style =
"text-align: center;"
>
{{ $loop->iteration }}
</td>
<td>{{
$list->firstItem
() +
$index
}}</td>
<td>
{{ $claim->user->name ?? '-' }}
</td>
<td>{{
$claim->mm_apply_no
}}</td>
<td>{{
$claim->mm_staff_name
?? '-' }}</td>
<td>{{ (
$bulan[$claim->mm_claim_month]
?? '-') . ' ' .
$claim->mm_claim_year
}}</td>
<td>{{
$claim->mm_submit_date
? \Carbon\Carbon::parse(
$claim->mm_submit_date
)->format('d/m/Y') : '-' }}</td>
<td><span class="
ui
{{
$color
}}
label
">{{
$claim->lkpStatus
?->description ?? '-' }}</span></td>
<td>
<td>
{{ $claim->claim_date }}
<div class="
ui
small
icon
buttons
">
@php
<a href="
{{
route
(
'mileage::HOD.show'
,
$claim
->
id
)
}}
" class="
ui
blue
button
">
$days = \Carbon\Carbon::parse($claim->claim_date)->diffInDays($claim->created_at ?? now());
<i class="
eye
icon
"></i>
@endphp
@if($days > 180)
<br><span
class=
"ui red label tiny"
>
Tertakluk BOD (
>
6 bulan)
</span>
@elseif($days > 90)
<br><span
class=
"ui red label tiny"
>
Lewat 3-6 bulan (-30%)
</span>
@elseif($days > 30)
<span
class=
"ui yellow label tiny"
>
Lewat 1-3 bulan (-10%)
</span>
@endif
</td>
<td>
{{ $claim->description ?? '-' }}
</td>
<td>
{{ max(0, $claim->total_mileage - 40) }} km
</td>
<td>
RM {{ number_format($claim->total_claim_amount, 2) }}
</td>
<td>
{{ $claim->status }}
</td>
<td
style =
"white-space: nowrap; width: 1%;"
>
<a
href=
"{{ route('mileage::HOD.show', $claim->id) }}"
class=
"ui blue button tiny"
>
Lihat
</a>
</a>
<form
action=
"{{ route('mileage::HOD.verify', $claim->id) }}"
method=
"POST"
style=
"display:inline;"
>
</div>
@csrf
<button
class=
"ui green button tiny"
type=
"submit"
>
Sokong
</button>
</form>
<form
action=
"{{ route('mileage::HOD.reject', $claim->id) }}"
method=
"POST"
style=
"display:inline;"
>
@csrf
<button
class=
"ui red button tiny"
type=
"submit"
>
Tolak
</button>
</form>
</td>
</td>
</tr>
</tr>
@empty
@empty
<tr>
<tr>
<td
colspan=
"8"
class=
"center aligned"
>
Tiada tuntutan menunggu sokongan
</td>
<td colspan="
7
" class="
center
aligned
">Tiada permohonan untuk diberi tindakan.
</td>
</tr>
</tr>
@endforelse
@endforelse
</tbody>
</tbody>
</table>
</table>
{{-- Verified / Rejected Claims --}}
{{
$list->withQueryString
()->links() }}
<h3
class=
"ui dividing header mt-5"
>
Previous Claims
</h3>
<table
class=
"ui celled table"
>
<thead>
<tr>
<th>
#
</th>
<th>
Staff
</th>
<th>
Tarikh
</th>
<th>
Butiran Projek
</th>
<th>
Jarak Layak (KM)
</th>
<th>
Jumlah Tuntutan (RM)
</th>
<th>
Status
</th>
<th>
Tindakan
</th>
</tr>
</thead>
<tbody>
@php
$previousClaims = $claims->whereIn('status', ['Disokong', 'Ditolak']);
@endphp
@forelse($previousClaims as $claim)
</div>
<tr>
<td>
{{ $loop->iteration }}
</td>
<td>
{{ $claim->user->name ?? '-' }}
</td>
<td>
{{ $claim->claim_date }}
</td>
<td>
{{ $claim->description ?? '-' }}
</td>
<td>
{{ max(0, $claim->total_mileage - 40) }} km
</td>
<td>
RM {{ number_format($claim->total_claim_amount, 2) }}
</td>
<td>
{{ $claim->status }}
</td>
<td>
<a
href=
"{{ route('mileage::HOD.show', $claim->id) }}"
class=
"ui blue button tiny"
>
Lihat
</a>
</td>
</tr>
@empty
<tr>
<td
colspan=
"8"
class=
"center aligned"
>
Tiada rekod tuntutan terdahulu
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
@endsection
@endsection
packages/portal/mileage/resources/views/HOD/show.blade.php
View file @
93a00a5e
<title>
Maklumat Tuntutan
</title>
@
extends
(
'ui::layouts.app'
)
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
@
section
(
'content'
)
<style>
body
{
background-color
:
#f0f2f5
;
}
.ui.container
{
max-width
:
70%
!important
;
margin-top
:
2rem
;
}
.ui.segment
{
box-shadow
:
0
4px
6px
rgba
(
0
,
0
,
0
,
0.1
);
border-radius
:
10px
;
background-color
:
#fff
;
padding
:
2rem
;
}
table
.ui.definition.table
td
:first-child
{
width
:
40%
;
font-weight
:
600
;
background-color
:
#f9fafb
;
}
.totals-row
td
{
font-weight
:
700
;
background
:
#f7f7f8
;
}
.small-muted
{
font-size
:
.9rem
;
color
:
#666
;
}
</style>
<div
class=
"ui
container
"
>
<
div
class
="
ui
segment
">
<
h2
class=
"ui header"
>
Maklumat Tuntutan
</h2
>
<
a class="
ui
violet
left
ribbon
label
">Semakan Permohonan - {{
$claim->mm_apply_no
}}</a><br/><br/
>
{{-- Claim Header Info --}}
<div class="
ui
segment
">
<div class="
ui
segment
">
<h3 class="
ui
header
">Maklumat Permohonan</h3>
<table class="
ui
definition
table
">
<table class="
ui
definition
table
">
<tr>
<tr>
<td>
Tarikh Tuntut
an
</td>
<td>
No. Permohon
an</td>
<td>
{{
\Carbon\Carbon::parse($claim->claim_date)->format('d/m/Y')
}}
</td>
<td>{{
$claim->mm_apply_no
}}</td>
</tr>
</tr>
<tr>
<tr>
<td>
Jenis Kenderaa
n
</td>
<td>
Nama Pemoho
n</td>
<td>
{{ $claim->
jenisKenderaan->keterangan ?? $claim->jenisKenderaan->
name ?? '-' }}
</td>
<td>{{
$claim->
mm_staff_
name
?? '-' }}</td>
</tr>
</tr>
<tr>
<tr>
<td>
Nama Projek
</td>
<td>Bulan Tuntutan</td>
<td>
{{ $claim->project->p_project_description ?? 'Tanpa Projek' }}
</td>
<td>
@php
$bulan
= [
1=>'Januari', 2=>'Februari', 3=>'Mac', 4=>'April',
5=>'Mei', 6=>'Jun', 7=>'Julai', 8=>'Ogos',
9=>'September', 10=>'Oktober', 11=>'November', 12=>'Disember'
];
@endphp
{{ (
$bulan[$claim->mm_claim_month]
?? '-') . ' ' .
$claim->mm_claim_year
}}
</td>
</tr>
</tr>
<tr>
<tr>
<td>
Butiran Tuntutan
</td>
<td>
Tarikh Hantar
</td>
<td>
{{ $claim->
description ??
'-' }}
</td>
<td>{{
$claim->
mm_submit_date
? \Carbon\Carbon::parse(
$claim->mm_submit_date
)->format('d/m/Y') :
'-' }}</td>
</tr>
</tr>
<tr>
<tr>
<td>
Jarak Dari
</td>
<td>Status</td>
<td>
{{ $claim->distance_from ?? '-' }}
</td>
<td>
@php
$refId
=
$claim->lkpStatus
?->ref_id ?? 0;
$color
= match(
$refId
) {
1 => 'grey',
2 => 'blue',
3 => 'yellow',
4 => 'red',
5 => 'olive',
6, 8, 10 => 'orange',
7 => 'teal',
9 => 'green',
default => 'grey',
};
@endphp
<span class="
ui
{{
$color
}}
label
">{{
$claim->lkpStatus
?->description ?? '-' }}</span>
</td>
</tr>
</tr>
</table>
</div>
{{-- Claim Details Table --}}
<div class="
ui
segment
">
<h3 class="
ui
header
">Butiran Tuntutan</h3>
<table class="
ui
celled
table
">
<thead>
<tr>
<tr>
<td>
Jarak Ke
</td>
<th>No</th>
<td>
{{ $claim->distance_to ?? '-' }}
</td>
<th>Tarikh</th>
</tr>
<th>Kenderaan</th>
<th>Projek</th>
<th>Butiran</th>
<th class="
right
aligned
">Jumlah Jarak (KM)</th>
<th class="
right
aligned
">
Jumlah Perbelanjaan (RM)
<i class="
info
circle
icon
" style="
cursor
:
pointer
;
color
:
#2185d0;"
onclick
=
"$('#modalPerbelanjaan').modal('show');"
></
i
>
</
th
>
<
th
class
="
right
aligned
">
Anggaran Tuntutan (RM)
<i class="
info
circle
icon
" style="
cursor
:
pointer
;
color
:
#2185d0;"
onclick
=
"$('#modalAnggaran').modal('show');"
></
i
>
</
th
>
<tr>
<td>
Jumlah Perbatuan (KM)
</td>
<td>
{{ number_format($claim->total_mileage ?? 0, 2) }} km
</td>
</
tr
>
</
tr
>
</
thead
>
<
tbody
>
@
php
$grandAnggaran
=
0
;
@
endphp
{{-- Claimable mileage (deduct 40km rule) --}}
@
forelse
(
$claim
->
details
as
$index
=>
$detail
)
<tr>
<td>
Jumlah Perbatuan Layak Dituntut
</td>
<td>
@
php
@
php
$totalMileage = floatval($claim->total_mileage ?? 0);
$jumlahJarak
=
(
float
)
$detail
->
md_total_mileage
;
$claimable = $claim->claimable_mileage ?? max(0, $totalMileage - 40);
$claimableKm
=
max
(
0
,
$jumlahJarak
-
40
);
$vehicleName
=
strtolower
(
$detail
->
jenisKenderaan
?->
name
??
''
);
$isMotosikal
=
in_array
(
$vehicleName
,
[
'motosikal'
,
'motorcycle'
]);
$rate
=
$isMotosikal
?
0.30
:
(
$claimableKm
<=
500
?
0.55
:
0.50
);
$mileageAmount
=
$claimableKm
*
$rate
;
$jumlahBelanja
=
(
float
)
$detail
->
md_total_toll
+
(
float
)
$detail
->
md_total_parking_fee
;
$anggaranTuntutan
=
$mileageAmount
+
$jumlahBelanja
;
$grandAnggaran
+=
$anggaranTuntutan
;
@
endphp
@
endphp
<
tr
>
{{ number_format($claimable, 2) }} km
<
td
>
{{
$index
+
1
}}
</
td
>
</td>
<
td
>
{{
\Carbon\Carbon
::
parse
(
$detail
->
md_claim_date
)
->
format
(
'd/m/Y'
)
}}
</
td
>
<
td
>
{{
$detail
->
jenisKenderaan
?->
name
??
'-'
}}
</
td
>
<
td
>
{{
$detail
->
project
?
$detail
->
project
->
p_project_code
.
' - '
.
$detail
->
project
->
p_project_description
:
'Tiada Projek'
}}
</
td
>
<
td
>
{{
$detail
->
md_description
}}
</
td
>
<
td
class
="
right
aligned
">{{ number_format(
$jumlahJarak
, 1) }}</td>
<td class="
right
aligned
">{{ number_format(
$jumlahBelanja
, 2) }}</td>
<td class="
right
aligned
">{{ number_format(
$anggaranTuntutan
, 2) }}</td>
</tr>
</tr>
@empty
{{-- Show per-km rate and mileage multiplication --}}
<tr>
<tr>
<td>
Kiraan (Perbatuan × Kadar)
</td>
<td colspan="
8
" class="
center
aligned
">Tiada butiran.</td>
<td>
@php
// Determine rate by vehicle
$jenisId = $claim->jenis_kenderaan_id ?? ($claim->jenisKenderaan->id ?? null);
if ($jenisId == 1) {
$rate = ($claimable
<
=
500
)
?
0
.
55
:
0
.
50
;
//
Car
}
else
{
$
rate =
0.30;
//
Motorcycle
}
$
mileageAmount =
round($claimable
*
$
rate
,
2
);
@
endphp
<
span
class=
"small-muted"
>
{{ number_format($claimable, 2) }} km × RM {{ number_format($rate, 2) }}
</span>
=
<strong>
RM {{ number_format($mileageAmount, 2) }}
</strong>
</td>
</tr>
</tr>
@endforelse
{{-- Toll amount --}}
</tbody>
@if(
$claim->details
->count() > 0)
<tfoot>
<tr>
<tr>
<td>
Tol (RM)
</td
>
<th colspan="
7
" class="
right
aligned
">JUMLAH KESELURUHAN ANGGARAN TUNTUTAN (RM)</th
>
<td>
RM {{ number_format(floatval($claim->toll_amount ?? 0), 2) }}
</td
>
<th class="
right
aligned
">{{ number_format(
$grandAnggaran
, 2) }}</th
>
</tr>
</tr>
</tfoot>
@endif
</table>
</div>
{{-- Others amount --}}
{{-- Modal: Jumlah Perbelanjaan --}}
<div class="
ui
small
modal
" id="
modalPerbelanjaan
">
<div class="
header
"><i class="
info
circle
icon
"></i> Jumlah Perbelanjaan</div>
<div class="
content
">
<table class="
ui
definition
table
">
<tr>
<tr>
<td>
Lain-lain (RM)
</td>
<td>
Formula
</td>
<td>
RM {{ number_format(floatval($claim->others_amount ?? 0), 2) }}
</td>
<td>
Jumlah Tol + Jumlah Bayaran Letak Kereta
</td>
</tr>
</tr>
</table>
</div>
<br>
</div>
{{-- Butiran Lain-lain (always shown) --}}
{{-- Modal: Anggaran Tuntutan --}}
<div class="
ui
small
modal
" id="
modalAnggaran
">
<div class="
header
"><i class="
info
circle
icon
"></i> Formula Anggaran Tuntutan</div>
<div class="
content
">
<table class="
ui
definition
table
">
<tr>
<tr>
<td>
Butiran Lain-lai
n
</td>
<td>
KM Tuntuta
n</td>
<td>
{{ $claim->others_description ?: 'Tiada Nilai Lain-lain' }}
</td>
<td>
Jumlah KM − 40 km
</td>
</tr>
</tr>
<tr>
<td>Kadar Motosikal</td>
<td>KM Tuntutan × RM 0.30 / km</td>
</tr>
<tr>
<td>Kadar Kereta (≤ 500 km)</td>
<td>KM Tuntutan × RM 0.55 / km</td>
</tr>
<tr>
<td>Kadar Kereta (> 500 km)</td>
<td>KM Tuntutan × RM 0.50 / km</td>
</tr>
<tr>
<td>Anggaran Tuntutan</td>
<td>(KM Tuntutan × Kadar) + Jumlah Perbelanjaan</td>
</tr>
</table>
</div>
<br>
</div>
{{-- Subtotal: mileageAmount + toll + others --}}
{{-- Lampiran --}}
<div class="
ui
segment
">
<h3 class="
ui
header
">Lampiran / Bukti Transaksi</h3>
@if(
$claim->attachments
->count() > 0)
<table class="
ui
celled
table
">
<thead>
<tr>
<tr>
<td>
Jumlah Tuntutan (Perjalanan + Tol + Lain-lain)
</td>
<th>No</th>
<td>
<th>Nama Fail</th>
@php
$toll = floatval($claim->toll_amount ?? 0);
$others = floatval($claim->others_amount ?? 0);
$subtotal = round($mileageAmount + $toll + $others, 2);
@endphp
RM {{ number_format($subtotal, 2) }}
</td>
</tr>
</tr>
</thead>
<tbody>
@foreach(
$claim->attachments
as
$index
=>
$file
)
<tr>
<tr>
<td>
Penalti
</td>
<td>{{
$index
+ 1 }}
</td>
<td>
<td>
@if($claim->display_penalty_amount > 0)
<a href="
{{
asset
(
'storage/'
.
$file
->
file_path
)
}}
" target="
_blank
">
<span
style=
"color:#e53935;"
>
<i class="
file
icon
"></i> {{
$file->file_name
}}
- RM {{ number_format($claim->display_penalty_amount, 2) }}
</a>
({{ $claim->display_penalty_reason }})
</span>
@else
{{ $claim->display_penalty_reason ?? 'Tiada penalti' }}
@endif
</td>
</td>
</tr>
</tr>
@endforeach
</tbody>
</table>
@else
<p class="
ui
grey
text
">Tiada lampiran.</p>
@endif
</div>
<tr
class=
"totals-row"
>
<td>
Jumlah Akhir (RM)
</td>
{{-- Query History --}}
@if(
$claim->auditQueries
->count() > 0)
<div class="
ui
segment
">
<h3 class="
ui
header
">Sejarah Kuiri</h3>
<table class="
ui
celled
table
">
<thead>
<tr>
<th>Bil</th>
<th>Catatan HOD</th>
<th>Respons Pemohon</th>
<th>Tarikh</th>
</tr>
</thead>
<tbody>
@foreach(
$claim->auditQueries
as
$index
=>
$q
)
<tr>
<td>{{
$index
+ 1 }}</td>
<td>{{
$q->comment
?? '-' }}</td>
<td>
<td>
<strong>
RM {{ number_format(floatval($claim->display_total_claim_amount ?? $subtotal), 2) }}
</strong>
@if(
$q->response
)
{{
$q->response
}}
@else
<span class="
ui
orange
label
">Belum Dijawab</span>
@endif
</td>
</td>
<td>{{ \Carbon\Carbon::parse(
$q->created_at
)->format('d/m/Y H:i') }}</td>
</tr>
</tr>
@endforeach
</tbody>
</table>
</table>
</div>
</div>
@endif
{{-- Action Buttons --}}
@if(in_array(
$claim->status
, [2, 3]))
<div class="
ui
segment
">
<h3 class="
ui
header
">Tindakan HOD</h3>
<form id="
formTindakan
" method="
POST
">
@csrf
<input type="
hidden
" name="
hod_comment
" id="
hiddenComment
">
<div class="
ui
form
">
<div class="
field
">
<label>Pilih Tindakan</label>
<div class="
ui
radio
checkbox
" style="
margin
-
right
:
2
rem
;
">
<input type="
radio
" name="
tindakan
" value="
sokong
" id="
radioSokong
">
<label for="
radioSokong
">Sokong</label>
</div>
<div class="
ui
radio
checkbox
">
<input type="
radio
" name="
tindakan
" value="
kuiri
" id="
radioKuiri
">
<label for="
radioKuiri
">Kuiri</label>
</div>
</div>
<div class="
field
">
<label>
Catatan
<span id="
commentRequired
" style="
color
:
red
;
display
:
none
;
">*</span>
</label>
<textarea id="
hodComment
" rows="
3
" placeholder="
Masukkan
catatan
"></textarea>
</div>
</div>
<br>
</form>
</div>
@push('script')
<script>
$(document).ready(function () {
$('.ui.radio.checkbox').checkbox();
$('input[name="
tindakan
"]').on('change', function () {
if ($(this).val() === 'kuiri') {
$('#commentRequired').show();
} else {
$('#commentRequired').hide();
}
});
});
function submitTindakan() {
var tindakan = $('input[name="
tindakan
"]:checked').val();
var comment = $('#hodComment').val().trim();
if (!tindakan) {
alert('Sila pilih tindakan (Sokong atau Kuiri).');
return;
}
if (tindakan === 'kuiri' && comment === '') {
alert('Sila masukkan catatan sebelum membuat kuiri.');
return;
}
if (!confirm(tindakan === 'sokong' ? 'Sokong permohonan ini?' : 'Kuiri permohonan ini?')) return;
$('#hiddenComment').val(comment);
var url = tindakan === 'sokong'
? '{{ route('mileage::HOD.sokong',
$claim->id
) }}'
: '{{ route('mileage::HOD.kuiri',
$claim->id
) }}';
$('#formTindakan').attr('action', url).submit();
}
</script>
@endpush
@endif
<div style="
text
-
align
:
right
;
">
<a href="
{{
route
(
'mileage::HOD.index'
)
}}
" class="
ui
button
">
<a href="
{{
route
(
'mileage::HOD.index'
)
}}
" class="
ui
button
">
<i class="
arrow
left
icon
"></i> Kembali
<i class="
arrow
left
icon
"></i> Kembali
</a>
</a>
<button type="
button
" onclick="
submitTindakan
()
" class="
ui
violet
button
">
<i class="
send
icon
"></i> Hantar Tindakan
</button>
</div>
<br><br>
</div>
</div>
@endsection
@endsection
@push('script')
<script>
$(document).ready(function () {
$('#modalPerbelanjaan').modal({ closable: true });
$('#modalAnggaran').modal({ closable: true });
});
</script>
@endpush
packages/portal/mileage/resources/views/mileage/form.blade.php
View file @
93a00a5e
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<div class="
ui
error
message
">{{ session('error') }}</div>
<div class="
ui
error
message
">{{ session('error') }}</div>
@endif
@endif
{{-- Segment 1: Senarai butiran yang telah ditambah
--}}
{{-- Segment 1: Senarai butiran
--}}
<div class="
ui
segment
">
<div class="
ui
segment
">
<h3 class="
ui
header
">Senarai Butiran Tuntutan</h3>
<h3 class="
ui
header
">Senarai Butiran Tuntutan</h3>
...
@@ -31,45 +31,62 @@
...
@@ -31,45 +31,62 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
@php
@php
$grandAnggaran
= 0; @endphp
$grandAnggaran
= 0;
@endphp
@forelse(
$claim->details
as
$index
=>
$detail
)
@forelse(
$claim->details
as
$index
=>
$detail
)
@php
@php
$jumlahJarak
= (float)
$detail->md_total_mileage
;
$jumlahJarak
= (float)
$detail->md_total_mileage
;
$claimableKm
= max(0,
$jumlahJarak
- 40);
$claimableKm
= max(0,
$jumlahJarak
- 40);
$vehicleName
= strtolower(
$detail->jenisKenderaan
?->name ?? '');
$vehicleName
= strtolower(
$detail->jenisKenderaan
?->name ?? '');
$isMotosikal
= in_array(
$vehicleName
, ['motosikal', 'motorcycle']);
$isMotosikal
= in_array(
$vehicleName
, ['motosikal', 'motorcycle']);
$rate
=
$isMotosikal
? 0.30 : (
$claimableKm
<= 500 ? 0.55 : 0.50);
$rate
=
$isMotosikal
? 0.30 : (
$claimableKm
<= 500 ? 0.55 : 0.50);
$mileageAmount
=
$claimableKm
*
$rate
;
$mileageAmount
=
$claimableKm
*
$rate
;
$jumlahBelanja
= (float)
$detail->md_total_toll
+ (float)
$detail->md_total_parking_fee
;
$jumlahBelanja
= (float)
$detail->md_total_toll
+ (float)
$detail->md_total_parking_fee
;
$anggaranTuntutan
=
$mileageAmount
+
$jumlahBelanja
;
$anggaranTuntutan
=
$mileageAmount
+
$jumlahBelanja
;
$grandAnggaran
+=
$anggaranTuntutan
;
$grandAnggaran
+=
$anggaranTuntutan
;
@endphp
@endphp
<tr>
<tr>
<td>{{
$index
+ 1 }}</td>
<td>{{
$index
+ 1 }}</td>
<td>{{ \Carbon\Carbon::parse(
$detail->md_claim_date
)->format('d/m/Y') }}</td>
<td>{{ \Carbon\Carbon::parse(
$detail->md_claim_date
)->format('d/m/Y') }}</td>
<td>{{
$detail->jenisKenderaan
?->name ?? '-' }}</td>
<td>{{
$detail->jenisKenderaan
?->name ?? '-' }}</td>
<td>{{
$detail->project
?
$detail->project
->p_project_code . ' - ' .
$detail->project
->p_project_description : 'Tiada Projek' }}</td> <td>{{
$detail->md_description
}} </td>
<td>{{
$detail->project
?
$detail->project
->p_project_code . ' - ' .
$detail->project
->p_project_description : 'Tiada Projek' }}</td>
<td>{{
$detail->md_description
}}</td>
<td class="
right
aligned
">{{ number_format(
$jumlahJarak
, 1) }}</td>
<td class="
right
aligned
">{{ number_format(
$jumlahJarak
, 1) }}</td>
<td class="
right
aligned
">{{ number_format(
$jumlahBelanja
, 2) }}</td>
<td class="
right
aligned
">{{ number_format(
$jumlahBelanja
, 2) }}</td>
<td class="
right
aligned
">{{ number_format(
$anggaranTuntutan
, 2) }}</td>
<td class="
right
aligned
">{{ number_format(
$anggaranTuntutan
, 2) }}</td>
<td>
<td>
@if(
$claim->status
== 1)
<div class="
ui
small
icon
buttons
">
<button type="
button
" class="
ui
blue
button
btn
-
edit
-
detail
"
data-update-url="
{{
route
(
'mileage::mileage.claim.detail.update'
,
[
'id'
=>
$detail
->
id
])
}}
"
data-date="
{{
$detail
->
md_claim_date
}}
"
data-kenderaan="
{{
$detail
->
fk_lkp_jenis_kenderaan
}}
"
data-project="
{{
$detail
->
fk_lkp_project
}}
"
data-description="
{{
$detail
->
md_description
}}
"
data-from="
{{
$detail
->
md_distance_from
}}
"
data-to="
{{
$detail
->
md_distance_to
}}
"
data-mileage="
{{
$detail
->
md_total_mileage
}}
"
data-toll="
{{
$detail
->
md_total_toll
}}
"
data-parking="
{{
$detail
->
md_total_parking_fee
}}
">
<i class="
edit
icon
"></i>
</button>
<form action="
{{
route
(
'mileage::mileage.claim.detail.destroy'
,
[
'id'
=>
$detail
->
id
])
}}
" method="
POST
" onsubmit="
return
confirm
(
'Padam butiran ini?'
);
" style="
display
:
inline
;
">
<form action="
{{
route
(
'mileage::mileage.claim.detail.destroy'
,
[
'id'
=>
$detail
->
id
])
}}
" method="
POST
" onsubmit="
return
confirm
(
'Padam butiran ini?'
);
" style="
display
:
inline
;
">
@csrf
@csrf
@method('DELETE')
@method('DELETE')
<button type="
submit
" class="
ui
red
small
button
"><i class="
trash
icon
"></i></button>
<button type="
submit
" class="
ui
red
button
"><i class="
trash
icon
"></i></button>
</form>
</form>
</div>
@else
-
@endif
</td>
</td>
</tr>
</tr>
@empty
@empty
<tr>
<tr>
<td colspan="
8
" class="
center
aligned
">Tiada butiran ditambah lagi.</td>
<td colspan="
9
" class="
center
aligned
">Tiada butiran ditambah lagi.</td>
</tr>
</tr>
@endforelse
@endforelse
</tbody>
</tbody>
...
@@ -85,10 +102,11 @@
...
@@ -85,10 +102,11 @@
</table>
</table>
</div>
</div>
{{-- Segment 2: Tambah / Kemaskini butiran (Draf only) --}}
{{-- Segment 2: Tambah butiran --}}
@if(
$claim->status
== 1)
<div class="
ui
segment
">
<div class="
ui
segment
" id="
segment2
">
<h3 class="
ui
h
eader
">Tambah Butiran Tuntutan</h3>
<h3 class="
ui
header
" id="
segmentH
eader
">Tambah Butiran Tuntutan</h3>
@php
@php
$minDate
= sprintf('%04d-%02d-01',
$claim->mm_claim_year
,
$claim->mm_claim_month
);
$minDate
= sprintf('%04d-%02d-01',
$claim->mm_claim_year
,
$claim->mm_claim_month
);
...
@@ -96,18 +114,17 @@
...
@@ -96,18 +114,17 @@
->endOfMonth()->format('Y-m-d');
->endOfMonth()->format('Y-m-d');
@endphp
@endphp
<form class="
ui
form
" method="
POST
" action="
{{
route
(
'mileage::mileage.claim.detail.store'
,
[
'id'
=>
$claim
->
id
])
}}
">
<form class="
ui
form
" id="
detailForm
" method="
POST
" action="
{{
route
(
'mileage::mileage.claim.detail.store'
,
[
'id'
=>
$claim
->
id
])
}}
">
@csrf
@csrf
<input type="
hidden
" name="
_method
" id="
formMethod
" value="">
<div class="
two
fields
">
<div class="
two
fields
">
<div class="
field
">
<div class="
field
">
<label>Tarikh
</label>
<label>Tarikh <span style="
color
:
red
;
">*</span>
</label>
<input type="
date
" name="
md_claim_date
" min="
{{
$minDate
}}
" max="
{{
$maxDate
}}
" required>
<input type="
date
" name="
md_claim_date
" min="
{{
$minDate
}}
" max="
{{
$maxDate
}}
" required>
</div>
</div>
<div class="
field
">
<div class="
field
">
<label>Jenis Kenderaan
</label>
<label>Jenis Kenderaan <span style="
color
:
red
;
">*</span>
</label>
<select name="
fk_lkp_jenis_kenderaan
" class="
ui
dropdown
" required>
<select name="
fk_lkp_jenis_kenderaan
" class="
ui
dropdown
" required>
<option value="">-- Pilih --</option>
<option value="">-- Pilih --</option>
@foreach(
$jenisKenderaan
as
$jk
)
@foreach(
$jenisKenderaan
as
$jk
)
...
@@ -119,7 +136,13 @@
...
@@ -119,7 +136,13 @@
<div class="
two
fields
">
<div class="
two
fields
">
<div class="
field
">
<div class="
field
">
<label>Projek</label>
<label>
Projek
<i class="
info
circle
icon
"
data-content="
Jika
Tiada
Projek
,
Tinggal
Kosong
"
data-position="
top
center
"
style="
cursor
:
pointer
;
color
:
#2185d0;"></i>
</
label
>
<
select
name
=
"fk_lkp_project"
class
="
ui
search
selection
dropdown
">
<
select
name
=
"fk_lkp_project"
class
="
ui
search
selection
dropdown
">
<option value="">Tiada Projek</option>
<option value="">Tiada Projek</option>
@foreach(
$projects
as
$project
)
@foreach(
$projects
as
$project
)
...
@@ -129,25 +152,26 @@
...
@@ -129,25 +152,26 @@
@endforeach
@endforeach
</select>
</select>
</div>
</div>
<div class="
field
">
<div class="
field
">
<label>Butiran
</label>
<label>Butiran <span style="
color
:
red
;
">*</span>
</label>
<input type="
text
" name="
md_description
" placeholder="
Cth
:
Lawatan
ke
pejabat
klien
"
>
<input type="
text
" name="
md_description
" placeholder="
Cth
:
Lawatan
ke
pejabat
klien
" required
>
</div>
</div>
</div>
</div>
<div class="
two
fields
">
<div class="
two
fields
">
<div class="
field
">
<div class="
field
">
<label>Jarak Dari
</label>
<label>Jarak Dari <span style="
color
:
red
;
">*</span>
</label>
<input type="
text
" name="
md_distance_from
" placeholder="
Cth
:
Pejabat
Ipoh
" required>
<input type="
text
" name="
md_distance_from
" placeholder="
Cth
:
Pejabat
Ipoh
" required>
</div>
</div>
<div class="
field
">
<div class="
field
">
<label>Jarak Ke
</label>
<label>Jarak Ke <span style="
color
:
red
;
">*</span>
</label>
<input type="
text
" name="
md_distance_to
" placeholder="
Cth
:
Pejabat
Pulau
Pinang
" required>
<input type="
text
" name="
md_distance_to
" placeholder="
Cth
:
Pejabat
Pulau
Pinang
" required>
</div>
</div>
</div>
</div>
<div class="
field
">
<div class="
field
">
<label>Jumlah Jarak (KM)
</label>
<label>Jumlah Jarak (KM) <span style="
color
:
red
;
">*</span>
</label>
<input type="
number
" step="
0.1
" name="
md_total_mileage
" required>
<input type="
number
" step="
0.1
" name="
md_total_mileage
" required>
</div>
</div>
...
@@ -163,19 +187,90 @@
...
@@ -163,19 +187,90 @@
</div>
</div>
<br>
<br>
<button type="
button
" id="
btnBatalEdit
" class="
ui
button
" style="
display
:
none
;
">Batal Edit</button>
<button type="
submit
" class="
ui
right
floated
primary
button
">Tambah Butiran</button>
<button type="
submit
" id="
btnSubmitDetail
" class="
ui
right
floated
primary
button
">Tambah Butiran</button>
<div style="
clear
:
both
"></div>
<div style="
clear
:
both
"></div>
</form>
</form>
</div>
</div>
@endif
{{-- Segment 3: Lampiran --}}
<div class="
ui
segment
">
<h3 class="
ui
header
">Lampiran / Bukti Transaksi</h3>
@if(
$claim->attachments
->count() > 0)
<table class="
ui
celled
table
">
<thead>
<tr>
<th>No</th>
<th>Nama Fail</th>
<th>Tindakan</th>
</tr>
</thead>
<tbody>
@foreach(
$claim->attachments
as
$index
=>
$file
)
<tr>
<td>{{
$index
+ 1 }}</td>
<td>
<a href="
{{
asset
(
'storage/'
.
$file
->
file_path
)
}}
" target="
_blank
">
<i class="
file
icon
"></i> {{
$file->file_name
}}
</a>
</td>
<td>
@if(
$claim->status
== 1)
<form action="
{{
route
(
'mileage::mileage.claim.attachment.delete'
,
$file
->
id
)
}}
" method="
POST
" onsubmit="
return
confirm
(
'Padam fail ini?'
);
" style="
display
:
inline
;
">
@csrf
@method('DELETE')
<button type="
submit
" class="
ui
red
small
button
">
<i class="
trash
icon
"></i> Padam
</button>
</form>
@else
-
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
@else
<p class="
ui
grey
text
">Tiada lampiran yang dimuat naik.</p>
@endif
@if(
$claim->status
== 1)
<div class="
ui
divider
"></div>
<form class="
ui
form
" action="
{{
route
(
'mileage::mileage.claim.attachment.upload'
,
$claim
->
id
)
}}
" method="
POST
" enctype="
multipart
/
form
-
data
">
@csrf
<div class="
field
">
<label>Muat Naik Fail <span style="
color
:
red
;
">*</span></label>
<small style="
color
:
grey
;
">Format: PDF, JPG, PNG. Saiz maksimum: 5MB.</small><br><br>
<input type="
file
" name="
attachment
" accept="
.
pdf
,
.
jpg
,
.
jpeg
,
.
png
" required>
</div>
<br>
<button type="
submit
" class="
ui
primary
small
button
">
<i class="
upload
icon
"></i> Muat Naik
</button>
</form>
@endif
</div>
<br>
<br>
@if(
$claim->status
== 1)
<form action="
{{
route
(
'mileage::mileage.claim.submit'
,
[
'id'
=>
$claim
->
id
])
}}
" method="
POST
" style="
display
:
inline
;
" onsubmit="
return
confirm
(
'Hantar permohonan ini? Anda tidak boleh membuat perubahan selepas ini.'
);
">
@csrf
<button type="
submit
" class="
ui
right
floated
green
button
">
<i class="
send
icon
"></i> Hantar Permohonan
</button>
</form>
@endif
<a href="
{{
route
(
'mileage::mileage.listmileage'
)
}}
" class="
ui
right
floated
button
">
<a href="
{{
route
(
'mileage::mileage.listmileage'
)
}}
" class="
ui
right
floated
button
">
<i class="
arrow
left
icon
"></i> Kembali ke Senarai
<i class="
arrow
left
icon
"></i> Simpan Sebagai Draf
</a>
</a>
<div style="
clear
:
both
"></div>
<div style="
clear
:
both
"></div>
<br>
<br>
</div>
</div>
...
@@ -188,8 +283,53 @@
...
@@ -188,8 +283,53 @@
$('.ui.dropdown').dropdown();
$('.ui.dropdown').dropdown();
$('select[name="
fk_lkp_project
"]').dropdown('setting', 'forceSelection', false);
$('select[name="
fk_lkp_project
"]').dropdown('setting', 'forceSelection', false);
$('select[name="
fk_lkp_project
"]').dropdown('setting', 'clearable', true);
$('select[name="
fk_lkp_project
"]').dropdown('setting', 'clearable', true);
$('.info.circle.icon').popup();
var storeUrl = '{{ route('mileage::mileage.claim.detail.store', ['id' =>
$claim->id
]) }}';
$('.btn-edit-detail').on('click', function () {
var btn = $(this);
$('input[name="
md_claim_date
"]').val(btn.data('date'));
$('select[name="
fk_lkp_jenis_kenderaan
"]').dropdown('set selected', btn.data('kenderaan'));
var project = btn.data('project');
if (project) {
$('select[name="
fk_lkp_project
"]').dropdown('set selected', project);
} else {
$('select[name="
fk_lkp_project
"]').dropdown('clear');
}
$('input[name="
md_description
"]').val(btn.data('description'));
$('input[name="
md_distance_from
"]').val(btn.data('from'));
$('input[name="
md_distance_to
"]').val(btn.data('to'));
$('input[name="
md_total_mileage
"]').val(btn.data('mileage'));
$('input[name="
md_total_toll
"]').val(btn.data('toll'));
$('input[name="
md_total_parking_fee
"]').val(btn.data('parking'));
$('#detailForm').attr('action', btn.data('update-url'));
$('#formMethod').val('PUT');
$('#btnSubmitDetail').text('Kemaskini Butiran');
$('#segmentHeader').text('Kemaskini Butiran Tuntutan');
$('#btnBatalEdit').show();
$('html, body').animate({ scrollTop: $('#segment2').offset().top }, 500);
});
$('#btnBatalEdit').on('click', function () {
$('#detailForm')[0].reset();
$('#detailForm').attr('action', storeUrl);
$('#formMethod').val('');
$('#btnSubmitDetail').text('Tambah Butiran');
$('#segmentHeader').text('Tambah Butiran Tuntutan');
$('#btnBatalEdit').hide();
$('select[name="
fk_lkp_jenis_kenderaan
"]').dropdown('clear');
$('select[name="
fk_lkp_project
"]').dropdown('clear');
});
});
});
</script>
</script>
@endpush
@endpush
packages/portal/mileage/resources/views/mileage/list.blade.php
View file @
93a00a5e
...
@@ -28,9 +28,9 @@
...
@@ -28,9 +28,9 @@
<button type="
button
" class="
ui
right
floated
primary
button
" onclick="
$
(
'#modalPermohonanBaharu'
)
.
modal
(
'show'
)
">
<button type="
button
" class="
ui
right
floated
primary
button
" onclick="
$
(
'#modalPermohonanBaharu'
)
.
modal
(
'show'
)
">
Permohonan Baharu
Permohonan Baharu
</button>
</button>
<a href="
{{
route
(
'mileage::mileage.audit-trail'
)
}}
" class="
ui
right
floated
button
">
{{--
<a href="
{{
route
(
'mileage::mileage.audit-trail'
)
}}
" class="
ui
right
floated
button
">
Audit Trail
Audit Trail
</a>
</a>
--}}
<br/>
<br/>
<div class="
column
sixteen
wide
table
-
uppercase
">
<div class="
column
sixteen
wide
table
-
uppercase
">
...
@@ -81,14 +81,20 @@
...
@@ -81,14 +81,20 @@
}],
}],
['header' => __('Tindakan'), 'raw' => function(
$row
){
['header' => __('Tindakan'), 'raw' => function(
$row
){
$url
= route('mileage::mileage.claim.form', ['id' =>
$row->id
]);
$icon
= 'eye';
$color
= 'teal';
return "
<
div
class
='
ui
small
basic
icon
buttons
'>
if (
$row->status
== 1) {
<a href='
{
$url
}
' class='
ui
button
'>
$icon
= 'edit';
<i class='
file
icon
'></i>
$color
= 'blue';
</a>
} elseif (
$row->status
== 8) {
</div>";
$icon
= 'exclamation circle';
$color
= 'orange';
}
$url
= route('mileage::mileage.claim.form',
$row->id
);
return '<a href="
' . $url . '
" class="
ui
' . $color . '
small
icon
button
"><i class="
' . $icon . '
icon
"></i></a>';
}]
}]
])
])
...
...
packages/portal/mileage/resources/views/mileage/queryForm.blade.php
0 → 100644
View file @
93a00a5e
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
violet
left
ribbon
label
">Permohonan Semula - {{
$claim->mm_apply_no
}}</a><br/><br/>
@if(session('success'))
<div class="
ui
success
message
">{{ session('success') }}</div>
@endif
@if(session('error'))
<div class="
ui
error
message
">{{ session('error') }}</div>
@endif
{{-- HOD Query Info --}}
<div class="
ui
warning
message
">
<div class="
header
">Permohonan Telah Dikuiri Oleh HOD</div>
<p><strong>Catatan HOD:</strong> {{
$query->comment
?? '-' }}</p>
<p><em>Sila semak butiran dan hantar semula permohonan anda.</em></p>
</div>
{{-- Segment 1: Senarai butiran --}}
<div class="
ui
segment
">
<h3 class="
ui
header
">Senarai Butiran Tuntutan</h3>
<table class="
ui
celled
table
">
<thead>
<tr>
<th>No</th>
<th>Tarikh</th>
<th>Kenderaan</th>
<th>Projek</th>
<th>Butiran</th>
<th class="
right
aligned
">Jumlah Jarak (KM)</th>
<th class="
right
aligned
">Jumlah Perbelanjaan (RM)</th>
<th class="
right
aligned
">Anggaran Tuntutan (RM)</th>
<th>Tindakan</th>
</tr>
</thead>
<tbody>
@php
$grandAnggaran
= 0; @endphp
@forelse(
$claim->details
as
$index
=>
$detail
)
@php
$jumlahJarak
= (float)
$detail->md_total_mileage
;
$claimableKm
= max(0,
$jumlahJarak
- 40);
$vehicleName
= strtolower(
$detail->jenisKenderaan
?->name ?? '');
$isMotosikal
= in_array(
$vehicleName
, ['motosikal', 'motorcycle']);
$rate
=
$isMotosikal
? 0.30 : (
$claimableKm
<= 500 ? 0.55 : 0.50);
$mileageAmount
=
$claimableKm
*
$rate
;
$jumlahBelanja
= (float)
$detail->md_total_toll
+ (float)
$detail->md_total_parking_fee
;
$anggaranTuntutan
=
$mileageAmount
+
$jumlahBelanja
;
$grandAnggaran
+=
$anggaranTuntutan
;
@endphp
<tr>
<td>{{
$index
+ 1 }}</td>
<td>{{ \Carbon\Carbon::parse(
$detail->md_claim_date
)->format('d/m/Y') }}</td>
<td>{{
$detail->jenisKenderaan
?->name ?? '-' }}</td>
<td>{{
$detail->project
?
$detail->project
->p_project_code . ' - ' .
$detail->project
->p_project_description : 'Tiada Projek' }}</td>
<td>{{
$detail->md_description
}}</td>
<td class="
right
aligned
">{{ number_format(
$jumlahJarak
, 1) }}</td>
<td class="
right
aligned
">{{ number_format(
$jumlahBelanja
, 2) }}</td>
<td class="
right
aligned
">{{ number_format(
$anggaranTuntutan
, 2) }}</td>
<td>
<div class="
ui
small
icon
buttons
">
<button type="
button
" class="
ui
blue
button
btn
-
edit
-
detail
"
data-update-url="
{{
route
(
'mileage::mileage.claim.detail.update'
,
[
'id'
=>
$detail
->
id
])
}}
"
data-date="
{{
$detail
->
md_claim_date
}}
"
data-kenderaan="
{{
$detail
->
fk_lkp_jenis_kenderaan
}}
"
data-project="
{{
$detail
->
fk_lkp_project
}}
"
data-description="
{{
$detail
->
md_description
}}
"
data-from="
{{
$detail
->
md_distance_from
}}
"
data-to="
{{
$detail
->
md_distance_to
}}
"
data-mileage="
{{
$detail
->
md_total_mileage
}}
"
data-toll="
{{
$detail
->
md_total_toll
}}
"
data-parking="
{{
$detail
->
md_total_parking_fee
}}
">
<i class="
edit
icon
"></i>
</button>
<form action="
{{
route
(
'mileage::mileage.claim.detail.destroy'
,
[
'id'
=>
$detail
->
id
])
}}
" method="
POST
" onsubmit="
return
confirm
(
'Padam butiran ini?'
);
" style="
display
:
inline
;
">
@csrf
@method('DELETE')
<button type="
submit
" class="
ui
red
button
"><i class="
trash
icon
"></i></button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td colspan="
9
" class="
center
aligned
">Tiada butiran ditambah lagi.</td>
</tr>
@endforelse
</tbody>
@if(
$claim->details
->count() > 0)
<tfoot>
<tr>
<th colspan="
7
" class="
right
aligned
">JUMLAH KESELURUHAN ANGGARAN TUNTUTAN (RM)</th>
<th class="
right
aligned
">{{ number_format(
$grandAnggaran
, 2) }}</th>
<th></th>
</tr>
</tfoot>
@endif
</table>
</div>
{{-- Segment 2: Tambah / Kemaskini butiran --}}
<div class="
ui
segment
" id="
segment2
">
<h3 class="
ui
header
" id="
segmentHeader
">Tambah Butiran Tuntutan</h3>
@php
$minDate
= sprintf('%04d-%02d-01',
$claim->mm_claim_year
,
$claim->mm_claim_month
);
$maxDate
= \Carbon\Carbon::createFromDate(
$claim->mm_claim_year
,
$claim->mm_claim_month
, 1)
->endOfMonth()->format('Y-m-d');
@endphp
<form class="
ui
form
" id="
detailForm
" method="
POST
" action="
{{
route
(
'mileage::mileage.claim.detail.store'
,
[
'id'
=>
$claim
->
id
])
}}
">
@csrf
<input type="
hidden
" name="
_method
" id="
formMethod
" value="">
<div class="
two
fields
">
<div class="
field
">
<label>Tarikh <span style="
color
:
red
;
">*</span></label>
<input type="
date
" name="
md_claim_date
" min="
{{
$minDate
}}
" max="
{{
$maxDate
}}
" required>
</div>
<div class="
field
">
<label>Jenis Kenderaan <span style="
color
:
red
;
">*</span></label>
<select name="
fk_lkp_jenis_kenderaan
" class="
ui
dropdown
" required>
<option value="">-- Pilih --</option>
@foreach(
$jenisKenderaan
as
$jk
)
<option value="
{{
$jk
->
id
}}
">{{
$jk->name
}}</option>
@endforeach
</select>
</div>
</div>
<div class="
two
fields
">
<div class="
field
">
<label>
Projek
<i class="
info
circle
icon
"
data-content="
Jika
Tiada
Projek
,
Tinggal
Kosong
"
data-position="
top
center
"
style="
cursor
:
pointer
;
color
:
#2185d0;"></i>
</
label
>
<
select
name
=
"fk_lkp_project"
class
="
ui
search
selection
dropdown
">
<option value="">Tiada Projek</option>
@foreach(
$projects
as
$project
)
<option value="
{{
$project
->
id
}}
">
{{
$project->p_project_code
}} - {{
$project->p_project_description
}}
</option>
@endforeach
</select>
</div>
<div class="
field
">
<label>Butiran <span style="
color
:
red
;
">*</span></label>
<input type="
text
" name="
md_description
" placeholder="
Cth
:
Lawatan
ke
pejabat
klien
" required>
</div>
</div>
<div class="
two
fields
">
<div class="
field
">
<label>Jarak Dari <span style="
color
:
red
;
">*</span></label>
<input type="
text
" name="
md_distance_from
" placeholder="
Cth
:
Pejabat
Ipoh
" required>
</div>
<div class="
field
">
<label>Jarak Ke <span style="
color
:
red
;
">*</span></label>
<input type="
text
" name="
md_distance_to
" placeholder="
Cth
:
Pejabat
Pulau
Pinang
" required>
</div>
</div>
<div class="
field
">
<label>Jumlah Jarak (KM) <span style="
color
:
red
;
">*</span></label>
<input type="
number
" step="
0.1
" name="
md_total_mileage
" required>
</div>
<div class="
two
fields
">
<div class="
field
">
<label>Jumlah Tol (RM)</label>
<input type="
number
" step="
0.01
" name="
md_total_toll
" value="
0
">
</div>
<div class="
field
">
<label>Jumlah Bayaran Letak Kereta (RM)</label>
<input type="
number
" step="
0.01
" name="
md_total_parking_fee
" value="
0
">
</div>
</div>
<br>
<button type="
button
" id="
btnBatalEdit
" class="
ui
button
" style="
display
:
none
;
">Batal Edit</button>
<button type="
submit
" id="
btnSubmitDetail
" class="
ui
right
floated
primary
button
">Tambah Butiran</button>
<div style="
clear
:
both
"></div>
</form>
</div>
{{-- Segment 3: Lampiran --}}
<div class="
ui
segment
">
<h3 class="
ui
header
">Lampiran / Bukti Transaksi</h3>
@if(
$claim->attachments
->count() > 0)
<table class="
ui
celled
table
">
<thead>
<tr>
<th>No</th>
<th>Nama Fail</th>
<th>Tindakan</th>
</tr>
</thead>
<tbody>
@foreach(
$claim->attachments
as
$index
=>
$file
)
<tr>
<td>{{
$index
+ 1 }}</td>
<td>
<a href="
{{
asset
(
'storage/'
.
$file
->
file_path
)
}}
" target="
_blank
">
<i class="
file
icon
"></i> {{
$file->file_name
}}
</a>
</td>
<td>
<form action="
{{
route
(
'mileage::mileage.claim.attachment.delete'
,
$file
->
id
)
}}
" method="
POST
" onsubmit="
return
confirm
(
'Padam fail ini?'
);
" style="
display
:
inline
;
">
@csrf
@method('DELETE')
<button type="
submit
" class="
ui
red
small
button
">
<i class="
trash
icon
"></i> Padam
</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
<p class="
ui
grey
text
">Tiada lampiran.</p>
@endif
<div class="
ui
divider
"></div>
<form class="
ui
form
" action="
{{
route
(
'mileage::mileage.claim.attachment.upload'
,
$claim
->
id
)
}}
" method="
POST
" enctype="
multipart
/
form
-
data
">
@csrf
<div class="
field
">
<label>Muat Naik Fail <span style="
color
:
red
;
">*</span></label>
<small style="
color
:
grey
;
">Format: PDF, JPG, PNG. Saiz maksimum: 5MB.</small><br><br>
<input type="
file
" name="
attachment
" accept="
.
pdf
,
.
jpg
,
.
jpeg
,
.
png
" required>
</div>
<br>
<button type="
submit
" class="
ui
primary
small
button
">
<i class="
upload
icon
"></i> Muat Naik
</button>
</form>
</div>
{{-- Response & Resubmit --}}
<div class="
ui
segment
">
<h3 class="
ui
header
">Maklum Balas Kepada HOD</h3>
<form class="
ui
form
" action="
{{
route
(
'mileage::mileage.claim.resubmit'
,
[
'id'
=>
$claim
->
id
])
}}
" method="
POST
" onsubmit="
return
confirm
(
'Hantar semula permohonan ini?'
);
">
@csrf
<div class="
field
">
<label>Respons Anda <span style="
color
:
red
;
">*</span></label>
<textarea name="
response
" rows="
3
" placeholder="
Masukkan
respons
anda
terhadap
catatan
HOD
...
" required></textarea>
</div>
<br>
<div style="
text
-
align
:
right
;
">
<button type="
submit
" class="
ui
green
button
">
<i class="
send
icon
"></i> Hantar Semula Permohonan
</button>
</div>
</form>
</div>
<a href="
{{
route
(
'mileage::mileage.listmileage'
)
}}
" class="
ui
right
floated
button
">
<i class="
arrow
left
icon
"></i> Simpan Sebagai Draf
</a>
<div style="
clear
:
both
"></div>
<br>
</div>
@endsection
@push('script')
<script>
$(document).ready(function () {
$('.ui.dropdown').dropdown();
$('select[name="
fk_lkp_project
"]').dropdown('setting', 'forceSelection', false);
$('select[name="
fk_lkp_project
"]').dropdown('setting', 'clearable', true);
$('.info.circle.icon').popup();
var storeUrl = '{{ route('mileage::mileage.claim.detail.store', ['id' =>
$claim->id
]) }}';
$('.btn-edit-detail').on('click', function () {
var btn = $(this);
$('input[name="
md_claim_date
"]').val(btn.data('date'));
$('select[name="
fk_lkp_jenis_kenderaan
"]').dropdown('set selected', btn.data('kenderaan'));
var project = btn.data('project');
if (project) {
$('select[name="
fk_lkp_project
"]').dropdown('set selected', project);
} else {
$('select[name="
fk_lkp_project
"]').dropdown('clear');
}
$('input[name="
md_description
"]').val(btn.data('description'));
$('input[name="
md_distance_from
"]').val(btn.data('from'));
$('input[name="
md_distance_to
"]').val(btn.data('to'));
$('input[name="
md_total_mileage
"]').val(btn.data('mileage'));
$('input[name="
md_total_toll
"]').val(btn.data('toll'));
$('input[name="
md_total_parking_fee
"]').val(btn.data('parking'));
$('#detailForm').attr('action', btn.data('update-url'));
$('#formMethod').val('PUT');
$('#btnSubmitDetail').text('Kemaskini Butiran');
$('#segmentHeader').text('Kemaskini Butiran Tuntutan');
$('#btnBatalEdit').show();
$('html, body').animate({ scrollTop: $('#segment2').offset().top }, 500);
});
$('#btnBatalEdit').on('click', function () {
$('#detailForm')[0].reset();
$('#detailForm').attr('action', storeUrl);
$('#formMethod').val('');
$('#btnSubmitDetail').text('Tambah Butiran');
$('#segmentHeader').text('Tambah Butiran Tuntutan');
$('#btnBatalEdit').hide();
$('select[name="
fk_lkp_jenis_kenderaan
"]').dropdown('clear');
$('select[name="
fk_lkp_project
"]').dropdown('clear');
});
});
</script>
@endpush
packages/portal/mileage/routes/web.php
View file @
93a00a5e
...
@@ -72,10 +72,11 @@ function () {
...
@@ -72,10 +72,11 @@ function () {
Route
::
prefix
(
'HOD'
)
->
name
(
'HOD'
)
->
group
(
function
()
{
Route
::
prefix
(
'HOD'
)
->
name
(
'HOD'
)
->
group
(
function
()
{
Route
::
get
(
'/dashboard'
,
[
HODController
::
class
,
'index'
])
->
name
(
'.index'
);
Route
::
get
(
'/dashboard'
,
[
HODController
::
class
,
'index'
])
->
name
(
'.index'
);
Route
::
get
(
'/show/{id}'
,
[
HODController
::
class
,
'show'
])
->
name
(
'.show'
);
Route
::
get
(
'/show/{id}'
,
[
HODController
::
class
,
'show'
])
->
name
(
'.show'
);
Route
::
post
(
'/{id}/
verify'
,
[
HODController
::
class
,
'verify'
])
->
name
(
'.verify
'
);
Route
::
post
(
'/{id}/
sokong'
,
[
HODController
::
class
,
'sokong'
])
->
name
(
'.sokong
'
);
Route
::
post
(
'/{id}/
reject'
,
[
HODController
::
class
,
'reject'
])
->
name
(
'.reject
'
);
Route
::
post
(
'/{id}/
kuiri'
,
[
HODController
::
class
,
'kuiri'
])
->
name
(
'.kuiri
'
);
});
});
// BOD
// BOD
Route
::
prefix
(
'BOD'
)
->
name
(
'BOD'
)
->
group
(
function
()
{
Route
::
prefix
(
'BOD'
)
->
name
(
'BOD'
)
->
group
(
function
()
{
Route
::
get
(
'/dashboard'
,
[
BODController
::
class
,
'index'
])
->
name
(
'.index'
);
Route
::
get
(
'/dashboard'
,
[
BODController
::
class
,
'index'
])
->
name
(
'.index'
);
...
@@ -100,6 +101,11 @@ function () {
...
@@ -100,6 +101,11 @@ function () {
Route
::
get
(
'claim/{id}/form'
,
[
'uses'
=>
'MileageController@formClaim'
,
'as'
=>
'mileage.claim.form'
]);
Route
::
get
(
'claim/{id}/form'
,
[
'uses'
=>
'MileageController@formClaim'
,
'as'
=>
'mileage.claim.form'
]);
Route
::
post
(
'claim/{id}/detail/store'
,
[
'uses'
=>
'MileageController@storeDetail'
,
'as'
=>
'mileage.claim.detail.store'
]);
Route
::
post
(
'claim/{id}/detail/store'
,
[
'uses'
=>
'MileageController@storeDetail'
,
'as'
=>
'mileage.claim.detail.store'
]);
Route
::
delete
(
'claim/detail/{id}/destroy'
,
[
'uses'
=>
'MileageController@destroyDetail'
,
'as'
=>
'mileage.claim.detail.destroy'
]);
Route
::
delete
(
'claim/detail/{id}/destroy'
,
[
'uses'
=>
'MileageController@destroyDetail'
,
'as'
=>
'mileage.claim.detail.destroy'
]);
Route
::
put
(
'claim/detail/{id}/update'
,
[
'uses'
=>
'MileageController@updateDetail'
,
'as'
=>
'mileage.claim.detail.update'
]);
Route
::
post
(
'claim/{id}/submit'
,
[
'uses'
=>
'MileageController@submitClaim'
,
'as'
=>
'mileage.claim.submit'
]);
Route
::
post
(
'claim/{id}/resubmit'
,
[
'uses'
=>
'MileageController@resubmitClaim'
,
'as'
=>
'mileage.claim.resubmit'
]);
Route
::
post
(
'claim/{id}/attachment/upload'
,
[
'uses'
=>
'MileageController@uploadAttachment'
,
'as'
=>
'mileage.claim.attachment.upload'
]);
Route
::
delete
(
'claim/attachment/{id}/delete'
,
[
'uses'
=>
'MileageController@deleteAttachment'
,
'as'
=>
'mileage.claim.attachment.delete'
]);
Route
::
get
(
'audit-trail'
,
[
'uses'
=>
'MileageController@getAuditTrail'
,
'as'
=>
'mileage.audit-trail'
]);
Route
::
get
(
'audit-trail'
,
[
'uses'
=>
'MileageController@getAuditTrail'
,
'as'
=>
'mileage.audit-trail'
]);
...
...
packages/portal/mileage/src/Data/Repo/HODRepo.php
0 → 100644
View file @
93a00a5e
<?php
namespace
Portal\Mileage\Data\Repo
;
use
Portal\Mileage\Model\MileageClaimMain
;
use
Portal\Mileage\Model\MileageClaimAuditTrail
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
use
Portal\Mileage\Model\AuditQuery
;
class
HODRepo
{
public
function
getHodList
(
$request
)
{
$search
=
$request
->
get
(
'search'
);
return
MileageClaimMain
::
with
([
'lkpStatus'
,
'staffInfo'
])
->
whereIn
(
'status'
,
[
2
,
3
,
7
,
8
])
->
when
(
$search
,
function
(
$query
)
use
(
$search
)
{
$query
->
where
(
'mm_apply_no'
,
'like'
,
'%'
.
$search
.
'%'
);
})
->
orderBy
(
'created_at'
,
'desc'
)
->
paginate
(
10
);
}
public
function
findClaim
(
$id
)
{
return
MileageClaimMain
::
with
([
'details.jenisKenderaan'
,
'details.project'
,
'lkpStatus'
,
'staffInfo'
,
'auditQueries'
,
'attachments'
])
->
findOrFail
(
$id
);
}
public
function
sokongClaim
(
$id
,
$comment
=
null
)
{
$claim
=
MileageClaimMain
::
findOrFail
(
$id
);
$claim
->
update
([
'status'
=>
7
,
'mm_verified_by'
=>
Auth
::
id
(),
'mm_verified_date'
=>
now
(),
]);
MileageClaimAuditTrail
::
create
([
'fk_lkp_mileage_task'
=>
6
,
'fk_mileage_claim_main'
=>
$id
,
'action_by'
=>
Auth
::
id
(),
'remark'
=>
Auth
::
user
()
->
name
.
' Telah Sokong Permohonan Tuntutan Mileage (mileage_claim_main.id = '
.
$id
.
')'
,
]);
return
$claim
;
}
public
function
kuiriClaim
(
$id
,
$comment
)
{
$claim
=
MileageClaimMain
::
findOrFail
(
$id
);
$claim
->
update
([
'status'
=>
8
,
'query_status'
=>
1
,
]);
AuditQuery
::
create
([
'fk_main'
=>
$id
,
'user_id'
=>
Auth
::
id
(),
'comment'
=>
$comment
,
]);
MileageClaimAuditTrail
::
create
([
'fk_lkp_mileage_task'
=>
7
,
'fk_mileage_claim_main'
=>
$id
,
'action_by'
=>
Auth
::
id
(),
'remark'
=>
Auth
::
user
()
->
name
.
' Telah Kuiri Permohonan Tuntutan Mileage (mileage_claim_main.id = '
.
$id
.
')'
,
]);
return
$claim
;
}
}
packages/portal/mileage/src/Data/Repo/MileageRepo.php
View file @
93a00a5e
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
use
Portal\Mileage\Model\StaffInfo
;
use
Portal\Mileage\Model\StaffInfo
;
use
Portal\Mileage\Model\LkpFaCategory
;
use
Portal\Mileage\Model\LkpFaCategory
;
use
Portal\Mileage\Model\MileageClaimAuditTrail
;
use
Portal\Mileage\Model\MileageClaimAuditTrail
;
use
Portal\Mileage\Model\AuditQuery
;
use
Portal\Mileage\Model\MileageClaimAttachment
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
...
@@ -51,14 +52,17 @@ public function index($request)
...
@@ -51,14 +52,17 @@ public function index($request)
public
function
mileageList
(
$request
)
public
function
mileageList
(
$request
)
{
{
$search
=
request
(
'search'
);
$search
=
request
(
'search'
);
$staff
=
StaffInfo
::
where
(
'fk_users'
,
Auth
::
id
())
->
first
();
$data
=
MileageClaimMain
::
where
(
'mm_apply_no'
,
'like'
,
'%'
.
$search
.
'%'
)
$data
=
MileageClaimMain
::
where
(
'fk_lkp_staff_info'
,
$staff
->
id
??
null
)
->
where
(
'mm_apply_no'
,
'like'
,
'%'
.
$search
.
'%'
)
->
orderBy
(
'created_at'
,
'desc'
)
->
orderBy
(
'created_at'
,
'desc'
)
->
paginate
(
10
);
->
paginate
(
10
);
return
$data
;
return
$data
;
}
}
public
function
storeClaim
(
$request
)
public
function
storeClaim
(
$request
)
{
{
$staff
=
StaffInfo
::
where
(
'fk_users'
,
Auth
::
id
())
->
first
();
$staff
=
StaffInfo
::
where
(
'fk_users'
,
Auth
::
id
())
->
first
();
...
@@ -69,7 +73,6 @@ public function storeClaim($request)
...
@@ -69,7 +73,6 @@ public function storeClaim($request)
'mm_claim_month'
=>
$request
->
mm_claim_month
,
'mm_claim_month'
=>
$request
->
mm_claim_month
,
'mm_claim_year'
=>
$request
->
mm_claim_year
,
'mm_claim_year'
=>
$request
->
mm_claim_year
,
'fk_lkp_fa_category'
=>
$request
->
fk_lkp_fa_category
,
'fk_lkp_fa_category'
=>
$request
->
fk_lkp_fa_category
,
'mm_submit_date'
=>
now
(),
'status'
=>
1
,
'status'
=>
1
,
]);
]);
...
@@ -83,13 +86,12 @@ public function storeClaim($request)
...
@@ -83,13 +86,12 @@ public function storeClaim($request)
return
$claim
->
id
;
return
$claim
->
id
;
}
}
public
function
findClaim
(
$id
)
public
function
findClaim
(
$id
)
{
{
return
MileageClaimMain
::
with
(
'details'
)
->
findOrFail
(
$id
);
return
MileageClaimMain
::
with
([
'details.jenisKenderaan'
,
'details.project'
,
'auditQueries'
,
'attachments'
]
)
->
findOrFail
(
$id
);
}
}
public
function
getJenisKenderaan
()
public
function
getJenisKenderaan
()
{
{
return
JenisKenderaan
::
orderBy
(
'name'
)
->
get
();
return
JenisKenderaan
::
orderBy
(
'name'
)
->
get
();
...
@@ -134,6 +136,105 @@ public function storeDetail($request, $id)
...
@@ -134,6 +136,105 @@ public function storeDetail($request, $id)
return
$detail
;
return
$detail
;
}
}
public
function
updateDetail
(
$request
,
$detailId
)
{
$detail
=
MileageClaimDetail
::
findOrFail
(
$detailId
);
$detail
->
update
([
'fk_lkp_jenis_kenderaan'
=>
$request
->
fk_lkp_jenis_kenderaan
,
'fk_lkp_project'
=>
$request
->
fk_lkp_project
??
null
,
'md_claim_date'
=>
$request
->
md_claim_date
,
'md_description'
=>
$request
->
md_description
,
'md_distance_from'
=>
$request
->
md_distance_from
,
'md_distance_to'
=>
$request
->
md_distance_to
,
'md_total_mileage'
=>
$request
->
md_total_mileage
,
'md_total_toll'
=>
$request
->
md_total_toll
??
0
,
'md_total_parking_fee'
=>
$request
->
md_total_parking_fee
??
0
,
]);
MileageClaimAuditTrail
::
create
([
'fk_lkp_mileage_task'
=>
5
,
'fk_mileage_claim_main'
=>
$detail
->
fk_mileage_claim_main
,
'action_by'
=>
Auth
::
id
(),
'remark'
=>
Auth
::
user
()
->
name
.
' Telah Kemaskini Butiran Tuntutan (mileage_claim_detail.id = '
.
$detailId
.
')'
,
]);
return
$detail
;
}
public
function
submitClaim
(
$id
)
{
$claim
=
MileageClaimMain
::
findOrFail
(
$id
);
$claim
->
update
([
'status'
=>
2
,
'mm_submit_date'
=>
now
(),
]);
MileageClaimAuditTrail
::
create
([
'fk_lkp_mileage_task'
=>
4
,
'fk_mileage_claim_main'
=>
$id
,
'action_by'
=>
Auth
::
id
(),
'remark'
=>
Auth
::
user
()
->
name
.
' Telah Hantar Permohonan Tuntutan Mileage (mileage_claim_main.id = '
.
$id
.
')'
,
]);
return
$claim
;
}
public
function
resubmitClaim
(
$id
,
$response
)
{
$claim
=
MileageClaimMain
::
findOrFail
(
$id
);
$query
=
AuditQuery
::
where
(
'fk_main'
,
$id
)
->
whereNull
(
'response'
)
->
latest
()
->
first
();
if
(
$query
)
{
$query
->
update
([
'response'
=>
$response
]);
}
$claim
->
update
([
'status'
=>
3
,
'query_status'
=>
null
,
'mm_submit_date'
=>
now
(),
]);
MileageClaimAuditTrail
::
create
([
'fk_lkp_mileage_task'
=>
8
,
'fk_mileage_claim_main'
=>
$id
,
'action_by'
=>
Auth
::
id
(),
'remark'
=>
Auth
::
user
()
->
name
.
' Telah Hantar Semula Permohonan Tuntutan Mileage (mileage_claim_main.id = '
.
$id
.
')'
,
]);
return
$claim
;
}
public
function
uploadAttachment
(
$request
,
$id
)
{
$file
=
$request
->
file
(
'attachment'
);
$fileName
=
$file
->
getClientOriginalName
();
$filePath
=
$file
->
storeAs
(
'mileage/attachments/'
.
$id
,
$fileName
,
'public'
);
return
MileageClaimAttachment
::
create
([
'fk_main'
=>
$id
,
'file_name'
=>
$fileName
,
'file_path'
=>
$filePath
,
]);
}
public
function
deleteAttachment
(
$id
)
{
$attachment
=
MileageClaimAttachment
::
findOrFail
(
$id
);
\Illuminate\Support\Facades\Storage
::
disk
(
'public'
)
->
delete
(
$attachment
->
file_path
);
$attachment
->
delete
();
return
$attachment
;
}
public
function
destroyDetail
(
$id
)
public
function
destroyDetail
(
$id
)
{
{
$detail
=
MileageClaimDetail
::
findOrFail
(
$id
);
$detail
=
MileageClaimDetail
::
findOrFail
(
$id
);
...
...
packages/portal/mileage/src/Http/Controllers/HODController.php
View file @
93a00a5e
...
@@ -2,127 +2,47 @@
...
@@ -2,127 +2,47 @@
namespace
Portal\Mileage\Http\Controllers
;
namespace
Portal\Mileage\Http\Controllers
;
use
App\Http\Controllers
\Controller
;
use
Illuminate\Routing
\Controller
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
use
Portal\Mileage\Data\Repo\HODRepo
;
use
Carbon\Carbon
;
use
Portal\Mileage\Model\Users
;
use
Portal\Mileage\Model\Claim
;
class
HODController
extends
Controller
class
HODController
extends
Controller
{
{
public
function
index
()
protected
$repos
;
{
$hod
=
Auth
::
user
();
// check if HOD has staff info
public
function
__construct
(
HODRepo
$repos
)
if
(
!
$hod
||
!
$hod
->
staffInfo
)
{
{
return
back
()
->
with
(
'error'
,
'Maklumat jabatan HOD tidak dijumpai.'
)
;
$this
->
repos
=
$repos
;
}
}
$departmentId
=
$hod
->
staffInfo
->
fk_lkp_department
;
public
function
index
(
Request
$request
)
{
// get all staff IDs under the same department
$list
=
$this
->
repos
->
getHodList
(
$request
);
$staffIds
=
Users
::
whereHas
(
'staffInfo'
,
function
(
$query
)
use
(
$departmentId
)
{
$query
->
where
(
'fk_lkp_department'
,
$departmentId
);
})
->
pluck
(
'id'
);
// fetch claims under the HOD’s department
$claims
=
Claim
::
with
([
'user'
,
'project'
])
->
whereIn
(
'user_id'
,
$staffIds
)
->
whereNull
(
'project_id'
)
->
where
(
function
(
$q
)
use
(
$hod
)
{
$q
->
whereIn
(
'status'
,
[
'Diproses'
,
'Disokong'
])
// pending for review
->
orWhere
(
function
(
$sub
)
use
(
$hod
)
{
// Only show rejected claims that were rejected by THIS HOD
$sub
->
where
(
'status'
,
'Ditolak'
)
->
where
(
'rejected_by'
,
$hod
->
id
);
});
})
->
orderBy
(
'claim_date'
,
'desc'
)
->
get
();
return
view
(
'mileage::HOD.index'
,
compact
(
'
claims
'
));
return
view
(
'mileage::HOD.index'
,
compact
(
'
list
'
));
}
}
public
function
show
(
$id
)
public
function
show
(
$id
)
{
{
$claim
=
Claim
::
with
([
'project'
,
'jenisKenderaan'
,
'user'
])
->
findOrFail
(
$id
);
$claim
=
$this
->
repos
->
findClaim
(
$id
);
// Deduct first 40 km
$totalMileage
=
$claim
->
total_mileage
??
0
;
$claim
->
claimable_mileage
=
max
(
0
,
$totalMileage
-
40
);
// Penalty logic
$claimDate
=
Carbon
::
parse
(
$claim
->
claim_date
);
$submissionDate
=
$claim
->
created_at
??
Carbon
::
now
();
$daysDiff
=
$claimDate
->
diffInDays
(
$submissionDate
);
$claimableMileage
=
max
(
0
,
(
$claim
->
total_mileage
??
0
)
-
40
);
if
(
$claim
->
jenis_kenderaan_id
==
1
)
{
$rate
=
(
$claimableMileage
<=
500
)
?
0.55
:
0.50
;
}
else
{
$rate
=
0.30
;
}
$calculatedAmount
=
round
(
$claimableMileage
*
$rate
,
2
);
if
(
$daysDiff
<=
30
)
{
$displayPenalty
=
0
;
$displayReason
=
'Tiada penalti (≤ 1 bulan)'
;
}
elseif
(
$daysDiff
<=
90
)
{
$displayPenalty
=
$calculatedAmount
*
0.10
;
$displayReason
=
'Lewat hantar >1 ≤3 bulan (10%)'
;
}
elseif
(
$daysDiff
<=
180
)
{
$displayPenalty
=
$calculatedAmount
*
0.30
;
$displayReason
=
'Lewat hantar >3 ≤6 bulan (30%)'
;
}
else
{
$displayPenalty
=
0
;
$displayReason
=
'Tertakluk kepada BOD'
;
}
$claim
->
display_penalty_amount
=
$displayPenalty
;
$claim
->
display_penalty_reason
=
$displayReason
;
$claim
->
display_total_claim_amount
=
(
$calculatedAmount
+
(
$claim
->
toll_amount
??
0
)
+
(
$claim
->
others_amount
??
0
))
-
$displayPenalty
;
return
view
(
'mileage::HOD.show'
,
compact
(
'claim'
));
return
view
(
'mileage::HOD.show'
,
compact
(
'claim'
));
}
}
public
function
verify
(
$id
)
public
function
sokong
(
Request
$request
,
$id
)
{
{
$hod
=
Auth
::
user
();
$this
->
repos
->
sokongClaim
(
$id
,
$request
->
hod_comment
);
$claim
=
Claim
::
with
(
'user.staffInfo'
)
->
findOrFail
(
$id
);
// Check if claim is from HOD’s department
$hodDept
=
$hod
->
staffInfo
->
fk_lkp_department
??
null
;
$claimDept
=
$claim
->
user
->
staffInfo
->
fk_lkp_department
??
null
;
if
(
$hodDept
!==
$claimDept
)
{
return
redirect
()
->
route
(
'mileage::HOD.index'
)
return
back
()
->
with
(
'error'
,
'Anda tidak dibenarkan menyokong tuntutan ini
.'
);
->
with
(
'success'
,
'Permohonan berjaya disokong
.'
);
}
}
$claim
->
status
=
'Disokong'
;
public
function
kuiri
(
Request
$request
,
$id
)
$claim
->
approved_by
=
$hod
->
id
;
$claim
->
save
();
return
back
()
->
with
(
'success'
,
'Tuntutan berjaya disokong.'
);
}
public
function
reject
(
$id
)
{
{
$hod
=
Auth
::
user
();
$this
->
repos
->
kuiriClaim
(
$id
,
$request
->
hod_comment
);
$claim
=
Claim
::
with
(
'user.staffInfo'
)
->
findOrFail
(
$id
);
$hodDept
=
$hod
->
staffInfo
->
fk_lkp_department
??
null
;
$claimDept
=
$claim
->
user
->
staffInfo
->
fk_lkp_department
??
null
;
if
(
$hodDept
!==
$claimDept
)
{
return
redirect
()
->
route
(
'mileage::HOD.index'
)
return
back
()
->
with
(
'error'
,
'Anda tidak dibenarkan menolak tuntutan ini
.'
);
->
with
(
'success'
,
'Permohonan telah dikuiri dan dipulangkan kepada pemohon
.'
);
}
}
$claim
->
status
=
'Ditolak'
;
$claim
->
rejected_by
=
$hod
->
id
;
$claim
->
save
();
return
back
()
->
with
(
'error'
,
'Tuntutan telah ditolak.'
);
}
}
}
packages/portal/mileage/src/Http/Controllers/MileageController.php
View file @
93a00a5e
...
@@ -74,9 +74,15 @@ public function formClaim(Request $request, $id)
...
@@ -74,9 +74,15 @@ public function formClaim(Request $request, $id)
$jenisKenderaan
=
$this
->
repos
->
getJenisKenderaan
();
$jenisKenderaan
=
$this
->
repos
->
getJenisKenderaan
();
$projects
=
$this
->
repos
->
getProjects
();
$projects
=
$this
->
repos
->
getProjects
();
if
(
$claim
->
query_status
==
1
)
{
$query
=
$claim
->
auditQueries
()
->
whereNull
(
'response'
)
->
latest
()
->
first
();
return
view
(
'mileage::mileage.queryForm'
,
compact
(
'claim'
,
'jenisKenderaan'
,
'projects'
,
'query'
));
}
return
view
(
'mileage::mileage.form'
,
compact
(
'claim'
,
'jenisKenderaan'
,
'projects'
));
return
view
(
'mileage::mileage.form'
,
compact
(
'claim'
,
'jenisKenderaan'
,
'projects'
));
}
}
public
function
storeDetail
(
Request
$request
,
$id
)
public
function
storeDetail
(
Request
$request
,
$id
)
{
{
$this
->
repos
->
storeDetail
(
$request
,
$id
);
$this
->
repos
->
storeDetail
(
$request
,
$id
);
...
@@ -100,5 +106,53 @@ public function getAuditTrail(Request $request)
...
@@ -100,5 +106,53 @@ public function getAuditTrail(Request $request)
return
view
(
'mileage::mileage.audit-trail'
,
compact
(
'auditTrail'
));
return
view
(
'mileage::mileage.audit-trail'
,
compact
(
'auditTrail'
));
}
}
public
function
updateDetail
(
Request
$request
,
$id
)
{
$this
->
repos
->
updateDetail
(
$request
,
$id
);
$detail
=
\Portal\Mileage\Model\MileageClaimDetail
::
findOrFail
(
$id
);
return
redirect
()
->
route
(
'mileage::mileage.claim.form'
,
[
'id'
=>
$detail
->
fk_mileage_claim_main
])
->
with
(
'success'
,
'Butiran tuntutan berjaya dikemaskini.'
);
}
public
function
submitClaim
(
Request
$request
,
$id
)
{
$this
->
repos
->
submitClaim
(
$id
);
return
redirect
()
->
route
(
'mileage::mileage.listmileage'
)
->
with
(
'success'
,
'Permohonan berjaya dihantar.'
);
}
public
function
resubmitClaim
(
Request
$request
,
$id
)
{
$this
->
repos
->
resubmitClaim
(
$id
,
$request
->
response
);
return
redirect
()
->
route
(
'mileage::mileage.listmileage'
)
->
with
(
'success'
,
'Permohonan berjaya dihantar semula.'
);
}
public
function
uploadAttachment
(
Request
$request
,
$id
)
{
$request
->
validate
([
'attachment'
=>
'required|file|mimes:pdf,jpg,jpeg,png|max:5120'
,
]);
$this
->
repos
->
uploadAttachment
(
$request
,
$id
);
return
redirect
()
->
route
(
'mileage::mileage.claim.form'
,
[
'id'
=>
$id
])
->
with
(
'success'
,
'Fail berjaya dimuat naik.'
);
}
public
function
deleteAttachment
(
Request
$request
,
$id
)
{
$attachment
=
$this
->
repos
->
deleteAttachment
(
$id
);
return
redirect
()
->
route
(
'mileage::mileage.claim.form'
,
[
'id'
=>
$attachment
->
fk_main
])
->
with
(
'success'
,
'Fail berjaya dipadam.'
);
}
}
}
packages/portal/mileage/src/Model/AuditQuery.php
0 → 100644
View file @
93a00a5e
<?php
namespace
Portal\Mileage\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
App\Models\User
;
class
AuditQuery
extends
Model
{
protected
$table
=
'audit_query'
;
protected
$fillable
=
[
'fk_main'
,
'user_id'
,
'comment'
,
'response'
,
];
public
function
claim
()
{
return
$this
->
belongsTo
(
MileageClaimMain
::
class
,
'fk_main'
);
}
public
function
hod
()
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
);
}
}
packages/portal/mileage/src/Model/MileageClaimAttachment.php
0 → 100644
View file @
93a00a5e
<?php
namespace
Portal\Mileage\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
MileageClaimAttachment
extends
Model
{
protected
$table
=
'mileage_claim_attachments'
;
protected
$fillable
=
[
'fk_main'
,
'file_name'
,
'file_path'
,
];
public
function
claim
()
{
return
$this
->
belongsTo
(
MileageClaimMain
::
class
,
'fk_main'
);
}
}
packages/portal/mileage/src/Model/MileageClaimMain.php
View file @
93a00a5e
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
use
App\Models\User
;
use
App\Models\User
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Portal\Mileage\Model\AuditQuery
;
class
MileageClaimMain
extends
Model
class
MileageClaimMain
extends
Model
{
{
...
@@ -25,6 +26,7 @@ class MileageClaimMain extends Model
...
@@ -25,6 +26,7 @@ class MileageClaimMain extends Model
'mm_approved_by'
,
'mm_approved_by'
,
'mm_approved_date'
,
'mm_approved_date'
,
'status'
,
'status'
,
'query_status'
,
];
];
protected
static
function
boot
()
protected
static
function
boot
()
...
@@ -87,4 +89,16 @@ public function details()
...
@@ -87,4 +89,16 @@ public function details()
{
{
return
$this
->
hasMany
(
MileageClaimDetail
::
class
,
'fk_mileage_claim_main'
);
return
$this
->
hasMany
(
MileageClaimDetail
::
class
,
'fk_mileage_claim_main'
);
}
}
public
function
auditQueries
()
{
return
$this
->
hasMany
(
AuditQuery
::
class
,
'fk_main'
);
}
public
function
attachments
()
{
return
$this
->
hasMany
(
MileageClaimAttachment
::
class
,
'fk_main'
);
}
}
}
packages/portal/mileage/src/ServiceProvider.php
View file @
93a00a5e
...
@@ -85,56 +85,62 @@ protected function menu()
...
@@ -85,56 +85,62 @@ protected function menu()
->
data
(
'icon'
,
'home'
)
->
data
(
'icon'
,
'home'
)
->
active
(
'home/*'
);
->
active
(
'home/*'
);
$menu
->
add
(
__
(
'Project Manager Dashboard'
),
route
(
'mileage::projectManager.index'
))
$menu
=
$menus
->
add
(
__
(
'Senarai Permohonan'
))
->
data
(
'icon'
,
'align justify'
);
->
data
(
'icon'
,
'briefcase'
)
$menu
->
add
(
__
(
'Senarai Permohonan Mileage Claim'
),
route
(
'mileage::mileage.listmileage'
))
->
active
(
'projectManager/*'
)
->
data
(
'icon'
,
'bars'
)
->
data
(
'permission'
,
Permission
::
PROJECT_MANAGER
);
->
active
(
'mileage/*'
);
// $menu->add(__('Project Manager Dashboard'), route('mileage::projectManager.index'))
// ->data('icon', 'briefcase')
// ->active('projectManager/*')
// ->data('permission', Permission::PROJECT_MANAGER);
$menu
->
add
(
__
(
'Project Director Dashboard'
),
route
(
'mileage::projectDirector.index'
))
//
$menu->add(__('Project Director Dashboard'), route('mileage::projectDirector.index'))
->
data
(
'icon'
,
'compass'
)
//
->data('icon', 'compass')
->
active
(
'projectDirector/*'
)
//
->active('projectDirector/*')
->
data
(
'permission'
,
Permission
::
PROJECT_DIRECTOR
);
//
->data('permission', Permission::PROJECT_DIRECTOR);
$menu
->
add
(
__
(
'HOD Dashboard'
),
route
(
'mileage::HOD.index'
))
$menu
->
add
(
__
(
'HOD Dashboard'
),
route
(
'mileage::HOD.index'
))
->
data
(
'icon'
,
'black tie'
)
->
data
(
'icon'
,
'black tie'
)
->
active
(
'HOD/*'
)
->
active
(
'HOD/*'
)
->
data
(
'permission'
,
Permission
::
HOD
);
->
data
(
'permission'
,
Permission
::
HOD
);
$menu
->
add
(
__
(
'BOD Dashboard'
),
route
(
'mileage::BOD.index'
))
->
data
(
'icon'
,
'users cog'
)
->
active
(
'BOD/*'
)
->
data
(
'permission'
,
Permission
::
BOD
);
$menu
->
add
(
__
(
'HR Dashboard'
),
route
(
'mileage::HR
.index'
))
// $menu->add(__('BOD Dashboard'), route('mileage::BOD
.index'))
->
data
(
'icon'
,
'id badge
'
)
// ->data('icon', 'users cog
')
->
active
(
'HR
/*'
)
// ->active('BOD
/*')
->
data
(
'permission'
,
Permission
::
HR
);
// ->data('permission', Permission::BOD
);
$menu
->
add
(
__
(
'Finance Dashboard'
),
route
(
'mileage::finance
.index'
))
// $menu->add(__('HR Dashboard'), route('mileage::HR
.index'))
->
data
(
'icon'
,
'calculator
'
)
// ->data('icon', 'id badge
')
->
active
(
'finance
/*'
)
// ->active('HR
/*')
->
data
(
'permission'
,
Permission
::
FINANCE
);
// ->data('permission', Permission::HR
);
$menu
=
$menus
->
add
(
__
(
'Borang Permohonan Mileage Claim'
))
->
data
(
'icon'
,
'align justify'
);
// $menu->add(__('Finance Dashboard'), route('mileage::finance.index'))
// ->data('icon', 'calculator')
// ->active('finance/*')
// ->data('permission', Permission::FINANCE);
$now
=
Carbon
::
today
()
->
format
(
'Y-m-d
'
);
// $menu = $menus->add(__('Borang Permohonan Mileage Claim'))->data('icon', 'align justify
');
$menu
->
add
(
__
(
'Bawah Projek'
),
route
(
'mileage::applyform.index'
))
// $now = Carbon::today()->format('Y-m-d');
->
data
(
'icon'
,
'check'
)
->
active
(
'applyform/*'
);
$menu
->
add
(
__
(
'Tiada Projek'
),
route
(
'mileage::applyform.noproject
'
))
// $menu->add(__('Bawah Projek'), route('mileage::applyform.index
'))
->
data
(
'icon'
,
'close
'
)
// ->data('icon', 'check
')
->
active
(
'noproject
/*'
);
// ->active('applyform
/*');
$menu
=
$menus
->
add
(
__
(
'Senarai Permohonan'
))
->
data
(
'icon'
,
'align justify'
);
// $menu->add(__('Tiada Projek'), route('mileage::applyform.noproject'))
$menu
->
add
(
__
(
'Senarai Permohonan Mileage Claim'
),
route
(
'mileage::applications.index'
))
// ->data('icon', 'close')
->
data
(
'icon'
,
'bars'
)
// ->active('noproject/*');
->
active
(
'applications/*'
);
// $menu = $menus->add(__('Senarai Permohonan'))->data('icon', 'align justify');
// $menu->add(__('Senarai Permohonan Mileage Claim'), route('mileage::applications.index'))
// ->data('icon', 'bars')
// ->active('applications/*');
$menu
->
add
(
__
(
'Senarai Tuntutan Saya'
),
route
(
'mileage::applications.senarai'
))
//
$menu->add(__('Senarai Tuntutan Saya'), route('mileage::applications.senarai'))
->
data
(
'icon'
,
'list alternate'
)
//
->data('icon', 'list alternate')
->
active
(
'applications/senarai'
);
//
->active('applications/senarai');
});
});
...
...
packages/portal/overtime/src/ServiceProvider.php
View file @
93a00a5e
...
@@ -81,10 +81,10 @@ protected function menu()
...
@@ -81,10 +81,10 @@ protected function menu()
app
(
'laravolt.menu.sidebar'
)
->
register
(
function
(
\Lavary\Menu\Builder
$menus
)
app
(
'laravolt.menu.sidebar'
)
->
register
(
function
(
\Lavary\Menu\Builder
$menus
)
{
{
$menu
=
$menus
->
add
(
__
(
'Tuntutan Lebih Masa'
))
->
data
(
'icon'
,
'align justify'
);
//
$menu = $menus->add(__('Tuntutan Lebih Masa'))->data('icon', 'align justify');
$menu
->
add
(
__
(
'Senarai Permohonan '
),
url
(
'/overtime/list'
))
//
$menu->add(__('Senarai Permohonan '), url('/overtime/list'))
->
data
(
'icon'
,
'home'
)
//
->data('icon', 'home')
->
active
(
'overtime/*'
);
//
->active('overtime/*');
// ->data('permission', Permission::PROJECT_MANAGER);
// ->data('permission', Permission::PROJECT_MANAGER);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment