partial update opnames and detail table
This commit is contained in:
@@ -32,16 +32,10 @@ class ProductsController extends Controller
|
||||
return $row->category ? $row->category->name : '-';
|
||||
})
|
||||
->addColumn('total_stock', function ($row){
|
||||
return $row->dealers->sum(function($dealer){
|
||||
return $dealer->pivot->quantity ?? 0;
|
||||
});
|
||||
return 0;
|
||||
})
|
||||
->addColumn('action', function ($row) use ($menu) {
|
||||
$btn = '<div class="d-flex">';
|
||||
|
||||
// if (Auth::user()->can('delete', $menu)) {
|
||||
// $btn .= '<button style="margin-right: 8px;" class="btn btn-danger btn-sm btn-destroy-product" data-action="' . route('products.destroy', $row->id) . '" data-id="' . $row->id . '">Hapus</button>';
|
||||
// }
|
||||
|
||||
if (Auth::user()->can('update', $menu)) {
|
||||
$btn .= '<a href="' . route('products.edit', $row->id) . '" class="btn btn-warning btn-sm" style="margin-right: 8px;">Edit</a>';
|
||||
|
||||
Reference in New Issue
Block a user