Scope stock table access by company warehouses
This commit is contained in:
@@ -44,6 +44,15 @@ class StockManager {
|
||||
throw new Exception("Invalid warehouse id.");
|
||||
}
|
||||
|
||||
$sth = $this->pdo->prepare(
|
||||
"SELECT id FROM md_warehouse
|
||||
WHERE company_id = :company_id AND id = :id"
|
||||
);
|
||||
$sth->execute([':company_id' => $this->company_id, ':id' => $warehouse_id]);
|
||||
if (!$sth->fetchColumn()) {
|
||||
throw new Exception("Warehouse ID {$warehouse_id} not found.");
|
||||
}
|
||||
|
||||
return 'td_stock_' . $warehouse_id;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user