Manejo de público general. alta rápida de cliente, en Ventas.aspx, tomando en cuenta los datos de la sucursal cuando es rfc genérico. y búscar RFC/Nombre, y si hay una sola coincidencia, cerrar modal, si hay varias seleccionar el cliente, sino hay ninguna poner la opción de crear nuevo, (sugiriendo datos de la sucursal)
This commit is contained in:
@@ -25204,17 +25204,71 @@ Partial Class Ventas
|
||||
DivFormaCliente.Visible = False
|
||||
divRegimenCliente.Visible = False
|
||||
divGiro.Visible = False
|
||||
UpAgregarCliente.Update()
|
||||
DivBusquedaCliente.Visible = False
|
||||
|
||||
CargaEstados()
|
||||
TxtRFCCliente.Focus()
|
||||
|
||||
If UsuarioActual.CveEmpresa = 189 Then
|
||||
TxtRFCNombre.Text = ""
|
||||
|
||||
DivValidaRFC.Visible = False
|
||||
DivValidaPorNombre.Visible = True
|
||||
CargaGiro()
|
||||
|
||||
TxtRFCNombre.Focus()
|
||||
Else
|
||||
DivValidaRFC.Visible = True
|
||||
DivValidaPorNombre.Visible = False
|
||||
|
||||
TxtRFCCliente.Focus()
|
||||
End If
|
||||
|
||||
UpAgregarCliente.Update()
|
||||
|
||||
RegistraScript("showDivEC();")
|
||||
End Sub
|
||||
|
||||
Protected Sub GvBusquedaCliente_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBusquedaCliente.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
Dim Liga As String = String.Format("<a href='javascript:CargaCliente(""{0}"");$(""#divAgregarCliente"").modal(""hide""); '>", e.Row.DBCampo("CveCliente"))
|
||||
|
||||
e.Row.FCLiteral("LtlCodigo").Text = String.Format("<div class='truncate'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Codigo"))
|
||||
e.Row.FCLiteral("LtlNombre").Text = String.Format("<div class='truncate'>{0}{1}</a></div>", Liga, e.Row.DBCampo("NombreComercial"))
|
||||
e.Row.FCLiteral("LtlRFC").Text = String.Format("<div class='truncate'>{0}{1}</a></div>", Liga, e.Row.DBCampo("RFC"))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub BtnValidaPorNombre_Click(sender As Object, e As EventArgs) Handles BtnValidaPorNombre.Click
|
||||
Dim ObjCliente As New ClsClientes
|
||||
If ObjCliente.BuscarClienteRFCNombre(TxtRFCNombre.Text, UsuarioActual.CveEmpresa) Then
|
||||
If ObjCliente.DtResultados.Rows.Count = 1 AndAlso TxtRFCNombre.Text.Trim() <> "XAXX010101000" Then
|
||||
RegistraScript("hideDivEC();")
|
||||
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString().ToEntero()
|
||||
HdnCveCliente.Value = ObjCliente.DtResultados(0)("CveCliente").ToString()
|
||||
CargaCliente(CveCliente)
|
||||
UpCliente.Update()
|
||||
|
||||
ElseIf ObjCliente.DtResultados.Rows.Count > 0 AndAlso TxtRFCNombre.Text.Trim() <> "XAXX010101000" Then
|
||||
DivBusquedaCliente.Visible = True
|
||||
GvBusquedaCliente.DataSource = ObjCliente.DtResultados
|
||||
GvBusquedaCliente.DataBind()
|
||||
|
||||
Else
|
||||
DivValidaRFC.Visible = True
|
||||
DivValidaPorNombre.Visible = False
|
||||
DivBusquedaCliente.Visible = False
|
||||
TxtRFCCliente.Text = TxtRFCNombre.Text
|
||||
BtnValidarRFC_Click(Nothing, EventArgs.Empty)
|
||||
End If
|
||||
End If
|
||||
ObjCliente.Dispose()
|
||||
|
||||
UpAgregarCliente.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnValidarRFC_Click(sender As Object, e As EventArgs) Handles BtnValidarRFC.Click
|
||||
|
||||
If TxtRFCCliente.Text.ToUpper = "XAXX010101000" Then
|
||||
@@ -25291,6 +25345,21 @@ Partial Class Ventas
|
||||
|
||||
If UsuarioActual.CveEmpresa = 189 Then
|
||||
divGiro.Visible = True
|
||||
|
||||
Dim DrSP As DataRow = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, DdlSubProyectoDatos.SelectedValue.ToEntero()).FiltroPrimero("")
|
||||
If DrSP IsNot Nothing Then
|
||||
|
||||
DdlEstadoSAT.SelectedValueExist(DrSP("CveEstado").ToString())
|
||||
TxtCiudadCliente.Text = DrSP("Municipio").ToString()
|
||||
TxtLocalidadCliente.Text = DrSP("Localidad").ToString()
|
||||
TxtColoniaCliente.Text = DrSP("Colonia").ToString()
|
||||
TxtCPCliente.Text = DrSP("CP").ToString()
|
||||
TxtDireccionCliente.Text = DrSP("Calle").ToString()
|
||||
TxtNumExtCliente.Text = DrSP("NoExt").ToString()
|
||||
TxtNumIntCliente.Text = DrSP("NoInt").ToString()
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user