IDEMPIERE-2477 Generate boolean in 2Pack as Y/N instead of true/false

This commit is contained in:
Carlos Ruiz 2015-02-25 13:44:42 -05:00
parent 639d830e1f
commit 0cea1c7fe1
4 changed files with 7 additions and 16 deletions

View File

@ -121,7 +121,7 @@ public class CommonTranslationHandler extends AbstractElementHandler implements
if(columnName.equalsIgnoreCase("IsActive") || if(columnName.equalsIgnoreCase("IsActive") ||
columnName.equalsIgnoreCase("IsTranslated")){ columnName.equalsIgnoreCase("IsTranslated")){
value = "true".equals(value) ? "Y" : "N"; value = "true".equals(value) || "Y".equals(value) ? "Y" : "N";
} }
pstm.setString(i, value); pstm.setString(i, value);
} }
@ -161,7 +161,7 @@ public class CommonTranslationHandler extends AbstractElementHandler implements
if(columnName.equalsIgnoreCase("IsActive") || if(columnName.equalsIgnoreCase("IsActive") ||
columnName.equalsIgnoreCase("IsTranslated")){ columnName.equalsIgnoreCase("IsTranslated")){
value = "true".equals(value) ? "Y" : "N"; value = "true".equals(value) || "Y".equals(value) ? "Y" : "N";
} }
pstm.setString(i, value); pstm.setString(i, value);

View File

@ -133,17 +133,8 @@ public class MenuElementHandler extends AbstractElementHandler {
int columnID = DB.getSQLValue(getTrxName(ctx), sql, colName, tableID); int columnID = DB.getSQLValue(getTrxName(ctx), sql, colName, tableID);
sql = "SELECT AD_Reference_ID FROM AD_COLUMN WHERE AD_Column_ID = ?"; sql = "SELECT AD_Reference_ID FROM AD_COLUMN WHERE AD_Column_ID = ?";
int referenceID = DB.getSQLValue(getTrxName(ctx), sql, columnID); int referenceID = DB.getSQLValue(getTrxName(ctx), sql, columnID);
if (referenceID == 20 || referenceID == 28) Object obj = rs.getObject(q);
if (rs.getObject(q).equals("Y")) colValue = obj == null ? "" : obj.toString();
colValue = "true";
else
colValue = "false";
else
{
Object obj = rs.getObject(q);
colValue = obj == null ? "" : obj.toString();
}
X_AD_Package_Imp_Backup backup = new X_AD_Package_Imp_Backup(ctx.ctx, 0, getTrxName(ctx)); X_AD_Package_Imp_Backup backup = new X_AD_Package_Imp_Backup(ctx.ctx, 0, getTrxName(ctx));
backup.setAD_Package_Imp_Detail_ID(impDetail.getAD_Package_Imp_Detail_ID()); backup.setAD_Package_Imp_Detail_ID(impDetail.getAD_Package_Imp_Detail_ID());
backup.setAD_Package_Imp_ID(getPackageImpId(ctx.ctx)); backup.setAD_Package_Imp_ID(getPackageImpId(ctx.ctx));

View File

@ -90,7 +90,7 @@ public class PoExporter {
* @param boolValue * @param boolValue
*/ */
public void addBoolean(String name, boolean boolValue, AttributesImpl atts){ public void addBoolean(String name, boolean boolValue, AttributesImpl atts){
addTextElement(name, boolValue == true ? "true" : "false", atts); addTextElement(name, boolValue == true ? "Y" : "N", atts);
} }
@ -120,7 +120,7 @@ public class PoExporter {
if(value instanceof String){ if(value instanceof String){
addTextElement(columnName, (String)value, atts); addTextElement(columnName, (String)value, atts);
} else if(value instanceof Boolean) { } else if(value instanceof Boolean) {
addTextElement(columnName, (Boolean)value == true ? "true" : "false", atts); addTextElement(columnName, (Boolean)value == true ? "Y" : "N", atts);
} else if(value instanceof Integer) { } else if(value instanceof Integer) {
addTextElement(columnName, value.toString(), atts); addTextElement(columnName, value.toString(), atts);
} else if(value instanceof BigDecimal) { } else if(value instanceof BigDecimal) {

View File

@ -70,7 +70,7 @@ public class PoFiller{
Element e = element.properties.get(columnName); Element e = element.properties.get(columnName);
String value = e != null ? e.contents.toString() : null; String value = e != null ? e.contents.toString() : null;
boolean bool = "true".equals(value) ? true : false; boolean bool = "true".equals(value) || "Y".equals(value) ? true : false;
if (po.get_Value(columnName) != null && po.get_ValueAsBoolean(columnName) == bool) if (po.get_Value(columnName) != null && po.get_ValueAsBoolean(columnName) == bool)
return; return;