From 66323a8f95345588d8cee4344c4c9a2ffa673a9b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 7 Dec 2009 22:38:31 +0000 Subject: [PATCH] BF [2904257] - wrong validation sql for "M_InOutShipment/Receipt (RMA)" https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2904257&group_id=176962 --- base/src/org/compiere/util/Env.java | 23 ++++++++----------- ...22_BF2904257_WrongRMALineValidationSQL.sql | 6 +++++ ...22_BF2904257_WrongRMALineValidationSQL.sql | 6 +++++ 3 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 migration/354a-trunk/oracle/622_BF2904257_WrongRMALineValidationSQL.sql create mode 100644 migration/354a-trunk/postgresql/622_BF2904257_WrongRMALineValidationSQL.sql diff --git a/base/src/org/compiere/util/Env.java b/base/src/org/compiere/util/Env.java index 1faecb6336..2772532b6e 100644 --- a/base/src/org/compiere/util/Env.java +++ b/base/src/org/compiere/util/Env.java @@ -382,10 +382,12 @@ public final class Env if (WindowNo != WINDOW_FIND && WindowNo != WINDOW_MLOOKUP) s_log.finest("Context("+WindowNo+","+TabNo+") " + context + "==" + value); // - if (value == null || value.equals("")) - ctx.remove(WindowNo+"|"+TabNo+"|"+context); - else - ctx.setProperty(WindowNo+"|"+TabNo+"|"+context, value); + if (value == null) + if (context.endsWith("_ID")) + value = new String("-1"); + else + value = new String(""); + ctx.setProperty(WindowNo+"|"+TabNo+"|"+context, value); } // setContext /** @@ -1181,16 +1183,9 @@ public final class Env ctxInfo = getContext(ctx, token); // get global context if (ctxInfo.length() == 0) { - if (token.endsWith("_ID")) - { - outStr.append("0"); - } - else - { - s_log.config("No Context Win=" + WindowNo + " for: " + token); - if (!ignoreUnparsable) - return ""; // token not found - } + s_log.config("No Context Win=" + WindowNo + " for: " + token); + if (!ignoreUnparsable) + return ""; // token not found } else outStr.append(ctxInfo); // replace context with Context diff --git a/migration/354a-trunk/oracle/622_BF2904257_WrongRMALineValidationSQL.sql b/migration/354a-trunk/oracle/622_BF2904257_WrongRMALineValidationSQL.sql new file mode 100644 index 0000000000..312f3d0e90 --- /dev/null +++ b/migration/354a-trunk/oracle/622_BF2904257_WrongRMALineValidationSQL.sql @@ -0,0 +1,6 @@ +-- Nov 26, 2009 11:18:36 AM MYT +-- 2904257 - wrong dynamic validation sql for rma line +UPDATE AD_Val_Rule SET Code='M_InOutLine.M_InOut_ID=@InOut_ID@ AND NOT EXISTS (SELECT * FROM M_RMALine rl WHERE rl.M_InOutLine_ID=M_InOutLine.M_InOutLine_ID AND rl.M_RMA_ID=@M_RMA_ID@ AND rl.M_RMALine_ID != @1|M_RMALine_ID@)',Updated=TO_DATE('2009-12-07 17:27:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52001 +; + +COMMIT; diff --git a/migration/354a-trunk/postgresql/622_BF2904257_WrongRMALineValidationSQL.sql b/migration/354a-trunk/postgresql/622_BF2904257_WrongRMALineValidationSQL.sql new file mode 100644 index 0000000000..b04f3c6d6e --- /dev/null +++ b/migration/354a-trunk/postgresql/622_BF2904257_WrongRMALineValidationSQL.sql @@ -0,0 +1,6 @@ +-- Nov 26, 2009 11:18:36 AM MYT +-- 2904257 - wrong dynamic validation sql for rma line +UPDATE AD_Val_Rule SET Code='M_InOutLine.M_InOut_ID=@InOut_ID@ AND NOT EXISTS (SELECT * FROM M_RMALine rl WHERE rl.M_InOutLine_ID=M_InOutLine.M_InOutLine_ID AND rl.M_RMA_ID=@M_RMA_ID@ AND rl.M_RMALine_ID != @1|M_RMALine_ID@)',Updated=TO_TIMESTAMP('2009-12-07 17:27:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=52001 +; + +COMMIT;