From 44f99b45bc47ecd9f4fa438647ae2cbbe65b0229 Mon Sep 17 00:00:00 2001 From: tsvikruha Date: Sat, 12 Dec 2015 12:16:48 -0500 Subject: [PATCH] IDEMPIERE-2716 Bank Register Report - add Bank Account Parameter --- .../i3.1/oracle/201512121213_IDEMPIERE-2716.sql | 15 +++++++++++++++ .../postgresql/201512121213_IDEMPIERE-2716.sql | 12 ++++++++++++ .../src/org/compiere/report/BankRegister.java | 6 ++++++ 3 files changed, 33 insertions(+) create mode 100644 migration/i3.1/oracle/201512121213_IDEMPIERE-2716.sql create mode 100644 migration/i3.1/postgresql/201512121213_IDEMPIERE-2716.sql diff --git a/migration/i3.1/oracle/201512121213_IDEMPIERE-2716.sql b/migration/i3.1/oracle/201512121213_IDEMPIERE-2716.sql new file mode 100644 index 0000000000..8dd67f52a0 --- /dev/null +++ b/migration/i3.1/oracle/201512121213_IDEMPIERE-2716.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-2716 Bank Register Report - add Bank Account Parameter +-- Jul 7, 2015 10:28:19 AM CEST +INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200082,'C_BankAccount by Bank','S','C_BankAccount.C_Bank_ID=@C_Bank_ID@',0,0,'Y',TO_DATE('2015-07-07 10:28:18','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-07-07 10:28:18','YYYY-MM-DD HH24:MI:SS'),100,'C','923bb7a8-b071-4f8a-85de-794e06e43490') +; + +-- Jul 7, 2015 10:28:27 AM CEST +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200139,0,0,'Y',TO_DATE('2015-07-07 10:28:26','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-07-07 10:28:26','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account','Account at the Bank','The Bank Account identifies an account at this Bank.',200035,15,19,'N',200082,10,'N','C_BankAccount_ID','Y','D',836,'c852e4f4-417c-4955-b1ec-26d73d79b81c','N') +; + +SELECT register_migration_script('201512121213_IDEMPIERE-2716.sql') FROM dual +; + diff --git a/migration/i3.1/postgresql/201512121213_IDEMPIERE-2716.sql b/migration/i3.1/postgresql/201512121213_IDEMPIERE-2716.sql new file mode 100644 index 0000000000..9b61ebf8be --- /dev/null +++ b/migration/i3.1/postgresql/201512121213_IDEMPIERE-2716.sql @@ -0,0 +1,12 @@ +-- IDEMPIERE-2716 Bank Register Report - add Bank Account Parameter +-- Jul 7, 2015 10:28:19 AM CEST +INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200082,'C_BankAccount by Bank','S','C_BankAccount.C_Bank_ID=@C_Bank_ID@',0,0,'Y',TO_TIMESTAMP('2015-07-07 10:28:18','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-07-07 10:28:18','YYYY-MM-DD HH24:MI:SS'),100,'C','923bb7a8-b071-4f8a-85de-794e06e43490') +; + +-- Jul 7, 2015 10:28:27 AM CEST +INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200139,0,0,'Y',TO_TIMESTAMP('2015-07-07 10:28:26','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-07-07 10:28:26','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account','Account at the Bank','The Bank Account identifies an account at this Bank.',200035,15,19,'N',200082,10,'N','C_BankAccount_ID','Y','D',836,'c852e4f4-417c-4955-b1ec-26d73d79b81c','N') +; + +SELECT register_migration_script('201512121213_IDEMPIERE-2716.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/report/BankRegister.java b/org.adempiere.base/src/org/compiere/report/BankRegister.java index c2a16fc4a4..3aa8cc159f 100644 --- a/org.adempiere.base/src/org/compiere/report/BankRegister.java +++ b/org.adempiere.base/src/org/compiere/report/BankRegister.java @@ -39,6 +39,8 @@ public class BankRegister extends SvrProcess { /** Bank Parameter */ private int p_C_Bank_ID = 0; + /** Bank Account Parameter */ + private int p_C_BankAccount_ID = 0; /** Period Parameter */ //private int p_C_Period_ID = 0; private Timestamp p_DateAcct_From = null; @@ -78,11 +80,15 @@ public class BankRegister extends SvrProcess } else if (name.equals("C_BPartner_ID")) p_C_BPartner_ID = ((BigDecimal)para[i].getParameter()).intValue(); + else if (name.equals("C_BankAccount_ID")) + p_C_BankAccount_ID = para[i].getParameterAsInt(); else log.log(Level.SEVERE, "Unknown Parameter: " + name); } m_parameterWhere.append(" fa.AD_Table_ID = (Select AD_Table_ID From AD_Table Where TableName = 'C_Payment') "); m_parameterWhere.append(" And b.C_Bank_ID = " + p_C_Bank_ID); + if(p_C_BankAccount_ID > 0) + m_parameterWhere.append(" AND ba.C_BankAccount_ID = " + p_C_BankAccount_ID); setDateAcct(); sb.append(" - DateAcct ").append(p_DateAcct_From).append("-").append(p_DateAcct_To);