From ba35f250bab681b2c599339672debf0de1a66626 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Dec 2012 11:55:40 -0500 Subject: [PATCH] IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting / Peer review --- ...IDEMPIERE-480_780.11_StatementDateAcct.sql | 56 ++++++++++++++++++- ...IDEMPIERE-480_780.11_StatementDateAcct.sql | 52 +++++++++++++++++ .../org/compiere/model/I_C_BankStatement.java | 26 +++++++++ .../compiere/model/MBankStatementLine.java | 4 +- .../org/compiere/model/X_C_BankStatement.java | 37 +++++++++++- 5 files changed, 172 insertions(+), 3 deletions(-) diff --git a/migration/i1.0a-release/oracle/201212121120_IDEMPIERE-480_780.11_StatementDateAcct.sql b/migration/i1.0a-release/oracle/201212121120_IDEMPIERE-480_780.11_StatementDateAcct.sql index a879714def..f335ccd20b 100644 --- a/migration/i1.0a-release/oracle/201212121120_IDEMPIERE-480_780.11_StatementDateAcct.sql +++ b/migration/i1.0a-release/oracle/201212121120_IDEMPIERE-480_780.11_StatementDateAcct.sql @@ -134,4 +134,58 @@ UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2011-07-22 17:15:20','YYYY-M -- 26/07/2011 3:12:34 PM -- -- UPDATE AD_Column SET Callout='org.compiere.model.CalloutEngine.dateAcct',Updated=TO_DATE('2011-07-26 15:12:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4918 -; \ No newline at end of file +; + +-- Dec 12, 2012 11:39:16 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET ColumnSpan=2, SeqNo=60, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2012-12-12 11:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=61967 +; + +-- Dec 12, 2012 11:39:16 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=150,Updated=TO_DATE('2012-12-12 11:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3997 +; + +-- Dec 12, 2012 11:39:16 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=160,Updated=TO_DATE('2012-12-12 11:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8686 +; + +-- Dec 12, 2012 11:39:16 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=170,Updated=TO_DATE('2012-12-12 11:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8687 +; + +-- Dec 12, 2012 11:39:16 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=180,Updated=TO_DATE('2012-12-12 11:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10585 +; + +-- Dec 12, 2012 11:39:17 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=190,Updated=TO_DATE('2012-12-12 11:39:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10586 +; + +-- Dec 12, 2012 11:39:17 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=200, IsDisplayed='Y', XPosition=5,Updated=TO_DATE('2012-12-12 11:39:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10587 +; + +-- Dec 12, 2012 11:39:17 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=210,Updated=TO_DATE('2012-12-12 11:39:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3999 +; + +-- Dec 12, 2012 11:41:08 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Column SET DefaultValue='@DateAcct@',Updated=TO_DATE('2012-12-12 11:41:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5216 +; + +-- Dec 12, 2012 11:41:34 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_DATE('2012-12-12 11:41:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4121 +; + +SELECT register_migration_script('201212121120_IDEMPIERE-480_780.11_StatementDateAcct.sql') FROM dual +; + diff --git a/migration/i1.0a-release/postgresql/201212121120_IDEMPIERE-480_780.11_StatementDateAcct.sql b/migration/i1.0a-release/postgresql/201212121120_IDEMPIERE-480_780.11_StatementDateAcct.sql index 197b123770..4834ab8b6e 100644 --- a/migration/i1.0a-release/postgresql/201212121120_IDEMPIERE-480_780.11_StatementDateAcct.sql +++ b/migration/i1.0a-release/postgresql/201212121120_IDEMPIERE-480_780.11_StatementDateAcct.sql @@ -136,4 +136,56 @@ UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2011-07-22 17:15:20','Y UPDATE AD_Column SET Callout='org.compiere.model.CalloutEngine.dateAcct',Updated=TO_TIMESTAMP('2011-07-26 15:12:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4918 ; +-- Dec 12, 2012 11:39:16 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET ColumnSpan=2, SeqNo=60, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2012-12-12 11:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=61967 +; + +-- Dec 12, 2012 11:39:16 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2012-12-12 11:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3997 +; + +-- Dec 12, 2012 11:39:16 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2012-12-12 11:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8686 +; + +-- Dec 12, 2012 11:39:16 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=170,Updated=TO_TIMESTAMP('2012-12-12 11:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=8687 +; + +-- Dec 12, 2012 11:39:16 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=180,Updated=TO_TIMESTAMP('2012-12-12 11:39:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10585 +; + +-- Dec 12, 2012 11:39:17 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=190,Updated=TO_TIMESTAMP('2012-12-12 11:39:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10586 +; + +-- Dec 12, 2012 11:39:17 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=200, IsDisplayed='Y', XPosition=5,Updated=TO_TIMESTAMP('2012-12-12 11:39:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10587 +; + +-- Dec 12, 2012 11:39:17 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2012-12-12 11:39:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3999 +; + +-- Dec 12, 2012 11:41:08 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Column SET DefaultValue='@DateAcct@',Updated=TO_TIMESTAMP('2012-12-12 11:41:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5216 +; + +-- Dec 12, 2012 11:41:34 AM COT +-- IDEMPIERE-480 Huge bug with FactAcctReset and Automatic Accounting +UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2012-12-12 11:41:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4121 +; + +SELECT register_migration_script('201212121120_IDEMPIERE-480_780.11_StatementDateAcct.sql') FROM dual +; diff --git a/org.adempiere.base/src/org/compiere/model/I_C_BankStatement.java b/org.adempiere.base/src/org/compiere/model/I_C_BankStatement.java index 8232c304e8..fa40d567c3 100644 --- a/org.adempiere.base/src/org/compiere/model/I_C_BankStatement.java +++ b/org.adempiere.base/src/org/compiere/model/I_C_BankStatement.java @@ -112,6 +112,19 @@ public interface I_C_BankStatement /** Get C_BankStatement_UU */ public String getC_BankStatement_UU(); + /** Column name CopyFrom */ + public static final String COLUMNNAME_CopyFrom = "CopyFrom"; + + /** Set Copy From. + * Copy From Record + */ + public void setCopyFrom (String CopyFrom); + + /** Get Copy From. + * Copy From Record + */ + public String getCopyFrom(); + /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -141,6 +154,19 @@ public interface I_C_BankStatement */ public String getCreateFrom(); + /** Column name DateAcct */ + public static final String COLUMNNAME_DateAcct = "DateAcct"; + + /** Set Account Date. + * Accounting Date + */ + public void setDateAcct (Timestamp DateAcct); + + /** Get Account Date. + * Accounting Date + */ + public Timestamp getDateAcct(); + /** Column name Description */ public static final String COLUMNNAME_Description = "Description"; diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java b/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java index 16ddc6f419..d2eb6c99e1 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java @@ -206,7 +206,9 @@ import org.compiere.util.Msg; if (amt.compareTo(getChargeAmt()) != 0) setChargeAmt (amt); // - + // IDEMPIERE-480 + setDateAcct(getParent().getDateAcct()); + return true; } // beforeSave diff --git a/org.adempiere.base/src/org/compiere/model/X_C_BankStatement.java b/org.adempiere.base/src/org/compiere/model/X_C_BankStatement.java index 5d090a4f7a..b23984d113 100644 --- a/org.adempiere.base/src/org/compiere/model/X_C_BankStatement.java +++ b/org.adempiere.base/src/org/compiere/model/X_C_BankStatement.java @@ -33,7 +33,7 @@ public class X_C_BankStatement extends PO implements I_C_BankStatement, I_Persis /** * */ - private static final long serialVersionUID = 20121031L; + private static final long serialVersionUID = 20121212L; /** Standard Constructor */ public X_C_BankStatement (Properties ctx, int C_BankStatement_ID, String trxName) @@ -43,6 +43,7 @@ public class X_C_BankStatement extends PO implements I_C_BankStatement, I_Persis { setC_BankAccount_ID (0); setC_BankStatement_ID (0); + setDateAcct (new Timestamp( System.currentTimeMillis() )); setDocAction (null); // CO setDocStatus (null); @@ -175,6 +176,23 @@ public class X_C_BankStatement extends PO implements I_C_BankStatement, I_Persis return (String)get_Value(COLUMNNAME_C_BankStatement_UU); } + /** Set Copy From. + @param CopyFrom + Copy From Record + */ + public void setCopyFrom (String CopyFrom) + { + set_Value (COLUMNNAME_CopyFrom, CopyFrom); + } + + /** Get Copy From. + @return Copy From Record + */ + public String getCopyFrom () + { + return (String)get_Value(COLUMNNAME_CopyFrom); + } + /** Set Create lines from. @param CreateFrom Process which will generate a new document lines based on an existing document @@ -192,6 +210,23 @@ public class X_C_BankStatement extends PO implements I_C_BankStatement, I_Persis return (String)get_Value(COLUMNNAME_CreateFrom); } + /** Set Account Date. + @param DateAcct + Accounting Date + */ + public void setDateAcct (Timestamp DateAcct) + { + set_Value (COLUMNNAME_DateAcct, DateAcct); + } + + /** Get Account Date. + @return Accounting Date + */ + public Timestamp getDateAcct () + { + return (Timestamp)get_Value(COLUMNNAME_DateAcct); + } + /** Set Description. @param Description Optional short description of the record