diff --git a/base/src/org/compiere/report/FinReport.java b/base/src/org/compiere/report/FinReport.java index afcfa4caa9..bad0336c2b 100644 --- a/base/src/org/compiere/report/FinReport.java +++ b/base/src/org/compiere/report/FinReport.java @@ -40,6 +40,9 @@ import org.compiere.util.TimeUtil; * Financial Report Engine * * @author Jorg Janke + * @author Armen Rizal, Goodwill Consulting + *
  • FR [2857076] User Element 1 and 2 completion - https://sourceforge.net/tracker/?func=detail&aid=2857076&group_id=176962&atid=879335 + * * @version $Id: FinReport.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ */ public class FinReport extends SvrProcess @@ -60,6 +63,14 @@ public class FinReport extends SvrProcess private int p_C_SalesRegion_ID = 0; /** Campaign Parameter */ private int p_C_Campaign_ID = 0; + /** User 1 Parameter */ + private int p_User1_ID = 0; + /** User 2 Parameter */ + private int p_User2_ID = 0; + /** User Element 1 Parameter */ + private int p_UserElement1_ID = 0; + /** User Element 2 Parameter */ + private int p_UserElement2_ID = 0; /** Details before Lines */ private boolean p_DetailsSourceFirst = false; /** Hierarchy */ @@ -116,6 +127,14 @@ public class FinReport extends SvrProcess p_C_SalesRegion_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("C_Campaign_ID")) p_C_Campaign_ID = ((BigDecimal)para[i].getParameter()).intValue(); + else if (name.equals("User1_ID")) + p_User1_ID = ((BigDecimal)para[i].getParameter()).intValue(); + else if (name.equals("User2_ID")) + p_User2_ID = ((BigDecimal)para[i].getParameter()).intValue(); + else if (name.equals("UserElement1_ID")) + p_UserElement1_ID = ((BigDecimal)para[i].getParameter()).intValue(); + else if (name.equals("UserElement2_ID")) + p_UserElement2_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("DetailsSourceFirst")) p_DetailsSourceFirst = "Y".equals(para[i].getParameter()); else if (name.equals("PA_ReportCube_ID")) @@ -152,6 +171,20 @@ public class FinReport extends SvrProcess if (p_C_SalesRegion_ID != 0) m_parameterWhere.append(" AND ").append(MReportTree.getWhereClause(getCtx(), p_PA_Hierarchy_ID, MAcctSchemaElement.ELEMENTTYPE_SalesRegion, p_C_SalesRegion_ID)); + // Optional User1_ID + if (p_User1_ID != 0) + m_parameterWhere.append(" AND ").append(MReportTree.getWhereClause(getCtx(), + p_PA_Hierarchy_ID, MAcctSchemaElement.ELEMENTTYPE_UserList1, p_User1_ID)); + // Optional User2_ID + if (p_User2_ID != 0) + m_parameterWhere.append(" AND ").append(MReportTree.getWhereClause(getCtx(), + p_PA_Hierarchy_ID, MAcctSchemaElement.ELEMENTTYPE_UserList2, p_User2_ID)); + // Optional UserElement1_ID + if (p_UserElement1_ID != 0) + m_parameterWhere.append(" AND UserElement1_ID=").append(p_UserElement1_ID); + // Optional UserElement2_ID + if (p_UserElement2_ID != 0) + m_parameterWhere.append(" AND UserElement2_ID=").append(p_UserElement2_ID); // Load Report Definition m_report = new MReport (getCtx(), getRecord_ID(), null); diff --git a/base/src/org/compiere/report/FinStatement.java b/base/src/org/compiere/report/FinStatement.java index d2cc936e9e..f71c7a3230 100644 --- a/base/src/org/compiere/report/FinStatement.java +++ b/base/src/org/compiere/report/FinStatement.java @@ -47,7 +47,10 @@ import org.compiere.util.Msg; * * @author victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com *
  • FR [ 2520591 ] Support multiples calendar for Org - * @see http://sourceforge.net/tracker2/?func=detail&atid=879335&aid=2520591&group_id=176962 + * @see http://sourceforge.net/tracker2/?func=detail&atid=879335&aid=2520591&group_id=176962 + * @author Armen Rizal, Goodwill Consulting + *
  • FR [2857076] User Element 1 and 2 completion - https://sourceforge.net/tracker/?func=detail&aid=2857076&group_id=176962&atid=879335 + * */ public class FinStatement extends SvrProcess { @@ -75,6 +78,14 @@ public class FinStatement extends SvrProcess private int p_C_SalesRegion_ID = 0; /** Campaign Parameter */ private int p_C_Campaign_ID = 0; + /** User List 1 Parameter */ + private int p_User1_ID = 0; + /** User List 2 Parameter */ + private int p_User2_ID = 0; + /** User Element 1 Parameter */ + private int p_UserElement1_ID = 0; + /** User Element 2 Parameter */ + private int p_UserElement2_ID = 0; /** Hierarchy */ private int p_PA_Hierarchy_ID = 0; @@ -129,6 +140,14 @@ public class FinStatement extends SvrProcess p_C_SalesRegion_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("C_Campaign_ID")) p_C_Campaign_ID = ((BigDecimal)para[i].getParameter()).intValue(); + else if (name.equals("User1_ID")) + p_User1_ID = ((BigDecimal)para[i].getParameter()).intValue(); + else if (name.equals("User2_ID")) + p_User2_ID = ((BigDecimal)para[i].getParameter()).intValue(); + else if (name.equals("UserElement1_ID")) + p_UserElement1_ID = ((BigDecimal)para[i].getParameter()).intValue(); + else if (name.equals("UserElement2_ID")) + p_UserElement2_ID = ((BigDecimal)para[i].getParameter()).intValue(); else log.log(Level.SEVERE, "Unknown Parameter: " + name); } @@ -168,6 +187,20 @@ public class FinStatement extends SvrProcess if (p_C_SalesRegion_ID != 0) m_parameterWhere.append(" AND ").append(MReportTree.getWhereClause(getCtx(), p_PA_Hierarchy_ID, MAcctSchemaElement.ELEMENTTYPE_SalesRegion, p_C_SalesRegion_ID)); + // Optional User1_ID + if (p_User1_ID != 0) + m_parameterWhere.append(" AND ").append(MReportTree.getWhereClause(getCtx(), + p_PA_Hierarchy_ID, MAcctSchemaElement.ELEMENTTYPE_UserList1, p_User1_ID)); + // Optional User2_ID + if (p_User2_ID != 0) + m_parameterWhere.append(" AND ").append(MReportTree.getWhereClause(getCtx(), + p_PA_Hierarchy_ID, MAcctSchemaElement.ELEMENTTYPE_UserList2, p_User2_ID)); + // Optional UserElement1_ID + if (p_UserElement1_ID != 0) + m_parameterWhere.append(" AND UserElement1_ID=").append(p_UserElement1_ID); + // Optional UserElement2_ID + if (p_UserElement2_ID != 0) + m_parameterWhere.append(" AND UserElement2_ID=").append(p_UserElement2_ID); // setDateAcct(); sb.append(" - DateAcct ").append(p_DateAcct_From).append("-").append(p_DateAcct_To);