@Override
  protected void customerSelected(ClientCustomer customer) {
    if (customer == null) return;

    // Job Tracking
    if (isTrackJob()) {
      jobListCombo.setValue("");
      jobListCombo.setEnabled(!isInViewMode());
      jobListCombo.setCustomer(customer);
    }
    ClientCurrency clientCurrency = getCurrency(customer.getCurrency());
    amountText.setCurrency(clientCurrency);
    bankBalText.setCurrency(clientCurrency);
    customerBalText.setCurrency(clientCurrency);

    this.setCustomer(customer);
    if (customerCombo != null) {
      customerCombo.setComboItem(customer);
    }
    this.addressListOfCustomer = customer.getAddress();
    initBillToCombo();
    customerBalText.setAmount(customer.getBalance());
    adjustBalance(amountText.getAmount());
    currencyWidget.setSelectedCurrencyFactorInWidget(
        clientCurrency, transactionDateItem.getDate().getDate());
  }
  @Override
  protected void initTransactionViewData() {
    if (transaction == null) {
      setData(new ClientCustomerPrePayment());
      initDepositInAccounts();
    } else {

      if (currencyWidget != null) {
        this.currency = getCompany().getCurrency(transaction.getCurrency());
        this.currencyFactor = transaction.getCurrencyFactor();
        currencyWidget.setSelectedCurrency(this.currency);
        // currencyWidget.currencyChanged(this.currency);
        currencyWidget.setCurrencyFactor(transaction.getCurrencyFactor());
        currencyWidget.setEnabled(!isInViewMode());
      }
      ClientCompany comapny = getCompany();

      ClientCustomer customer = comapny.getCustomer(transaction.getCustomer());
      customerSelected(comapny.getCustomer(transaction.getCustomer()));
      this.billingAddress = transaction.getAddress();
      if (billingAddress != null) billToaddressSelected(billingAddress);
      amountText.setEnabled(!isInViewMode());
      amountText.setAmount(transaction.getTotal());
      if (customer != null) {
        customerBalText.setAmount(customer.getBalance());
      }
      // bankBalText.setAmount(getAmountInTransactionCurrency(transaction.g));
      paymentMethodSelected(transaction.getPaymentMethod());
      this.depositInAccount = comapny.getAccount(transaction.getDepositIn());
      if (depositInAccount != null) {
        depositInCombo.setComboItem(depositInAccount);
        bankBalText.setAmount(depositInAccount.getTotalBalanceInAccountCurrency());
        bankBalText.setCurrency(getCompany().getCurrency(depositInAccount.getCurrency()));
      }
      if (isTrackClass()) {
        classListCombo.setComboItem(
            getCompany().getAccounterClass(transaction.getAccounterClass()));
      }
      paymentMethodCombo.setComboItem(transaction.getPaymentMethod());
      checkNo.setValue(transaction.getCheckNumber());
      // if (transaction.getPaymentMethod().equals(constants.check())) {
      // printCheck.setDisabled(isInViewMode());
      // checkNo.setDisabled(isInViewMode());
      // } else {
      // printCheck.setDisabled(true);
      // checkNo.setDisabled(true);
      // }

      // if (transaction.getCheckNumber() != null) {
      // if (transaction.getCheckNumber().equals(
      // messages.toBePrinted())) {
      // checkNo.setValue(messages.toBePrinted());
      // printCheck.setValue(true);
      // } else {
      // checkNo.setValue(transaction.getCheckNumber());
      // printCheck.setValue(false);
      // }
      // }
    }
    if (locationTrackingEnabled)
      locationSelected(getCompany().getLocation(transaction.getLocation()));
    if (isTrackJob()) {
      if (customer != null) {
        jobListCombo.setCustomer(customer);
      }
      jobSelected(Accounter.getCompany().getjob(transaction.getJob()));
    }
    initMemoAndReference();
    initCustomers();
    if (isMultiCurrencyEnabled()) {
      updateAmountsFromGUI();
    }
  }