[open-ils-commits] r12898 - trunk/Open-ILS/src/support-scripts/test-scripts (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Apr 16 17:33:55 EDT 2009
Author: erickson
Date: 2009-04-16 17:33:50 -0400 (Thu, 16 Apr 2009)
New Revision: 12898
Modified:
trunk/Open-ILS/src/support-scripts/test-scripts/purge_po.sql
Log:
logic bug
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-16 20:42:18 UTC (rev 12897)
+++ trunk/Open-ILS/src/support-scripts/test-scripts/purge_po.sql 2009-04-16 21:33:50 UTC (rev 12898)
@@ -16,18 +16,19 @@
DELETE FROM acq.fund_debit WHERE id in (
SELECT fund_debit FROM acq.lineitem_detail WHERE lineitem = li.id);
- IF li.picklist IS NULL THEN
+ IF li.picklist IS NOT NULL THEN
IF purge_items THEN
DELETE FROM acq.lineitem_detail WHERE lineitem = li.id;
ELSE
- UPDATE acq.lineitem_detail SET eg_copy_id = NULL WHERE lineitem = li.id;
+ UPDATE acq.lineitem_detail SET eg_copy_id = NULL, fund_debit = NULL WHERE lineitem = li.id;
END IF;
+ UPDATE acq.lineitem SET purchase_order = NULL, eg_bib_id = NULL, state = 'new' WHERE id = li.id;
+ ELSE
+ 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;
- ELSE
- DELETE FROM acq.lineitem_detail WHERE lineitem = li.id;
- UPDATE acq.lineitem SET purchase_order = NULL, eg_bib_id = NULL, state = 'new' 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