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
aa2c0374
Commit
aa2c0374
authored
Nov 07, 2025
by
Hannah Zahra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Final Update
parent
a3cb80f0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
345 additions
and
2 deletions
+345
-2
packages/portal/mileage/resources/views/BOD/show.blade.php
+153
-0
packages/portal/mileage/resources/views/HOD/index.blade.php
+1
-1
packages/portal/mileage/resources/views/HOD/show.blade.php
+153
-0
packages/portal/mileage/resources/views/application/show.blade.php
+1
-1
packages/portal/mileage/resources/views/applyform/index.blade.php
+19
-0
packages/portal/mileage/resources/views/applyform/noproject.blade.php
+18
-0
packages/portal/mileage/resources/views/projectDirector/show.blade.php
+0
-0
No files found.
packages/portal/mileage/resources/views/BOD/show.blade.php
View file @
aa2c0374
<title>
Maklumat Tuntutan
</title>
@extends('ui::layouts.app')
@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"
>
<h2
class=
"ui header"
>
Maklumat Tuntutan
</h2>
<div
class=
"ui segment"
>
<table
class=
"ui definition table"
>
<tr>
<td>
Tarikh Tuntutan
</td>
<td>
{{ \Carbon\Carbon::parse($claim->claim_date)->format('d/m/Y') }}
</td>
</tr>
<tr>
<td>
Jenis Kenderaan
</td>
<td>
{{ $claim->jenisKenderaan->keterangan ?? $claim->jenisKenderaan->name ?? '-' }}
</td>
</tr>
<tr>
<td>
Nama Projek
</td>
<td>
{{ $claim->project->p_project_description ?? 'Tanpa Projek' }}
</td>
</tr>
<tr>
<td>
Butiran Tuntutan
</td>
<td>
{{ $claim->description ?? '-' }}
</td>
</tr>
<tr>
<td>
Jarak Dari
</td>
<td>
{{ $claim->distance_from ?? '-' }}
</td>
</tr>
<tr>
<td>
Jarak Ke
</td>
<td>
{{ $claim->distance_to ?? '-' }}
</td>
</tr>
<tr>
<td>
Jumlah Perbatuan (KM)
</td>
<td>
{{ number_format($claim->total_mileage ?? 0, 2) }} km
</td>
</tr>
{{-- Claimable mileage (deduct 40km rule) --}}
<tr>
<td>
Jumlah Perbatuan Layak Dituntut
</td>
<td>
@php
$totalMileage = floatval($claim->total_mileage ?? 0);
$claimable = $claim->claimable_mileage ?? max(0, $totalMileage - 40);
@endphp
{{ number_format($claimable, 2) }} km
</td>
</tr>
{{-- Show per-km rate and mileage multiplication --}}
<tr>
<td>
Kiraan (Perbatuan × Kadar)
</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>
{{-- Toll amount --}}
<tr>
<td>
Tol (RM)
</td>
<td>
RM {{ number_format(floatval($claim->toll_amount ?? 0), 2) }}
</td>
</tr>
{{-- Others amount --}}
<tr>
<td>
Lain-lain (RM)
</td>
<td>
RM {{ number_format(floatval($claim->others_amount ?? 0), 2) }}
</td>
</tr>
{{-- Butiran Lain-lain (always shown) --}}
<tr>
<td>
Butiran Lain-lain
</td>
<td>
{{ $claim->others_description ?: 'Tiada Nilai Lain-lain' }}
</td>
</tr>
{{-- Subtotal: mileageAmount + toll + others --}}
<tr>
<td>
Jumlah Tuntutan (Perjalanan + Tol + Lain-lain)
</td>
<td>
@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
class=
"totals-row"
>
<td>
Jumlah Akhir (RM)
</td>
<td>
@php
$final = $claim->total_claim_amount ?? round($subtotal - ($displayPenalty ?? 0), 2);
@endphp
<strong>
RM {{ number_format(floatval($final), 2) }}
</strong>
</td>
</tr>
</table>
</div>
<a
href=
"{{ route('mileage::BOD.index') }}"
class=
"ui button"
>
<i
class=
"arrow left icon"
></i>
Kembali
</a>
</div>
@endsection
packages/portal/mileage/resources/views/HOD/index.blade.php
View file @
aa2c0374
...
@@ -97,7 +97,7 @@
...
@@ -97,7 +97,7 @@
<td>
{{ $claim->claim_date }}
</td>
<td>
{{ $claim->claim_date }}
</td>
<td>
{{ $claim->description ?? '-' }}
</td>
<td>
{{ $claim->description ?? '-' }}
</td>
<td>
{{ max(0, $claim->total_mileage - 40) }} km
</td>
<td>
{{ max(0, $claim->total_mileage - 40) }} km
</td>
<td>
RM {{ number_format($claim->
calculated
_amount, 2) }}
</td>
<td>
RM {{ number_format($claim->
total_claim
_amount, 2) }}
</td>
<td>
{{ $claim->status }}
</td>
<td>
{{ $claim->status }}
</td>
<td
style =
"white-space: nowrap; width: 1%;"
>
<td
style =
"white-space: nowrap; width: 1%;"
>
<a
href=
"{{ route('mileage::HOD.show', $claim->id) }}"
class=
"ui blue button tiny"
>
<a
href=
"{{ route('mileage::HOD.show', $claim->id) }}"
class=
"ui blue button tiny"
>
...
...
packages/portal/mileage/resources/views/HOD/show.blade.php
View file @
aa2c0374
<title>
Maklumat Tuntutan
</title>
@extends('ui::layouts.app')
@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"
>
<h2
class=
"ui header"
>
Maklumat Tuntutan
</h2>
<div
class=
"ui segment"
>
<table
class=
"ui definition table"
>
<tr>
<td>
Tarikh Tuntutan
</td>
<td>
{{ \Carbon\Carbon::parse($claim->claim_date)->format('d/m/Y') }}
</td>
</tr>
<tr>
<td>
Jenis Kenderaan
</td>
<td>
{{ $claim->jenisKenderaan->keterangan ?? $claim->jenisKenderaan->name ?? '-' }}
</td>
</tr>
<tr>
<td>
Nama Projek
</td>
<td>
{{ $claim->project->p_project_description ?? 'Tanpa Projek' }}
</td>
</tr>
<tr>
<td>
Butiran Tuntutan
</td>
<td>
{{ $claim->description ?? '-' }}
</td>
</tr>
<tr>
<td>
Jarak Dari
</td>
<td>
{{ $claim->distance_from ?? '-' }}
</td>
</tr>
<tr>
<td>
Jarak Ke
</td>
<td>
{{ $claim->distance_to ?? '-' }}
</td>
</tr>
<tr>
<td>
Jumlah Perbatuan (KM)
</td>
<td>
{{ number_format($claim->total_mileage ?? 0, 2) }} km
</td>
</tr>
{{-- Claimable mileage (deduct 40km rule) --}}
<tr>
<td>
Jumlah Perbatuan Layak Dituntut
</td>
<td>
@php
$totalMileage = floatval($claim->total_mileage ?? 0);
$claimable = $claim->claimable_mileage ?? max(0, $totalMileage - 40);
@endphp
{{ number_format($claimable, 2) }} km
</td>
</tr>
{{-- Show per-km rate and mileage multiplication --}}
<tr>
<td>
Kiraan (Perbatuan × Kadar)
</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>
{{-- Toll amount --}}
<tr>
<td>
Tol (RM)
</td>
<td>
RM {{ number_format(floatval($claim->toll_amount ?? 0), 2) }}
</td>
</tr>
{{-- Others amount --}}
<tr>
<td>
Lain-lain (RM)
</td>
<td>
RM {{ number_format(floatval($claim->others_amount ?? 0), 2) }}
</td>
</tr>
{{-- Butiran Lain-lain (always shown) --}}
<tr>
<td>
Butiran Lain-lain
</td>
<td>
{{ $claim->others_description ?: 'Tiada Nilai Lain-lain' }}
</td>
</tr>
{{-- Subtotal: mileageAmount + toll + others --}}
<tr>
<td>
Jumlah Tuntutan (Perjalanan + Tol + Lain-lain)
</td>
<td>
@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
class=
"totals-row"
>
<td>
Jumlah Akhir (RM)
</td>
<td>
@php
$final = $claim->total_claim_amount ?? round($subtotal - ($displayPenalty ?? 0), 2);
@endphp
<strong>
RM {{ number_format(floatval($final), 2) }}
</strong>
</td>
</tr>
</table>
</div>
<a
href=
"{{ route('mileage::HOD.index') }}"
class=
"ui button"
>
<i
class=
"arrow left icon"
></i>
Kembali
</a>
</div>
@endsection
packages/portal/mileage/resources/views/application/show.blade.php
View file @
aa2c0374
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
@foreach($claims as $c)
@foreach($claims as $c)
@php
@php
$total += $c->total_claim;
$total += $c->total_claim
_amount
;
$totalMileage += $c->total_mileage ?? 0;
$totalMileage += $c->total_mileage ?? 0;
$totalToll += $c->toll_amount ?? 0;
$totalToll += $c->toll_amount ?? 0;
$totalOthers += $c->others_amount ?? 0;
$totalOthers += $c->others_amount ?? 0;
...
...
packages/portal/mileage/resources/views/applyform/index.blade.php
View file @
aa2c0374
...
@@ -226,6 +226,25 @@
...
@@ -226,6 +226,25 @@
<script>
<script>
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
// Show / hide "Butiran Lain-lain" based on input
function
toggleOthersDescription
()
{
const
val
=
parseFloat
(
$
(
'#others_amount'
).
val
())
||
0
;
if
(
val
>
0
)
{
$
(
'#others_description_wrapper'
).
slideDown
();
$
(
'#others_description'
).
attr
(
'required'
,
true
);
}
else
{
$
(
'#others_description_wrapper'
).
slideUp
();
$
(
'#others_description'
).
removeAttr
(
'required'
).
val
(
''
);
}
}
// Run when user types
$
(
'#others_amount'
).
on
(
'input'
,
toggleOthersDescription
);
// Run on page load in case editing
toggleOthersDescription
();
// === Auto Calculation for Ringkasan Pengiraan ===
// === Auto Calculation for Ringkasan Pengiraan ===
function
updateSummary
()
{
function
updateSummary
()
{
const
totalMileage
=
parseFloat
(
$
(
'#total_mileage'
).
val
())
||
0
;
const
totalMileage
=
parseFloat
(
$
(
'#total_mileage'
).
val
())
||
0
;
...
...
packages/portal/mileage/resources/views/applyform/noproject.blade.php
View file @
aa2c0374
...
@@ -212,6 +212,24 @@
...
@@ -212,6 +212,24 @@
<script>
<script>
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
// Show / hide "Butiran Lain-lain" based on input
function
toggleOthersDescription
()
{
const
val
=
parseFloat
(
$
(
'#others_amount'
).
val
())
||
0
;
if
(
val
>
0
)
{
$
(
'#others_description_wrapper'
).
slideDown
();
$
(
'#others_description'
).
attr
(
'required'
,
true
);
}
else
{
$
(
'#others_description_wrapper'
).
slideUp
();
$
(
'#others_description'
).
removeAttr
(
'required'
).
val
(
''
);
}
}
// Run when user types
$
(
'#others_amount'
).
on
(
'input'
,
toggleOthersDescription
);
// Run on page load in case editing
toggleOthersDescription
();
// === Auto Calculation for Ringkasan Pengiraan ===
// === Auto Calculation for Ringkasan Pengiraan ===
function
updateSummary
()
{
function
updateSummary
()
{
...
...
packages/portal/mileage/resources/views/projectDirector/show.blade.php
View file @
aa2c0374
This diff is collapsed.
Click to expand it.
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