/** * Called when a valid record is read from the table/query. * Re-read the sub-file on change. * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) { super.doValidRecord(bDisplayOption); this.recountRecords(); } /**
/** * Constructor. * @param recordSub The sub-record. */ public RecountOnValidHandler(Record recordSub) { this(); this.init(null, recordSub, false); } /**
BookingLine recBookingLine = new BookingLine(this); recProfile.addListener(new RecountOnValidHandler(recBooking)); recBooking.addListener(new SubFileFilter(recProfile)); recBooking.addListener(new RecountOnValidHandler(recBookingLine)); recBookingLine.addDetailBehaviors(recBooking, null);
this.addListener(recountOnValidHandler = new RecountOnValidHandler((Record)recBookingLine, true)); this.setEditMode(iCurrentEditMode); recountOnValidHandler.recountRecords(); listener = (FreeOnFreeHandler)this.getListener(FreeOnFreeHandler.class); if (recArTrx == null) this.addListener(recountOnValidHandler = new RecountOnValidHandler((Record)recArTrx, true)); this.setEditMode(iCurrentEditMode); recountOnValidHandler.recountRecords(); return recArTrx;
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (this.getOwner() == null) return; if (m_recordSub != null) // If field is not in this file, remember to remove it m_recordSub.addListener(new FileRemoveBOnCloseHandler(this)); } /**
BookingLine recBookingLine = new BookingLine(this); recProfile.addListener(new RecountOnValidHandler(recBooking)); recBooking.addListener(new SubFileFilter(recProfile)); recBooking.addListener(new RecountOnValidHandler(recBookingLine)); recBookingLine.addDetailBehaviors(recBooking, null);
this.addListener(recountOnValidHandler = new RecountOnValidHandler((Record)recBookingLine, true)); this.setEditMode(iCurrentEditMode); recountOnValidHandler.recountRecords(); listener = (FreeOnFreeHandler)this.getListener(FreeOnFreeHandler.class); if (recArTrx == null) this.addListener(recountOnValidHandler = new RecountOnValidHandler((Record)recArTrx, true)); this.setEditMode(iCurrentEditMode); recountOnValidHandler.recountRecords(); return recArTrx;
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (this.getOwner() == null) return; if (m_recordSub != null) // If field is not in this file, remember to remove it m_recordSub.addListener(new FileRemoveBOnCloseHandler(this)); } /**
/** * Add the behaviors to calculate the "Amount Selected" and Balance field. */ public ApTrx addSelectBehaviors() { RecordOwner recordOwner = this.findRecordOwner(); ApTrx recApTrx2 = new ApTrx(recordOwner); // Don't add second copy to screen if (recordOwner != null) recordOwner.removeRecord(recApTrx2); this.addListener(new FreeOnFreeHandler(recApTrx2)); // ...but be sure to free it recApTrx2.addListener(new SubFileFilter(this)); this.addListener(new RecountOnValidHandler(recApTrx2)); BooleanField fldTrue = new BooleanField(null, "True", 1, null, new Boolean(true)); recApTrx2.addListener(new FreeOnFreeHandler(fldTrue)); recApTrx2.addListener(new CompareFileFilter(ApTrx.ACTIVE_TRX, fldTrue, "=", fldTrue, true)); recApTrx2.addListener(new SubCountHandler(this.getField(Vendor.AMOUNT_SELECTED), ApTrx.AMOUNT_SELECTED, true, true)); recApTrx2.addListener(new SubCountHandler(this.getField(Vendor.VENDOR_BALANCE), ApTrx.INVOICE_BALANCE, true, true)); return recApTrx2; } /**
/** * Called when a valid record is read from the table/query. * Re-read the sub-file on change. * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) { super.doValidRecord(bDisplayOption); this.recountRecords(); } /**
/** * Constructor. * @param recordSub The sub-record. */ public RecountOnValidHandler(Record recordSub) { this(); this.init(null, recordSub, false); } /**
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (this.getOwner() == null) return; if (m_recordSub != null) // If field is not in this file, remember to remove it m_recordSub.addListener(new FileRemoveBOnCloseHandler(this)); } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); this.getRecord(Profile.PROFILE_FILE).getField(Profile.PROFILE_CODE).addListener(new MainReadOnlyHandler(Profile.PROFILE_CODE_KEY)); this.getMainRecord().addListener(new SubFileFilter(this.getRecord(Profile.PROFILE_FILE), true)); this.getHeaderRecord().getField(Profile.ID).addListener(new FieldReSelectHandler(this)); Record recArTrx = this.getRecord(ArTrx.AR_TRX_FILE); Record recBooking = this.getRecord(Booking.BOOKING_FILE); Record recBookingLine = this.getRecord(BookingLine.BOOKING_LINE_FILE); recArTrx.addListener(new SubFileFilter(recBooking)); recBooking.addListener(new RecountOnValidHandler(recArTrx)); recArTrx.addListener(new SubCountHandler(recBooking.getField(Booking.BALANCE), ArTrx.AMOUNT, true, true)); recBookingLine.addListener(new SubFileFilter(recBooking)); recBooking.addListener(new RecountOnValidHandler(recBookingLine)); recBookingLine.addListener(new SubCountHandler(recBooking.getField(Booking.GROSS), BookingLine.GROSS, true, true)); recBookingLine.addListener(new SubCountHandler(recBooking.getField(Booking.NET), BookingLine.NET, true, true)); recBooking.addListener(new SubCountHandler(this.getScreenRecord().getField(ArTrxAgentScreenRecord.BALANCE), Booking.BALANCE, true, true)); this.setEnabled(false); this.setAppending(false); } /**
/** * Called when a valid record is read from the table/query. * Re-read the sub-file on change. * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) { super.doValidRecord(bDisplayOption); this.recountRecords(); } /**
/** * Constructor. * @param recordSub The sub-record. */ public RecountOnValidHandler(Record recordSub, boolean bRestoreCurrentRecord) { this(); this.init(null, recordSub, bRestoreCurrentRecord); } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); this.getMainRecord().setKeyArea(Booking.BOOKING_DATE_KEY); this.getMainRecord().addListener(new ValidBookingHandler(null)); Record recBooking = this.getRecord(Booking.BOOKING_FILE); Record recArTrx = this.getRecord(ArTrx.AR_TRX_FILE); Record recBookingLine = this.getRecord(BookingLine.BOOKING_LINE_FILE); recArTrx.addListener(new SubFileFilter(recBooking)); recBooking.addListener(new RecountOnValidHandler(recArTrx)); recArTrx.addListener(new SubCountHandler(recBooking.getField(Booking.BALANCE), ArTrx.AMOUNT, true, true)); recBookingLine.addListener(new SubFileFilter(recBooking)); recBooking.addListener(new RecountOnValidHandler(recBookingLine)); recBookingLine.addListener(new SubCountHandler(recBooking.getField(Booking.GROSS), BookingLine.GROSS, true, true)); recBookingLine.addListener(new SubCountHandler(recBooking.getField(Booking.NET), BookingLine.NET, true, true)); recBooking.addListener(new CalcPlanTotals((ScreenRecord)this.getScreenRecord())); recBooking.addListener(new CalcStartDateHandler(this.getScreenRecord().getField(CashPlanScreenRecord.DEPOSIT_PERIOD_DATE), recBooking.getField(Booking.DEPOSIT_DUE_DATE), this.getScreenRecord().getField(CashPlanScreenRecord.START_DATE), this.getScreenRecord().getField(CashPlanScreenRecord.PERIOD_TYPE), this.getScreenRecord().getField(CashPlanScreenRecord.PERIOD_LENGTH))); recBooking.addListener(new CalcStartDateHandler(this.getScreenRecord().getField(CashPlanScreenRecord.FINAL_PERIOD_DATE), recBooking.getField(Booking.FINAL_PAYMENT_DUE_DATE), this.getScreenRecord().getField(CashPlanScreenRecord.START_DATE), this.getScreenRecord().getField(CashPlanScreenRecord.PERIOD_TYPE), this.getScreenRecord().getField(CashPlanScreenRecord.PERIOD_LENGTH))); } /**
/** * Constructor. * @param recordSub The sub-record. */ public RecountOnValidHandler(Record recordSub, boolean bRestoreCurrentRecord) { this(); this.init(null, recordSub, bRestoreCurrentRecord); } /**
recBooking.addListener(new RecountOnValidHandler(recArTrx)); recArTrx.addListener(new SubCountHandler(recBooking.getField(Booking.BALANCE), ArTrx.AMOUNT, true, true)); recArTrx.addListener(new CountMcoAmountHandler(this.getScreenRecord().getField(PastDueScreenRecord.MCO_AMOUNT_PAID), ArTrx.AMOUNT, true, true)); recBooking.addListener(new RecountOnValidHandler(recBookingLine)); recBookingLine.addListener(new SubCountHandler(recBooking.getField(Booking.GROSS), BookingLine.GROSS, true, true)); recBookingLine.addListener(new SubCountHandler(recBooking.getField(Booking.NET), BookingLine.NET, true, true));
/** * Constructor. * @param recordSub The sub-record. */ public RecountOnValidHandler(Record recordSub) { this(); this.init(null, recordSub, false); } /**
Record recBookingLine = this.getRecord(BookingLine.BOOKING_LINE_FILE); recBookingLine.addListener(new SubFileFilter(recBooking)); recBooking.addListener(new RecountOnValidHandler(recBookingLine)); recBookingLine.addListener(new SubCountHandler(recBooking.getField(Booking.GROSS), BookingLine.GROSS, true, true)); recBookingLine.addListener(new SubCountHandler(recBooking.getField(Booking.NET), BookingLine.NET, true, true));