create feature sa create list claim and price to work per dealer

This commit is contained in:
2025-07-07 19:11:04 +07:00
parent fa554446ca
commit 956df5cfe6
16 changed files with 3062 additions and 404 deletions

View File

@@ -35,6 +35,13 @@ class WorkController extends Controller
</a>';
}
// Set Prices Button
if(Gate::allows('view', $menu)) {
$btn .= '<a href="'. route('work.set-prices', ['work' => $row->work_id]) .'" class="btn btn-primary btn-sm" title="Set Harga per Dealer">
Harga
</a>';
}
if(Gate::allows('update', $menu)) {
$btn .= '<button class="btn btn-warning btn-sm" id="editWork'. $row->work_id .'" data-url="'. route('work.edit', $row->work_id) .'" data-action="'. route('work.update', $row->work_id) .'" onclick="editWork('. $row->work_id .')">
Edit
@@ -157,4 +164,20 @@ class WorkController extends Controller
return response()->json($response);
}
/**
* Show the form for setting prices per dealer for a specific work.
*
* @param \App\Models\Work $work
* @return \Illuminate\Http\Response
*/
public function showPrices(Work $work)
{
$menu = Menu::where('link', 'work.index')->first();
abort_if(Gate::denies('view', $menu), 403, 'Unauthorized User');
$dealers = \App\Models\Dealer::all();
return view('back.master.work_prices', compact('work', 'dealers'));
}
}