IDEMPIERE-3961 GL Journal - Switching accounting schema removes PERIOD

This commit is contained in:
Heng Sin Low 2019-05-08 17:39:55 +08:00
parent aa580a443b
commit 0d8cbeb5bc
4 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,10 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3961 GL Journal - Switching accounting schema removes PERIOD
-- May 7, 2019, 5:20:41 PM SGT
UPDATE AD_Column SET Callout='org.compiere.model.CalloutGLJournal.acctSchema',Updated=TO_DATE('2019-05-07 17:20:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1632
;
SELECT register_migration_script('201905071815_IDEMPIERE-3961.sql') FROM dual
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-3961 GL Journal - Switching accounting schema removes PERIOD
-- May 7, 2019, 5:20:41 PM SGT
UPDATE AD_Column SET Callout='org.compiere.model.CalloutGLJournal.acctSchema',Updated=TO_TIMESTAMP('2019-05-07 17:20:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1632
;
SELECT register_migration_script('201905071815_IDEMPIERE-3961.sql') FROM dual
;

View File

@ -294,4 +294,26 @@ public class CalloutGLJournal extends CalloutEngine
}
return "";
}
/**
* Journal - Acct Schema
* Set Currency from C_AcctSchema_ID
* @param ctx context
* @param WindowNo window no
* @param mTab tab
* @param mField field
* @param value value
* @return null or error message
*/
public String acctSchema(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
{
if (value == null)
return "";
int C_AcctSchema_ID = Env.getContextAsInt(ctx, WindowNo, "C_AcctSchema_ID");
MAcctSchema as = MAcctSchema.get (ctx, C_AcctSchema_ID);
mTab.setValue("C_Currency_ID", as.getC_Currency_ID());
return "";
}
} // CalloutGLJournal

View File

@ -2783,8 +2783,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
{
if (log.isLoggable(Level.FINE)) log.fine(columnName + " changed - "
+ dependentField.getColumnName() + " set to null");
Object currentValue = dependentField.getValue();
// invalidate current selection
setValue(dependentField, null);
if (currentValue != null && mLookup.containsKey(currentValue))
setValue(dependentField, currentValue);
}
}
// if the field is a Virtual UI Column