En la recepción de usados, cuando sea un cliente no distribuidor, especificar de que factura es, para validar que lo que se recibe no exceda alo que se facturó, de ser así toparlo a los puntos del usado que se facturo

This commit is contained in:
2019-10-14 16:51:28 -07:00
parent bbab24c4b7
commit c09e17f76a
2 changed files with 111 additions and 199 deletions

View File

@@ -148,7 +148,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row" id="DivFactura" runat="server" visible="false">
<label class="col-md-1 truncate" style="width: 110px">Factura:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlFactura" runat="server" CssClass="form-control input-sm select2me" Style="max-width: 200px" DataTextField="SerieFolio" DataValueField="CveVenta">
</asp:DropDownList>
</div>
</div>
<div class="row" id="DivDepartamentoEntrega" runat="server" visible="False"> <div class="row" id="DivDepartamentoEntrega" runat="server" visible="False">
<label class="col-md-1 truncate" style="width: 110px"> <label class="col-md-1 truncate" style="width: 110px">
<asp:Label runat="server" ID="LblDepartamentoEntrega"> Depto. entrega:</asp:Label> <asp:Label runat="server" ID="LblDepartamentoEntrega"> Depto. entrega:</asp:Label>

View File

@@ -373,18 +373,11 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
Private Sub PermisoVerImportes() Private Sub PermisoVerImportes()
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201) Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
End Sub End Sub
#End Region #End Region
Private Function isWhitFamily() As Boolean
Return (UsuarioActual.CveEmpresa = 66)
End Function
#Region " VALORES INICIALES " #Region " VALORES INICIALES "
Protected Sub CreaDT() Protected Sub CreaDT()
Dim dt As New DataTable Dim dt As New DataTable
@@ -436,30 +429,15 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
Private Sub CargaCombos() Private Sub CargaCombos()
'Llenar el dropdownlist de Secciones
If UsuarioActual.CveEmpresa = 66 Then
'DdlClasificacion.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
Else
Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
' DdlClasificacion.DataSource = ObjClasificaciones.DtResultados
End If
ObjClasificaciones.Dispose()
End If
'DdlClasificacion.DataBind()
DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa) DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccion.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlSeccion.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccion.DataBind() DdlSeccion.DataBind()
'Llenar el dropdownlist de monedas 'Llenar el dropdownlist de monedas
DdlMoneda.DataSource = GlobalDTMonedas DdlMoneda.DataSource = GlobalDTMonedas
DdlMoneda.DataBind() DdlMoneda.DataBind()
'Llenar el dropdownlist de almacén 'Llenar el dropdownlist de almacén
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (22)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (22)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
@@ -472,10 +450,7 @@ Partial Class Inventarios_RecepcionUsados
DdlAlmacen_SelectedIndexChanged(DdlAlmacen, EventArgs.Empty) DdlAlmacen_SelectedIndexChanged(DdlAlmacen, EventArgs.Empty)
End If End If
CargaPS() CargaPS()
End Sub End Sub
Private Sub CargaPS() Private Sub CargaPS()
Dim ObjAcum As New ClsAcumuladores Dim ObjAcum As New ClsAcumuladores
@@ -488,45 +463,24 @@ Partial Class Inventarios_RecepcionUsados
If drow("CvePSCargo").ToString.ToEntero > 0 Then If drow("CvePSCargo").ToString.ToEntero > 0 Then
lista.Add(drow("CvePSCargo").ToString) lista.Add(drow("CvePSCargo").ToString)
End If End If
Next Next
End If End If
If lista.Count > 0 Then If lista.Count > 0 Then
Filtro = "CvePS in(" & String.Join(",", lista) & ")" Filtro = "CvePS in(" & String.Join(",", lista) & ")"
'DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTamaño > 0")
' Filtro
DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros(Filtro) DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros(Filtro)
DdlProducto2.DataBind() DdlProducto2.DataBind()
DdlProducto2.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlProducto2.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If End If
'DdlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
'If UsuarioActual.CveEmpresa = 66 Then
' DdlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
'End If
'If Not DdlProducto2.UsaWebService AndAlso CType(DdlProducto2.DataSource, DataTable) Is Nothing Then
' DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoPS = 2")
' DdlProducto2.DataBind()
' DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
'End If
ObjAcum.Dispose() ObjAcum.Dispose()
End Sub End Sub
Private Sub CargaSubProyectos() Private Sub CargaSubProyectos()
DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)) DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1))
DdlSubProyecto.DataBind() DdlSubProyecto.DataBind()
'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) 'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub End Sub
@@ -567,7 +521,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
#End Region #End Region
#Region " CARGA DATOS " #Region " CARGA DATOS "
@@ -600,7 +553,6 @@ Partial Class Inventarios_RecepcionUsados
#End Region #End Region
#Region " BOTONES: ELIMINAR, NUEVO " #Region " BOTONES: ELIMINAR, NUEVO "
Protected Sub BtnNuevo_Click(sender As Object, e As EventArgs) Handles BtnNuevo.Click Protected Sub BtnNuevo_Click(sender As Object, e As EventArgs) Handles BtnNuevo.Click
'Response.Redirect("EntradasSalidas.aspx") 'Response.Redirect("EntradasSalidas.aspx")
@@ -993,8 +945,6 @@ Partial Class Inventarios_RecepcionUsados
Dim ImporteConcepto = 0.0 Dim ImporteConcepto = 0.0
Try Try
Dim CveSubProyecto = -1 Dim CveSubProyecto = -1
Dim ActivoFijo = -1 Dim ActivoFijo = -1
@@ -1015,16 +965,18 @@ Partial Class Inventarios_RecepcionUsados
Dim tCveProveedor As Integer = -1 Dim tCveProveedor As Integer = -1
If DdlProveedor.SelectedValue.ToEntero > 0 Then tCveProveedor = DdlProveedor.SelectedValue.ToEntero If DdlProveedor.SelectedValue.ToEntero > 0 Then tCveProveedor = DdlProveedor.SelectedValue.ToEntero
Dim CveVenta As Integer = -1 Dim CveVenta As Integer = -1
If CveRemisionRecibida > 0 Then If CveRemisionRecibida > 0 Then
CveVenta = CveRemisionRecibida CveVenta = CveRemisionRecibida
ElseIf EsDistribuidor AndAlso DdlFactura.SelectedValue.ToEntero() > 0 Then
CveVenta = DdlFactura.SelectedValue.ToEntero()
End If End If
'Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/ES", 53, 0, 0, 1, TxtFecha.Text.ToDate, $" {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3) 'Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/ES", 53, 0, 0, 1, TxtFecha.Text.ToDate, $" {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, CveConcepto, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, CveConcepto, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta,
CveSubProyecto, ActivoFijo, Guia:=TxtGuia.Text, Observaciones:=TxtObservaciones.Text, CvePersonal:=DdlPersonal.SelectedValue.ToEntero, CveSubProyecto, ActivoFijo, Guia:=TxtGuia.Text, Observaciones:=TxtObservaciones.Text, CvePersonal:=DdlPersonal.SelectedValue.ToEntero,
Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text, Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text,
PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor) PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor)
If CveMovimiento <= 0 Then If CveMovimiento <= 0 Then
Alert("No se pudo almacenar el movimiento correctamente", TipoMensaje.MsgError) Alert("No se pudo almacenar el movimiento correctamente", TipoMensaje.MsgError)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
@@ -1054,13 +1006,10 @@ Partial Class Inventarios_RecepcionUsados
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2) Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2)
If RBLOpcion.SelectedValue.ToEntero <> 3 Then If RBLOpcion.SelectedValue.ToEntero <> 3 Then
If EsDistribuidor Then If EsDistribuidor Then
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario, If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
'CveCliente As Integer, Cantidad As Integer, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer, 'CveCliente As Integer, Cantidad As Integer, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
'CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String 'CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String
@@ -1069,11 +1018,7 @@ Partial Class Inventarios_RecepcionUsados
Exit For Exit For
End If End If
End If End If
End If End If
Next Next
If Not ErrorMovInv Then If Not ErrorMovInv Then
@@ -1088,10 +1033,8 @@ Partial Class Inventarios_RecepcionUsados
ObjInventario.Commit() ' aplica los movimientos insertados ObjInventario.Commit() ' aplica los movimientos insertados
'If ObjContaAC IsNot Nothing Then ObjContaAC.Commit() 'If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
Alert(Msg.ToString, TipoMensaje.MsgInformacion) Alert(Msg.ToString, TipoMensaje.MsgInformacion)
'Limpia Valores cuando inserta de campos especiales 'Limpia Valores cuando inserta de campos especiales
If UsuarioActual.CveEmpresa = 66 Then If UsuarioActual.CveEmpresa = 66 Then
DdlSubProyecto.SelectedValueExist("-1") DdlSubProyecto.SelectedValueExist("-1")
@@ -1103,7 +1046,6 @@ Partial Class Inventarios_RecepcionUsados
UPDatos.Update() UPDatos.Update()
LimpiarMovimiento() LimpiarMovimiento()
Else Else
ObjInventario.RollBack() 'deshace lo insertado ObjInventario.RollBack() 'deshace lo insertado
CveMovimiento = 0 CveMovimiento = 0
@@ -1111,18 +1053,11 @@ Partial Class Inventarios_RecepcionUsados
Alert("ocurrió un Error al registrar los movimientos", TipoMensaje.MsgError) Alert("ocurrió un Error al registrar los movimientos", TipoMensaje.MsgError)
' RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") ' RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
End If End If
End If End If
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' ")) CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
End If End If
Catch ex As Exception Catch ex As Exception
ObjInventario.RollBack() 'deshace lo insertado ObjInventario.RollBack() 'deshace lo insertado
CveMovimiento = 0 CveMovimiento = 0
@@ -1138,11 +1073,11 @@ Partial Class Inventarios_RecepcionUsados
Alert("No hay ningun registro para generar el movimiento. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError) Alert("No hay ningun registro para generar el movimiento. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
End If End If
End Sub End Sub
#End Region #End Region
#Region " ADD INVENTARIO INICIAL " #Region " ADD INVENTARIO INICIAL "
Protected Sub BtnCodigoBarras_Click(sender As Object, e As EventArgs) Protected Sub BtnCodigoBarras_Click(sender As Object, e As EventArgs)
@@ -1221,7 +1156,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
#End Region #End Region
#Region " DdlConcepto, DdlClasificacion, DdlAlmacen | Index CHANGED " #Region " DdlConcepto, DdlClasificacion, DdlAlmacen | Index CHANGED "
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs)
@@ -1270,34 +1204,6 @@ Partial Class Inventarios_RecepcionUsados
FolioAsignado = Folio FolioAsignado = Folio
End Sub End Sub
'Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
' ChangeDdlProducto()
'End Sub
'Private Sub ChangeDdlProducto()
' If UsuarioActual.Empresa.Funcionalidad(105) = "" Then
' Dim filtro As String = ""
' If Not (DdlClasificacion.SelectedValue = "-1") Then
' If isWhitFamily() Then
' filtro = String.Format("CveSubFamilia={0}", DdlClasificacion.SelectedValue)
' Else
' filtro = String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue)
' End If
' End If
' DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros($"{filtro} AND CveTipoPS = 2", "PSCodigo")
' DdlProducto2.DataBind()
' DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
' Else
' If isWhitFamily() Then
' DdlProducto2.ddlWS.Attributes.Add("data-idSubFamilia", DdlClasificacion.SelectedValue)
' Else
' DdlProducto2.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacion.SelectedValue)
' End If
' End If
'End Sub
Protected Sub DdlProducto2_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlProducto2_SelectedIndexChanged(sender As Object, e As EventArgs)
ElProductoChange() ElProductoChange()
End Sub End Sub
@@ -1346,7 +1252,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
#End Region #End Region
#Region " GVM " #Region " GVM "
Private Sub CargaGVM(DtTemp As DataTable) Private Sub CargaGVM(DtTemp As DataTable)
GvM.DataSource = DtTemp GvM.DataSource = DtTemp
@@ -1444,13 +1349,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
#End Region #End Region
#Region " TIPO DE CAMBIO " #Region " TIPO DE CAMBIO "
Protected Sub DdlMonedaTC_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlMonedaTC_SelectedIndexChanged(sender As Object, e As EventArgs)
Select Case DdlMonedaTC.SelectedValue.ToEntero Select Case DdlMonedaTC.SelectedValue.ToEntero
@@ -1492,7 +1390,6 @@ Partial Class Inventarios_RecepcionUsados
#End Region #End Region
#Region " BITACORA " #Region " BITACORA "
Private Sub InicializaBitacoraTemporal() Private Sub InicializaBitacoraTemporal()
@@ -1696,10 +1593,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
#End Region #End Region
#Region " CONSUMO INTERNO " #Region " CONSUMO INTERNO "
'Private Sub ActivaConsumoInterno() 'Private Sub ActivaConsumoInterno()
' EsConsumoInterno = True ' EsConsumoInterno = True
@@ -1729,7 +1622,6 @@ Partial Class Inventarios_RecepcionUsados
'End Sub 'End Sub
#End Region #End Region
#Region "PAQUETERIA GUIA" #Region "PAQUETERIA GUIA"
'Protected Sub LnkAgregarGuia_Click(sender As Object, e As EventArgs) 'Protected Sub LnkAgregarGuia_Click(sender As Object, e As EventArgs)
' RegistraScript(String.Format("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveMovimiento={0}',800,620);", CveMovimiento)) ' RegistraScript(String.Format("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveMovimiento={0}',800,620);", CveMovimiento))
@@ -1775,6 +1667,26 @@ Partial Class Inventarios_RecepcionUsados
DivClienteSucursal.Visible = False DivClienteSucursal.Visible = False
DdlClientesSucursales.Items.Clear() DdlClientesSucursales.Items.Clear()
CargaSucursalesCliente() CargaSucursalesCliente()
CargaFacturasCliente()
UpGenerales.Update()
End Sub
Private Sub CargaFacturasCliente()
DivFactura.Visible = True
Dim CveCliente As Integer = DdlClientes.SelectedValue.ToEntero()
If CveCliente > 0 Then
Me.EsDistribuidor = True
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
DdlFactura.DataSource = ObjVentas.DtResultados.Copy()
End If
ObjVentas.Dispose()
DdlFactura.DataBind()
DdlFactura.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
End Sub End Sub
Protected Sub CargaSucursalesCliente() Protected Sub CargaSucursalesCliente()
DdlClientesSucursales.Enabled = True DdlClientesSucursales.Enabled = True
@@ -1886,10 +1798,6 @@ Partial Class Inventarios_RecepcionUsados
#End Region #End Region
Private Sub GuardarBitacora(CveVenta As Integer, RutaAdjunto As String, Obser As String) Private Sub GuardarBitacora(CveVenta As Integer, RutaAdjunto As String, Obser As String)
Dim ObjEventos As New ClsOIEventos() Dim ObjEventos As New ClsOIEventos()
@@ -1907,7 +1815,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
Protected Sub LnkAgregarUsado_Click(sender As Object, e As EventArgs) Protected Sub LnkAgregarUsado_Click(sender As Object, e As EventArgs)
AgregarUsado = True AgregarUsado = True
ResetModalUsados() ResetModalUsados()
@@ -1916,8 +1823,6 @@ Partial Class Inventarios_RecepcionUsados
UpModalAgregar.Update() UpModalAgregar.Update()
End Sub End Sub
Protected Sub LnkModalAgregarUsado_Click(sender As Object, e As EventArgs) Protected Sub LnkModalAgregarUsado_Click(sender As Object, e As EventArgs)
AgregarPS() AgregarPS()
End Sub End Sub
@@ -1970,7 +1875,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
Private Sub RBLOpcion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLOpcion.SelectedIndexChanged Private Sub RBLOpcion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLOpcion.SelectedIndexChanged
If RBLOpcion.SelectedValue.ToEntero = 3 Then If RBLOpcion.SelectedValue.ToEntero = 3 Then
DivCliente.Visible = False DivCliente.Visible = False
Else Else
@@ -1996,7 +1900,6 @@ Partial Class Inventarios_RecepcionUsados
Me.CveRemisionRecibida = -1 Me.CveRemisionRecibida = -1
Me.CveRemisionRecibida = CType(CType(sender, LinkButton).NamingContainer, GridViewRow).DataKey("CveVenta").ToEntero() Me.CveRemisionRecibida = CType(CType(sender, LinkButton).NamingContainer, GridViewRow).DataKey("CveVenta").ToEntero()
Dim DtUsados As DataTable = Nothing Dim DtUsados As DataTable = Nothing
Dim CveCliente As Integer = -1 Dim CveCliente As Integer = -1
@@ -2008,10 +1911,13 @@ Partial Class Inventarios_RecepcionUsados
If EsDistribuidor Then If EsDistribuidor Then
DivCliente.Visible = True DivCliente.Visible = True
DdlClientes.SelectedValueExist(CveCliente)
DdlClientes_SelectedIndexChanged(DdlClientes, EventArgs.Empty)
DdlFactura.SelectedValueExist(CveRemisionRecibida)
Else Else
DivCliente.Visible = False DivCliente.Visible = False
DivFactura.Visible = False
End If End If
DdlClientes.SelectedValueExist(CveCliente)
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
DtUsados = ObjVentas.DtResultados.Copy() DtUsados = ObjVentas.DtResultados.Copy()