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
b5c3bfdc
Commit
b5c3bfdc
authored
Aug 07, 2026
by
Muhammad Iz'aan bin suhaimi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the pm's flow
parent
5fec6b7a
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
99 additions
and
80 deletions
+99
-80
packages/portal/mileage/resources/views/BOD/history.blade.php
+1
-1
packages/portal/mileage/resources/views/BOD/index.blade.php
+1
-1
packages/portal/mileage/resources/views/BOD/show.blade.php
+4
-4
packages/portal/mileage/resources/views/HOD/index.blade.php
+1
-1
packages/portal/mileage/resources/views/HOD/show.blade.php
+10
-6
packages/portal/mileage/resources/views/PM/index.blade.php
+1
-1
packages/portal/mileage/resources/views/PM/show.blade.php
+13
-10
packages/portal/mileage/resources/views/finance/index.blade.php
+1
-1
packages/portal/mileage/resources/views/finance/show.blade.php
+41
-42
packages/portal/mileage/resources/views/mileage/audit-trail.blade.php
+1
-1
packages/portal/mileage/resources/views/mileage/form.blade.php
+4
-4
packages/portal/mileage/src/Data/Repo/FinanceRepo.php
+4
-4
packages/portal/mileage/src/Data/Repo/HODRepo.php
+2
-2
packages/portal/mileage/src/Data/Repo/PMRepo.php
+15
-2
No files found.
packages/portal/mileage/resources/views/BOD/history.blade.php
View file @
b5c3bfdc
...
...
@@ -58,7 +58,7 @@
@if(request()->hasAny(['tahun', 'bulan', 'status', 'search']))
<a href="
{{
route
(
'mileage::BOD.history'
)
}}
" class="
ui
button
">Reset</a>
@endif
<button type="
submit
" class="
ui
violet
button
"><i class="
search
icon
"></i> Cari</button>
<button type="
submit
" class="
ui
teal
button
"><i class="
search
icon
"></i> Cari</button>
</div>
</form>
...
...
packages/portal/mileage/resources/views/BOD/index.blade.php
View file @
b5c3bfdc
...
...
@@ -16,7 +16,7 @@
<form method="
GET
" action="
{{
route
(
'mileage::BOD.index'
)
}}
" class="
ui
form
" style="
margin
-
bottom
:
1
rem
;
">
<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>
<button type="
submit
" class="
ui
teal
button
">Cari</button>
@if(request('search'))
<a href="
{{
route
(
'mileage::BOD.index'
)
}}
" class="
ui
button
">Reset</a>
@endif
...
...
packages/portal/mileage/resources/views/BOD/show.blade.php
View file @
b5c3bfdc
...
...
@@ -86,7 +86,7 @@
$dateCounts[$dk]
= (
$dateCounts[$dk]
?? 0) + 1;
}
$dateFirstSeen
= [];
$cumulativeKm
ByDate
= []
;
$cumulativeKm
= 0
;
@endphp
@forelse(
$sortedDetails
as
$index
=>
$detail
)
...
...
@@ -101,14 +101,14 @@
} else {
$claimableKm
=
$jumlahJarak
;
}
$startKm
=
$cumulativeKm
ByDate[$dateKey]
?? 0
;
$endKm
=
$
start
Km
+
$claimableKm
;
$startKm
=
$cumulativeKm
;
$endKm
=
$
cumulative
Km
+
$claimableKm
;
$mileageAmount
= 0;
foreach (
$detail->jenisKenderaan
?->rates ?? collect() as
$tier
) {
$kmInTier
= max(0, min(
$tier->km_to
,
$endKm
) - max(
$tier->km_from
,
$startKm
));
$mileageAmount
+=
$kmInTier
* (float)
$tier->rate
;
}
$cumulativeKm
ByDate[$dateKey]
=
$endKm
;
$cumulativeKm
=
$endKm
;
$jumlahTol
= (float)
$detail->md_total_toll
;
$jumlahParking
= (float)
$detail->md_total_parking_fee
;
$jumlahBelanja
=
$jumlahTol
+
$jumlahParking
;
...
...
packages/portal/mileage/resources/views/HOD/index.blade.php
View file @
b5c3bfdc
...
...
@@ -16,7 +16,7 @@
<form method="
GET
" action="
{{
route
(
'mileage::HOD.index'
)
}}
" class="
ui
form
" style="
margin
-
bottom
:
1
rem
;
">
<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>
<button type="
submit
" class="
ui
teal
button
">Cari</button>
@if(request('search'))
<a href="
{{
route
(
'mileage::HOD.index'
)
}}
" class="
ui
button
">Reset</a>
@endif
...
...
packages/portal/mileage/resources/views/HOD/show.blade.php
View file @
b5c3bfdc
...
...
@@ -83,7 +83,7 @@
$dateCounts[$dk]
= (
$dateCounts[$dk]
?? 0) + 1;
}
$dateFirstSeen
= [];
$cumulativeKm
ByDate
= []
;
$cumulativeKm
= 0
;
@endphp
@forelse(
$sortedDetails
as
$index
=>
$detail
)
...
...
@@ -98,14 +98,14 @@
} else {
$claimableKm
=
$jumlahJarak
;
}
$startKm
=
$cumulativeKm
ByDate[$dateKey]
?? 0
;
$endKm
=
$
start
Km
+
$claimableKm
;
$startKm
=
$cumulativeKm
;
$endKm
=
$
cumulative
Km
+
$claimableKm
;
$mileageAmount
= 0;
foreach (
$detail->jenisKenderaan
?->rates ?? collect() as
$tier
) {
$kmInTier
= max(0, min(
$tier->km_to
,
$endKm
) - max(
$tier->km_from
,
$startKm
));
$mileageAmount
+=
$kmInTier
* (float)
$tier->rate
;
}
$cumulativeKm
ByDate[$dateKey]
=
$endKm
;
$cumulativeKm
=
$endKm
;
$jumlahTol
= (float)
$detail->md_total_toll
;
$jumlahParking
= (float)
$detail->md_total_parking_fee
;
$jumlahBelanja
=
$jumlahTol
+
$jumlahParking
;
...
...
@@ -262,7 +262,11 @@
@endif
{{-- Action Buttons --}}
@if(in_array(
$claim->status
, [5, 8]))
@php
$hasPmReviews
=
$claim->details
->flatMap(fn(
$d
) =>
$d->pmReviews
)->isNotEmpty();
@endphp
@if(in_array(
$claim->status
, [5, 8]) || (in_array(
$claim->status
, [2, 3]) && !
$hasPmReviews
))
<div class="
ui
segment
">
<h3 class="
ui
header
">Tindakan HOD</h3>
<form id="
formTindakan
" method="
POST
">
...
...
@@ -339,7 +343,7 @@ function submitTindakan() {
<a href="
{{
route
(
'mileage::HOD.index'
)
}}
" class="
ui
button
">
<i class="
arrow
left
icon
"></i> Kembali
</a>
@if(in_array(
$claim->status
, [5, 8]))
@if(in_array(
$claim->status
, [5, 8])
|| (in_array(
$claim->status
, [2, 3]) && !
$hasPmReviews
)
)
<button type="
button
" onclick="
submitTindakan
()
" class="
ui
violet
button
">
<i class="
send
icon
"></i> Hantar Tindakan
</button>
...
...
packages/portal/mileage/resources/views/PM/index.blade.php
View file @
b5c3bfdc
...
...
@@ -16,7 +16,7 @@
<form method="
GET
" action="
{{
route
(
'mileage::PM.index'
)
}}
" class="
ui
form
" style="
margin
-
bottom
:
1
rem
;
">
<div class="
ui
action
input
">
<input type="
text
" name="
search
" value="
{{
request
(
'search'
)
}}
" placeholder="
Cari
no
.
permohonan
...
">
<button type="
submit
" class="
ui
olive
button
">Cari</button>
<button type="
submit
" class="
ui
teal
button
">Cari</button>
@if(request('search'))
<a href="
{{
route
(
'mileage::PM.index'
)
}}
" class="
ui
button
">Reset</a>
@endif
...
...
packages/portal/mileage/resources/views/PM/show.blade.php
View file @
b5c3bfdc
...
...
@@ -77,7 +77,7 @@
$dateCounts[$dk]
= (
$dateCounts[$dk]
?? 0) + 1;
}
$dateFirstSeen
= [];
$cumulativeKm
ByDate
= []
;
$cumulativeKm
= 0
;
@endphp
@forelse(
$sortedDetails
as
$index
=>
$detail
)
...
...
@@ -92,14 +92,14 @@
} else {
$claimableKm
=
$jumlahJarak
;
}
$startKm
=
$cumulativeKmByDate[$dateKey]
?? 0
;
$endKm
=
$start
Km
+
$claimableKm
;
$startKm
=
$cumulativeKm
;
$endKm
=
$cumulative
Km
+
$claimableKm
;
$mileageAmount
= 0;
foreach (
$detail->jenisKenderaan
?->rates ?? collect() as
$tier
) {
$kmInTier
= max(0, min(
$tier->km_to
,
$endKm
) - max(
$tier->km_from
,
$startKm
));
$mileageAmount
+=
$kmInTier
* (float)
$tier->rate
;
}
$cumulativeKm
ByDate[$dateKey]
=
$endKm
;
$cumulativeKm
=
$endKm
;
$jumlahTol
= (float)
$detail->md_total_toll
;
$jumlahParking
= (float)
$detail->md_total_parking_fee
;
$anggaranTuntutan
=
$mileageAmount
+
$jumlahTol
+
$jumlahParking
;
...
...
@@ -253,7 +253,7 @@
})->count();
@endphp
@if(in_array(
$claim->status
, [2, 3]) &&
$myDetails->count
() > 0)
@if(in_array(
$claim->status
, [2, 3
, 6
]) &&
$myDetails->count
() > 0)
<div class="
ui
segment
">
<h3 class="
ui
header
">Tindakan PM</h3>
<table class="
ui
celled
table
">
...
...
@@ -294,9 +294,12 @@
Semak
</button>
</form>
<button type="
button
" class="
ui
orange
mini
button
" onclick="
toggleKuiri
({{
$detail
->
id
}})
">
Kuiri
</button>
@if(
$claim->status
== 6)
<div class="
ui
yellow
message
">
<i class="
exclamation
triangle
icon
"></i>
Permohonan ini sedang dalam proses kuiri oleh PM lain. Anda hanya boleh semak sahaja.
</div>
@endif
@else
-
@endif
...
...
@@ -338,7 +341,7 @@
@endif
<div style="
text
-
align
:
right
;
">
@if(in_array(
$claim->status
, [2, 3]) &&
$myDetails->count
() > 0 &&
$myPendingCount
=== 0)
@if(in_array(
$claim->status
, [2, 3
, 6
]) &&
$myDetails->count
() > 0 &&
$myPendingCount
=== 0)
<a href="
{{
route
(
'mileage::PM.index'
)
}}
" class="
ui
button
"
onclick="
return
confirm
(
'Anda belum menghantar tindakan. Adakah anda pasti mahu kembali?'
)
">
<i class="
arrow
left
icon
"></i> Kembali
...
...
@@ -348,7 +351,7 @@
<i class="
arrow
left
icon
"></i> Kembali
</a>
@endif
@if(in_array(
$claim->status
, [2, 3]) &&
$myDetails->count
() > 0)
@if(in_array(
$claim->status
, [2, 3
, 6
]) &&
$myDetails->count
() > 0)
@if(
$myPendingCount
=== 0)
<form method="
POST
" action="
{{
route
(
'mileage::PM.submitTindakan'
,
$claim
->
id
)
}}
" style="
display
:
inline
;
">
@csrf
...
...
packages/portal/mileage/resources/views/finance/index.blade.php
View file @
b5c3bfdc
...
...
@@ -96,7 +96,7 @@
<td><span class="
ui
{{
$color
}}
label
">{{
$claim->lkpStatus
?->description ?? '-' }}</span></td>
<td>
<a href="
{{
route
(
'mileage::finance.show'
,
$claim
->
id
)
}}
" class="
ui
blue
small
button
">
<i class="
eye
icon
"></i>
<i class="
eye
icon
"></i>
Lihat
</a>
</td>
</tr>
...
...
packages/portal/mileage/resources/views/finance/show.blade.php
View file @
b5c3bfdc
...
...
@@ -94,7 +94,7 @@
$dateCounts[$dk]
= (
$dateCounts[$dk]
?? 0) + 1;
}
$dateFirstSeen
= [];
$cumulativeKm
ByDate
= []
;
$cumulativeKm
= 0
;
@endphp
@forelse(
$sortedDetails
as
$index
=>
$detail
)
...
...
@@ -109,14 +109,14 @@
} else {
$claimableKm
=
$jumlahJarak
;
}
$startKm
=
$cumulativeKmByDate[$dateKey]
?? 0
;
$endKm
=
$start
Km
+
$claimableKm
;
$startKm
=
$cumulativeKm
;
$endKm
=
$cumulative
Km
+
$claimableKm
;
$mileageAmount
= 0;
foreach (
$detail->jenisKenderaan
?->rates ?? collect() as
$tier
) {
$kmInTier
= max(0, min(
$tier->km_to
,
$endKm
) - max(
$tier->km_from
,
$startKm
));
$mileageAmount
+=
$kmInTier
* (float)
$tier->rate
;
}
$cumulativeKm
ByDate[$dateKey]
=
$endKm
;
$cumulativeKm
=
$endKm
;
$jumlahTol
= (float)
$detail->md_total_toll
;
$jumlahParking
= (float)
$detail->md_total_parking_fee
;
$anggaranTuntutan
=
$mileageAmount
+
$jumlahTol
+
$jumlahParking
;
...
...
@@ -323,44 +323,6 @@
</div>
@endif
{{-- Penalty Preview (status 9 only) --}}
@if(
$claim->status
== 9)
@php
$earliestDate
=
$claim->details
->min('md_claim_date');
$submitDate
=
$claim->mm_submit_date
?? now();
$daysDiff
= \Carbon\Carbon::parse(
$earliestDate
)->diffInDays(\Carbon\Carbon::parse(
$submitDate
));
if (
$daysDiff
<= 30) {
$previewRate
= 0;
$previewLabel
= 'Tiada penalti (≤ 30 hari)';
} elseif (
$daysDiff
<= 90) {
$previewRate
= 10;
$previewLabel
= 'Lewat hantar > 30 ≤ 90 hari (10%)';
} elseif (
$daysDiff
<= 180) {
$previewRate
= 30;
$previewLabel
= 'Lewat hantar > 90 ≤ 180 hari (30%)';
} else {
$previewRate
= null;
$previewLabel
= 'Lewat hantar > 180 hari (Tertakluk BOD)';
}
$previewPenalty
=
$previewRate
!== null ? round(
$grandAnggaran
* (
$previewRate
/ 100), 2) : 0;
$previewFinal
= round(
$grandAnggaran
-
$previewPenalty
, 2);
@endphp
<div class="
ui
segment
">
<h3 class="
ui
header
">Pengiraan Penalti</h3>
<table class="
ui
definition
table
">
<tr><td>Tarikh Tuntutan Terawal</td><td>{{ \Carbon\Carbon::parse(
$earliestDate
)->format('d/m/Y') }}</td></tr>
<tr><td>Tarikh Hantar</td><td>{{ \Carbon\Carbon::parse(
$submitDate
)->format('d/m/Y') }}</td></tr>
<tr><td>Selisih Hari</td><td>{{
$daysDiff
}} hari</td></tr>
<tr><td>Kadar Penalti</td><td>{{
$previewLabel
}}</td></tr>
<tr><td>Jumlah Anggaran</td><td>RM {{ number_format(
$grandAnggaran
, 2) }}</td></tr>
<tr><td>Potongan Penalti</td><td>RM {{ number_format(
$previewPenalty
, 2) }}</td></tr>
<tr><td><strong>Jumlah Yang Akan Dibayar</strong></td><td><strong>RM {{ number_format(
$previewFinal
, 2) }}</strong></td></tr>
</table>
</div>
@endif
{{-- Sejarah Kuiri --}}
@if(
$claim->auditQueries
->count() > 0)
<div class="
ui
segment
">
...
...
@@ -404,6 +366,43 @@
</div>
@endif
{{-- Penalty Preview (status 9 only) --}}
@if(
$claim->status
== 9)
@php
$earliestDate
=
$claim->details
->min('md_claim_date');
$submitDate
=
$claim->mm_submit_date
?? now();
$daysDiff
= \Carbon\Carbon::parse(
$earliestDate
)->diffInDays(\Carbon\Carbon::parse(
$submitDate
));
if (
$daysDiff
<= 30) {
$previewRate
= 0;
$previewLabel
= 'Tiada penalti (≤ 30 hari)';
} elseif (
$daysDiff
<= 90) {
$previewRate
= 10;
$previewLabel
= 'Lewat hantar > 30 ≤ 90 hari (10%)';
} elseif (
$daysDiff
<= 180) {
$previewRate
= 30;
$previewLabel
= 'Lewat hantar > 90 ≤ 180 hari (30%)';
} else {
$previewRate
= null;
$previewLabel
= 'Lewat hantar > 180 hari (Tertakluk BOD)';
}
$previewPenalty
=
$previewRate
!== null ? round(
$grandAnggaran
* (
$previewRate
/ 100), 2) : 0;
$previewFinal
= round(
$grandAnggaran
-
$previewPenalty
, 2);
@endphp
<div class="
ui
segment
">
<h3 class="
ui
header
">Pengiraan Penalti</h3>
<table class="
ui
definition
table
">
<tr><td>Tarikh Tuntutan Terawal</td><td>{{ \Carbon\Carbon::parse(
$earliestDate
)->format('d/m/Y') }}</td></tr>
<tr><td>Tarikh Hantar</td><td>{{ \Carbon\Carbon::parse(
$submitDate
)->format('d/m/Y') }}</td></tr>
<tr><td>Selisih Hari</td><td>{{
$daysDiff
}} hari</td></tr>
<tr><td>Kadar Penalti</td><td>{{
$previewLabel
}}</td></tr>
<tr><td>Jumlah Anggaran</td><td>RM {{ number_format(
$grandAnggaran
, 2) }}</td></tr>
<tr><td>Potongan Penalti</td><td>RM {{ number_format(
$previewPenalty
, 2) }}</td></tr>
<tr><td><strong>Jumlah Yang Akan Dibayar</strong></td><td><strong>RM {{ number_format(
$previewFinal
, 2) }}</strong></td></tr>
</table>
</div>
@endif
{{-- Finance Detail (status 11 or 12) --}}
@if(
$claim->financeDetail
)
<div class="
ui
segment
">
...
...
packages/portal/mileage/resources/views/mileage/audit-trail.blade.php
View file @
b5c3bfdc
...
...
@@ -13,7 +13,7 @@
<form method="
GET
" action="
{{
route
(
'mileage::mileage.audit-trail'
)
}}
" class="
ui
form
" style="
margin
-
bottom
:
1
rem
;
">
<div class="
ui
action
input
">
<input type="
text
" name="
search
" value="
{{
request
(
'search'
)
}}
" placeholder="
Cari
rekod
audit
...
">
<button type="
submit
" class="
ui
violet
button
">Cari</button>
<button type="
submit
" class="
ui
teal
button
">Cari</button>
@if(request('search'))
<a href="
{{
route
(
'mileage::mileage.audit-trail'
)
}}
" class="
ui
button
">Reset</a>
@endif
...
...
packages/portal/mileage/resources/views/mileage/form.blade.php
View file @
b5c3bfdc
...
...
@@ -89,7 +89,7 @@
$dateCounts[$dk]
= (
$dateCounts[$dk]
?? 0) + 1;
}
$dateFirstSeen
= [];
$cumulativeKm
ByDate
= []
;
$cumulativeKm
= 0
;
@endphp
@forelse(
$sortedDetails
as
$index
=>
$detail
)
...
...
@@ -104,14 +104,14 @@
} else {
$claimableKm
=
$jumlahJarak
;
}
$startKm
=
$cumulativeKm
ByDate[$dateKey]
?? 0
;
$endKm
=
$
start
Km
+
$claimableKm
;
$startKm
=
$cumulativeKm
;
$endKm
=
$
cumulative
Km
+
$claimableKm
;
$mileageAmount
= 0;
foreach (
$detail->jenisKenderaan
?->rates ?? collect() as
$tier
) {
$kmInTier
= max(0, min(
$tier->km_to
,
$endKm
) - max(
$tier->km_from
,
$startKm
));
$mileageAmount
+=
$kmInTier
* (float)
$tier->rate
;
}
$cumulativeKm
ByDate[$dateKey]
=
$endKm
;
$cumulativeKm
=
$endKm
;
$jumlahTol
= (float)
$detail->md_total_toll
;
$jumlahParking
= (float)
$detail->md_total_parking_fee
;
$jumlahBelanja
=
$jumlahTol
+
$jumlahParking
;
...
...
packages/portal/mileage/src/Data/Repo/FinanceRepo.php
View file @
b5c3bfdc
...
...
@@ -166,7 +166,7 @@ private function calculateTotal($claim)
$total
=
0
;
$sortedDetails
=
$claim
->
details
->
sortBy
(
'md_claim_date'
)
->
values
();
$dateFirstSeen
=
[];
$cumulativeKm
ByDate
=
[]
;
$cumulativeKm
=
0
;
$deductionCount
=
0
;
foreach
(
$sortedDetails
as
$detail
)
{
...
...
@@ -180,8 +180,8 @@ private function calculateTotal($claim)
}
else
{
$claimableKm
=
$jumlahJarak
;
}
$startKm
=
$cumulativeKmByDate
[
$dateKey
]
??
0
;
$endKm
=
$start
Km
+
$claimableKm
;
$startKm
=
$cumulativeKm
;
$endKm
=
$cumulative
Km
+
$claimableKm
;
$mileageAmount
=
0
;
foreach
(
$detail
->
jenisKenderaan
?->
rates
??
collect
()
as
$tier
)
{
...
...
@@ -189,7 +189,7 @@ private function calculateTotal($claim)
$mileageAmount
+=
$kmInTier
*
(
float
)
$tier
->
rate
;
}
$cumulativeKm
ByDate
[
$dateKey
]
=
$endKm
;
$cumulativeKm
=
$endKm
;
$total
+=
$mileageAmount
+
(
float
)
$detail
->
md_total_toll
+
(
float
)
$detail
->
md_total_parking_fee
;
}
...
...
packages/portal/mileage/src/Data/Repo/HODRepo.php
View file @
b5c3bfdc
...
...
@@ -20,7 +20,7 @@ public function getHodList($request)
->
where
(
function
(
$q
)
{
$q
->
whereIn
(
'status'
,
[
5
])
->
orWhere
(
function
(
$q2
)
{
$q2
->
where
(
'status'
,
2
)
$q2
->
where
In
(
'status'
,
[
2
,
3
]
)
->
whereDoesntHave
(
'pmReviews'
);
});
})
...
...
@@ -32,9 +32,9 @@ public function getHodList($request)
})
->
orderBy
(
'created_at'
,
'desc'
)
->
paginate
(
10
);
}
public
function
getHodHistory
(
$request
)
{
$search
=
$request
->
get
(
'search'
);
...
...
packages/portal/mileage/src/Data/Repo/PMRepo.php
View file @
b5c3bfdc
...
...
@@ -17,7 +17,16 @@ public function getPmList($request)
$employeeCode
=
Auth
::
user
()
->
employeeCode
;
return
MileageClaimMain
::
with
([
'lkpStatus'
,
'staffInfo'
])
->
whereIn
(
'status'
,
[
2
,
3
])
->
where
(
function
(
$q
)
use
(
$employeeCode
)
{
$q
->
whereIn
(
'status'
,
[
2
,
3
])
->
orWhere
(
function
(
$q2
)
use
(
$employeeCode
)
{
$q2
->
where
(
'status'
,
6
)
->
whereHas
(
'pmReviews'
,
function
(
$q3
)
use
(
$employeeCode
)
{
$q3
->
where
(
'pm_employee_code'
,
$employeeCode
)
->
where
(
'status'
,
'pending'
);
});
});
})
->
whereHas
(
'pmReviews'
,
function
(
$q
)
use
(
$employeeCode
)
{
$q
->
where
(
'pm_employee_code'
,
$employeeCode
);
})
...
...
@@ -26,6 +35,7 @@ public function getPmList($request)
})
->
orderBy
(
'created_at'
,
'desc'
)
->
paginate
(
10
);
}
public
function
findClaim
(
$id
)
...
...
@@ -103,8 +113,11 @@ public function submitTindakan($claimId)
'remark'
=>
Auth
::
user
()
->
name
.
' Telah Kuiri Permohonan Tuntutan Mileage (mileage_claim_main.id = '
.
$claimId
.
')'
,
]);
}
else
{
$this
->
checkAllReviewed
(
$claimId
);
if
(
$claim
->
status
!==
6
)
{
$this
->
checkAllReviewed
(
$claimId
);
}
}
}
private
function
checkAllReviewed
(
$claimId
)
...
...
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