diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index ea00e848c..5ad5f3e85 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -3080,7 +3080,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Observaciones", Observaciones)) - If UsuarioActual.CveEmpresa.Contiene(186, 189, 193) Then + If UsuarioActual.CveEmpresa.Contiene(186, 189, 193, 189) Then params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)) params.Add(New ReportParameter("NombreProveedor", If(CveCompra > 0, dr("RazonSocial").ToString, ""))) End If diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 98d85a892..427aae109 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2300,28 +2300,38 @@ Partial Class Inventarios_EntregaAlmacen StrXML.Append("") Dim TieneErrorExistencia As Boolean = False - If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero(), TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), If(TipoEntrega = 2, 1, -1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then - If ObjInventario.DtResultados.Rows.Count > 0 Then - TieneErrorExistencia = True - For Each Dr As DataRow In ObjInventario.DtResultados.Rows + Dim VerificaExistencia As Boolean = True - Dim SerieLoteCaducidad As String = "," - If Dr("Serie").ToString.Trim.Length > 0 AndAlso Dr("Serie").ToString.Trim <> "-1" Then - SerieLoteCaducidad = $" Serie: { Dr("Serie").ToString.Trim}" - End If - If Dr("Lote").ToString.Trim.Length > 0 AndAlso Dr("Lote").ToString.Trim <> "-1" Then - SerieLoteCaducidad = $"{SerieLoteCaducidad} Lote: {Dr("Lote").ToString.Trim}" - End If - If Dr("FechaCaducidad").ToString.Trim.Length > 0 AndAlso Dr("FechaCaducidad").ToString.Trim <> "-1" Then - SerieLoteCaducidad = $"{SerieLoteCaducidad} Caducidad: { Dr("FechaCaducidad").ToString.Trim.ToDate.ToString("dd/MM/yyyy")}" - End If - TextoError.AppendFormat(" - {0} Existencia: {1:#,##0.##} {2}
", Dr("CodigoPS"), Dr("Existencia"), If(SerieLoteCaducidad <> ",", SerieLoteCaducidad, "")) - Next - End If - Else - TieneErrorExistencia = True + 'TEMPORAL - NO VERIFICAR EXISTENCIA CUANDO SON MUCHOS DATOS + If UsuarioActual.CveEmpresa = 140 AndAlso DtDatos.Rows.Count > 10 Then + VerificaExistencia = False End If + If VerificaExistencia Then + If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero(), TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), If(TipoEntrega = 2, 1, -1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjInventario.DtResultados.Rows.Count > 0 Then + TieneErrorExistencia = True + For Each Dr As DataRow In ObjInventario.DtResultados.Rows + + Dim SerieLoteCaducidad As String = "," + If Dr("Serie").ToString.Trim.Length > 0 AndAlso Dr("Serie").ToString.Trim <> "-1" Then + SerieLoteCaducidad = $" Serie: { Dr("Serie").ToString.Trim}" + End If + If Dr("Lote").ToString.Trim.Length > 0 AndAlso Dr("Lote").ToString.Trim <> "-1" Then + SerieLoteCaducidad = $"{SerieLoteCaducidad} Lote: {Dr("Lote").ToString.Trim}" + End If + If Dr("FechaCaducidad").ToString.Trim.Length > 0 AndAlso Dr("FechaCaducidad").ToString.Trim <> "-1" Then + SerieLoteCaducidad = $"{SerieLoteCaducidad} Caducidad: { Dr("FechaCaducidad").ToString.Trim.ToDate.ToString("dd/MM/yyyy")}" + End If + TextoError.AppendFormat(" - {0} Existencia: {1:#,##0.##} {2}
", Dr("CodigoPS"), Dr("Existencia"), If(SerieLoteCaducidad <> ",", SerieLoteCaducidad, "")) + Next + End If + Else + TieneErrorExistencia = True + End If + End If + + If TieneErrorExistencia Then ObjInventario.RollBack() ObjInventario.Dispose() @@ -3681,17 +3691,28 @@ Partial Class Inventarios_EntregaAlmacen StrXML.Append("") Dim TieneErrorExistencia As Boolean = False - If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero(), TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), If(TipoEntrega = 2, 1, -1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then - If ObjInventario.DtResultados.Rows.Count > 0 Then - TieneErrorExistencia = True - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - TextoError += $" - {Dr("CodigoPS")} Existencia: {Dr("Existencia").ToString().ToDecimal.ToString("#,##0.##")}
" - Next - End If - Else - TieneErrorExistencia = True + + Dim VerificaExistencia As Boolean = True + + 'TEMPORAL - NO VERIFICAR EXISTENCIA CUANDO SON MUCHOS DATOS + If UsuarioActual.CveEmpresa = 140 AndAlso DtDatos.Rows.Count > 10 Then + VerificaExistencia = False End If + If VerificaExistencia Then + If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero(), TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), If(TipoEntrega = 2, 1, -1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjInventario.DtResultados.Rows.Count > 0 Then + TieneErrorExistencia = True + For Each Dr As DataRow In ObjInventario.DtResultados.Rows + TextoError += $" - {Dr("CodigoPS")} Existencia: {Dr("Existencia").ToString().ToDecimal.ToString("#,##0.##")}
" + Next + End If + Else + TieneErrorExistencia = True + End If + End If + + If TieneErrorExistencia Then ObjInventario.RollBack() ObjInventario.Dispose() diff --git a/OC/RepOCxSurtir.aspx b/OC/RepOCxSurtir.aspx index 0365b13b2..148aeb4e3 100644 --- a/OC/RepOCxSurtir.aspx +++ b/OC/RepOCxSurtir.aspx @@ -18,7 +18,7 @@ <%--FILTROS--%> -
+
@@ -53,6 +53,10 @@
+
Centro de Costo
+
+ +
@@ -60,16 +64,15 @@
- + <%----%> +
Cliente:
- -
-
Centro de Costo
-
- + <%----%> +
+
diff --git a/OC/RepOCxSurtir.aspx.vb b/OC/RepOCxSurtir.aspx.vb index 0a9726d3a..5e0c376cc 100644 --- a/OC/RepOCxSurtir.aspx.vb +++ b/OC/RepOCxSurtir.aspx.vb @@ -15,20 +15,51 @@ Partial Class OC_RepOCxSurtir #Region " INICIALIZA VALORES " Private Sub InicializaValores() + + Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) + TxtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString TxtFechaF.Text = NowADS().ToShortDateString - DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - DdlProveedor.DataBind() - DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1")) + 'DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) + 'DdlProveedor.DataBind() + 'DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1")) + + 'CargaProveedores + DdlSubProyecto.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa) DdlSubProyecto.DataBind() DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlCliente.DataBind() - DdlCliente.Items.Insert(0, New ListItem("Todos", "-1")) + + + + If EsWS Then + DdlCliente.setEsWebService(True) + DdlCliente.SelectedText = "Todos" + DdlCliente.SelectedValue = "-1" + + DdlProveedor.setEsWebService(True) + DdlProveedor.Attributes.Add("data-metodo", "getproveedores") + DdlProveedor.SelectedText = "Todos" + DdlProveedor.SelectedValue = "-1" + + Else + DdlCliente.setEsWebService(False) + DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + DdlCliente.DataBind() + DdlCliente.ddl.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlProveedor.setEsWebService(False) + DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) + DdlProveedor.DataBind() + DdlProveedor.ddl.Items.Insert(0, New ListItem("Todos", "-1")) + + + + End If + UPFiltros.Update() End Sub diff --git a/Site.master b/Site.master index d925ca666..89641e5d6 100644 --- a/Site.master +++ b/Site.master @@ -168,7 +168,7 @@
  • - Buscar Venta diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index 4bd6c2ca6..6db207689 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -102,7 +102,8 @@ Partial Class Ventas_PVCobranza #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not Page.IsPostBack Then + If Not Page.IsPostBack Then + Dim Arr As New ArrayList 'Arr.Add("autorizada") 'If EnviarNotificacionWhatsApp("526621430964", "solicitud_autorizacion_anticipo_respuesta", Arr) Then @@ -389,7 +390,24 @@ Partial Class Ventas_PVCobranza Else e.Row.FCLinkButton("BtnPagar").CssClass = "btn btn-xs btn-danger" ' e.Row.FCLinkButton("BtnPagar").Enabled = False - e.Row.FCLinkButton("BtnPagar").OnClientClick = "alert('La solicitud de crédito no ha sido autorizada');return false;" + 'e.Row.FCLinkButton("BtnPagar").OnClientClick = "alert('La solicitud de crédito no ha sido autorizada');return false;" + 'e.Row.FCLinkButton("BtnPagar").OnClientClick = "bootbox.dialog({message: 'La solicitud de crédito no ha sido autorizada ', className: ' header-yellow ', onEscape: function() { },title: ' Advertencia',buttons: { success: { label: '', className: ' hide',callback: function() { } }, danger: { label: '', className: ' hide',callback: function() { } },main: { label: 'Aceptar', className: ' yellow', callback: function() { } } } });return false;" + 'e.Row.FCLinkButton("BtnPagar") = + e.Row.FCLinkButton("BtnPagar").Enabled = False + e.Row.FCLinkButton("BtnPagar").OnClientClick = + "bootbox.dialog({" & + "message: 'La solicitud de crédito no ha sido autorizada ', " & + "className: 'header-yellow', " & + "onEscape: function() {}, " & + "title: ' Advertencia', " & + "buttons: { " & + "success: { label: '', className: 'hide', callback: function() {} }, " & + "danger: { label: '', className: 'hide', callback: function() {} }, " & + "main: { label: 'Aceptar', className: 'yellow', callback: function() {} } " & + "} " & + "});" & + "return false;" + End If End If diff --git a/Ventas/PopUpBuscarFolio.aspx.vb b/Ventas/PopUpBuscarFolio.aspx.vb index 99717874d..8f3996771 100644 --- a/Ventas/PopUpBuscarFolio.aspx.vb +++ b/Ventas/PopUpBuscarFolio.aspx.vb @@ -175,7 +175,7 @@ Partial Class PopUpBuscarFolio Liga = String.Format("", e.Row.DBCampo("CveVenta")) End If - e.Row.FCLiteral("LtlTipo").Text = String.Format("", Liga, e.Row.DBCampo("TipoDocto")) + e.Row.FCLiteral("LtlTipo").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("TipoDocto")) e.Row.FCLiteral("LtlFolio").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("Folio")) e.Row.FCLiteral("LtlFecha").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("Fecha").ToDate.ToShortDateString) e.Row.FCLiteral("LtlNombre").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("NombreComercial")) diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx index 1aa380ef7..0b342eb9b 100644 --- a/Ventas/Promociones.aspx +++ b/Ventas/Promociones.aspx @@ -142,6 +142,9 @@ Descuento PU + + @@ -193,7 +196,7 @@
    - +
    diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb index de8564cf0..82f584ad0 100644 --- a/Ventas/Promociones.aspx.vb +++ b/Ventas/Promociones.aspx.vb @@ -243,7 +243,7 @@ Partial Class Ventas_Promociones 'CLASIFICACIONES DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion") DdlClasificacion.DataBind() - If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If EmpresaGrupoDiaz Then DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) Else DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -536,11 +536,16 @@ Partial Class Ventas_Promociones End If ' validación de %minimo considerado 02580104V - If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If EmpresaGrupoDiaz Then Dim tuc As Decimal = LblUltimoCosto.Text.ToDecimal Dim tpu As Decimal = TxtPromocionConcepto.Text.ToDecimal If tuc <= 0 OrElse (tpu - tuc) / tuc < UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100 Then - Alert("El producto está debajo de la utilidad permitida, la promoción requerirá autorización.", TipoMensaje.MsgAdvertencia.ToastAdventencia) + If PermisoAutorizPromocionPorcentaje Then + Alert("El producto está debajo de la utilidad permitida.", TipoMensaje.MsgAdvertencia.ToastAdventencia) + Else + Alert("El producto está debajo de la utilidad permitida, la promoción requerirá autorización.", TipoMensaje.MsgAdvertencia.ToastAdventencia) + End If + End If End If @@ -714,7 +719,7 @@ Partial Class Ventas_Promociones Next End If - If BloqueadoPromocionPorcentaje AndAlso Bloquear Then + If (Not PermisoAutorizPromocionPorcentaje) AndAlso BloqueadoPromocionPorcentaje AndAlso Bloquear Then ChkEstatus.Checked = False ChkEstatus.Enabled = False End If diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index d7f5f38f7..b556ddb94 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -8233,7 +8233,7 @@
    - +
    @@ -8383,10 +8383,9 @@
    - - + - +
    diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 287783c7c..2b18ea627 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -11,7 +11,6 @@ Imports ADSNetLibrary.SIGAPI.Models.CRM.Request Imports ADSNetLibrary.SIGAPI.Services.CRM Imports ADSTimbrado Imports Extensiones -Imports Microsoft.Ajax.Utilities Imports Microsoft.Reporting.WebForms Imports Modelos Imports Newtonsoft.Json.Linq @@ -25084,7 +25083,7 @@ Partial Class Ventas DivNombreCliente.Visible = False DivTipoPersona.Visible = False DivDireccionCliente.Visible = False - + DVRegimenSociedad.Visible = False DivNumeroCPCliente.Visible = False 'DivColoniaTelefonoCliente.Visible = False DivCiudadLocalidadCliente.Visible = False @@ -25098,6 +25097,20 @@ Partial Class Ventas CargaEstados() + TxtNombreCliente.Text = "" + TxtRFCCliente.Text = "" + TxtRegimenSociedad.Text = "" + DdlEstadoSAT.SelectedValueExist("-1") + TxtCiudadCliente.Text = "" + TxtLocalidadCliente.Text = "" + TxtColoniaCliente.Text = "" + TxtCPCliente.Text = "" + TxtDireccionCliente.Text = "" + TxtNumExtCliente.Text = "" + TxtNumIntCliente.Text = "" + TxtCorreoCliente.Text = "" + TxtTelefonoCliente.Text = "" + If UsuarioActual.CveEmpresa = 189 Then TxtRFCNombre.Text = "" @@ -25150,7 +25163,16 @@ Partial Class Ventas DivValidaRFC.Visible = True DivValidaPorNombre.Visible = False DivBusquedaCliente.Visible = False - TxtRFCCliente.Text = TxtRFCNombre.Text + + 'VERIFICAR SI EL TEXTO DE ENTRADA ES UN NOMBRE O UN RFC + If TxtRFCNombre.Text.Length > 13 Then + TxtNombreCliente.Text = TxtRFCNombre.Text.Trim().ToUpper() + ElseIf EsRFC(TxtRFCNombre.Text.Trim()) Then + TxtRFCCliente.Text = TxtRFCNombre.Text.Trim().ToUpper() + Else + TxtNombreCliente.Text = TxtRFCNombre.Text.Trim().ToUpper() + End If + BtnValidarRFC_Click(Nothing, EventArgs.Empty) End If End If @@ -25183,7 +25205,8 @@ Partial Class Ventas RdTipoPersona.SelectedValue = "0" - DdlMetodoCliente.SelectedValueExist(1) + DdlMetodoCliente.SelectedValueExist("1") + DdlMetodoCliente_SelectedIndexChanged(Nothing, EventArgs.Empty) 'DdlFormaCliente.SelectedValueExist(1) @@ -25233,7 +25256,7 @@ Partial Class Ventas End If - If UsuarioActual.CveEmpresa = 189 Then + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then divGiro.Visible = True Dim DrSP As DataRow = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, DdlSubProyectoDatos.SelectedValue.ToEntero()).FiltroPrimero("") @@ -25250,6 +25273,32 @@ Partial Class Ventas End If + DdlMetodoCliente.SelectedValueExist(1) + DdlMetodoCliente_SelectedIndexChanged(Nothing, EventArgs.Empty) + + 'PERSONA MORAL + If TxtRFCCliente.Text.Trim().Length = 12 Then + RdTipoPersona.SelectedValue = "1" + RdTipoPersona_SelectedIndexChanged(Nothing, EventArgs.Empty) + + DdlRegimenFiscalCliente.SelectedValueExist("1") + DdlRegimenFiscalCliente_SelectedIndexChanged(Nothing, EventArgs.Empty) + 'PERSONA FISICA + Else + RdTipoPersona.SelectedValue = "0" + RdTipoPersona_SelectedIndexChanged(Nothing, EventArgs.Empty) + + If TxtRFCCliente.Text.Trim() = "XAXX010101000" Then + DdlRegimenFiscalCliente.SelectedValueExist("11") + Else + DdlRegimenFiscalCliente.SelectedValueExist("9") + End If + + DdlRegimenFiscalCliente_SelectedIndexChanged(Nothing, EventArgs.Empty) + + End If + + DdlUsoCFDICliente.SelectedValueExist("3") End If End Sub @@ -26064,16 +26113,16 @@ Partial Class Ventas Dim RestringirAlmacenes As Integer = -1 - Dim BuscarEnTabla As Boolean = True - - Dim ObjInventarios As New ClsInventarios() - If ObjInventarios.GetExistenciasProducto(GvRow.DataKey("CvePS").ToEntero(), -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), - ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=-1, - ExcluyeTransitorios:=1, RestringirAlmacenes:=RestringirAlmacenes, TopSelect:=100, BuscarEnTabla:=BuscarEnTabla) Then - GvVerExistencias.DataSource = ObjInventarios.DtResultados.Copy() - End If - ObjInventarios.Dispose() - + Dim BuscarEnTabla As Boolean = True + + Dim ObjInventarios As New ClsInventarios() + If ObjInventarios.GetExistenciasProducto(GvRow.DataKey("CvePS").ToEntero(), -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), + ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=-1, + ExcluyeTransitorios:=1, RestringirAlmacenes:=RestringirAlmacenes, TopSelect:=100, BuscarEnTabla:=BuscarEnTabla) Then + GvVerExistencias.DataSource = ObjInventarios.DtResultados.Copy() + End If + ObjInventarios.Dispose() + GvVerExistencias.DataBind() UpVerExistencias.Update() @@ -38738,7 +38787,7 @@ Partial Class Ventas End Sub Private Sub DdlMetodoCliente_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlMetodoCliente.SelectedIndexChanged - DdlFormaCliente.Items.Clear() + If DdlMetodoCliente.SelectedValue = "3" Then DdlFormaCliente.DataSource = GlobalDTVtaFormaPago.FiltraParametros("CveFormaPago = 20") Else @@ -38746,6 +38795,10 @@ Partial Class Ventas End If DdlFormaCliente.DataBind() + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + DdlFormaCliente.SelectedValueExist("1") + End If + End Sub Private Sub AsignaMedicoProcedimientoFacturaRemisionesModal() @@ -39863,18 +39916,18 @@ Partial Class Ventas End Function Protected Sub GvVerExistencias_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CveAlmacen") = "" Then - e.Row.CssClass = "Totales" + If e.Row.DBCampo("CveAlmacen") = "" Then + e.Row.CssClass = "Totales" End If End If End Sub - Private Sub CargaGiro() - Dim Dt As DataTable = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa) - DdlGiro.DataSource = Dt - DdlGiro.DataBind() - DdlGiro.Items.Insert(0, New ListItem("Seleccione", "-1")) - UpAgregarCliente.Update() + Private Sub CargaGiro() + Dim Dt As DataTable = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa) + DdlGiro.DataSource = Dt + DdlGiro.DataBind() + DdlGiro.Items.Insert(0, New ListItem("Seleccione", "-1")) + UpAgregarCliente.Update() End Sub @@ -40058,9 +40111,21 @@ Partial Class Ventas DivValidaRFC.Visible = True DivValidaPorNombre.Visible = False DivBusquedaCliente.Visible = False - TxtRFCCliente.Text = TxtRFCNombre.Text + + 'VERIFICAR SI EL TEXTO DE ENTRADA ES UN NOMBRE O UN RFC + If TxtRFCNombre.Text.Length > 13 Then + TxtNombreCliente.Text = TxtRFCNombre.Text.Trim().ToUpper() + ElseIf EsRFC(TxtRFCNombre.Text.Trim()) Then + TxtRFCCliente.Text = TxtRFCNombre.Text.Trim().ToUpper() + Else + TxtNombreCliente.Text = TxtRFCNombre.Text.Trim().ToUpper() + End If BtnValidarRFC_Click(Nothing, EventArgs.Empty) End Sub + + Private Function EsRFC(texto As String) As Boolean + Return Regex.IsMatch(texto, "^[a-zñA-ZÑ.)(/\\&-]{3,4}(\d{6})((\D|\d){2})((\D|\d){1})$") + End Function End Class