From 42bcef6981d4b8363dbb98b4cac9ba5e0644afc7 Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Wed, 2 Jul 2008 12:46:02 +0000 Subject: [PATCH] BF [ 2008762 ] Validation Rule C_UOM Product Options (again) --- migration/351a-trunk/214_BF2008762.sql | 28 +++++++++++++++++++ .../351a-trunk/postgresql/214_BF2008762.sql | 28 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 migration/351a-trunk/214_BF2008762.sql create mode 100644 migration/351a-trunk/postgresql/214_BF2008762.sql diff --git a/migration/351a-trunk/214_BF2008762.sql b/migration/351a-trunk/214_BF2008762.sql new file mode 100644 index 0000000000..ec70286de4 --- /dev/null +++ b/migration/351a-trunk/214_BF2008762.sql @@ -0,0 +1,28 @@ +-- Mar 13, 2008 11:51:15 AM CET +UPDATE AD_Val_Rule SET Code='( +EXISTS ( + /* UOM is a default UOM and no product selected */ + SELECT * + FROM C_UOM uu + WHERE C_UOM.C_UOM_ID=uu.C_UOM_ID AND IsDefault=''Y'' AND @M_Product_ID@=0 +) +OR EXISTS ( + /* UOM is the products UOM */ + SELECT * + FROM M_Product p + WHERE C_UOM.C_UOM_ID=p.C_UOM_ID AND @M_Product_ID@=p.M_Product_ID +) +OR EXISTS ( + /* For the products UOM there is a conversion that is explicitly bound to the product */ + SELECT * + FROM M_Product p INNER JOIN C_UOM_Conversion c ON (p.C_UOM_ID=c.C_UOM_ID AND p.M_PRODUCT_ID=c.M_Product_ID) + WHERE C_UOM.C_UOM_ID=c.C_UOM_TO_ID AND @M_Product_ID@=p.M_Product_ID +) +OR EXISTS ( + /* For the products UOM there is a conversion that is not bound to any product explicitly */ + SELECT * + FROM M_Product p INNER JOIN C_UOM_Conversion c ON (p.C_UOM_ID=c.C_UOM_ID AND c.M_Product_ID IS NULL) + WHERE C_UOM.C_UOM_ID=c.C_UOM_TO_ID AND @M_Product_ID@=p.M_Product_ID +))',Updated=TO_DATE('2008-03-13 11:51:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=210 +; + diff --git a/migration/351a-trunk/postgresql/214_BF2008762.sql b/migration/351a-trunk/postgresql/214_BF2008762.sql new file mode 100644 index 0000000000..0620beec8c --- /dev/null +++ b/migration/351a-trunk/postgresql/214_BF2008762.sql @@ -0,0 +1,28 @@ +-- Mar 13, 2008 11:51:15 AM CET +UPDATE AD_Val_Rule SET Code='( +EXISTS ( + /* UOM is a default UOM and no product selected */ + SELECT * + FROM C_UOM uu + WHERE C_UOM.C_UOM_ID=uu.C_UOM_ID AND IsDefault=''Y'' AND @M_Product_ID@=0 +) +OR EXISTS ( + /* UOM is the products UOM */ + SELECT * + FROM M_Product p + WHERE C_UOM.C_UOM_ID=p.C_UOM_ID AND @M_Product_ID@=p.M_Product_ID +) +OR EXISTS ( + /* For the products UOM there is a conversion that is explicitly bound to the product */ + SELECT * + FROM M_Product p INNER JOIN C_UOM_Conversion c ON (p.C_UOM_ID=c.C_UOM_ID AND p.M_PRODUCT_ID=c.M_Product_ID) + WHERE C_UOM.C_UOM_ID=c.C_UOM_TO_ID AND @M_Product_ID@=p.M_Product_ID +) +OR EXISTS ( + /* For the products UOM there is a conversion that is not bound to any product explicitly */ + SELECT * + FROM M_Product p INNER JOIN C_UOM_Conversion c ON (p.C_UOM_ID=c.C_UOM_ID AND c.M_Product_ID IS NULL) + WHERE C_UOM.C_UOM_ID=c.C_UOM_TO_ID AND @M_Product_ID@=p.M_Product_ID +))',Updated=TO_TIMESTAMP('2008-03-13 11:51:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=210 +; +