cost/price/margin

This commit is contained in:
Thanakorn S
2026-05-06 09:37:28 +07:00
parent 6501d326ca
commit d8131a01b7
10 changed files with 130 additions and 27 deletions
+5 -3
View File
@@ -360,6 +360,7 @@ class ProductManager {
':sku' => $data['sku'],
':uom' => $data['uom'] ?? 'pcs',
':price' => $data['price'],
':cost_price' => (float)($data['cost_price'] ?? 0),
':min_stock' => $data['min_stock'],
':reorder_point' => $data['reorder_point'],
':category' => $data['category'],
@@ -377,6 +378,7 @@ class ProductManager {
sku = :sku,
uom = :uom,
price = :price,
cost_price = :cost_price,
min_stock = :min_stock,
reorder_point = :reorder_point,
category = :category,
@@ -389,10 +391,10 @@ class ProductManager {
} else {
$this->pdo->prepare(
"INSERT INTO md_product
(company_id, product_name, sku, uom, price, min_stock, reorder_point,
(company_id, product_name, sku, uom, price, cost_price, min_stock, reorder_point,
category, product_image, `description`, `status`, `log`)
VALUES
(:company_id, :product_name, :sku, :uom, :price, :min_stock, :reorder_point,
(:company_id, :product_name, :sku, :uom, :price, :cost_price, :min_stock, :reorder_point,
:category, :product_image, :description, :status, :log)"
)->execute($params);
}
@@ -499,4 +501,4 @@ class ProductManager {
$sth->execute([':company_id' => $this->company_id]);
return $sth->fetchAll(PDO::FETCH_ASSOC);
}
}
}