partial update stock opname feature
This commit is contained in:
@@ -4,6 +4,8 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Models\Dealer;
|
||||
use App\Models\Product;
|
||||
use App\Models\Stock;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\User;
|
||||
use App\Models\Work;
|
||||
@@ -26,7 +28,15 @@ class TransactionController extends Controller
|
||||
->select('d.name as dealer_name', 'd.id as dealer_id', 'users.name', 'users.id', 'users.role', 'users.email', 'd.dealer_code', 'd.address')
|
||||
->where('users.id', Auth::user()->id)->first();
|
||||
$now = Carbon::now()->translatedFormat('d F Y');
|
||||
return view('transaction.index', compact('now', 'wash_work', 'work_works', 'user_sas', 'count_transaction_users', 'count_transaction_dealers', 'mechanic'));
|
||||
|
||||
// Get products with stock based on user role
|
||||
$products = Product::with(['stocks' => function($query) {
|
||||
$query->where('dealer_id', Auth::user()->dealer_id);
|
||||
}, 'stocks.dealer'])
|
||||
->where('active', true)
|
||||
->get();
|
||||
|
||||
return view('transaction.index', compact('now', 'wash_work', 'work_works', 'user_sas', 'count_transaction_users', 'count_transaction_dealers', 'mechanic', 'products'));
|
||||
}
|
||||
|
||||
public function workcategory($category_id)
|
||||
|
||||
Reference in New Issue
Block a user