Пример #1
0
 /**
  * Called when a valid record is read from the table/query.
  *
  * @param bDisplayOption If true, display any changes.
  */
 public void doValidRecord(boolean bDisplayOption) {
   super.doValidRecord(bDisplayOption);
   Record recApTrx = this.getOwner();
   if (m_iDepartureEstimate == -1) {
     TrxStatus recTrxStatus =
         new TrxStatus(
             this.getOwner()
                 .findRecordOwner()); // Rarely, but if it doesn't exist in the screen, add it!
     m_iDepartureEstimate =
         recTrxStatus.getTrxStatusID(
             TransactionType.ACCTPAY, ApTrx.AP_TRX_FILE, ApTrx.DEP_ESTIMATE);
     m_iDepartureEstimateManual =
         recTrxStatus.getTrxStatusID(
             TransactionType.ACCTPAY, ApTrx.AP_TRX_FILE, ApTrx.DEPARTURE_EST_MANUAL);
     recTrxStatus.free();
   }
   if ((recApTrx.getField(ApTrx.TRX_STATUS_ID).getValue() == m_iDepartureEstimate)
       || (recApTrx.getField(ApTrx.TRX_STATUS_ID).getValue() == m_iDepartureEstimateManual)) {
     recApTrx
         .getField(ApTrx.INVOICE_AMOUNT)
         .moveFieldToThis(recApTrx.getField(ApTrx.DEPARTURE_ESTIMATE));
     recApTrx
         .getField(ApTrx.INVOICE_BALANCE)
         .moveFieldToThis(recApTrx.getField(ApTrx.DEPARTURE_ESTIMATE));
     recApTrx
         .getField(ApTrx.INVOICE_BALANCE_LOCAL)
         .moveFieldToThis(recApTrx.getField(ApTrx.DEPARTURE_ESTIMATE_LOCAL));
   }
 }
Пример #2
0
 /** Set up all the screen fields. */
 public void setupSFields() {
   Record recVendor =
       ((ReferenceField) this.getMainRecord().getField(ApTrx.VENDOR_ID)).getReferenceRecord(this);
   if (recVendor != null) { // Make sure currency is read for LocalCurrencyField(s).
     Record recCurrencys =
         ((ReferenceField) recVendor.getField(Vendor.CURRENCYS_ID)).getReferenceRecord(this);
     recVendor.getField(Vendor.CURRENCYS_ID).addListener(new ReadSecondaryHandler(recCurrencys));
   }
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.CODE)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.TRX_STATUS_ID)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.VENDOR_ID)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.TOUR_ID)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.DEPARTURE_DATE)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.DESCRIPTION)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.START_SERVICE_DATE)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.END_SERVICE_DATE)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.FINALIZATION_DATE)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.DEPARTURE_ESTIMATE)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.DEPARTURE_EXCHANGE)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.DEPARTURE_ESTIMATE_LOCAL)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.INVOICE_NO)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.INVOICE_DATE)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.INVOICE_AMOUNT)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.INVOICE_LOCAL)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.INVOICE_BALANCE)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.INVOICE_BALANCE_LOCAL)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.AMOUNT_SELECTED)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.ACKNOWLEDGE_DATE)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.ACKNOWLEDGED_ON)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
   this.getRecord(ApTrx.AP_TRX_FILE)
       .getField(ApTrx.ACKNOWLEDGED_BY)
       .setupDefaultView(
           this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT),
           this,
           ScreenConstants.DEFAULT_DISPLAY);
 }