--filtro por compuesto
This commit is contained in:
@@ -73,6 +73,9 @@ Partial Class Inventarios_Default
|
||||
DivEquivalentes.Visible = True
|
||||
DivPS.Visible = False
|
||||
End If
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.CveUsuario.Contiene(1703, 100) Then
|
||||
TrCompuesto.Visible = True
|
||||
End If
|
||||
Dim Txt As String = IfNull(Request("Txt"), "").ToString
|
||||
If Txt <> "" Then LblTitulo.Text = String.Format("Búsqueda de {0}", Txt)
|
||||
|
||||
@@ -91,6 +94,8 @@ Partial Class Inventarios_Default
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
CargarDatosMedRin()
|
||||
CargaEquivalencia()
|
||||
ElseIf UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.CveUsuario.Contiene(1703, 100) Then
|
||||
CargaDatosCompuesto()
|
||||
Else
|
||||
CargaDatos(DDlPS.SelectedValue.ToEntero, 1)
|
||||
End If
|
||||
@@ -107,53 +112,7 @@ Partial Class Inventarios_Default
|
||||
If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"),
|
||||
ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero,
|
||||
ExcluyeTransitorios:=1, RestringirAlmacenes:=RestringirAlmacenes, TopSelect:=100) Then
|
||||
Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||
|
||||
If dr IsNot Nothing Then
|
||||
LtPs.Text = $"Producto: <b>{dr("PSCodigo").ToString}</b>"
|
||||
Dim CvePrecioLista As Integer = -1
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'sino manneja precios de lista
|
||||
CvePrecioLista = -2
|
||||
End If
|
||||
|
||||
Dim ObjVta As New ClsVentas
|
||||
Dim objPS As New ClsProductosServicios
|
||||
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
|
||||
If ObjVta.DtResultados.Rows.Count > 0 Then
|
||||
If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero
|
||||
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then
|
||||
If objPS.DtResultados.Rows.Count > 0 Then
|
||||
LtPrecioPS.Text = $"Precio de venta: <b>$: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}</b>"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
ObjVta.Dispose()
|
||||
objPS.Dispose()
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
If CBool(dr("AplicaIEPS")) Then
|
||||
LtlIEPS.Visible = True
|
||||
LtlIEPSPorcentaje.Visible = True
|
||||
LtlIEPSPorcentaje.Text = $"<b>% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}</b>"
|
||||
Else
|
||||
LtlIEPS.Visible = False
|
||||
LtlIEPSPorcentaje.Visible = False
|
||||
End If
|
||||
If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then
|
||||
LtlIVA.Visible = True
|
||||
LtlIVAPorcentaje.Visible = True
|
||||
LtlIVAPorcentaje.Text = $"<b>Si</b>"
|
||||
Else
|
||||
LtlIVA.Visible = False
|
||||
LtlIVAPorcentaje.Visible = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoPagina(624) Then
|
||||
HlPendiente.Visible = True
|
||||
HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS)
|
||||
End If
|
||||
CargaPS(CvePS)
|
||||
|
||||
If ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
GV.DataSource = ObjInventarios.DtResultados
|
||||
@@ -167,14 +126,66 @@ Partial Class Inventarios_Default
|
||||
ObjInventarios.Dispose()
|
||||
GV.DataBind()
|
||||
|
||||
|
||||
|
||||
UPDatos.Update()
|
||||
TblBusqueda.Visible = True
|
||||
|
||||
Else
|
||||
Alert("Seleccione un producto", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPS(CvePS As Integer)
|
||||
If CvePS <= 0 Then Exit Sub
|
||||
|
||||
Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||
|
||||
If dr IsNot Nothing Then
|
||||
TblBusqueda.Visible = True
|
||||
LtPs.Text = $"Producto: <b>{dr("PSCodigo").ToString}</b>"
|
||||
Dim CvePrecioLista As Integer = -1
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'sino manneja precios de lista
|
||||
CvePrecioLista = -2
|
||||
End If
|
||||
|
||||
Dim ObjVta As New ClsVentas
|
||||
Dim objPS As New ClsProductosServicios
|
||||
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
|
||||
If ObjVta.DtResultados.Rows.Count > 0 Then
|
||||
If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero
|
||||
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then
|
||||
If objPS.DtResultados.Rows.Count > 0 Then
|
||||
LtPrecioPS.Text = $"Precio de venta: <b>$: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}</b>"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
ObjVta.Dispose()
|
||||
objPS.Dispose()
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
If CBool(dr("AplicaIEPS")) Then
|
||||
LtlIEPS.Visible = True
|
||||
LtlIEPSPorcentaje.Visible = True
|
||||
LtlIEPSPorcentaje.Text = $"<b>% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}</b>"
|
||||
Else
|
||||
LtlIEPS.Visible = False
|
||||
LtlIEPSPorcentaje.Visible = False
|
||||
End If
|
||||
If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then
|
||||
LtlIVA.Visible = True
|
||||
LtlIVAPorcentaje.Visible = True
|
||||
LtlIVAPorcentaje.Text = $"<b>Si</b>"
|
||||
Else
|
||||
LtlIVA.Visible = False
|
||||
LtlIVAPorcentaje.Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoPagina(624) Then
|
||||
HlPendiente.Visible = True
|
||||
HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS)
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CveAlmacen") = "" Then
|
||||
@@ -199,7 +210,22 @@ Partial Class Inventarios_Default
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatosCompuesto()
|
||||
Dim Compuesto As String = TxtCompuesto.Text.Trim
|
||||
If Compuesto = "" Then Compuesto = "-1"
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetExistencias119(DDlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, Compuesto) Then
|
||||
GV.DataSource = ObjInventarios.DtResultados
|
||||
TblBusqueda.Visible = False
|
||||
CargaPS(DDlPS.SelectedValue.ToEntero)
|
||||
GV.Columns(6).Visible = True
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
GV.DataBind()
|
||||
UPDatos.Update()
|
||||
DivMedRin.Visible = True
|
||||
End Sub
|
||||
|
||||
#Region " BUSCA | CODIGO - SERIE "
|
||||
Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Reference in New Issue
Block a user