Merge a03437121c3f

This commit is contained in:
Heng Sin Low 2013-09-07 02:51:52 +08:00
commit ee52fd68f3
3 changed files with 27 additions and 4 deletions

View File

@ -16,6 +16,7 @@ import org.adempiere.pipo2.ElementHandler;
import org.adempiere.pipo2.PIPOContext;
import org.adempiere.pipo2.PackOut;
import org.adempiere.pipo2.PoExporter;
import org.compiere.model.MLanguage;
import org.compiere.model.MTable;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -52,6 +53,10 @@ public class CommonTranslationHandler extends AbstractElementHandler implements
throw new SAXException();
String language = getStringValue(element, "AD_Language");
MLanguage lang = MLanguage.get(ctx.ctx, language);
// skip if not system installed language
if (! lang.isSystemLanguage())
return;
if (log.isLoggable(Level.INFO)) log.info(elementValue+" "+getStringValue(element, "Name"));

View File

@ -386,8 +386,13 @@ public final class AEnv
zoomQuery.addRestriction(column, MQuery.EQUAL, value);
zoomQuery.setRecordCount(1); // guess
}
int windowId = lookup.getZoom(zoomQuery);
zoom(windowId, zoomQuery);
if (value instanceof Integer && ((Integer) value).intValue() >= 0 && zoomQuery != null && zoomQuery.getZoomTableName() != null) {
int tableId = MTable.getTable_ID(zoomQuery.getZoomTableName());
zoom(tableId, ((Integer) value).intValue());
} else {
int windowId = lookup.getZoom(zoomQuery);
zoom(windowId, zoomQuery);
}
}
/**

View File

@ -23,6 +23,7 @@ import org.compiere.model.GridTab;
import org.compiere.model.MRole;
import org.compiere.util.DB;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Env;
/**
*
@ -52,9 +53,21 @@ public abstract class PaymentFormOnCredit extends PaymentForm {
/**
* Load Payment Terms
*/
String ad_language = Env.getAD_Language(Env.getCtx());
boolean isBaseLanguage = Env.isBaseLanguage(ad_language, "C_PaymentTerm");
StringBuilder sb = new StringBuilder();
if (isBaseLanguage) {
sb.append("SELECT p.C_PaymentTerm_ID, p.Name FROM C_PaymentTerm p")
.append(" WHERE p.IsActive='Y' ORDER BY p.Name");
} else {
sb.append("SELECT p.C_PaymentTerm_ID, pt.Name FROM C_PaymentTerm p")
.append(" JOIN C_PaymentTerm_Trl pt ON (p.C_PaymentTerm_ID=pt.C_PaymentTerm_ID AND pt.AD_Language='")
.append(ad_language).append("')")
.append(" WHERE p.IsActive='Y' ORDER BY p.Name");
}
String SQL = MRole.getDefault().addAccessSQL(
"SELECT C_PaymentTerm_ID, Name FROM C_PaymentTerm WHERE IsActive='Y' ORDER BY Name",
"C_PaymentTerm", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
sb.toString(), "p", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);
PreparedStatement pstmt = null;
ResultSet rs = null;
try