Special treatment for EntityType it's a Table reference but must be treated as String

bug reported by guyferd on IRC channel
This commit is contained in:
Carlos Ruiz 2006-12-20 05:20:09 +00:00
parent 551d71c9ae
commit 2b2bfd2017
1 changed files with 14 additions and 12 deletions

View File

@ -15,7 +15,7 @@
* or via info@compiere.org or http://www.compiere.org/license.html * * or via info@compiere.org or http://www.compiere.org/license.html *
* *
* Copyright (C) 2005 Robert Klein. robeklein@hotmail.com * Copyright (C) 2005 Robert Klein. robeklein@hotmail.com
* _____________________________________________ * Contributor(s): Carlos Ruiz - globalqss
*****************************************************************************/ *****************************************************************************/
package org.compiere.PackOut; package org.compiere.PackOut;
@ -246,15 +246,18 @@ public class PackRoll extends SvrProcess
columnIDName = tableName+"_ID"; columnIDName = tableName+"_ID";
} }
//Update columns that are Strings adjusting for single quotes //Update columns that are Strings adjusting for single quotes
if (v_AD_Reference_ID == 10 || v_AD_Reference_ID == 14 || v_AD_Reference_ID == 34 || v_AD_Reference_ID == 17) if (v_AD_Reference_ID == 10 || v_AD_Reference_ID == 14 || v_AD_Reference_ID == 34 || v_AD_Reference_ID == 17
if (rs2.getObject("ColValue").toString().equals("null")){ // Carlos Ruiz globalqss, special treatment for EntityType
;//Ignore null values // it's a Table reference but must be treated as String
} || (v_AD_Reference_ID == 18 && columnName.equalsIgnoreCase("EntityType")))
else{ if (rs2.getObject("ColValue").toString().equals("null")){
sqlC = new StringBuffer ("UPDATE " + tableName ;//Ignore null values
+ " SET " + columnName + " = " }
+ "'" + rs2.getObject("ColValue").toString().replaceAll("'","''") + "'" else{
+ " WHERE " + columnIDName+" = "+ recordID);} sqlC = new StringBuffer ("UPDATE " + tableName
+ " SET " + columnName + " = "
+ "'" + rs2.getObject("ColValue").toString().replaceAll("'","''") + "'"
+ " WHERE " + columnIDName+" = "+ recordID);}
//Update true/false columns //Update true/false columns
else if (v_AD_Reference_ID == 20|| v_AD_Reference_ID == 28){ else if (v_AD_Reference_ID == 20|| v_AD_Reference_ID == 28){
sqlC = new StringBuffer ("UPDATE " + tableName sqlC = new StringBuffer ("UPDATE " + tableName
@ -295,7 +298,6 @@ public class PackRoll extends SvrProcess
+ " WHERE AD_Package_Imp_Detail_ID = "+ rs.getInt("AD_Package_Imp_Detail_ID")); + " WHERE AD_Package_Imp_Detail_ID = "+ rs.getInt("AD_Package_Imp_Detail_ID"));
no = DB.executeUpdate(sqlD.toString(), null); no = DB.executeUpdate(sqlD.toString(), null);
} }
} }
rs2.close (); rs2.close ();
@ -459,4 +461,4 @@ public class PackRoll extends SvrProcess
return success; return success;
} }
} // PackRoll } // PackRoll