Classe methods: remove reducdancy

This commit is contained in:
Thanakorn S
2026-05-29 08:56:58 +07:00
parent ed3dd2f215
commit a0677d6d8d
9 changed files with 112 additions and 93 deletions
@@ -52,6 +52,20 @@ class WarehouseManager {
return 'td_stock_' . $warehouse_id;
}
public function getStockTables(): array
{
$sth = $this->pdo->prepare(
"SELECT t.table_name
FROM md_warehouse w
JOIN information_schema.tables t
ON t.table_schema = DATABASE()
AND t.table_name = CONCAT('td_stock_', w.id)
WHERE w.company_id = :company_id"
);
$sth->execute([':company_id' => $this->company_id]);
return $sth->fetchAll(PDO::FETCH_COLUMN);
}
public function assertStockMovementWindow(?string $date, string $context = 'Stock movement'): void
{
global $pdo1;