Merge 432b42c979ad

This commit is contained in:
Heng Sin Low 2013-02-04 18:11:05 +08:00
commit 8d5f668baf
2 changed files with 41 additions and 6 deletions

View File

@ -180,9 +180,20 @@ public class MBPBankAccount extends X_C_BP_BankAccount
// maintain routing on bank level
if (isACH() && getBank() != null)
setRoutingNo(null);
//
//
if (getCreditCardNumber() != null)
{
String encrpytedCCNo = PaymentUtil.encrpytCreditCard(getCreditCardNumber());
if (!encrpytedCCNo.equals(getCreditCardNumber()))
setCreditCardNumber(encrpytedCCNo);
}
if (getCreditCardVV() != null)
setCreditCardVV(PaymentUtil.encrpytCvv(getCreditCardVV()));
{
String encrpytedCvv = PaymentUtil.encrpytCvv(getCreditCardVV());
if (!encrpytedCvv.equals(getCreditCardVV()))
setCreditCardVV(encrpytedCvv);
}
return true;
} // beforeSave

View File

@ -48,19 +48,43 @@ public class AdempiereActivator implements BundleActivator {
private void installPackage() {
String trxName = Trx.createTrxName();
try {
String where = "Name=? AND PK_Version=?";
// e.g. 1.0.0.qualifier, check only the "1.0.0" part
String version = getVersion();
if (version != null)
{
int count = 0;
int index = -1;
for(int i = 0; i < version.length(); i++)
{
if(version.charAt(i) == '.')
count++;
if (count == 3)
{
index = i;
break;
}
}
if (index == -1)
index = version.length();
version = version.substring(0, index);
}
String where = "Name=? AND PK_Version LIKE ?";
Query q = new Query(Env.getCtx(), X_AD_Package_Imp.Table_Name,
where.toString(), trxName);
q.setParameters(new Object[] { getName(), getVersion() });
q.setParameters(new Object[] { getName(), version + "%" });
X_AD_Package_Imp pkg = q.first();
if (pkg == null) {
packIn(trxName);
install();
if (logger.isLoggable(Level.INFO))
logger.info(getName() + " " + getVersion() + " installed.");
logger.info(getName() + " " + version + " installed.");
} else {
if (logger.isLoggable(Level.INFO))
logger.info(getName() + " " + getVersion() + " was installed: "
logger.info(getName() + " " + version + " was installed: "
+ pkg.getCreated());
}
Trx.get(trxName, false).commit();