[open-ils-commits] r12878 - trunk/Open-ILS/src/support-scripts/test-scripts (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Apr 15 11:45:44 EDT 2009


Author: erickson
Date: 2009-04-15 11:45:42 -0400 (Wed, 15 Apr 2009)
New Revision: 12878

Modified:
   trunk/Open-ILS/src/support-scripts/test-scripts/purge_po.sql
Log:
don't remove the lineitem and attrs if it points to a selection list

Modified: trunk/Open-ILS/src/support-scripts/test-scripts/purge_po.sql
===================================================================
--- trunk/Open-ILS/src/support-scripts/test-scripts/purge_po.sql	2009-04-15 15:12:05 UTC (rev 12877)
+++ trunk/Open-ILS/src/support-scripts/test-scripts/purge_po.sql	2009-04-15 15:45:42 UTC (rev 12878)
@@ -16,8 +16,12 @@
         DELETE FROM acq.fund_debit WHERE id in (
             SELECT fund_debit FROM acq.lineitem_detail WHERE lineitem = li.id);
         DELETE FROM acq.lineitem_detail WHERE lineitem = li.id;
-        DELETE FROM acq.lineitem_attr WHERE lineitem = li.id;
-        DELETE from acq.lineitem WHERE id = li.id;
+        IF li.picklist IS NULL THEN
+            DELETE FROM acq.lineitem_attr WHERE lineitem = li.id;
+            DELETE from acq.lineitem WHERE id = li.id;
+        ELSE
+            UPDATE acq.lineitem SET purchase_order = NULL WHERE id = li.id;
+        END IF;
     END LOOP;
 
     DELETE FROM acq.purchase_order WHERE id = po_id;



More information about the open-ils-commits mailing list