diff --git a/AstuteSystem/sql/astute.sql b/AstuteSystem/sql/astute.sql
index 48a4741..04ee9ef 100644
--- a/AstuteSystem/sql/astute.sql
+++ b/AstuteSystem/sql/astute.sql
@@ -781,6 +781,17 @@ return rem_qty;
 END//
 DELIMITER ;
 
+CREATE FUNCTION astute.`is_po_fulfilled`(po_no varchar(20)) RETURNS int(1)
+BEGIN
+  declare count int;
+  SELECT count(*) INTO count FROM po_detail WHERE PO_num = po_no and remaining_qty > 0;
+  if count > 0 then
+      return 0;
+  else
+      return 1;
+  end if;
+END;
+
 -- Dumping structure for table astute.user
 CREATE TABLE IF NOT EXISTS `user` (
   `user_id` int(5) NOT NULL,