Classe methods: remove reducdancy

This commit is contained in:
Thanakorn S
2026-05-29 08:56:58 +07:00
parent 356d308907
commit 7b294f70da
9 changed files with 112 additions and 93 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ class BarcodeManager {
$warehouses->execute([':company_id' => $this->company_id]);
foreach ($warehouses->fetchAll(PDO::FETCH_COLUMN) as $warehouse_id) {
$table = $this->stockTableName((int)$warehouse_id);
$table = 'td_stock_' . (int)$warehouse_id;
$sth = $this->pdo->prepare(
"SELECT lot_number
FROM `{$table}`
@@ -169,7 +169,7 @@ class BarcodeManager {
$warehouses->execute([':company_id' => $this->company_id]);
foreach ($warehouses->fetchAll(PDO::FETCH_COLUMN) as $warehouse_id) {
$table = $this->stockTableName((int)$warehouse_id);
$table = 'td_stock_' . (int)$warehouse_id;
$sth = $this->pdo->prepare(
"SELECT ROUND(SUM(COALESCE(`in`, 0)) - SUM(COALESCE(`out`, 0)), 2) AS balance
FROM `{$table}`