partial update opnames and detail table

This commit is contained in:
2025-06-04 18:29:05 +07:00
parent 8305e44c42
commit ff498cd98f
20 changed files with 864 additions and 174 deletions

View File

@@ -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>';