public void modificarFactura() {
    System.out.println("Ingreso a registrarFactura...");
    if (selectedSucursal.getId().intValue() == 0) {
      FacesUtil.infoMessage("VALIDACION", "Seleccione una sucursal");
      return;
    }
    if (verificarNitCi()) {
      selectedFactura.setNombreFactura(textoAutoCompleteCliente);
      selectedFactura.setNitCi(textoAutoCompleteNit);
      selectedFactura.setTotalFacturado(totalImporte);
      selectedFactura.setTotalPagar(totalImporte);
      selectedFactura.setTotalEfectivo(totalImporte);
      selectedFactura.setTotalLiteral(obtenerMontoLiteral(totalImporte));
      selectedFactura.setCliente(selectedCliente);
      selectedFactura.setSucursal(selectedSucursal);
      selectedFactura.setNombreFactura(selectedCliente.getNombre());
      selectedFactura.setImporteSubTotal(
          selectedFactura.getTotalFacturado()
              - selectedFactura.getImporteICE()
              - selectedFactura.getImporteExportaciones()
              - selectedFactura.getImporteVentasGrabadasTasaCero());
      selectedFactura.setImporteBaseDebitoFiscal(
          selectedFactura.getImporteSubTotal()
              - selectedFactura.getImporteDescuentosBonificaciones());
      selectedFactura.setImporteBaseDebitoFiscal(
          selectedFactura.getImporteBaseDebitoFiscal() * 0.13);
      selectedFactura.setMes(Time.obtenerFormatoMM(selectedFactura.getFechaFactura()));

      facturaRegistration.update(selectedFactura);
      FacesUtil.infoMessage("Factura Modificada", "Nº " + selectedFactura.getNumeroFactura());
      loadValuesDefault();
    }
  }