Merge 432b42c979ad
This commit is contained in:
commit
8d5f668baf
|
@ -180,9 +180,20 @@ public class MBPBankAccount extends X_C_BP_BankAccount
|
||||||
// maintain routing on bank level
|
// maintain routing on bank level
|
||||||
if (isACH() && getBank() != null)
|
if (isACH() && getBank() != null)
|
||||||
setRoutingNo(null);
|
setRoutingNo(null);
|
||||||
//
|
//
|
||||||
|
if (getCreditCardNumber() != null)
|
||||||
|
{
|
||||||
|
String encrpytedCCNo = PaymentUtil.encrpytCreditCard(getCreditCardNumber());
|
||||||
|
if (!encrpytedCCNo.equals(getCreditCardNumber()))
|
||||||
|
setCreditCardNumber(encrpytedCCNo);
|
||||||
|
}
|
||||||
|
|
||||||
if (getCreditCardVV() != null)
|
if (getCreditCardVV() != null)
|
||||||
setCreditCardVV(PaymentUtil.encrpytCvv(getCreditCardVV()));
|
{
|
||||||
|
String encrpytedCvv = PaymentUtil.encrpytCvv(getCreditCardVV());
|
||||||
|
if (!encrpytedCvv.equals(getCreditCardVV()))
|
||||||
|
setCreditCardVV(encrpytedCvv);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // beforeSave
|
} // beforeSave
|
||||||
|
|
|
@ -48,19 +48,43 @@ public class AdempiereActivator implements BundleActivator {
|
||||||
private void installPackage() {
|
private void installPackage() {
|
||||||
String trxName = Trx.createTrxName();
|
String trxName = Trx.createTrxName();
|
||||||
try {
|
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,
|
Query q = new Query(Env.getCtx(), X_AD_Package_Imp.Table_Name,
|
||||||
where.toString(), trxName);
|
where.toString(), trxName);
|
||||||
q.setParameters(new Object[] { getName(), getVersion() });
|
q.setParameters(new Object[] { getName(), version + "%" });
|
||||||
X_AD_Package_Imp pkg = q.first();
|
X_AD_Package_Imp pkg = q.first();
|
||||||
if (pkg == null) {
|
if (pkg == null) {
|
||||||
packIn(trxName);
|
packIn(trxName);
|
||||||
install();
|
install();
|
||||||
if (logger.isLoggable(Level.INFO))
|
if (logger.isLoggable(Level.INFO))
|
||||||
logger.info(getName() + " " + getVersion() + " installed.");
|
logger.info(getName() + " " + version + " installed.");
|
||||||
} else {
|
} else {
|
||||||
if (logger.isLoggable(Level.INFO))
|
if (logger.isLoggable(Level.INFO))
|
||||||
logger.info(getName() + " " + getVersion() + " was installed: "
|
logger.info(getName() + " " + version + " was installed: "
|
||||||
+ pkg.getCreated());
|
+ pkg.getCreated());
|
||||||
}
|
}
|
||||||
Trx.get(trxName, false).commit();
|
Trx.get(trxName, false).commit();
|
||||||
|
|
Loading…
Reference in New Issue