Ejemplo n.º 1
0
  public void verificarTransaccion() throws Exception {

    if (subCuenta.getCodigoCuenta().getTipoCuenta().equals("DEUDORA")) {

      if (haber != null) {

        if (subCuenta.getSaldoSubCuenta().compareTo(haber) < 0) {
          throw new Exception(
              "El Saldo de"
                  + subCuenta.getNombreSubcuenta()
                  + "es insuficiente para la Transacción");
        }
      }

    } else {

      if (debe != null) {

        if (subCuenta.getSaldoSubCuenta().compareTo(debe) < 0) {
          throw new Exception(
              "El Saldo de"
                  + subCuenta.getNombreSubcuenta()
                  + "es insuficiente para la Transacción");
        }
      }
    }
  }