cost/price/margin
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user