IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts / Thanks to Thomas Bayen

Transplanted and modified from:
https://bitbucket.org/tbayen/idempiere/commits/e8c641c
This commit is contained in:
Carlos Ruiz 2013-02-20 10:50:15 -05:00
parent 93ad118186
commit c84e60ff1c
5 changed files with 84 additions and 79 deletions

View File

@ -0,0 +1,39 @@
-- 17.02.2013 19:27:25 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2013-02-17 19:27:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200178
;
-- 17.02.2013 19:27:34 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2013-02-17 19:27:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200179
;
-- 17.02.2013 19:28:19 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2013-02-17 19:28:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200234
;
-- 17.02.2013 19:28:27 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Field SET IsActive='N',Updated=TO_DATE('2013-02-17 19:28:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200235
;
-- 17.02.2013 19:28:51 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2013-02-17 19:28:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200229
;
-- 17.02.2013 19:28:55 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2013-02-17 19:28:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200230
;
ALTER TABLE gl_journalline DROP COLUMN userelement1_id
;
ALTER TABLE gl_journalline DROP COLUMN userelement2_id
;
SELECT register_migration_script('201302171931_IDEMPIERE-637.sql') FROM dual
;

View File

@ -0,0 +1,38 @@
-- 17.02.2013 19:27:25 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2013-02-17 19:27:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200178
;
-- 17.02.2013 19:27:34 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2013-02-17 19:27:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200179
;
-- 17.02.2013 19:28:19 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2013-02-17 19:28:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200234
;
-- 17.02.2013 19:28:27 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Field SET IsActive='N',Updated=TO_TIMESTAMP('2013-02-17 19:28:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200235
;
-- 17.02.2013 19:28:51 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2013-02-17 19:28:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200229
;
-- 17.02.2013 19:28:55 MEZ
-- IDEMPIERE-637 GL Journal: Accounting Dimension "User Element 1&2" not posted to Accounting Facts
UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2013-02-17 19:28:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200230
;
ALTER TABLE gl_journalline DROP COLUMN userelement1_id
;
ALTER TABLE gl_journalline DROP COLUMN userelement2_id
;
SELECT register_migration_script('201302171931_IDEMPIERE-637.sql') FROM dual
;

View File

@ -602,30 +602,4 @@ public interface I_GL_JournalLine
public int getUser2_ID();
public org.compiere.model.I_C_ElementValue getUser2() throws RuntimeException;
/** Column name UserElement1_ID */
public static final String COLUMNNAME_UserElement1_ID = "UserElement1_ID";
/** Set User Element 1.
* User defined accounting Element
*/
public void setUserElement1_ID (int UserElement1_ID);
/** Get User Element 1.
* User defined accounting Element
*/
public int getUserElement1_ID();
/** Column name UserElement2_ID */
public static final String COLUMNNAME_UserElement2_ID = "UserElement2_ID";
/** Set User Element 2.
* User defined accounting Element
*/
public void setUserElement2_ID (int UserElement2_ID);
/** Get User Element 2.
* User defined accounting Element
*/
public int getUserElement2_ID();
}

View File

@ -398,9 +398,7 @@ public class MJournalLine extends X_GL_JournalLine
|| is_ValueChanged("C_Campaign_ID")
|| is_ValueChanged("C_Activity_ID")
|| is_ValueChanged("User1_ID")
|| is_ValueChanged("User2_ID")
|| is_ValueChanged("UserElement1_ID")
|| is_ValueChanged("UserElement2_ID"))))
|| is_ValueChanged("User2_ID"))))
{
MJournal gl = new MJournal(getCtx(), getGL_Journal_ID(), get_TrxName());
@ -429,6 +427,10 @@ public class MJournalLine extends X_GL_JournalLine
errorFields += "@" + COLUMNNAME_C_Project_ID + "@, ";
if (MAcctSchemaElement.ELEMENTTYPE_SalesRegion.equals(et) && getC_SalesRegion_ID() == 0)
errorFields += "@" + COLUMNNAME_C_SalesRegion_ID + "@, ";
if (MAcctSchemaElement.ELEMENTTYPE_UserList1.equals(et) && getUser1_ID() == 0)
errorFields += "@" + COLUMNNAME_User1_ID + "@, ";
if (MAcctSchemaElement.ELEMENTTYPE_UserList2.equals(et) && getUser2_ID() == 0)
errorFields += "@" + COLUMNNAME_User2_ID + "@, ";
}
if (errorFields.length() > 0)
{
@ -439,7 +441,7 @@ public class MJournalLine extends X_GL_JournalLine
MAccount acct = MAccount.get(getCtx(), getAD_Client_ID(), getAD_Org_ID(), gl.getC_AcctSchema_ID(), getAccount_ID(),
getC_SubAcct_ID(), getM_Product_ID(), getC_BPartner_ID(), getAD_OrgTrx_ID(), getC_LocFrom_ID(),
getC_LocTo_ID(), getC_SalesRegion_ID(), getC_Project_ID(), getC_Campaign_ID(),
getC_Activity_ID(), getUser1_ID(), getUser2_ID(), getUserElement1_ID(), getUserElement2_ID());
getC_Activity_ID(), getUser1_ID(), getUser2_ID(), 0, 0);
if (acct != null)
{
@ -474,8 +476,6 @@ public class MJournalLine extends X_GL_JournalLine
setC_Activity_ID(combi.getC_Activity_ID() > 0 ? combi.getC_Activity_ID() : 0);
setUser1_ID(combi.getUser1_ID() > 0 ? combi.getUser1_ID() : 0);
setUser2_ID(combi.getUser2_ID() > 0 ? combi.getUser2_ID() : 0);
setUserElement1_ID(combi.getUserElement1_ID() > 0 ? combi.getUserElement1_ID() : 0);
setUserElement2_ID(combi.getUserElement2_ID() > 0 ? combi.getUserElement2_ID() : 0);
}
} // fillDimensionsFromCombination

View File

@ -33,7 +33,7 @@ public class X_GL_JournalLine extends PO implements I_GL_JournalLine, I_Persiste
/**
*
*/
private static final long serialVersionUID = 20121031L;
private static final long serialVersionUID = 20130217L;
/** Standard Constructor */
public X_GL_JournalLine (Properties ctx, int GL_JournalLine_ID, String trxName)
@ -980,50 +980,4 @@ public class X_GL_JournalLine extends PO implements I_GL_JournalLine, I_Persiste
return 0;
return ii.intValue();
}
/** Set User Element 1.
@param UserElement1_ID
User defined accounting Element
*/
public void setUserElement1_ID (int UserElement1_ID)
{
if (UserElement1_ID < 1)
set_Value (COLUMNNAME_UserElement1_ID, null);
else
set_Value (COLUMNNAME_UserElement1_ID, Integer.valueOf(UserElement1_ID));
}
/** Get User Element 1.
@return User defined accounting Element
*/
public int getUserElement1_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_UserElement1_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set User Element 2.
@param UserElement2_ID
User defined accounting Element
*/
public void setUserElement2_ID (int UserElement2_ID)
{
if (UserElement2_ID < 1)
set_Value (COLUMNNAME_UserElement2_ID, null);
else
set_Value (COLUMNNAME_UserElement2_ID, Integer.valueOf(UserElement2_ID));
}
/** Get User Element 2.
@return User defined accounting Element
*/
public int getUserElement2_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_UserElement2_ID);
if (ii == null)
return 0;
return ii.intValue();
}
}