diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarClienteController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarClienteController.java index d611b256e..ff1801105 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarClienteController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarClienteController.java @@ -872,18 +872,26 @@ public class EditarClienteController extends MyGenericForwardComposer { } } } - - List lsCliente = clienteService.buscarPorDocumento(txtNumRfc.getValue()); - if (lsCliente.size() > 1 - || (lsCliente.size() == 1 && !lsCliente.get(0).getClienteId().equals(cliente.getClienteId()))) { - Messagebox.show(Labels.getLabel("editarClienteController.MSG.documentoexiste"), - Labels.getLabel("editarClienteController.window.title"), Messagebox.OK, - Messagebox.EXCLAMATION); - txtNumRfc.focus(); - return; + List lsCliente = new ArrayList(); + if ((txtNumRfc.getText() != null && !txtNumRfc.getText().isEmpty()) && cmbTipoIdentificacion != null + && cmbTipoIdentificacion.getSelectedItem() != null + && cmbTipoIdentificacion.getSelectedItem().getValue() != null + && CPF.equals(cmbTipoIdentificacion.getSelectedItem().getValue().toString())){ + lsCliente = clienteService.buscarPorDocumento(txtNumRfc.getValue()); + if (lsCliente.size() > 1 + || (lsCliente.size() == 1 && !lsCliente.get(0).getClienteId().equals(cliente.getClienteId()))) { + Messagebox.show(Labels.getLabel("editarClienteController.MSG.documentoexiste"), + Labels.getLabel("editarClienteController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + txtNumRfc.focus(); + return; + } } - if (txtNumRfc2.getText() != null && !txtNumRfc2.getText().isEmpty()) { + if (txtNumRfc2.getText() != null && !txtNumRfc2.getText().isEmpty() && cmbTipoIdentificacion2 != null + && cmbTipoIdentificacion2.getSelectedItem() != null + && cmbTipoIdentificacion2.getSelectedItem().getValue() != null + && CPF.equals(cmbTipoIdentificacion2.getSelectedItem().getValue().toString())) { lsCliente = clienteService.buscarPorDocumento(txtNumRfc2.getValue()); if (lsCliente.size() > 1 || (lsCliente.size() == 1 && !lsCliente.get(0).getClienteId().equals(cliente.getClienteId()))) {