/** @see org.kuali.kfs.module.tem.document.TravelDocumentBase#initiateDocument() */
  @Override
  public void initiateDocument() {
    super.initiateDocument();

    // clear expenses
    setActualExpenses(new ArrayList<ActualExpense>());
    setPerDiemExpenses(new ArrayList<PerDiemExpense>());

    // default dates if null
    Calendar calendar = getDateTimeService().getCurrentCalendar();
    if (getTripBegin() == null) {
      calendar.add(Calendar.DAY_OF_MONTH, 1);
      setTripBegin(new Timestamp(calendar.getTimeInMillis()));
    }
    if (getTripEnd() == null) {
      calendar.add(Calendar.DAY_OF_MONTH, 2);
      setTripEnd(new Timestamp(calendar.getTimeInMillis()));
    }

    // initiate payment and wire transfer
    this.travelPayment = new TravelPayment();
    this.wireTransfer = new PaymentSourceWireTransfer();
    // set due date to the next day
    calendar = getDateTimeService().getCurrentCalendar();
    calendar.add(Calendar.DAY_OF_MONTH, 1);
    travelPayment.setDueDate(new java.sql.Date(calendar.getTimeInMillis()));
    travelPayment.setCheckStubText(
        getConfigurationService()
            .getPropertyValueAsString(TemKeyConstants.MESSAGE_TEM_REIMBURSEMENT_PAYMENT_HOLD_TEXT));

    // set up the default bank
    setDefaultBankCode();
    updatePayeeTypeForReimbursable();
  }
  /**
   * Overridden to set document number on travel payment and wire transfer
   *
   * @see org.kuali.kfs.sys.document.FinancialSystemTransactionalDocumentBase#prepareForSave()
   */
  @Override
  public void prepareForSave() {
    super.prepareForSave();

    if (wireTransfer != null) {
      wireTransfer.setDocumentNumber(this.documentNumber);
    }
    if (travelPayment != null) {
      travelPayment.setDocumentNumber(this.documentNumber);
    }
  }