localize library cdn, remove approve button from transaction page, fix all fitur running datatable as well, fixing sortable datatable using new cdn, fix modal approve, add note to receiver mutations

This commit is contained in:
2025-06-16 15:01:08 +07:00
parent 9cfb566aee
commit 567e4aa5fc
45 changed files with 16202 additions and 365 deletions

View File

@@ -26,8 +26,10 @@ class ProductsController extends Controller
{
$menu = Menu::where('link','products.index')->first();
if($request->ajax()){
$data = Product::with(['category', 'stocks'])
->orderBy('id', 'desc');
$data = Product::with(['category'])
->select('products.*')
->leftJoin('product_categories', 'products.product_category_id', '=', 'product_categories.id');
return DataTables::of($data)
->addIndexColumn()
->addColumn('category_name', function ($row) {
@@ -55,6 +57,12 @@ class ProductsController extends Controller
return $btn;
})
->filterColumn('category_name', function($query, $keyword) {
$query->where('product_categories.name', 'like', "%{$keyword}%");
})
->orderColumn('category_name', function ($query, $order) {
$query->orderBy('product_categories.name', $order);
})
->rawColumns(['action'])
->make(true);
}
@@ -196,7 +204,7 @@ class ProductsController extends Controller
public function all_products(){
try{
$products = Product::where('is_active', true)->select('id','name')->get();
$products = Product::where('active', true)->select('id','name')->get();
return response()->json($products);
}catch(\Exception $ex){
Log::error($ex->getMessage());