src-db/database/model/triggers/C_SETTLEMENT_TRG.xml
changeset 1605 8a0fe0193bef
parent 756 ae11e4610537
child 2078 cf88ca44cdd2
--- a/src-db/database/model/triggers/C_SETTLEMENT_TRG.xml	Wed Sep 03 17:10:52 2008 +0000
+++ b/src-db/database/model/triggers/C_SETTLEMENT_TRG.xml	Wed Sep 03 17:55:37 2008 +0000
@@ -29,23 +29,23 @@
  IF UPDATING THEN
  IF (:OLD.Processed = 'Y' AND
      ( (COALESCE(:OLD.DOCUMENTNO,'.')<>COALESCE(:NEW.DOCUMENTNO,'.'))
-     OR (COALESCE(:OLD.C_DOCTYPE_ID,0)<>COALESCE(:NEW.C_DOCTYPE_ID,0))
-     OR (COALESCE(:OLD.USER1_ID,0)<>COALESCE(:NEW.USER1_ID,0))
-     OR (COALESCE(:OLD.USER2_ID,0)<>COALESCE(:NEW.USER2_ID,0))
+     OR (COALESCE(:OLD.C_DOCTYPE_ID,'0')<>COALESCE(:NEW.C_DOCTYPE_ID,'0'))
+     OR (COALESCE(:OLD.USER1_ID,'0')<>COALESCE(:NEW.USER1_ID,'0'))
+     OR (COALESCE(:OLD.USER2_ID,'0')<>COALESCE(:NEW.USER2_ID,'0'))
      OR (COALESCE(:OLD.GENERATEDAMT,0)<>COALESCE(:NEW.GENERATEDAMT,0))
      OR (COALESCE(:OLD.CHARGEDAMT,0)<>COALESCE(:NEW.CHARGEDAMT,0))
-     OR (COALESCE(:OLD.C_CURRENCY_ID,0)<>COALESCE(:NEW.C_CURRENCY_ID,0))
-     OR(COALESCE(:old.AD_ORG_ID, 0) <> COALESCE(:new.AD_ORG_ID, 0))
-     OR(COALESCE(:old.AD_CLIENT_ID, 0) <> COALESCE(:new.AD_CLIENT_ID, 0))
+     OR (COALESCE(:OLD.C_CURRENCY_ID,'0')<>COALESCE(:NEW.C_CURRENCY_ID,'0'))
+     OR(COALESCE(:old.AD_ORG_ID, '0') <> COALESCE(:new.AD_ORG_ID, '0'))
+     OR(COALESCE(:old.AD_CLIENT_ID, '0') <> COALESCE(:new.AD_CLIENT_ID, '0'))
      )) THEN
         RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted');
   END IF;
   IF (:OLD.Posted = 'Y' AND
      ((COALESCE(:OLD.DATEACCT,v_DateNull)<>COALESCE(:NEW.DATEACCT,v_DateNull))
-     OR (COALESCE(:OLD.C_CAMPAIGN_ID,0)<>COALESCE(:NEW.C_CAMPAIGN_ID,0))
-     OR (COALESCE(:OLD.C_PROJECT_ID,0)<>COALESCE(:NEW.C_PROJECT_ID,0))
-     OR (COALESCE(:OLD.C_CURRENCY_ID,0)<>COALESCE(:NEW.C_CURRENCY_ID,0))
-     OR (COALESCE(:OLD.C_ACTIVITY_ID,0)<>COALESCE(:NEW.C_ACTIVITY_ID,0)))) THEN
+     OR (COALESCE(:OLD.C_CAMPAIGN_ID,'0')<>COALESCE(:NEW.C_CAMPAIGN_ID,'0'))
+     OR (COALESCE(:OLD.C_PROJECT_ID,'0')<>COALESCE(:NEW.C_PROJECT_ID,'0'))
+     OR (COALESCE(:OLD.C_CURRENCY_ID,'0')<>COALESCE(:NEW.C_CURRENCY_ID,'0'))
+     OR (COALESCE(:OLD.C_ACTIVITY_ID,'0')<>COALESCE(:NEW.C_ACTIVITY_ID,'0')))) THEN
         RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted');
   END IF;
  END IF;