add claim tab to all users
This commit is contained in:
@@ -1085,15 +1085,6 @@ class TransactionController extends Controller
|
||||
*/
|
||||
public function getClaimTransactions(Request $request)
|
||||
{
|
||||
// Only allow mechanics to access this endpoint
|
||||
if (Auth::user()->role_id != 3) {
|
||||
return response()->json([
|
||||
'draw' => intval($request->input('draw')),
|
||||
'recordsTotal' => 0,
|
||||
'recordsFiltered' => 0,
|
||||
'data' => []
|
||||
]);
|
||||
}
|
||||
|
||||
$request->validate([
|
||||
'dealer_id' => 'required|exists:dealers,id'
|
||||
@@ -1290,9 +1281,6 @@ class TransactionController extends Controller
|
||||
<i class="fas fa-trash"></i> Hapus
|
||||
</button>';
|
||||
|
||||
// Only show claim buttons for mechanics
|
||||
if (Auth::user()->role_id == 3) {
|
||||
|
||||
// Claim button - show only if not claimed yet
|
||||
if (empty($transaction->claimed_at) && empty($transaction->claimed_by)) {
|
||||
$buttons .= '<button class="btn btn-sm btn-success mr-1" onclick="claimTransaction(' . $transaction->id . ')" title="Klaim Pekerjaan" style="font-size: 11px; padding: 4px 8px;">';
|
||||
@@ -1309,7 +1297,6 @@ class TransactionController extends Controller
|
||||
}
|
||||
$buttons .= '<span class="badge badge-info" style="font-size: 10px;"><i class="fas fa-check-circle"></i> Sudah Diklaim</span>';
|
||||
}
|
||||
}
|
||||
|
||||
return $buttons;
|
||||
}
|
||||
@@ -1318,7 +1305,6 @@ class TransactionController extends Controller
|
||||
{
|
||||
$buttons = '';
|
||||
|
||||
if (Auth::user()->role_id == 3) {
|
||||
$precheck = Precheck::where('transaction_id', $transaction->id)->first();
|
||||
|
||||
if ($precheck) {
|
||||
@@ -1340,7 +1326,6 @@ class TransactionController extends Controller
|
||||
</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $buttons;
|
||||
}
|
||||
@@ -1348,8 +1333,6 @@ class TransactionController extends Controller
|
||||
private function getActionButtonsPostcheck($transaction)
|
||||
{
|
||||
$buttons = '';
|
||||
|
||||
if (Auth::user()->role_id == 3) {
|
||||
$postcheck = Postcheck::where('transaction_id', $transaction->id)->first();
|
||||
$precheck = Precheck::where('transaction_id', $transaction->id)->first();
|
||||
|
||||
@@ -1372,7 +1355,6 @@ class TransactionController extends Controller
|
||||
}else{
|
||||
$buttons .= '<span class="badge badge-danger" style="font-size: 10px;">Precheck Belum Disimpan</span>';
|
||||
}
|
||||
}
|
||||
return $buttons;
|
||||
}
|
||||
|
||||
|
||||
11167
public/css/app.css
11167
public/css/app.css
File diff suppressed because one or more lines are too long
1211
public/js/app.js
1211
public/js/app.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -820,11 +820,9 @@ use Illuminate\Support\Facades\Auth;
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if(old('form') == 'wash') active @endif" href="#form-cuci">Form Cuci</a>
|
||||
</li>
|
||||
@if(Auth::user()->role_id == 3)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if(old('form') == 'claim') active @endif" href="#form-claim">Klaim</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mt-3">
|
||||
@@ -1128,7 +1126,6 @@ use Illuminate\Support\Facades\Auth;
|
||||
</div>
|
||||
|
||||
<!-- Form Klaim - Hanya untuk Mekanik -->
|
||||
@if(Auth::user()->role_id == 3)
|
||||
<div class="tab-pane @if(old('form') == 'claim') active @endif" id="form-claim" role="tabpanel">
|
||||
<div class="mt-3">
|
||||
<h6 class="mb-3">Daftar Pekerjaan yang Dapat Diklaim</h6>
|
||||
@@ -1154,7 +1151,6 @@ use Illuminate\Support\Facades\Auth;
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
<b class="font-weight-bold text-dark">x{{ $transaction->qty }}</b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="kt-portlet__foot text-right mt-4" style="background: none !important; padding-right: 0 !important; padding-left: 0 !important; padding-bottom: 0; margin-bottom: 0;">
|
||||
{{-- <div class="kt-portlet__foot text-right mt-4" style="background: none !important; padding-right: 0 !important; padding-left: 0 !important; padding-bottom: 0; margin-bottom: 0;">
|
||||
@if ($transaction->status == 1)
|
||||
<span class="badge badge-success">Closed</span>
|
||||
@else
|
||||
@@ -128,7 +128,7 @@
|
||||
@method('DELETE')
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div> --}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -171,6 +171,10 @@ Route::group(['middleware' => 'auth'], function() {
|
||||
// Stock Management Routes
|
||||
Route::post('/transaction/check-stock', [TransactionController::class, 'checkStockAvailability'])->name('transaction.check-stock');
|
||||
Route::get('/transaction/stock-prediction', [TransactionController::class, 'getStockPrediction'])->name('transaction.stock-prediction');
|
||||
});
|
||||
|
||||
// KPI Data Route - accessible to all authenticated users
|
||||
Route::get('/transaction/get-kpi-data', [TransactionController::class, 'getKpiData'])->name('transaction.get-kpi-data');
|
||||
|
||||
// Claim Transactions Route
|
||||
Route::get('/transaction/get-claim-transactions', [TransactionController::class, 'getClaimTransactions'])->name('transaction.get-claim-transactions');
|
||||
@@ -195,10 +199,6 @@ Route::group(['middleware' => 'auth'], function() {
|
||||
Route::get('print', [PostchecksController::class, 'print'])->name('print');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// KPI Data Route - accessible to all authenticated users
|
||||
Route::get('/transaction/get-kpi-data', [TransactionController::class, 'getKpiData'])->name('transaction.get-kpi-data');
|
||||
|
||||
Route::group(['prefix' => 'admin', 'middleware' => 'adminRole'], function() {
|
||||
Route::get('/dashboard2', [AdminController::class, 'dashboard2'])->name('dashboard2');
|
||||
|
||||
Reference in New Issue
Block a user