IDEMPIERE-4245 Set GL Category automatically for GL Journal / implement the same in callouts

This commit is contained in:
Carlos Ruiz 2020-04-22 20:17:57 +02:00
parent d3d7e57cf9
commit 3ede3738de
3 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,15 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-4245 Set GL Category automatically for GL Journal
-- Apr 22, 2020, 8:05:30 PM CEST
UPDATE AD_Column SET Callout='org.compiere.model.CalloutGLJournal.docType',Updated=TO_DATE('2020-04-22 20:05:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1625
;
-- Apr 22, 2020, 8:16:34 PM CEST
UPDATE AD_Column SET Callout='org.compiere.model.CalloutGLJournal.docType',Updated=TO_DATE('2020-04-22 20:16:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10760
;
SELECT register_migration_script('202004222017_IDEMPIERE-4245.sql') FROM dual
;

View File

@ -0,0 +1,12 @@
-- IDEMPIERE-4245 Set GL Category automatically for GL Journal
-- Apr 22, 2020, 8:05:30 PM CEST
UPDATE AD_Column SET Callout='org.compiere.model.CalloutGLJournal.docType',Updated=TO_TIMESTAMP('2020-04-22 20:05:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1625
;
-- Apr 22, 2020, 8:16:34 PM CEST
UPDATE AD_Column SET Callout='org.compiere.model.CalloutGLJournal.docType',Updated=TO_TIMESTAMP('2020-04-22 20:16:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10760
;
SELECT register_migration_script('202004222017_IDEMPIERE-4245.sql') FROM dual
;

View File

@ -316,4 +316,27 @@ public class CalloutGLJournal extends CalloutEngine
return ""; return "";
} }
/**
* Journal - Doc Type
* Set GL Category from C_DocType_ID
* @param ctx context
* @param WindowNo window no
* @param mTab tab
* @param mField field
* @param value value
* @return null or error message
*/
public String docType(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
{
if (value == null)
return "";
int C_DocType_ID = Env.getContextAsInt(ctx, WindowNo, "C_DocType_ID");
MDocType dt = MDocType.get (ctx, C_DocType_ID);
mTab.setValue("GL_Category_ID", dt.getGL_Category_ID());
return "";
}
} // CalloutGLJournal } // CalloutGLJournal