public String amt(Properties ctx,int WindowNo,GridTab mTab,GridField mField,Object value){
  String colName=mField.getColumnName();
  if (value == null || isCalloutActive())   return "";
  int C_AcctSchema_ID=Env.getContextAsInt(ctx,WindowNo,"C_AcctSchema_ID");
  MAcctSchema as=MAcctSchema.get(ctx,C_AcctSchema_ID);
  int Precision=as.getStdPrecision();
  BigDecimal CurrencyRate=(BigDecimal)mTab.getValue("CurrencyRate");
  if (CurrencyRate == null) {
    CurrencyRate=Env.ONE;
    mTab.setValue("CurrencyRate",CurrencyRate);
  }
  BigDecimal AmtSourceDr=(BigDecimal)mTab.getValue("AmtSourceDr");
  if (AmtSourceDr == null)   AmtSourceDr=Env.ZERO;
  BigDecimal AmtSourceCr=(BigDecimal)mTab.getValue("AmtSourceCr");
  if (AmtSourceCr == null)   AmtSourceCr=Env.ZERO;
  BigDecimal AmtAcctDr=AmtSourceDr.multiply(CurrencyRate);
  AmtAcctDr=AmtAcctDr.setScale(Precision,BigDecimal.ROUND_HALF_UP);
  mTab.setValue("AmtAcctDr",AmtAcctDr);
  BigDecimal AmtAcctCr=AmtSourceCr.multiply(CurrencyRate);
  AmtAcctCr=AmtAcctCr.setScale(Precision,BigDecimal.ROUND_HALF_UP);
  mTab.setValue("AmtAcctCr",AmtAcctCr);
  return "";
}

public String amt ( Properties ctx , int WindowNo , GridTab mTab , GridField mField , Object value ) { String colName = mField . getColumnName ( ) ; if ( value == null || isCalloutActive ( ) ) return "" ; int C_AcctSchema_ID = Env . getContextAsInt ( ctx , WindowNo , "C_AcctSchema_ID" ) ; MAcctSchema as = MAcctSchema . get ( ctx , C_AcctSchema_ID ) ; int Precision = as . getStdPrecision ( ) ; BigDecimal CurrencyRate = ( BigDecimal ) mTab . getValue ( "CurrencyRate" ) ; if ( CurrencyRate == null ) { CurrencyRate = Env . ONE ; mTab . setValue ( "CurrencyRate" , CurrencyRate ) ; } BigDecimal AmtSourceDr = ( BigDecimal ) mTab . getValue ( "AmtSourceDr" ) ; if ( AmtSourceDr == null ) AmtSourceDr = Env . ZERO ; BigDecimal AmtSourceCr = ( BigDecimal ) mTab . getValue ( "AmtSourceCr" ) ; if ( AmtSourceCr == null ) AmtSourceCr = Env . ZERO ; BigDecimal AmtAcctDr = AmtSourceDr . multiply ( CurrencyRate ) ; AmtAcctDr = AmtAcctDr . setScale ( Precision , BigDecimal . ROUND_HALF_UP ) ; mTab . setValue ( "AmtAcctDr" , AmtAcctDr ) ; BigDecimal AmtAcctCr = AmtSourceCr . multiply ( CurrencyRate ) ; AmtAcctCr = AmtAcctCr . setScale ( Precision , BigDecimal . ROUND_HALF_UP ) ; mTab . setValue ( "AmtAcctCr" , AmtAcctCr ) ; return "" ; }
journalline - amt . convert the source amount to accounted amount ( amtacctdr / cr ) called when source amount ( amtsourcecr / dr ) or rate changes
