/** * Constructor. * @param converter The next converter in the converter chain. * @param bDebit If true, output this field if it is positive. */ public DrCrConverter(Converter converter, boolean bDebit) { this(); this.init(converter, bDebit); } /**
/** * Retrieve (in string format) from this field. * @return The string. */ public String getString() { String string = super.getString(); // By default, get the data as-is if (this.getField() instanceof NumberField) { double dValue = this.getField().getValue(); if (m_bDebit) { if (dValue < 0) string = Constants.BLANK; // For debit/negative, return a null } else { // Credit if (dValue >= 0) string = Constants.BLANK; // For credit/positive, return a null else string = ((NumberField)this.getField()).binaryToString(new Double(-dValue)); // Positive representation } } return string; } /**
/** * Set up all the screen fields. */ public void setupSFields() { this.getRecord(AcctDetail.ACCT_DETAIL_FILE).getField(AcctDetail.ACCOUNT_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(AcctDetail.ACCT_DETAIL_FILE).getField(AcctDetail.TRX_DATE).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); BaseField field = this.getRecord(AcctDetail.ACCT_DETAIL_FILE).getField(AcctDetail.AMOUNT_LOCAL); Converter converter = new DrCrConverter(field, true); converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); converter = new DrCrConverter(field, false); converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(AcctDetail.ACCT_DETAIL_FILE).getField(AcctDetail.COMMENTS).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(AcctDetail.ACCT_DETAIL_FILE).getField(AcctDetail.SOURCE).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(AcctDetail.ACCT_DETAIL_FILE).getField(AcctDetail.TRX_TYPE_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(AcctDetail.ACCT_DETAIL_FILE).getField(AcctDetail.TRX_ENTRY).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); } /**
/** * Retrieve (in string format) from this field. * @return The string. */ public String getString() { String string = super.getString(); // By default, get the data as-is if (this.getField() instanceof NumberField) { double dValue = this.getField().getValue(); if (m_bDebit) { if (dValue < 0) string = Constants.BLANK; // For debit/negative, return a null } else { // Credit if (dValue >= 0) string = Constants.BLANK; // For credit/positive, return a null else string = ((NumberField)this.getField()).binaryToString(new Double(-dValue)); // Positive representation } } return string; } /**
/** * Retrieve (in string format) from this field. * @return The string. */ public String getString() { String string = super.getString(); // By default, get the data as-is if (this.getField() instanceof NumberField) { double dValue = this.getField().getValue(); if (m_bDebit) { if (dValue < 0) string = Constants.BLANK; // For debit/negative, return a null } else { // Credit if (dValue >= 0) string = Constants.BLANK; // For credit/positive, return a null else string = ((NumberField)this.getField()).binaryToString(new Double(-dValue)); // Positive representation } } return string; } /**
/** * Constructor. * @param converter The next converter in the converter chain. * @param bDebit If true, output this field if it is positive. */ public DrCrConverter(Converter converter, boolean bDebit) { this(); this.init(converter, bDebit); } /**
if (this.getField() != null) if (this.getField() instanceof NumberField) field = (NumberField)this.getField(); if (field == null) return super.setString(string, bDisplayOption, moveMode); // Convert to internal rep and return strError = ex.getClass().getName(); Task task = null; if (this.getField() != null) if (((BaseField)this.getField()).getRecord() != null) if (((BaseField)this.getField()).getRecord().getRecordOwner() != null) task = ((BaseField)this.getField()).getRecord().getRecordOwner().getTask();
/** * Constructor. * @param converter The next converter in the converter chain. * @param bDebit If true, output this field if it is positive. */ public DrCrConverter(Converter converter, boolean bDebit) { this(); this.init(converter, bDebit); } /**
if (this.getField() != null) if (this.getField() instanceof NumberField) field = (NumberField)this.getField(); if (field == null) return super.setString(string, bDisplayOption, moveMode); // Convert to internal rep and return strError = ex.getClass().getName(); Task task = null; if (this.getField() != null) if (((BaseField)this.getField()).getRecord() != null) if (((BaseField)this.getField()).getRecord().getRecordOwner() != null) task = ((BaseField)this.getField()).getRecord().getRecordOwner().getTask(); if (task == null) task = BaseApplet.getSharedInstance();
if (this.getField() != null) if (this.getField() instanceof NumberField) field = (NumberField)this.getField(); if (field == null) return super.setString(string, bDisplayOption, moveMode); // Convert to internal rep and return strError = ex.getClass().getName(); Task task = null; if (this.getField() != null) if (((BaseField)this.getField()).getRecord() != null) if (((BaseField)this.getField()).getRecord().getRecordOwner() != null) task = ((BaseField)this.getField()).getRecord().getRecordOwner().getTask(); if (task == null) task = BaseApplet.getSharedInstance();