Stock information
Posted: Sun Nov 13, 2011 12:25 pm
1. A situation with information about products cantity, value at price list, with and without tax, group by category etc., I think it is a usefull list.
2. I make a view in mySQL, but I don't know to use it with php. (is posible or only a stored procedure must be used?)
select `product`.`product_id` AS `Id`,`product_description`.`model_number` AS `Cod_Articol`,`product_description`.`name` AS `Nume_Articol`,`product`.`price` AS `Pret`,`product`.`quantity` AS `Stoc`,(`product`.`quantity` * `product`.`price`) AS `val_cu_TVA`,`product`.`viewed` AS `Nr_Vizualizari`,`category_description`.`name` AS `Den_Grupa` from (((`product` left join `product_description` on((`product`.`product_id` = `product_description`.`product_id`))) left join `product_to_category` on((`product`.`product_id` = `product_to_category`.`product_id`))) left join `category_description` on((`product_to_category`.`category_id` = `category_description`.`category_id`)))
3. A situation about invoices, based on the followinh view...
select `order`.`invoice_number` AS `Nr_doc`,`order`.`date_added` AS `Data_Doc`,`order`.`lastname` AS `Fact_Nume_Cli`,`order`.`firstname` AS `Fact_Pren_Client`,`order`.`email` AS `email`,`order`.`shipping_lastname` AS `Liv_Nume_Cli`,`order`.`shipping_firstname` AS `Liv_Pren_Client`,`order`.`shipping_address_1` AS `Liv_Strada`,`order`.`shipping_city` AS `Liv_Oras`,`order`.`shipping_postcode` AS `Cod_Postal`,`order`.`payment_method` AS `Metoda_Liv`,`order`.`total` AS `Val_Doc`,`order_product`.`name` AS `Den_Prod`,`order_product`.`model_number` AS `Cod_Prod`,`order_product`.`quantity` AS `quantity`,`order_product`.`price` AS `price`,`order_status`.`name` AS `Stare` from ((`order` left join `order_product` on((`order`.`order_id` = `order_product`.`order_id`))) left join `order_status` on((`order`.`order_status_id` = `order_status`.`order_status_id`)))
Can you help me? I use 1.2.5 version.
Thank you.
2. I make a view in mySQL, but I don't know to use it with php. (is posible or only a stored procedure must be used?)
select `product`.`product_id` AS `Id`,`product_description`.`model_number` AS `Cod_Articol`,`product_description`.`name` AS `Nume_Articol`,`product`.`price` AS `Pret`,`product`.`quantity` AS `Stoc`,(`product`.`quantity` * `product`.`price`) AS `val_cu_TVA`,`product`.`viewed` AS `Nr_Vizualizari`,`category_description`.`name` AS `Den_Grupa` from (((`product` left join `product_description` on((`product`.`product_id` = `product_description`.`product_id`))) left join `product_to_category` on((`product`.`product_id` = `product_to_category`.`product_id`))) left join `category_description` on((`product_to_category`.`category_id` = `category_description`.`category_id`)))
3. A situation about invoices, based on the followinh view...
select `order`.`invoice_number` AS `Nr_doc`,`order`.`date_added` AS `Data_Doc`,`order`.`lastname` AS `Fact_Nume_Cli`,`order`.`firstname` AS `Fact_Pren_Client`,`order`.`email` AS `email`,`order`.`shipping_lastname` AS `Liv_Nume_Cli`,`order`.`shipping_firstname` AS `Liv_Pren_Client`,`order`.`shipping_address_1` AS `Liv_Strada`,`order`.`shipping_city` AS `Liv_Oras`,`order`.`shipping_postcode` AS `Cod_Postal`,`order`.`payment_method` AS `Metoda_Liv`,`order`.`total` AS `Val_Doc`,`order_product`.`name` AS `Den_Prod`,`order_product`.`model_number` AS `Cod_Prod`,`order_product`.`quantity` AS `quantity`,`order_product`.`price` AS `price`,`order_status`.`name` AS `Stare` from ((`order` left join `order_product` on((`order`.`order_id` = `order_product`.`order_id`))) left join `order_status` on((`order`.`order_status_id` = `order_status`.`order_status_id`)))
Can you help me? I use 1.2.5 version.
Thank you.