hi,
I am extending some features according to my requirements, I want to know the MySQL Query to find the available quantities of a given products the same way it shows on the page where you click on a product name and it shows which warehouse has how many qty of the given product?
I tried to put a count on sma_sales_items and sma_purchase_items to subtract qty of purchase from sales but it gives me wrong value. not sure if you handle returns and transfers qty to find current available qty of a product. so please help me with the MySQL query to do this.
thank you
- MSAnswered
Hello,
Please be infomred that we don’t offer support for modification and modified versions. You are allowed to modify the item at your own risk as per license.
If you are not sure, please hire any developer to help you modify the item as you need.
The following query is used to get product quantity.
SET SESSION sql_mode = ""; SELECT `sma_warehouses`.*, `sma_warehouses_products`.`quantity`, `sma_warehouses_products`.`rack`, `sma_warehouses_products`.`avg_cost` FROM `sma_warehouses` LEFT JOIN `sma_warehouses_products` ON `sma_warehouses_products`.`warehouse_id` = `sma_warehouses`.`id` WHERE `sma_warehouses_products`.`product_id` = '1' GROUP BY `sma_warehouses`.`id`;
Thank you
- Login to Reply