src-db/database/model/triggers/GL_JOURNAL_CHK_RESTRICT_TRG.xml
changeset 1605 8a0fe0193bef
parent 756 ae11e4610537
child 2078 cf88ca44cdd2
equal deleted inserted replaced
1604:a1c518e6ed93 1605:8a0fe0193bef
    26     v_DateNull DATE := TO_DATE('01-01-1900', 'DD-MM-YYYY');
    26     v_DateNull DATE := TO_DATE('01-01-1900', 'DD-MM-YYYY');
    27     BEGIN
    27     BEGIN
    28     IF UPDATING
    28     IF UPDATING
    29     THEN  IF(:old.Processed='Y'
    29     THEN  IF(:old.Processed='Y'
    30     AND ((COALESCE(:old.DATEDOC, v_DateNull) <> COALESCE(:new.DATEDOC, v_DateNull))
    30     AND ((COALESCE(:old.DATEDOC, v_DateNull) <> COALESCE(:new.DATEDOC, v_DateNull))
    31     OR(COALESCE(:old.C_PERIOD_ID, 0) <> COALESCE(:new.C_PERIOD_ID, 0))
    31     OR(COALESCE(:old.C_PERIOD_ID, '0') <> COALESCE(:new.C_PERIOD_ID, '0'))
    32     OR(COALESCE(:old.CURRENCYRATE, 0) <> COALESCE(:new.CURRENCYRATE, 0))
    32     OR(COALESCE(:old.CURRENCYRATE, 0) <> COALESCE(:new.CURRENCYRATE, 0))
    33     OR(COALESCE(:old.CURRENCYRATETYPE, '.') <> COALESCE(:new.CURRENCYRATETYPE, '.'))
    33     OR(COALESCE(:old.CURRENCYRATETYPE, '.') <> COALESCE(:new.CURRENCYRATETYPE, '.'))
    34     OR(COALESCE(:old.CONTROLAMT, 0) <> COALESCE(:new.CONTROLAMT, 0))
    34     OR(COALESCE(:old.CONTROLAMT, 0) <> COALESCE(:new.CONTROLAMT, 0))
    35     OR(COALESCE(:old.AD_ORG_ID, 0) <> COALESCE(:new.AD_ORG_ID, 0))
    35     OR(COALESCE(:old.AD_ORG_ID, '0') <> COALESCE(:new.AD_ORG_ID, '0'))
    36     OR(COALESCE(:old.AD_CLIENT_ID, 0) <> COALESCE(:new.AD_CLIENT_ID, 0))))
    36     OR(COALESCE(:old.AD_CLIENT_ID, '0') <> COALESCE(:new.AD_CLIENT_ID, '0'))))
    37     THEN  RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
    37     THEN  RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
    38     END IF;
    38     END IF;
    39   IF(:old.Posted='Y' AND ((COALESCE(:old.DATEACCT, v_DateNull) <> COALESCE(:new.DATEACCT, v_DateNull)) OR(COALESCE(:old.C_ACCTSCHEMA_ID, 0) <> COALESCE(:new.C_ACCTSCHEMA_ID, 0)) OR(COALESCE(:old.GL_CATEGORY_ID, 0) <> COALESCE(:new.GL_CATEGORY_ID, 0)) OR(COALESCE(:old.POSTINGTYPE, '.') <> COALESCE(:new.POSTINGTYPE, '.')))) THEN
    39   IF(:old.Posted='Y' AND ((COALESCE(:old.DATEACCT, v_DateNull) <> COALESCE(:new.DATEACCT, v_DateNull)) OR(COALESCE(:old.C_ACCTSCHEMA_ID, '0') <> COALESCE(:new.C_ACCTSCHEMA_ID, '0')) OR(COALESCE(:old.GL_CATEGORY_ID, '0') <> COALESCE(:new.GL_CATEGORY_ID, '0')) OR(COALESCE(:old.POSTINGTYPE, '.') <> COALESCE(:new.POSTINGTYPE, '.')))) THEN
    40    RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
    40    RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
    41   END IF;
    41   END IF;
    42  END IF;
    42  END IF;
    43  IF(DELETING) THEN
    43  IF(DELETING) THEN
    44   IF(:old.Processed='Y') THEN
    44   IF(:old.Processed='Y') THEN