-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `kns_legal`
--

-- --------------------------------------------------------

--
-- Structure for view `po_material_list`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `po_material_list`  AS  select `smm`.`stock_material_code` AS `material_code`,`smm`.`stock_material_name` AS `material_name`,`smm`.`stock_material_price` AS `material_price`,`spoi`.`stock_purchase_order_item_id` AS `spoi_id`,`spoi`.`stock_purchase_order_item` AS `material_id`,`spo`.`stock_purchase_order_project` AS `project_id`,`spoi`.`stock_purchase_order_item_quantity` AS `po_material_qty`,`spoi`.`stock_grn_qty` AS `stock_grn_quantity`,`spoi`.`stock_grn_remaning_qty` AS `stock_grn_remaning_qty`,`spo`.`stock_purchase_order_quotation_id` AS `po_quotation_id`,`spo`.`stock_purchase_order_id` AS `po_order_id`,`spo`.`stock_purchase_order_number` AS `stock_purchase_order_number` from ((`stock_purchase_order_items` `spoi` join `stock_purchase_order` `spo` on((`spo`.`stock_purchase_order_id` = `spoi`.`stock_purchase_order_id`))) left join `stock_material_master` `smm` on((`smm`.`stock_material_id` = `spoi`.`stock_purchase_order_item`))) where ((`spoi`.`stock_purchase_order_item_status` = 'Waiting') or (`spoi`.`stock_purchase_order_item_status` = 'Pending') or (`spoi`.`stock_purchase_order_item_status` = 'Approved')) ;

--
-- VIEW  `po_material_list`
-- Data: None
--

COMMIT;

