IDEMPIERE-1852 Translation: Accounting Fact Reconcilation (manual)

This commit is contained in:
Carlos Ruiz 2014-03-24 20:21:05 -05:00
parent aced8500df
commit a980daf1d8
3 changed files with 51 additions and 12 deletions

View File

@ -0,0 +1,19 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Mar 24, 2014 8:09:18 PM COT
-- IDEMPIERE-1852 Translation: Accounting Fact Reconcilation (manual)
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('I','DR',200260,'D','40c2b5df-fe62-4d94-9376-fa82bfe99969','DR','Y',TO_DATE('2014-03-24 20:09:17','YYYY-MM-DD HH24:MI:SS'),100,100,TO_DATE('2014-03-24 20:09:17','YYYY-MM-DD HH24:MI:SS'),0,0)
;
-- Mar 24, 2014 8:09:35 PM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('I','CR',200261,'D','c4c434ec-7516-46c0-ad29-122c2b871b04','CR','Y',TO_DATE('2014-03-24 20:09:35','YYYY-MM-DD HH24:MI:SS'),100,100,TO_DATE('2014-03-24 20:09:35','YYYY-MM-DD HH24:MI:SS'),0,0)
;
-- Mar 24, 2014 8:10:25 PM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('I','DR/CR',200262,'D','41ceddd4-a1d0-4387-8d64-f10391a9badf','DR/CR','Y',TO_DATE('2014-03-24 20:10:24','YYYY-MM-DD HH24:MI:SS'),100,100,TO_DATE('2014-03-24 20:10:24','YYYY-MM-DD HH24:MI:SS'),0,0)
;
SELECT register_migration_script('201403242011_IDEMPIERE-1852.sql') FROM dual
;

View File

@ -0,0 +1,16 @@
-- Mar 24, 2014 8:09:18 PM COT
-- IDEMPIERE-1852 Translation: Accounting Fact Reconcilation (manual)
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('I','DR',200260,'D','40c2b5df-fe62-4d94-9376-fa82bfe99969','DR','Y',TO_TIMESTAMP('2014-03-24 20:09:17','YYYY-MM-DD HH24:MI:SS'),100,100,TO_TIMESTAMP('2014-03-24 20:09:17','YYYY-MM-DD HH24:MI:SS'),0,0)
;
-- Mar 24, 2014 8:09:35 PM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('I','CR',200261,'D','c4c434ec-7516-46c0-ad29-122c2b871b04','CR','Y',TO_TIMESTAMP('2014-03-24 20:09:35','YYYY-MM-DD HH24:MI:SS'),100,100,TO_TIMESTAMP('2014-03-24 20:09:35','YYYY-MM-DD HH24:MI:SS'),0,0)
;
-- Mar 24, 2014 8:10:25 PM COT
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('I','DR/CR',200262,'D','41ceddd4-a1d0-4387-8d64-f10391a9badf','DR/CR','Y',TO_TIMESTAMP('2014-03-24 20:10:24','YYYY-MM-DD HH24:MI:SS'),100,100,TO_TIMESTAMP('2014-03-24 20:10:24','YYYY-MM-DD HH24:MI:SS'),0,0)
;
SELECT register_migration_script('201403242011_IDEMPIERE-1852.sql') FROM dual
;

View File

@ -55,8 +55,8 @@ public class FactReconcile {
Vector<String> columnNames = new Vector<String>();
columnNames.add(Msg.translate(Env.getCtx(), "Amt"));
//columnNames.add(Msg.translate(Env.getCtx(), "AmtAcct"));
columnNames.add("DR/CR");
columnNames.add("Fact Acct");
columnNames.add(Msg.translate(Env.getCtx(), "DR/CR"));
columnNames.add(Msg.translate(Env.getCtx(), "Selected"));
columnNames.add(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
columnNames.add(Msg.translate(Env.getCtx(), "DateAcct"));
columnNames.add(Msg.translate(Env.getCtx(), "GL_Category_ID"));
@ -74,16 +74,20 @@ public class FactReconcile {
Vector<Vector<Object>> data = new Vector<Vector<Object>>();
StringBuilder sql = new StringBuilder("SELECT abs(fa.amtacctdr-fa.amtacctcr), (fa.amtacctdr-fa.amtacctcr)," // 1-2
+ " (CASE WHEN (fa.amtacctdr-fa.amtacctcr) < 0 THEN 'CR' ELSE 'DR' END), fa.Fact_Acct_ID, bp.name, DateAcct,"
+ " glc.name, p.name, Qty, fa.Description, r.MatchCode, fa.DateTrx, o.value"
+ " FROM Fact_Acct fa"
+ " LEFT OUTER JOIN Fact_Reconciliation r ON (fa.Fact_Acct_ID=r.Fact_Acct_ID)"
+ " LEFT OUTER JOIN C_BPartner bp ON (fa.C_BPartner_ID=bp.C_BPartner_ID)"
+ " LEFT OUTER JOIN AD_Org o ON (o.AD_Org_ID=fa.AD_Org_ID)"
+ " LEFT OUTER JOIN M_Product p ON (p.M_Product_ID=fa.M_Product_ID)"
+ " LEFT OUTER JOIN GL_Category glc ON (fa.GL_Category_ID=glc.GL_Category_ID)"
+ " WHERE fa.AD_Client_ID=?");
StringBuilder sql = new StringBuilder("SELECT abs(fa.amtacctdr-fa.amtacctcr), (fa.amtacctdr-fa.amtacctcr),") // 1-2
.append(" (CASE WHEN (fa.amtacctdr-fa.amtacctcr) < 0 THEN ")
.append(DB.TO_STRING(Msg.translate(Env.getCtx(), "CR")))
.append(" ELSE ")
.append(DB.TO_STRING(Msg.translate(Env.getCtx(), "DR")))
.append(" END), fa.Fact_Acct_ID, bp.name, DateAcct,")
.append(" glc.name, p.name, Qty, fa.Description, r.MatchCode, fa.DateTrx, o.value")
.append(" FROM Fact_Acct fa")
.append(" LEFT OUTER JOIN Fact_Reconciliation r ON (fa.Fact_Acct_ID=r.Fact_Acct_ID)")
.append(" LEFT OUTER JOIN C_BPartner bp ON (fa.C_BPartner_ID=bp.C_BPartner_ID)")
.append(" LEFT OUTER JOIN AD_Org o ON (o.AD_Org_ID=fa.AD_Org_ID)")
.append(" LEFT OUTER JOIN M_Product p ON (p.M_Product_ID=fa.M_Product_ID)")
.append(" LEFT OUTER JOIN GL_Category glc ON (fa.GL_Category_ID=glc.GL_Category_ID)")
.append(" WHERE fa.AD_Client_ID=?");
// role security
sql = new StringBuilder( MRole.getDefault(Env.getCtx(), false).addAccessSQL( sql.toString(), "fa", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO ) );