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
8a10485b
Commit
8a10485b
authored
Aug 18, 2026
by
Muhammad Iz'aan bin suhaimi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pdf download
parent
786bc219
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
204 additions
and
162 deletions
+204
-162
packages/portal/mileage/resources/views/mileage/pdf.blade.php
+198
-129
packages/portal/mileage/routes/web.php
+3
-31
packages/portal/mileage/src/Http/Controllers/MileageController.php
+2
-1
packages/portal/mileage/src/Model/MileageClaimMain.php
+1
-1
No files found.
packages/portal/mileage/resources/views/mileage/pdf.blade.php
View file @
8a10485b
...
...
@@ -2,224 +2,293 @@
<html>
<head>
<meta
charset=
"utf-8"
>
<title>
T
untutan Mileage
- {{ $claim->mm_apply_no }}
</title>
<title>
T
ravelling Claims Form
- {{ $claim->mm_apply_no }}
</title>
<style>
body
{
font-family
:
Arial
,
sans-serif
;
font-size
:
12px
;
color
:
#333
;
margin
:
20px
;
}
h2
{
font-size
:
13px
;
border-bottom
:
2px
solid
#333
;
padding-bottom
:
4px
;
margin-top
:
20px
;
}
table
{
width
:
100%
;
border-collapse
:
collapse
;
margin-bottom
:
10px
;
font-size
:
11px
;
}
th
{
background-color
:
#f0f0f0
;
border
:
1px
solid
#ccc
;
padding
:
5px
8px
;
text-align
:
left
;
}
td
{
border
:
1px
solid
#ccc
;
padding
:
5px
8px
;
vertical-align
:
top
;
}
*
{
margin
:
0
;
padding
:
0
;
}
body
{
font-family
:
Arial
,
sans-serif
;
font-size
:
11px
;
color
:
#000
;
margin
:
20px
30px
;
}
.title-wrapper
{
text-align
:
center
;
margin-bottom
:
14px
;
}
.title-box
{
display
:
inline-block
;
border
:
2px
solid
#000
;
padding
:
7px
40px
;
font-size
:
14px
;
font-weight
:
bold
;
letter-spacing
:
1px
;
}
.info-table
{
width
:
100%
;
border-collapse
:
collapse
;
font-size
:
11px
;
margin-bottom
:
6px
;
}
.info-table
td
{
padding
:
2px
3px
;
}
.info-value
{
border-bottom
:
1px
solid
#000
;
}
.category-table
{
width
:
100%
;
border-collapse
:
collapse
;
margin-bottom
:
8px
;
font-size
:
11px
;
}
.checkbox-cell
{
width
:
12px
;
height
:
12px
;
border
:
1px
solid
#000
;
text-align
:
center
;
vertical-align
:
middle
;
padding
:
0
;
}
.checkbox-checked
{
background-color
:
#000
;
}
.claim-table
{
width
:
100%
;
border-collapse
:
collapse
;
font-size
:
9.5px
;
}
.claim-table
th
{
border
:
1px
solid
#000
;
padding
:
4px
3px
;
text-align
:
center
;
font-weight
:
bold
;
}
.claim-table
td
{
border
:
1px
solid
#000
;
padding
:
3px
4px
;
height
:
17px
;
vertical-align
:
middle
;
}
.right
{
text-align
:
right
;
}
.center
{
text-align
:
center
;
}
.label
{
background-color
:
#f9f9f9
;
font-weight
:
bold
;
width
:
25%
;
}
tfoot
td
{
background-color
:
#f0f0f0
;
font-weight
:
bold
;
}
.footer
{
margin-top
:
30px
;
font-size
:
10px
;
color
:
#666
;
text-align
:
center
;
border-top
:
1px
solid
#ccc
;
padding-top
:
8px
;
}
.sig-table
{
width
:
100%
;
border-collapse
:
collapse
;
margin-top
:
12px
;
}
.sig-table
td
{
border
:
1px
solid
#000
;
padding
:
5px
8px
;
vertical-align
:
top
;
width
:
25%
;
height
:
80px
;
font-size
:
10px
;
}
.note
{
margin-top
:
8px
;
font-size
:
9px
;
}
</style>
</head>
<body>
{{-- Header --}}
<div
style=
"text-align:center; margin-bottom:20px;"
>
<div
style=
"font-size:15px; font-weight:bold;"
>
SISTEM TUNTUTAN MILEAGE
</div>
<div
style=
"font-size:13px; font-weight:bold; margin-top:4px;"
>
BORANG TUNTUTAN MILEAGE
</div>
<div
style=
"margin-top:4px;"
>
No. Permohonan:
<strong>
{{ $claim->mm_apply_no }}
</strong></div>
</div>
{{-- 1. Maklumat Permohonan --}}
<h2>
1. Maklumat Permohonan
</h2>
@php
$bulan = [
1=>'J
anuari', 2=>'Februari', 3=>'Mac', 4=>'April
',
5=>'M
ei', 6=>'Jun', 7=>'Julai', 8=>'Ogos
',
9=>'S
eptember', 10=>'Oktober', 11=>'November', 12=>'Disember
'
$bulan
Nama
= [
1=>'J
ANUARY', 2=>'FEBRUARY', 3=>'MARCH', 4=>'APRIL
',
5=>'M
AY', 6=>'JUNE', 7=>'JULY', 8=>'AUGUST
',
9=>'S
EPTEMBER', 10=>'OCTOBER', 11=>'NOVEMBER', 12=>'DECEMBER
'
];
$bulanLabel = $bulanNama[$claim->mm_claim_month] ?? '';
@endphp
<table>
<tr>
<td
class=
"label"
>
No. Permohonan
</td>
<td>
{{ $claim->mm_apply_no }}
</td>
<td
class=
"label"
>
Status
</td>
<td>
{{ $claim->lkpStatus?->description ?? '-' }}
</td>
</tr>
{{-- Title --}}
<div
class=
"title-wrapper"
>
<div
class=
"title-box"
>
TRAVELLING CLAIMS FORM {{ $bulanLabel }} {{ $claim->mm_claim_year }}
</div>
</div>
{{-- Info Header --}}
<table
class=
"info-table"
>
<tr>
<td
class=
"label"
>
Nama Pemohon
</td>
<td>
{{ $claim->mm_staff_name ?? '-' }}
</td>
<td
class=
"label"
>
Kategori FA
</td>
<td>
{{ $claim->faCategory?->fa_category ?? '-' }}
</td>
<td
style=
"width:9%;"
>
Name
</td>
<td
style=
"width:2%;"
>
:
</td>
<td
class=
"info-value"
style=
"width:37%;"
>
{{ $claim->mm_staff_name ?? '-' }}
</td>
<td
style=
"width:9%;"
>
Company
</td>
<td
style=
"width:2%;"
>
:
</td>
<td
class=
"info-value"
>
{{ $claim->mm_staff_company ?? '3F Resources Sdn Bhd' }}
</td>
</tr>
<tr>
<td
class=
"label"
>
Bulan Tuntutan
</td>
<td>
{{ ($bulan[$claim->mm_claim_month] ?? '-') . ' ' . $claim->mm_claim_year }}
</td>
<td
class=
"label"
>
Tarikh Hantar
</td>
<td>
{{ $claim->mm_submit_date ? \Carbon\Carbon::parse($claim->mm_submit_date)->format('d/m/Y') : '-' }}
</td>
<td>
Position
</td>
<td>
:
</td>
<td
class=
"info-value"
>
</td>
<td>
Date
</td>
<td>
:
</td>
<td
class=
"info-value"
>
{{ $claim->mm_submit_date ? \Carbon\Carbon::parse($claim->mm_submit_date)->format('d-m-Y') : '-' }}
</td>
</tr>
</table>
<div
style=
"height:6px;"
></div>
{{-- Category --}}
@php
$catName = strtolower($claim->faCategory?->fa_category ?? '');
$isOther = str_contains($catName, 'pm')
|| str_contains($catName, 'sales')
|| str_contains($catName, 'other');
$isFaOnly = !$isOther;
@endphp
<table
class=
"category-table"
>
<tr>
<td
class=
"label"
>
Disokong Oleh (HOD)
</td>
<td>
{{ $claim->verifiedBy?->name ?? '-' }}{{ $claim->mm_verified_date ? ' (' . \Carbon\Carbon::parse($claim->mm_verified_date)->format('d/m/Y') . ')' : '' }}
</td>
<td
class=
"label"
>
Diluluskan Oleh (BOD)
</td>
<td>
{{ $claim->approvedBy?->name ?? '-' }}{{ $claim->mm_approved_date ? ' (' . \Carbon\Carbon::parse($claim->mm_approved_date)->format('d/m/Y') . ')' : '' }}
</td>
<td
style=
"padding-right:8px; white-space:nowrap;"
>
Category
:
</td>
<td
class=
"checkbox-cell {{ $isFaOnly ? 'checkbox-checked' : '' }}"
>
</td>
<td
style=
"padding: 0 30px 0 5px; white-space:nowrap;"
>
Employee with FA only
</td>
<td
class=
"checkbox-cell {{ $isOther ? 'checkbox-checked' : '' }}"
>
</td>
<td
style=
"padding-left:5px;"
>
Employee with FA
&
other allowance (PM / Sales Allowance)
</td>
</tr>
</table>
{{-- 2. Butiran Tuntutan --}}
<h2>
2. Butiran Tuntutan
</h2>
{{-- Main Claim Table --}}
@php
$grandAnggaran = 0; $grandTol = 0; $grandParking = 0; $grandJarak = 0;
$deductionCount = 0;
$grandJarak = 0;
$grandTol = 0;
$grandParking = 0;
$grandAnggaran = 0;
$sortedDetails = $claim->details->sortBy('md_claim_date')->values();
$rowCount = $sortedDetails->count();
$minRows = 12;
$dateFirstSeen = [];
$deductionCount = 0;
$cumulativeKm = 0;
@endphp
<table>
<table
class=
"claim-table"
>
<thead>
<tr>
<th>
No
</th>
<th
>
Tarikh
</th>
<th
>
Kenderaan
</th>
<th
>
Projek
</th>
<th
>
Butira
n
</th>
<th
class=
"right"
>
Jarak
(KM)
</th>
<th
class=
"right"
>
To
l (RM)
</th>
<th
class=
"right"
>
Parking
(RM)
</th>
<th
class=
"right"
>
Anggaran
(RM)
</th>
<th
style=
"width:4%;"
>
No
</th>
<th
style=
"width:8%;"
>
Date
</th>
<th
style=
"width:10%;"
>
Vehicle
</th>
<th
style=
"width:14%;"
>
Project
</th>
<th
style=
"width:21%;"
>
Descriptio
n
</th>
<th
style=
"width:9%;"
>
Total
<br>
Distance
(KM)
</th>
<th
style=
"width:8%;"
>
Total
<br>
Tol
l (RM)
</th>
<th
style=
"width:13%;"
>
Total
<br>
Parking Fees
(RM)
</th>
<th
style=
"width:13%;"
>
Estimated
<br>
Claim
(RM)
</th>
</tr>
</thead>
<tbody>
@fore
lse
($sortedDetails as $index => $detail)
@fore
ach
($sortedDetails as $index => $detail)
@php
$jumlahJarak = (float) $detail->md_total_mileage;
$jumlahTol = (float) $detail->md_total_toll;
$jumlahParking = (float) $detail->md_total_parking_fee;
// 40km first-trip deduction (max 10 days)
$dateKey = $detail->md_claim_date;
$isFirstOfDate = !isset($dateFirstSeen[$dateKey]);
if ($isFirstOfDate) $dateFirstSeen[$dateKey] = true;
if ($isFirstOfDate) { $dateFirstSeen[$dateKey] = true; }
if ($isFirstOfDate
&&
$deductionCount
<
10
)
{
$
claimableKm =
max(0,
$
jumlahJarak
-
40
);
$
deductionCount
++;
}
else
{
$
claimableKm =
$jumlahJarak;
}
$
startKm =
$cumulativeKm;
$
endKm =
$cumulativeKm
+
$
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 = $endKm;
$jumlahTol = (float) $detail->md_total_toll;
$jumlahParking = (float) $detail->md_total_parking_fee;
$anggaranTuntutan = $mileageAmount + $jumlahTol + $jumlahParking;
$grandJarak += $jumlahJarak;
$grandTol += $jumlahTol;
$grandParking += $jumlahParking;
$grandAnggaran += $anggaranTuntutan;
$projekLabel = $detail->project
? $detail->project->p_project_code . ' - ' . $detail->project->p_project_description
: 'Tiada Projek';
@endphp
<tr>
<td
class=
"center"
>
{{ $index + 1 }}
</td>
<td>
{{ \Carbon\Carbon::parse($dateKey)->format('d/m/Y') }}
</td>
<td
class=
"center"
>
{{ \Carbon\Carbon::parse($dateKey)->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>
{{ $
projekLabel
}}
</td>
<td>
{{ $detail->md_description }}
</td>
<td
class=
"right"
>
{{ number_format($jumlahJarak, 1) }}
</td>
<td
class=
"right"
>
{{ number_format($jumlahTol, 2) }}
</td>
<td
class=
"right"
>
{{ number_format($jumlahParking, 2) }}
</td>
<td
class=
"right"
>
{{ number_format($anggaranTuntutan, 2) }}
</td>
</tr>
@empty
<tr><td
colspan=
"9"
class=
"center"
>
Tiada butiran.
</td></tr>
@endforelse
@endforeach
</tbody>
@if($claim->details->count() > 0)
<tfoot>
<tr>
<td
colspan=
"5"
class=
"right"
>
JUMLAH KESELURUHAN
</td>
<td
class=
"right
"
>
{{ number_format($grandJarak, 1) }}
</td>
<td
class=
"right
"
>
{{ number_format($grandTol, 2) }}
</td>
<td
class=
"right
"
>
{{ number_format($grandParking, 2) }}
</td>
<td
class=
"right
"
>
{{ number_format($grandAnggaran, 2) }}
</td>
<td
colspan=
"5"
class=
"center"
style=
"font-weight:bold;"
>
TOTAL AMOUNT
</td>
<td
class=
"right"
style=
"font-weight:bold;
"
>
{{ number_format($grandJarak, 1) }}
</td>
<td
class=
"right"
style=
"font-weight:bold;
"
>
{{ number_format($grandTol, 2) }}
</td>
<td
class=
"right"
style=
"font-weight:bold;
"
>
{{ number_format($grandParking, 2) }}
</td>
<td
class=
"right"
style=
"font-weight:bold;
"
>
{{ number_format($grandAnggaran, 2) }}
</td>
</tr>
</tfoot>
@endif
</table>
{{--
3. Pelarasan Kewangan
--}}
{{--
Financial Summary
--}}
@if($claim->financeDetail)
<h2>
3. Pelarasan Kewangan
</h2>
<table>
<div
style=
"margin-top:12px;"
>
<div
style=
"font-weight:bold; font-size:11px; margin-bottom:4px; border-bottom:1px solid #000; padding-bottom:3px;"
>
Finance Decision
</div>
<table
style=
"width:100%; border-collapse:collapse; font-size:10px;"
>
<tr>
<td
style=
"border:1px solid #000; padding:4px 8px; background:#f0f0f0; font-weight:bold; width:50%;"
>
Original Estimated Amount
</td>
<td
style=
"border:1px solid #000; padding:4px 8px;"
>
RM {{ number_format($claim->financeDetail->fin_original_amount, 2) }}
</td>
</tr>
<tr>
<td
class=
"label"
>
Jumlah Asal (RM)
</td>
<td
class=
"right"
>
{{ number_format($claim->financeDetail->fin_original_amount, 2) }}
</td>
<td
class=
"label"
>
Kadar Penalti
</td>
<td
class=
"right"
>
<td
style=
"border:1px solid #000; padding:4px 8px; background:#f0f0f0; font-weight:bold;"
>
Penalty Rate
</td>
<td
style=
"border:1px solid #000; padding:4px 8px;"
>
@if($claim->financeDetail->fin_penalty_rate === null)
Budi Bicara BOD
BOD Discretion
@else
{{ $claim->financeDetail->fin_penalty_rate
}}%
{{ number_format($claim->financeDetail->fin_penalty_rate, 2)
}}%
@endif
</td>
</tr>
<tr>
<td
class=
"label"
>
Jumlah Penalti (RM)
</td>
<td
class=
"right"
>
{{ number_format($claim->financeDetail->fin_penalty_amount, 2) }}
</td>
<td
class=
"label"
>
Jumlah Akhir (RM)
</td>
<td
class=
"right"
><strong>
{{ number_format($claim->financeDetail->fin_final_amount, 2) }}
</strong></td>
<td
style=
"border:1px solid #000; padding:4px 8px; background:#f0f0f0; font-weight:bold;"
>
Penalty Deduction
</td>
<td
style=
"border:1px solid #000; padding:4px 8px;"
>
RM {{ number_format($claim->financeDetail->fin_penalty_amount, 2) }}
</td>
</tr>
<tr>
<td
style=
"border:1px solid #000; padding:4px 8px; background:#f0f0f0; font-weight:bold;"
>
Final Claim Amount
</td>
<td
style=
"border:1px solid #000; padding:4px 8px; font-weight:bold;"
>
RM {{ number_format($claim->financeDetail->fin_final_amount, 2) }}
</td>
</tr>
@if($claim->financeDetail->fin_amendment_remark)
<tr>
<td
class=
"label"
>
Catatan Pindaan
</td>
<td
colspan=
"3
"
>
{{ $claim->financeDetail->fin_amendment_remark }}
</td>
<td
style=
"border:1px solid #000; padding:4px 8px; background:#f0f0f0; font-weight:bold;"
>
Amendment Remark
</td>
<td
style=
"border:1px solid #000; padding:4px 8px;
"
>
{{ $claim->financeDetail->fin_amendment_remark }}
</td>
</tr>
@endif
</table>
@endif
{{-- 4. Lampiran --}}
@if($claim->attachments->count() > 0)
<h2>
4. Lampiran / Bukti Transaksi
</h2>
<table>
<thead>
<tr><th>
No
</th><th>
Nama Fail
</th></tr>
</thead>
<tbody>
@foreach($claim->attachments as $index => $file)
<tr>
<td
class=
"center"
>
{{ $index + 1 }}
</td>
<td>
{{ $file->file_name }}
</td>
<td
style=
"border:1px solid #000; padding:4px 8px; background:#f0f0f0; font-weight:bold;"
>
Reviewed By
</td>
<td
style=
"border:1px solid #000; padding:4px 8px;"
>
{{ $claim->financeDetail->processedBy?->name ?? '-' }}
@if($claim->financeDetail->fin_processed_date)
({{ \Carbon\Carbon::parse($claim->financeDetail->fin_processed_date)->format('d/m/Y') }})
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
{{-- 5. Sejarah Kuiri --}}
@if($claim->auditQueries->count() > 0)
<h2>
5. Sejarah Kuiri
</h2>
<table>
<thead>
<tr>
<th>
Bil
</th>
<th>
Dikuiri Oleh
</th>
<th>
Catatan
</th>
<th>
Respons Pemohon
</th>
<th>
Tarikh
</th>
</tr>
</thead>
<tbody>
@foreach($claim->auditQueries as $index => $q)
{{-- Signature Section --}}
<table
class=
"sig-table"
>
<tr>
<td
class=
"center"
>
{{ $index + 1 }}
</td>
<td
class=
"center"
>
{{ $q->kuiri_by ?? '-' }}
</td>
<td>
{{ $q->comment ?? '-' }}
</td>
<td>
{{ $q->response ?? 'Belum Dijawab' }}
</td>
<td
class=
"center"
>
{{ \Carbon\Carbon::parse($q->created_at)->format('d/m/Y H:i') }}
</td>
<td>
Prepared by :
<br><br>
{{ $claim->mm_staff_name ?? '-' }}
</td>
<td>
Verified by :(GM/HOD/HOU/PM)
<br><br>
{{ $claim->verifiedBy?->name ?? '-' }}
<br>
@if($claim->mm_verified_date)
<span
style=
"font-size:9px;"
>
{{ \Carbon\Carbon::parse($claim->mm_verified_date)->format('d/m/Y') }}
</span>
@endif
</td>
<td>
Approve by Director :-
<br><br>
{{ $claim->approvedBy?->name ?? '-' }}
<br>
@if($claim->mm_approved_date)
<span
style=
"font-size:9px;"
>
{{ \Carbon\Carbon::parse($claim->mm_approved_date)->format('d/m/Y') }}
</span>
@endif
</td>
<td>
ACCT. Dept
</td>
</tr>
@endforeach
</tbody>
</table>
@endif
<div
class=
"footer"
>
Dokumen ini dijana secara automatik oleh sistem pada {{ \Carbon\Carbon::now()->format('d/m/Y H:i') }}.
</div>
</body>
</html>
packages/portal/mileage/routes/web.php
View file @
8a10485b
<?php
use
Illuminate\Support\Facades\Route
;
use
Portal\Mileage\Http\Controllers\ApplyformController
;
use
Portal\Mileage\Http\Controllers\ApplicationsController
;
use
Portal\Mileage\Http\Controllers\PMController
;
use
Portal\Mileage\Http\Controllers\ProjectDirectorController
;
use
Portal\Mileage\Http\Controllers\HODController
;
use
Portal\Mileage\Http\Controllers\BODController
;
use
Portal\Mileage\Http\Controllers\HRController
;
...
...
@@ -19,23 +16,6 @@
'middleware'
=>
[
'web'
,
'auth'
],
],
function
()
{
// Applyform
Route
::
prefix
(
'applyform'
)
->
name
(
'applyform'
)
->
group
(
function
()
{
Route
::
get
(
'/'
,
[
ApplyformController
::
class
,
'index'
])
->
name
(
'.index'
);
Route
::
get
(
'/noproject'
,
[
ApplyformController
::
class
,
'noproject'
])
->
name
(
'.noproject'
);
Route
::
get
(
'/applyform/getDates'
,
[
ApplyformController
::
class
,
'getDates'
])
->
name
(
'.getDates'
);
});
// Route::resource('applyform', ApplyformController::class);
// Applications
Route
::
get
(
'applications/senarai'
,
[
ApplicationsController
::
class
,
'senarai'
])
->
name
(
'applications.senarai'
);
Route
::
resource
(
'applications'
,
ApplicationsController
::
class
);
Route
::
put
(
'applications/{id}/updateStatus'
,
[
ApplicationsController
::
class
,
'updateStatus'
])
->
name
(
'applications.updateStatus'
);
Route
::
get
(
'applications/view/claim/{id}'
,
[
ApplicationsController
::
class
,
'viewEach'
])
->
name
(
'applications.viewEach'
);
Route
::
put
(
'applications/{id}'
,
[
ApplicationsController
::
class
,
'update'
])
->
name
(
'applications.update'
);
/// PM
Route
::
prefix
(
'PM'
)
->
name
(
'PM'
)
->
group
(
function
()
{
Route
::
get
(
'/dashboard'
,
[
PMController
::
class
,
'index'
])
->
name
(
'.index'
);
...
...
@@ -45,16 +25,6 @@ function () {
Route
::
post
(
'/{id}/submitTindakan'
,
[
PMController
::
class
,
'submitTindakan'
])
->
name
(
'.submitTindakan'
);
});
// Project Director
Route
::
prefix
(
'projectDirector'
)
->
name
(
'projectDirector'
)
->
group
(
function
()
{
Route
::
get
(
'/dashboard'
,
[
ProjectDirectorController
::
class
,
'index'
])
->
name
(
'.index'
);
Route
::
get
(
'/show/{projectId}/{userId}'
,
[
ProjectDirectorController
::
class
,
'show'
])
->
name
(
'.show'
);
Route
::
post
(
'/approve-month'
,
[
ProjectDirectorController
::
class
,
'approveMonth'
])
->
name
(
'.approveMonth'
);
Route
::
post
(
'/reject-month'
,
[
ProjectDirectorController
::
class
,
'rejectMonth'
])
->
name
(
'.rejectMonth'
);
Route
::
post
(
'/claim/{id}/approve'
,
[
ProjectDirectorController
::
class
,
'approveClaim'
])
->
name
(
'.approveClaim'
);
Route
::
post
(
'/claim/{id}/reject'
,
[
ProjectDirectorController
::
class
,
'rejectClaim'
])
->
name
(
'.rejectClaim'
);
});
// Finance
Route
::
prefix
(
'finance'
)
->
name
(
'finance'
)
->
group
(
function
()
{
Route
::
get
(
'/dashboard'
,
[
FinanceController
::
class
,
'index'
])
->
name
(
'.index'
);
...
...
@@ -117,10 +87,12 @@ function () {
Route
::
get
(
'department/{id}/edit'
,
[
DepartmentController
::
class
,
'edit'
])
->
name
(
'department.edit'
);
Route
::
put
(
'department/{id}'
,
[
DepartmentController
::
class
,
'update'
])
->
name
(
'department.update'
);
Route
::
delete
(
'department/{id}'
,
[
DepartmentController
::
class
,
'destroy'
])
->
name
(
'department.destroy'
);
}
Route
::
get
(
'claim/{id}/pdf'
,
[
'uses'
=>
'MileageController@downloadPdf'
,
'as'
=>
'mileage.claim.downloadPdf'
]);
}
);
// Guest group (currently unused)
...
...
packages/portal/mileage/src/Http/Controllers/MileageController.php
View file @
8a10485b
...
...
@@ -189,6 +189,7 @@ public function downloadPdf(Request $request, $id)
'attachments'
,
'faCategory'
,
'financeDetail'
,
'financeDetail.processedBy'
,
])
->
findOrFail
(
$id
);
if
(
!
in_array
(
$claim
->
status
,
[
11
,
12
]))
{
...
...
@@ -205,7 +206,7 @@ public function downloadPdf(Request $request, $id)
}
$html
=
view
(
'mileage::mileage.pdf'
,
compact
(
'claim'
))
->
render
();
$pdf
=
\Barryvdh\DomPDF\Facade\Pdf
::
loadHTML
(
$html
)
->
setPaper
(
'A4'
,
'
portrait
'
);
$pdf
=
\Barryvdh\DomPDF\Facade\Pdf
::
loadHTML
(
$html
)
->
setPaper
(
'A4'
,
'
landscape
'
);
return
$pdf
->
download
(
'Tuntutan_Mileage_'
.
$claim
->
mm_apply_no
.
'.pdf'
);
...
...
packages/portal/mileage/src/Model/MileageClaimMain.php
View file @
8a10485b
...
...
@@ -49,7 +49,7 @@ protected static function boot()
public
static
function
generateApplyNo
()
:
string
{
$year
=
now
()
->
format
(
'Y'
);
$prefix
=
"
M
C-
{
$year
}
-"
;
$prefix
=
"
T
C-
{
$year
}
-"
;
$last
=
static
::
where
(
'mm_apply_no'
,
'like'
,
"
{
$prefix
}
%"
)
->
orderByDesc
(
'mm_apply_no'
)
...
...
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