src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml
changeset 1605 8a0fe0193bef
parent 756 ae11e4610537
child 2078 cf88ca44cdd2
--- a/src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml	Wed Sep 03 17:10:52 2008 +0000
+++ b/src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml	Wed Sep 03 17:55:37 2008 +0000
@@ -23,9 +23,9 @@
     * Contributor(s):  ______________________________________.
     ************************************************************************/
   v_Processed CHAR(1) ;
-  v_C_INVOICE_ID NUMBER(10) ;
+  v_C_INVOICE_ID VARCHAR2(32) ;
   v_Prec NUMBER:=2;
-  v_Currency     NUMBER;
+  v_Currency     VARCHAR2(32);
 BEGIN
   IF INSERTING THEN
     v_C_INVOICE_ID:=:NEW.C_INVOICE_ID;
@@ -40,24 +40,24 @@
   WHERE C_INVOICE_ID=v_C_INVOICE_ID;
   IF UPDATING THEN
     IF(v_Processed='Y' AND ((COALESCE(:OLD.LINE, 0) <> COALESCE(:NEW.LINE, 0))
-         OR(COALESCE(:OLD.M_PRODUCT_ID, 0) <> COALESCE(:NEW.M_PRODUCT_ID, 0))
+         OR(COALESCE(:OLD.M_PRODUCT_ID, '0') <> COALESCE(:NEW.M_PRODUCT_ID, '0'))
       OR(COALESCE(:OLD.QTYINVOICED, 0) <> COALESCE(:NEW.QTYINVOICED, 0))
       OR(COALESCE(:old.LINE, 0) <> COALESCE(:NEW.LINE, 0))
       OR(COALESCE(:OLD.PRICELIST, 0) <> COALESCE(:NEW.PRICELIST, 0))
       OR(COALESCE(:OLD.PRICEACTUAL, 0) <> COALESCE(:NEW.PRICEACTUAL, 0))
       OR(COALESCE(:OLD.PRICELIMIT, 0) <> COALESCE(:NEW.PRICELIMIT, 0))
       OR(COALESCE(:OLD.LINENETAMT, 0) <> COALESCE(:NEW.LINENETAMT, 0))
-      OR(COALESCE(:OLD.C_CHARGE_ID, 0) <> COALESCE(:NEW.C_CHARGE_ID, 0))
+      OR(COALESCE(:OLD.C_CHARGE_ID, '0') <> COALESCE(:NEW.C_CHARGE_ID, '0'))
       OR(COALESCE(:OLD.CHARGEAMT, 0) <> COALESCE(:NEW.CHARGEAMT, 0))
-      OR(COALESCE(:OLD.C_UOM_ID, 0) <> COALESCE(:NEW.C_UOM_ID, 0))
-      OR(COALESCE(:OLD.C_TAX_ID, 0) <> COALESCE(:NEW.C_TAX_ID, 0))
+      OR(COALESCE(:OLD.C_UOM_ID, '0') <> COALESCE(:NEW.C_UOM_ID, '0'))
+      OR(COALESCE(:OLD.C_TAX_ID, '0') <> COALESCE(:NEW.C_TAX_ID, '0'))
       OR(COALESCE(:OLD.TAXAMT, 0) <> COALESCE(:NEW.TAXAMT, 0))
-      OR(COALESCE(:OLD.M_ATTRIBUTESETINSTANCE_ID, 0) <> COALESCE(:NEW.M_ATTRIBUTESETINSTANCE_ID, 0))
+      OR(COALESCE(:OLD.M_ATTRIBUTESETINSTANCE_ID, '0') <> COALESCE(:NEW.M_ATTRIBUTESETINSTANCE_ID, '0'))
       OR(COALESCE(:OLD.QUANTITYORDER, 0) <> COALESCE(:NEW.QUANTITYORDER, 0))
-      OR(COALESCE(:OLD.C_ORDERLINE_ID, 0) <> COALESCE(:NEW.C_ORDERLINE_ID, 0))
-      OR(COALESCE(:OLD.M_PRODUCT_UOM_ID, 0) <> COALESCE(:NEW.M_PRODUCT_UOM_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_ORDERLINE_ID, '0') <> COALESCE(:NEW.C_ORDERLINE_ID, '0'))
+      OR(COALESCE(:OLD.M_PRODUCT_UOM_ID, '0') <> COALESCE(:NEW.M_PRODUCT_UOM_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;