GDiaz - Compras Prontos Pagos
This commit is contained in:
@@ -172,9 +172,9 @@
|
||||
<label class="col-md-1 truncate" style="max-width: 80px;" id="lblAlm" runat="server">Almacén:</label>
|
||||
<div class="col-md-2">
|
||||
<%--<asp:DropDownList ID="ddlAlmacen" runat="server" CssClass="select2me " Style="width: 175px !important;" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:DropDownList>--%>
|
||||
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox>
|
||||
|
||||
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="col-md-1" style="max-width: 85px;">Fecha Inicio:</label>
|
||||
<div class="col-md-1" style="min-width: 115px;">
|
||||
@@ -192,6 +192,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<label class="col-md-1 " style="max-width: 70px;">Fecha Fin:</label>
|
||||
<div class="col-md-1" style="min-width: 115px;">
|
||||
@@ -254,6 +255,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-1" runat="server" id="DVNavegar" visible="false">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:LinkButton runat="server" ID="LnkPSAntyerior" OnClick="LnkPSAntyerior_Click" CssClass="btn btn-primary" ><</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<asp:LinkButton runat="server" ID="LnkPSSiguiente" OnClick="LnkPSSiguiente_Click" CssClass="btn btn-primary" >></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,10 +25,60 @@ Partial Class Inventarios_Kardex
|
||||
ViewState("CveMovimiento") = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property IndiceNavegacionActual As Integer
|
||||
Get
|
||||
|
||||
If ViewState("IndiceNavegacionActual") Is Nothing Then
|
||||
ViewState("IndiceNavegacionActual") = 0
|
||||
End If
|
||||
Return ViewState("IndiceNavegacionActual").ToString.ToEntero
|
||||
End Get
|
||||
Set
|
||||
ViewState("IndiceNavegacionActual") = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DTPSNavegacion As DataTable
|
||||
Get
|
||||
If ViewState("DTPSNavegacion") Is Nothing Then
|
||||
ViewState("DTPSNavegacion") = New DataTable
|
||||
End If
|
||||
|
||||
Return DirectCast(ViewState("DTPSNavegacion"), DataTable)
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTPSNavegacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property NavegacionTieneDatos As Boolean
|
||||
Get
|
||||
|
||||
If ViewState("NavegacionTieneDatos") Is Nothing Then
|
||||
ViewState("NavegacionTieneDatos") = False
|
||||
End If
|
||||
Return Boolean.Parse(ViewState("NavegacionTieneDatos").ToString)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("NavegacionTieneDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
CreaDTPSNavegacion()
|
||||
DVNavegar.Visible = True
|
||||
End If
|
||||
|
||||
TxtFechaI.Text = NowADS().AddMonths(-1).ToShortDateString
|
||||
TxtFechaF.Text = NowADS().ToShortDateString
|
||||
CargaCombos()
|
||||
@@ -200,7 +250,7 @@ Partial Class Inventarios_Kardex
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
||||
CargaDatos()
|
||||
CargaDatos(True)
|
||||
Dim almacenes As String = ddlAlmacen.GetSelectedValues()
|
||||
If almacenes = "" Then
|
||||
almacenes = "-1"
|
||||
@@ -208,12 +258,25 @@ Partial Class Inventarios_Kardex
|
||||
ImprimirQR.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=Etiqueta2&CvePS={0}&PS={1}&CveAlmacen={2}&Modalidad={3}", ddlProducto2.SelectedValue.ToEntero, ddlProducto2.SelectedText.ToString, almacenes, "Individual")))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Private Sub CargaDatos(Optional validaInidiceActual As Boolean = False)
|
||||
|
||||
NavegacionTieneDatos = False
|
||||
Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero
|
||||
|
||||
If validaInidiceActual Then
|
||||
EstablecerIndiceActaual(CveProducto)
|
||||
End If
|
||||
|
||||
|
||||
If CveProducto > 0 Then
|
||||
Dim DtTemp = CargarKardex(CveProducto)
|
||||
|
||||
If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 1 Then
|
||||
NavegacionTieneDatos = True
|
||||
End If
|
||||
|
||||
If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then
|
||||
|
||||
Dim AplicaSeccion, AplicaLote, AplicaCaducidad, AplicaSerie As Boolean
|
||||
AplicaSerie = DtTemp.MAX("Serie") <> ""
|
||||
AplicaSeccion = DtTemp.MAX("SeccionAlmacen") <> ""
|
||||
@@ -370,8 +433,8 @@ Partial Class Inventarios_Kardex
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetExistenciasCaducidad(ddlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
|
||||
GvProductoCaducidad.DataSource = ObjInventarios.DtResultados
|
||||
GvProductoCaducidad.columns(2).visible = ObjInventarios.DtResultados.max("Serie") <> ""
|
||||
GvProductoCaducidad.columns(3).visible = ObjInventarios.DtResultados.max("Lote") <> ""
|
||||
GvProductoCaducidad.Columns(2).Visible = ObjInventarios.DtResultados.MAX("Serie") <> ""
|
||||
GvProductoCaducidad.Columns(3).Visible = ObjInventarios.DtResultados.MAX("Lote") <> ""
|
||||
GvProductoCaducidad.Columns(4).Visible = ObjInventarios.DtResultados.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvProductoCaducidad.Columns(4).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
|
||||
@@ -535,6 +598,81 @@ Partial Class Inventarios_Kardex
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Private Sub EstablecerIndiceActaual(CveProducto As Integer)
|
||||
|
||||
IndiceNavegacionActual = 0
|
||||
For Each drow As DataRow In DTPSNavegacion.Rows
|
||||
If drow("CvePS").ToString.ToEntero = CveProducto Then
|
||||
Exit Sub
|
||||
End If
|
||||
IndiceNavegacionActual = IndiceNavegacionActual + 1
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CreaDTPSNavegacion()
|
||||
DTPSNavegacion = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros("", "Codigo", {"CvePS", "CodigoPS", "Codigo"})
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkPSAntyerior_Click(sender As Object, e As EventArgs)
|
||||
|
||||
NavegacionTieneDatos = False
|
||||
|
||||
For x As Integer = IndiceNavegacionActual - 1 To 0 Step -1
|
||||
|
||||
|
||||
If x <= 0 Or NavegacionTieneDatos Then
|
||||
IndiceNavegacionActual = x
|
||||
UPFiltros.Update()
|
||||
End If
|
||||
|
||||
ddlProducto2.SelectedValue = DTPSNavegacion.Rows(x)("CvePS").ToString
|
||||
ddlProducto2.SelectedText = DTPSNavegacion.Rows(x)("CodigoPS").ToString
|
||||
ddlProducto2.txtValue.Value = DTPSNavegacion.Rows(x)("CvePS").ToString
|
||||
ddlProducto2.txtText.Value = DTPSNavegacion.Rows(x)("CodigoPS").ToString
|
||||
CargaDatos()
|
||||
|
||||
If x <= 0 Or NavegacionTieneDatos Then
|
||||
IndiceNavegacionActual = x
|
||||
UPFiltros.Update()
|
||||
UPDatos.Update()
|
||||
Exit Sub
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkPSSiguiente_Click(sender As Object, e As EventArgs)
|
||||
|
||||
NavegacionTieneDatos = False
|
||||
|
||||
For x As Integer = IndiceNavegacionActual + 1 To DTPSNavegacion.Rows.Count - 1 Step 1
|
||||
|
||||
|
||||
If x >= DTPSNavegacion.Rows.Count - 1 Or NavegacionTieneDatos Then
|
||||
IndiceNavegacionActual = x
|
||||
UPFiltros.Update()
|
||||
End If
|
||||
|
||||
ddlProducto2.SelectedValue = DTPSNavegacion.Rows(x)("CvePS").ToString
|
||||
ddlProducto2.SelectedText = DTPSNavegacion.Rows(x)("CodigoPS").ToString
|
||||
ddlProducto2.txtValue.Value = DTPSNavegacion.Rows(x)("CvePS").ToString
|
||||
ddlProducto2.txtText.Value = DTPSNavegacion.Rows(x)("CodigoPS").ToString
|
||||
CargaDatos()
|
||||
|
||||
If x >= DTPSNavegacion.Rows.Count - 1 Or NavegacionTieneDatos Then
|
||||
IndiceNavegacionActual = x
|
||||
UPFiltros.Update()
|
||||
UPDatos.Update()
|
||||
Exit Sub
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user