first commit - system mileage

parent 0779f4cb
<?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('lkp_fa_category', function (Blueprint $table) {
$table->id();
$table->string('fa_category', 150);
$table->integer('status')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('lkp_fa_category');
}
};
<?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_main', function (Blueprint $table) {
$table->id();
$table->string('mm_apply_no')->unique();
$table->unsignedInteger('fk_lkp_staff_info')->nullable()->index();
$table->string('mm_staff_name')->nullable();
$table->integer('mm_staff_position')->nullable();
$table->integer('mm_staff_id')->nullable();
$table->integer('mm_staff_company')->nullable();
$table->timestamp('mm_submit_date')->nullable();
$table->unsignedInteger('fk_lkp_fa_category')->nullable()->index();
$table->unsignedInteger('mm_verified_by')->nullable()->index();
$table->timestamp('mm_verified_date')->nullable();
$table->unsignedInteger('mm_approved_by')->nullable()->index();
$table->timestamp('mm_approved_date')->nullable();
$table->unsignedInteger('status')->nullable()->index();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mileage_claim_main');
}
};
<?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_detail', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('fk_mileage_claim_main')->index();
$table->unsignedBigInteger('fk_lkp_jenis_kenderaan')->index();
$table->unsignedInteger('fk_lkp_project')->nullable()->index();
$table->timestamp('md_claim_date');
$table->string('md_description')->nullable();
$table->float('md_distance_from');
$table->float('md_distance_to');
$table->float('md_total_mileage');
$table->float('md_total_toll')->default(0);
$table->float('md_total_parking_fee')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mileage_claim_detail');
}
};
<?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('mm_claim_month')->nullable()->after('mm_submit_date');
$table->integer('mm_claim_year')->nullable()->after('mm_claim_month');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('mileage_claim_main', function (Blueprint $table) {
$table->dropColumn(['mm_claim_month', 'mm_claim_year']);
});
}
};
<?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_detail', function (Blueprint $table) {
$table->dropColumn(['md_distance_from', 'md_distance_to']);
});
Schema::table('mileage_claim_detail', function (Blueprint $table) {
$table->string('md_distance_from')->nullable()->after('md_description');
$table->string('md_distance_to')->nullable()->after('md_distance_from');
});
}
public function down()
{
Schema::table('mileage_claim_detail', function (Blueprint $table) {
$table->dropColumn(['md_distance_from', 'md_distance_to']);
});
Schema::table('mileage_claim_detail', function (Blueprint $table) {
$table->float('md_distance_from')->after('md_description');
$table->float('md_distance_to')->after('md_distance_from');
});
}
};
<?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('lkp_status', function (Blueprint $table) {
$table->string('module')->nullable()->after('id');
$table->integer('ref_id')->nullable()->after('module');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('lkp_status', function (Blueprint $table) {
$table->dropColumn(['module', 'ref_id']);
});
}
};
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Portal\Mileage\Model\LkpFaCategory;
class LkpFaCategorySeeder extends Seeder
{
public function run()
{
$categories = [
'Employee with FA only',
'Employee with FA & other allowance (PM / Sales Allowance)',
];
foreach ($categories as $category) {
LkpFaCategory::create([
'fa_category' => $category,
'status' => 1,
]);
}
}
}
@extends('ui::layouts.app')
@section('content')
<div class="ui segment">
<a class="ui violet left ribbon label">Permohonan Tuntutan Mileage - {{ $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
{{-- Segment 1: Senarai butiran yang telah ditambah --}}
<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>Jumlah Jarak (KM)</th>
<th>Jumlah Perbelanjaan (RM)</th>
<th>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?->p_project_description ?? '-' }}</td>
<td>{{ number_format($jumlahJarak, 1) }}</td>
<td>{{ number_format($jumlahBelanja, 2) }}</td>
<td>{{ number_format($anggaranTuntutan, 2) }}</td>
<td>
<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 small button"><i class="trash icon"></i></button>
</form>
</td>
</tr>
@empty
<tr>
<td colspan="8" class="center aligned">Tiada butiran ditambah lagi.</td>
</tr>
@endforelse
</tbody>
@if($claim->details->count() > 0)
<tfoot>
<tr>
<th colspan="6" class="right aligned">JUMLAH KESELURUHAN ANGGARAN TUNTUTAN (RM)</th>
<th>{{ number_format($grandAnggaran, 2) }}</th>
<th></th>
</tr>
</tfoot>
@endif
</table>
</div>
{{-- Segment 2: Tambah butiran --}}
<div class="ui segment">
<h3 class="ui header">Tambah Butiran Tuntutan</h3>
<form class="ui form" method="POST" action="{{ route('mileage::mileage.claim.detail.store', ['id' => $claim->id]) }}">
@csrf
<div class="two fields">
<div class="field">
<label>Tarikh</label>
<input type="date" name="md_claim_date" required>
</div>
<div class="field">
<label>Jenis Kenderaan</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</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_description }}</option>
@endforeach
</select>
</div>
<div class="field">
<label>Butiran</label>
<input type="text" name="md_description" placeholder="Cth: Lawatan ke pejabat klien">
</div>
</div>
<div class="two fields">
<div class="field">
<label>Jarak Dari</label>
<input type="text" name="md_distance_from" placeholder="Cth: Pejabat Ipoh" required>
</div>
<div class="field">
<label>Jarak Ke</label>
<input type="text" name="md_distance_to" placeholder="Cth: Pejabat Pulau Pinang" required>
</div>
</div>
<div class="field">
<label>Jumlah Jarak (KM)</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>
<button type="submit" class="ui primary button">Tambah Butiran</button>
</form>
</div>
<a href="{{ route('mileage::mileage.listmileage') }}" class="ui button">
<i class="arrow left icon"></i> Kembali ke Senarai
</a>
</div>
@endsection
@push('script')
<script>
$(document).ready(function () {
$('.ui.dropdown').dropdown();
});
</script>
@endpush
@extends('ui::layouts.app')
@section('content')
<style>
.table-uppercase td
{
text-transform: uppercase;
}
</style>
<div class="ui segment">
<a class="ui violet left ribbon label">Senarai Permohonan Tuntutan Mileage</a><br/>
<div class="ui segment">
@if(session('success'))
<div class="ui success message">{{ session('success') }}</div>
@endif
@if(session('error'))
<div class="ui error message">{{ session('error') }}</div>
@endif
<button type="button" class="ui right floated primary button" onclick="$('#modalPermohonanBaharu').modal('show')">
Permohonan Baharu
</button>
<br/>
<div class="column sixteen wide table-uppercase">
<h1 class="ui header">Senarai Permohonan Tuntutan Mileage</h1>
{!!
Suitable::source($list)
->title(__('Senarai Permohonan Tuntutan Mileage'))
->columns([
\Laravolt\Suitable\Columns\Numbering::make('No'),
['header' => __('Claim No'), 'field' => 'mm_apply_no', 'sortable' => true],
['header' => __('Bulan'), 'raw' => function($row){
$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',
];
if (!$row->mm_claim_month || !$row->mm_claim_year) {
return '-';
}
return ($bulan[$row->mm_claim_month] ?? $row->mm_claim_month) . ' ' . $row->mm_claim_year;
}],
['header' => __('Tarikh Hantar'), 'raw' => function($row){
return $row->mm_submit_date
? \Carbon\Carbon::parse($row->mm_submit_date)->format('d/m/Y')
: '-';
}],
['header' => __('Status'), 'raw' => function($row){
$status = $row->lkpStatus?->description ?? 'Draf';
$color = match($status) {
'Draf' => 'grey',
'Diproses' => 'blue',
'Disokong' => 'green',
'Disahkan' => 'olive',
'Disemak' => 'purple',
'Dibayar' => 'teal',
'Ditolak' => 'red',
default => 'grey',
};
return '<span class="ui ' . $color . ' label">' . $status . '</span>';
}],
['header' => __('Tindakan'), 'raw' => function($row){
$url = route('mileage::mileage.claim.form', ['id' => $row->id]);
return "
<div class='ui small basic icon buttons'>
<a href='{$url}' class='ui button'>
<i class='file icon'></i>
</a>
</div>";
}]
])
->render()
!!}
</div>
<br/><br/>
</div>
</div>
{{-- Modal: Permohonan Baharu --}}
<div class="ui small modal" id="modalPermohonanBaharu">
<i class="close icon"></i>
<div class="header">
Permohonan Baharu
</div>
<div class="content">
<form class="ui form" method="POST" action="{{ route('mileage::mileage.claim.store') }}" id="formPermohonanBaharu">
@csrf
<div class="field">
<label>Bulan Tuntutan</label>
<select name="mm_claim_month" class="ui dropdown" required>
<option value="">-- Pilih Bulan --</option>
@foreach([
1 => 'Januari', 2 => 'Februari', 3 => 'Mac', 4 => 'April',
5 => 'Mei', 6 => 'Jun', 7 => 'Julai', 8 => 'Ogos',
9 => 'September', 10 => 'Oktober', 11 => 'November', 12 => 'Disember',
] as $value => $label)
<option value="{{ $value }}" {{ now()->month == $value ? 'selected' : '' }}>{{ $label }}</option>
@endforeach
</select>
</div>
<div class="field">
<label>Tahun Tuntutan</label>
<select name="mm_claim_year" class="ui dropdown" required>
@for($y = now()->year; $y >= now()->year - 2; $y--)
<option value="{{ $y }}" {{ now()->year == $y ? 'selected' : '' }}>{{ $y }}</option>
@endfor
</select>
</div>
<div class="field">
<label>Kategori FA</label>
<select name="fk_lkp_fa_category" class="ui dropdown" required>
<option value="">-- Pilih Kategori --</option>
@foreach($faCategories as $category)
<option value="{{ $category->id }}">{{ $category->fa_category }}</option>
@endforeach
</select>
</div>
</form>
</div>
<div class="actions">
<div class="ui black deny button">Batal</div>
<div class="ui primary approve button" onclick="document.getElementById('formPermohonanBaharu').submit()">
Seterusnya
</div>
</div>
</div>
@endsection
@push('script')
<script>
$(document).ready(function () {
$('.ui.dropdown').dropdown();
$('#modalPermohonanBaharu').modal();
});
</script>
@endpush
......@@ -12,7 +12,8 @@
Route::group(
[
'prefix' => '',
'namespace' => '\Portal\Mileage\Http\Controllers',
'prefix' => 'mileage',
'as' => 'mileage::',
'middleware' => ['web', 'auth'],
],
......@@ -26,6 +27,7 @@ function () {
// 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');
......@@ -90,6 +92,15 @@ function () {
Route::post('/{id}/reject', [HRController::class, 'reject'])->name('.reject');
Route::get('/export', [HRController::class, 'export'])->name('.export');
});
Route::get('index', ['uses' => 'MileageController@index', 'as' => 'mileage.index']);
Route::get('list', ['uses' => 'MileageController@getListMileage', 'as' => 'mileage.listmileage']);
Route::post('claim/store', ['uses' => 'MileageController@storeClaim', 'as' => 'mileage.claim.store']);
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::delete('claim/detail/{id}/destroy', ['uses' => 'MileageController@destroyDetail', 'as' => 'mileage.claim.detail.destroy']);
}
);
......
<?php
namespace Portal\Mileage\Data\Repo;
use Portal\Mileage\Model\MileageClaimDetail;
use Portal\Mileage\Model\JenisKenderaan;
use Portal\Mileage\Model\Project;
use Portal\Mileage\Model\StaffInfo;
use Portal\Mileage\Model\LkpFaCategory;
use Illuminate\Http\Request;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Input;
use Carbon\Carbon;
use App\Events\AuditLog;
use Auth;
use DB;
use Event;
use File;
use Mail;
use PDF;
use Redirect;
use Curl;
use Portal\Mileage\Model\MileageClaimMain;
use Portal\Mileage\Model\Users;
/**
* undocumented function
*
* @return testing please hide this function and continue below
* @author afif@3fresources.com
**/
class MileageRepo
{
public function index($request)
{
// $users = Users::where('status', 'ACTIVE')
// ->paginate(10);
// return $users;
}
// mileage crud start
public function mileageList($request)
{
$search = request('search');
$data = MileageClaimMain::where('mm_apply_no','like', '%' . $search . '%')
->orderBy('created_at', 'desc')
->paginate(10);
return $data;
}
public function storeClaim($request)
{
$staff = StaffInfo::where('fk_users', Auth::id())->first();
$claim = MileageClaimMain::create([
'fk_lkp_staff_info' => $staff->id ?? null,
'mm_staff_name' => Auth::user()->name ?? null,
'mm_claim_month' => $request->mm_claim_month,
'mm_claim_year' => $request->mm_claim_year,
'fk_lkp_fa_category' => $request->fk_lkp_fa_category,
'mm_submit_date' => now(),
]);
return $claim->id;
}
public function findClaim($id)
{
return MileageClaimMain::with('details')->findOrFail($id);
}
public function getJenisKenderaan()
{
return JenisKenderaan::orderBy('name')->get();
}
public function getProjects()
{
return Project::orderBy('p_project_description')->get();
}
public function getFaCategories()
{
return LkpFaCategory::orderBy('id')->get();
}
public function storeDetail($request, $id)
{
return MileageClaimDetail::create([
'fk_mileage_claim_main' => $id,
'fk_lkp_jenis_kenderaan' => $request->fk_lkp_jenis_kenderaan,
'fk_lkp_project' => $request->fk_lkp_project,
'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,
]);
}
public function destroyDetail($id)
{
$detail = MileageClaimDetail::findOrFail($id);
$detail->delete();
return $detail;
}
}
......@@ -67,6 +67,23 @@ public function index(Request $request)
]);
}
public function senarai(Request $request)
{
$user = auth()->user();
$month = $request->get('month', Carbon::now()->format('Y-m'));
$parsedMonth = Carbon::createFromFormat('Y-m', $month);
$claims = Claim::with(['project', 'jenisKenderaan'])
->where('user_id', $user->id)
->whereMonth('claim_date', $parsedMonth->month)
->whereYear('claim_date', $parsedMonth->year)
->latest()
->get();
return view('mileage::application.senarai', compact('claims', 'month'));
}
public function store(Request $request)
{
// your existing store logic
......
<?php
namespace Portal\Mileage\Http\Controllers;
use Illuminate\Routing\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use Carbon\Carbon;
use Auth;
use DB;
use Event;
use File;
use Mail;
use PDF;
use Redirect;
use Curl;
use Portal\Mileage\Data\Repo\MileageRepo;
class MileageController extends Controller
{
/**
* @var MileageRepo
*/
protected $repos;
public function __construct(MileageRepo $repos)
{
$this->repos = $repos;
}
/**
* undocumented function
*
* @return testing please hide this function and continue below
* @author afif@3fresources.com
**/
public function index(Request $request)
{
dd('Welcome to index E-Mileage 3FRSB');exit;
// $list = $this->repos->index($request);
// return view('mileage::list', compact('list'));
}
// mileage crud start
public function getListMileage(Request $request)
{
$list = $this->repos->mileageList($request);
$faCategories = $this->repos->getFaCategories();
return view('mileage::mileage.list', compact('list', 'faCategories'));
}
public function storeClaim(Request $request)
{
$id = $this->repos->storeClaim($request);
return redirect()->route('mileage::mileage.claim.form', ['id' => $id]);
}
public function formClaim(Request $request, $id)
{
$claim = $this->repos->findClaim($id);
$jenisKenderaan = $this->repos->getJenisKenderaan();
$projects = $this->repos->getProjects();
return view('mileage::mileage.form', compact('claim', 'jenisKenderaan', 'projects'));
}
public function storeDetail(Request $request, $id)
{
$this->repos->storeDetail($request, $id);
return redirect()->route('mileage::mileage.claim.form', ['id' => $id])
->with('success', 'Butiran tuntutan berjaya ditambah.');
}
public function destroyDetail(Request $request, $id)
{
$detail = $this->repos->destroyDetail($id);
return redirect()->route('mileage::mileage.claim.form', ['id' => $detail->fk_mileage_claim_main])
->with('success', 'Butiran tuntutan berjaya dipadam.');
}
}
<?php
namespace Portal\Mileage\Model;
use Illuminate\Database\Eloquent\Model;
class LkpFaCategory extends Model
{
protected $table = 'lkp_fa_category';
protected $fillable = [
'fa_category',
'status',
];
}
<?php
namespace Portal\Mileage\Model;
use Illuminate\Database\Eloquent\Model;
class MileageClaimDetail extends Model
{
protected $table = 'mileage_claim_detail';
protected $fillable = [
'fk_mileage_claim_main',
'fk_lkp_jenis_kenderaan',
'fk_lkp_project',
'md_claim_date',
'md_description',
'md_distance_from',
'md_distance_to',
'md_total_mileage',
'md_total_toll',
'md_total_parking_fee',
];
public function claimMain()
{
return $this->belongsTo(MileageClaimMain::class, 'fk_mileage_claim_main');
}
public function jenisKenderaan()
{
return $this->belongsTo(JenisKenderaan::class, 'fk_lkp_jenis_kenderaan');
}
public function project()
{
return $this->belongsTo(Project::class, 'fk_lkp_project');
}
}
<?php
namespace Portal\Mileage\Model;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
class MileageClaimMain extends Model
{
protected $table = 'mileage_claim_main';
protected $fillable = [
'mm_apply_no',
'fk_lkp_staff_info',
'mm_staff_name',
'mm_staff_position',
'mm_staff_id',
'mm_staff_company',
'mm_submit_date',
'mm_claim_month',
'mm_claim_year',
'fk_lkp_fa_category',
'mm_verified_by',
'mm_verified_date',
'mm_approved_by',
'mm_approved_date',
'status',
];
protected static function boot()
{
parent::boot();
static::creating(function (self $model) {
if (empty($model->mm_apply_no)) {
$model->mm_apply_no = static::generateApplyNo();
}
});
}
/**
* Generate the next running application number in the format MC-YYYY-NNNN,
* resetting the sequence every year.
*/
public static function generateApplyNo(): string
{
$year = now()->format('Y');
$prefix = "MC-{$year}-";
$last = static::where('mm_apply_no', 'like', "{$prefix}%")
->orderByDesc('mm_apply_no')
->value('mm_apply_no');
$nextNumber = $last ? ((int) substr($last, -4)) + 1 : 1;
return $prefix . str_pad((string) $nextNumber, 4, '0', STR_PAD_LEFT);
}
public function staffInfo()
{
return $this->belongsTo(StaffInfo::class, 'fk_lkp_staff_info', 'id');
}
public function faCategory()
{
return $this->belongsTo(LkpFaCategory::class, 'fk_lkp_fa_category');
}
public function lkpStatus()
{
return $this->belongsTo(LkpStatus::class, 'status');
}
public function verifiedBy()
{
return $this->belongsTo(User::class, 'mm_verified_by');
}
public function approvedBy()
{
return $this->belongsTo(User::class, 'mm_approved_by');
}
public function details()
{
return $this->hasMany(MileageClaimDetail::class, 'fk_mileage_claim_main');
}
}
......@@ -132,6 +132,11 @@ protected function menu()
->data('icon', 'bars')
->active('applications/*');
$menu->add(__('Senarai Tuntutan Saya'), route('mileage::applications.senarai'))
->data('icon', 'list alternate')
->active('applications/senarai');
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment