Review FR: [ 2214883 ] Remove SQL code and Replace for Query >> to incorporate Heng Sin's advice. No unit testing done but compiler tested OK.
Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2214883
This commit is contained in:
parent
fdfe4fb8b1
commit
490cb806df
|
@ -107,8 +107,8 @@ public class ExpenseTypesFromAccounts extends SvrProcess {
|
||||||
MProduct product;
|
MProduct product;
|
||||||
|
|
||||||
// Read all existing applicable products into memory for quick comparison.
|
// Read all existing applicable products into memory for quick comparison.
|
||||||
List<MProduct> products = new Query(getCtx(), MProduct.Table_Name, "ProductType=?", get_TrxName())
|
List<MProduct> products = new Query(getCtx(), I_M_Product.Table_Name, "ProductType=?", get_TrxName())
|
||||||
.setParameters(new Object[]{MProduct.PRODUCTTYPE_ExpenseType})
|
.setParameters(MProduct.PRODUCTTYPE_ExpenseType)
|
||||||
.list();
|
.list();
|
||||||
|
|
||||||
Map<String,MProduct> productMap = new TreeMap<String, MProduct>();
|
Map<String,MProduct> productMap = new TreeMap<String, MProduct>();
|
||||||
|
@ -121,10 +121,10 @@ public class ExpenseTypesFromAccounts extends SvrProcess {
|
||||||
MAccount validComb;
|
MAccount validComb;
|
||||||
List<MAccount> validCombs = new Query(
|
List<MAccount> validCombs = new Query(
|
||||||
getCtx(),
|
getCtx(),
|
||||||
MAccount.Table_Name,
|
I_C_ValidCombination.Table_Name,
|
||||||
"C_AcctSchema_ID=? and AD_Client_ID=? and AD_Org_ID=0",
|
"C_AcctSchema_ID=? and AD_Client_ID=? and AD_Org_ID=0",
|
||||||
get_TrxName())
|
get_TrxName())
|
||||||
.setParameters(new Object[]{m_acctSchemaId, m_clientId})
|
.setParameters(m_acctSchemaId, m_clientId)
|
||||||
.list();
|
.list();
|
||||||
|
|
||||||
Map<Integer, MAccount> validCombMap = new TreeMap<Integer, MAccount>();
|
Map<Integer, MAccount> validCombMap = new TreeMap<Integer, MAccount>();
|
||||||
|
@ -136,10 +136,10 @@ public class ExpenseTypesFromAccounts extends SvrProcess {
|
||||||
// Read all accounttypes that fit the given criteria.
|
// Read all accounttypes that fit the given criteria.
|
||||||
List<MElementValue> result = new Query(
|
List<MElementValue> result = new Query(
|
||||||
getCtx(),
|
getCtx(),
|
||||||
MElementValue.Table_Name,
|
I_C_ElementValue.Table_Name,
|
||||||
"AccountType=? and isSummary='N' and Value>=? and Value<=? and AD_Client_ID=?",
|
"AccountType=? and isSummary='N' and Value>=? and Value<=? and AD_Client_ID=?",
|
||||||
get_TrxName())
|
get_TrxName())
|
||||||
.setParameters(new Object[]{MElementValue.ACCOUNTTYPE_Expense, m_startElement, m_endElement, m_clientId})
|
.setParameters(MElementValue.ACCOUNTTYPE_Expense, m_startElement, m_endElement, m_clientId)
|
||||||
.list();
|
.list();
|
||||||
|
|
||||||
MElementValue elem;
|
MElementValue elem;
|
||||||
|
@ -195,8 +195,8 @@ public class ExpenseTypesFromAccounts extends SvrProcess {
|
||||||
|
|
||||||
// TODO: It might be needed to make the accounting more specific, but the purpose
|
// TODO: It might be needed to make the accounting more specific, but the purpose
|
||||||
// of the process now is to create general accounts so this is intentional.
|
// of the process now is to create general accounts so this is intentional.
|
||||||
productAcct = new Query(getCtx(), X_M_Product_Acct.Table_Name, "M_Product_ID=? and C_AcctSchema_ID=?", get_TrxName())
|
productAcct = new Query(getCtx(), I_M_Product_Acct.Table_Name, "M_Product_ID=? and C_AcctSchema_ID=?", get_TrxName())
|
||||||
.setParameters(new Object[]{product.get_ID(), m_acctSchemaId})
|
.setParameters(product.get_ID(), m_acctSchemaId)
|
||||||
.first();
|
.first();
|
||||||
productAcct.setP_Expense_Acct(validComb.get_ID());
|
productAcct.setP_Expense_Acct(validComb.get_ID());
|
||||||
productAcct.setP_Revenue_Acct(validComb.get_ID());
|
productAcct.setP_Revenue_Acct(validComb.get_ID());
|
||||||
|
|
Loading…
Reference in New Issue