472 lines
21 KiB
VB.net
472 lines
21 KiB
VB.net
Option Strict On
|
|
Option Explicit On
|
|
|
|
Imports System.Data
|
|
Imports Extensiones
|
|
Imports Microsoft.Reporting.WebForms
|
|
|
|
Partial Class Inventarios_Kardex
|
|
Inherits ClsPaginas
|
|
#Region "P R O P I E D A D E S"
|
|
'Public Property DtKardex As DataTable
|
|
' Get
|
|
' Return CType(ViewState("DtKardex"), DataTable)
|
|
' End Get
|
|
' Set(value As DataTable)
|
|
' ViewState("DtKardex") = value
|
|
' End Set
|
|
'End Property
|
|
|
|
Private Property CveMovimiento() As Integer
|
|
Get
|
|
Return If(IsNothing(ViewState("CveMovimiento")), -1, CInt(ViewState("CveMovimiento")))
|
|
End Get
|
|
Set
|
|
ViewState("CveMovimiento") = Value
|
|
End Set
|
|
End Property
|
|
#End Region
|
|
|
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
TxtFechaI.Text = Now.AddMonths(-1).ToShortDateString
|
|
TxtFechaF.Text = Now.ToShortDateString
|
|
CargaCombos()
|
|
'ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
If UsuarioActual.TienePermisoProceso(258) Then GvM.Columns(1).Visible = True
|
|
|
|
ddlAlmacen.SelectedValue = If(Request("CveAlmacen") IsNot Nothing, Request("CveAlmacen").ToString, "-1")
|
|
|
|
If Request("FechaI") IsNot Nothing AndAlso Request("FechaI") <> "-1" Then TxtFechaI.Text = Request("FechaI").ToString
|
|
If Request("FechaF") IsNot Nothing AndAlso Request("FechaF") <> "-1" Then TxtFechaF.Text = Request("FechaF").ToString
|
|
|
|
'If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
|
|
'ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
|
|
|
|
If Request("CvePS") IsNot Nothing And Request("CvePS") <> "-1" Then
|
|
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
|
|
ddlProducto_SelectedIndexChanged(ddlProducto2, EventArgs.Empty)
|
|
CargaDatos()
|
|
End If
|
|
|
|
CargaPermisos()
|
|
|
|
If UsuarioActual.CveUsuario = 100 Then
|
|
LblPS.ToolTip = ddlProducto2.SelectedValue
|
|
End If
|
|
|
|
End If
|
|
End Sub
|
|
|
|
|
|
|
|
#Region " INICIALIZA VALORES "
|
|
|
|
Private Sub CargaPermisos()
|
|
If UsuarioActual.CveRol = 1 Then ChkAgruparAlmacen.Visible = True
|
|
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
|
GvM.Columns(14).Visible = TienePermisoImportes ' costo
|
|
GvM.Columns(15).Visible = TienePermisoImportes ' importe
|
|
GvM.Columns(17).Visible = TienePermisoImportes ' valor
|
|
End Sub
|
|
|
|
Private Function isWithFamily() As Boolean
|
|
Return (UsuarioActual.CveEmpresa = 66)
|
|
End Function
|
|
Private Sub CargaCombos()
|
|
|
|
CargaFuncionalidad105()
|
|
CargaPS()
|
|
|
|
ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
|
|
ddlAlmacen.DataBind()
|
|
If IfNull(Request("CveAlmacen"), "-1").ToString.ToEntero > 0 Then ddlAlmacen.SelectedValuesIfExist(Request("CveAlmacen").ToString)
|
|
CargaClasificaciones()
|
|
|
|
CBLTiposAlmacen.DataSource = GlobalDTTipoAlmacen(-1)
|
|
CBLTiposAlmacen.DataBind()
|
|
For Each item As ListItem In CBLTiposAlmacen.Items
|
|
If item.Text.Contiene("Entrega Adelantado", "Transitorio") Then
|
|
item.Selected = False
|
|
Else
|
|
item.Selected = True
|
|
End If
|
|
|
|
Next
|
|
End Sub
|
|
Private Sub CargaFuncionalidad105()
|
|
ddlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
|
|
|
If ddlProducto2.UsaWebService Then
|
|
ddlProducto2.ddlWS.Attributes.Add("data-Estatus", "-1")
|
|
ddlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
|
|
ddlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
|
|
|
|
'DdlClasificacion.AutoPostBack = False
|
|
Else
|
|
ddlProducto2.ddl.Items.Add(New ListItem("Seleccione", "-1"))
|
|
ddlProducto2.ddl.Items.Add(New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
|
End If
|
|
|
|
End Sub
|
|
Private Sub CargaClasificaciones()
|
|
|
|
Dim CveClasificacion = If(Request("CveClasificacion") IsNot Nothing, Request("CveClasificacion").ToString, "-1")
|
|
|
|
If isWithFamily() Then
|
|
|
|
DdlClasificacion.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
|
Else
|
|
Dim ObjClasificaciones As New ClsClasificaciones
|
|
If UsuarioActual.Empresa.UsaAC Then
|
|
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
|
|
DdlClasificacion.DataSource = ObjClasificaciones.DtResultados
|
|
' DdlClasificacion.DataBind()
|
|
End If
|
|
Else
|
|
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
|
|
DdlClasificacion.DataSource = ObjClasificaciones.DtResultados
|
|
' DdlClasificacion.DataBind()
|
|
End If
|
|
End If
|
|
ObjClasificaciones.Dispose()
|
|
End If
|
|
|
|
'DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", "Clasificacion")
|
|
DdlClasificacion.DataBind()
|
|
DdlClasificacion.SelectedValueExist(CveClasificacion)
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region " CARGA PS "
|
|
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
|
CargaPS()
|
|
End Sub
|
|
Private Sub CargaPS()
|
|
If Not ddlProducto2.UsaWebService Then
|
|
Dim Filtro = If(DdlClasificacion.SelectedValue.ToEntero > 0, String.Format("CveClasificacion={0} And CveTipoPS=2", DdlClasificacion.SelectedValue), "CveTipoPS=2")
|
|
ddlProducto2.ddl.Items.Clear()
|
|
ddlProducto2.DataSource = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(Filtro, "PSCodigo")
|
|
ddlProducto2.DataBind()
|
|
ddlProducto2.ddl.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
|
Else
|
|
ddlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
|
|
ddlProducto2.SelectedText = ""
|
|
ddlProducto2.SelectedValue = "-1"
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub ddlProducto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlProducto2.selectedindexchange
|
|
DdlUnidadMedida.Items.Clear()
|
|
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
|
|
DdlUnidadMedida.DataBind()
|
|
DdlUnidadMedida.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
|
|
If UsuarioActual.CveUsuario = 100 Then
|
|
LblPS.ToolTip = ddlProducto2.SelectedValue
|
|
End If
|
|
|
|
TxtSerie.Text = ""
|
|
If ddlProducto2.SelectedValue.ToEntero > 0 Then
|
|
Dim Dr As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=ddlProducto2.SelectedValue.ToEntero).FiltroPrimero("")
|
|
If Dr IsNot Nothing Then
|
|
If Dr("AplicaSerie").ToString = "True" Then
|
|
DivSerie.Visible = True
|
|
Else
|
|
DivSerie.Visible = False
|
|
End If
|
|
End If
|
|
End If
|
|
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region " CARGA DATOS "
|
|
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
|
CargaDatos()
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero
|
|
|
|
If CveProducto > 0 Then
|
|
Dim DtTemp = CargarKardex(CveProducto)
|
|
If DtTemp IsNot Nothing Then
|
|
Dim AplicaSeccion, AplicaLote, AplicaCaducidad, AplicaSerie As Boolean
|
|
AplicaSerie = DtTemp.MAX("Serie") <> ""
|
|
AplicaSeccion = DtTemp.MAX("SeccionAlmacen") <> ""
|
|
AplicaLote = DtTemp.MAX("Lote") <> ""
|
|
AplicaCaducidad = DtTemp.MAX("FechaCaducidad") <> ""
|
|
|
|
GvM.Columns(6).Visible = DtTemp.MAX("FolioRelacionEntrada") <> ""
|
|
|
|
If AplicaSeccion Then GvM.Columns(8).Visible = True
|
|
If AplicaSerie Then GvM.Columns(9).Visible = True
|
|
If AplicaLote Then GvM.Columns(10).Visible = True
|
|
If AplicaCaducidad Then GvM.Columns(11).Visible = True
|
|
|
|
Dim AuxAplicaSerie As Boolean = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimeroValor("AplicaSerie") = "True"
|
|
Dim AuxAplicaCad As Boolean = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimeroValor("AplicaCaducidad") = "True"
|
|
LnkSeries.Visible = AuxAplicaSerie
|
|
LnkCaducidad.Visible = AuxAplicaCad
|
|
'CARGA INDICADORES
|
|
If UsuarioActual.TienePermisoProceso(201) Then
|
|
DivIndicadores.Visible = True
|
|
|
|
Dim Dr = DtTemp.FiltroUltimo("")
|
|
Dim TC = If(GlobalTipoCambio(Now) > 0, GlobalTipoCambio(Now), 1)
|
|
|
|
LtIndicador_Existencia.Text = Dr("Existencias").ToString.FormatoNumero()
|
|
|
|
LtIndicador_ValorPesos.Text = Dr("ValorInventario").ToString.FormatoNumero()
|
|
LtIndicador_ValorDolares.Text = (Dr("ValorInventario").ToString.ToDouble / TC).FormatoNumero()
|
|
|
|
Dim CostoPromedio = If(Dr("Existencias").ToString.ToDouble > 0, Dr("ValorInventario").ToString.ToDouble / Dr("Existencias").ToString.ToDouble, 0)
|
|
LtIndicador_CPPesos.Text = CostoPromedio.FormatoNumero()
|
|
LtIndicador_CPDolares.Text = (CostoPromedio / TC).FormatoNumero()
|
|
|
|
LtIndicador_UCPesos.Text = Dr("UltimoCosto").ToString.FormatoNumero()
|
|
LtIndicador_UCDolares.Text = Dr("UltimoCostoUSD").ToString.FormatoNumero()
|
|
|
|
LtIndicador_Mensaje.Text = $"* Importes calculados con el tipo de cambio del dia <b> $ {TC.FormatoNumero(4)} </b>"
|
|
|
|
If TxtSerie.Text <> "" Then
|
|
LtIndicador_MensajeSerie.Text = $"* Existencia y costos calculada por numero de serie: <b> {TxtSerie.Text} </b>"
|
|
Else
|
|
LtIndicador_MensajeSerie.Text = ""
|
|
End If
|
|
|
|
UpIndicadores.Update()
|
|
|
|
GvM.Attributes.Add("data-heighterror", "430")
|
|
Else
|
|
GvM.Attributes.Add("data-heighterror", "270")
|
|
End If
|
|
GvM.DataSource = DtTemp
|
|
GvM.DataBind()
|
|
UpAcciones.Update()
|
|
End If
|
|
Else
|
|
Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia)
|
|
End If
|
|
End Sub
|
|
|
|
Private Function CargarKardex(CvePS As Integer) As DataTable
|
|
Dim dt As DataTable = Nothing
|
|
|
|
Dim Entrada As Boolean = cbEntrada.Checked
|
|
Dim Salida As Boolean = cbSalida.Checked
|
|
|
|
Dim FechaI As String = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
|
|
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
|
|
Dim CveAlmacen As Integer = -1
|
|
Dim CveAlmacenes As String = ddlAlmacen.GetSelectedValues()
|
|
If CvePS > 0 Then
|
|
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
|
If dr IsNot Nothing Then
|
|
ddlProducto2.SelectedText = dr("PSCodigo").ToString
|
|
ddlProducto2.SelectedValue = CvePS.ToString
|
|
End If
|
|
|
|
End If
|
|
|
|
Dim CveTiposAlmacen = ""
|
|
For Each item As ListItem In CBLTiposAlmacen.Items
|
|
CveTiposAlmacen += If(item.Selected, $"{item.Value},", "")
|
|
Next
|
|
|
|
Dim Serie As String = If(TxtSerie.Text <> "", TxtSerie.Text, "-1")
|
|
|
|
Dim ObjInventarios As New ClsInventarios
|
|
If ObjInventarios.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked, Serie, CveAlmacenes) Then
|
|
dt = ObjInventarios.DtResultados.Copy
|
|
End If
|
|
ObjInventarios.Dispose()
|
|
|
|
Return dt
|
|
End Function
|
|
Protected Sub gvMovimientos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvM.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
e.Row.Cells(0).ToolTip = e.Row.DBCampo("FechaMovto")
|
|
|
|
If UsuarioActual.TienePermisoProceso(201) Then 'PERMISO PARA VER IMPORTES
|
|
If e.Row.DBCampo("CveCompra") <> "" Then
|
|
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
|
|
ElseIf e.Row.DBCampo("CveVenta") <> "" Then
|
|
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DBCampo("CveVenta"))
|
|
ElseIf e.Row.DBCampo("CveOrdenCompra") <> "" Then
|
|
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/OC/OC.aspx?OC={0}", e.Row.DBCampo("CveOrdenCompra"))
|
|
End If
|
|
End If
|
|
|
|
If GvM.Columns(1).Visible Then
|
|
If Not e.Row.DBCampo("CveMovimiento").ToEntero > 0 Then
|
|
e.Row.Cells(1).Text = ""
|
|
End If
|
|
End If
|
|
|
|
If e.Row.DBCampo("Concepto").Contains("TOTAL GENERAL") Then
|
|
e.Row.CssClass = "Totales"
|
|
ElseIf e.Row.DBCampo("Concepto").Contains("SALDO INICIAL") Then
|
|
e.Row.CssClass = "SubTotales"
|
|
End If
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CargarExistenciasProductosSeries()
|
|
Dim almacenes As String = ddlAlmacen.GetSelectedValues()
|
|
If almacenes = "" Then
|
|
almacenes = "-1"
|
|
End If
|
|
Dim ObjInventarios As New ClsInventarios
|
|
If ObjInventarios.GetExistenciasProductoSerie(ddlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
|
|
GvSeries.DataSource = ObjInventarios.DtResultados
|
|
End If
|
|
ObjInventarios.Dispose()
|
|
GvSeries.DataBind()
|
|
End Sub
|
|
|
|
Private Sub CargarCaducidadProducto()
|
|
Dim almacenes As String = ddlAlmacen.GetSelectedValues()
|
|
If almacenes = "" Then
|
|
almacenes = "-1"
|
|
End If
|
|
Dim ObjInventarios As New ClsInventarios
|
|
If ObjInventarios.GetExistenciasCaducidad(ddlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
|
|
GvProductoCaducidad.DataSource = ObjInventarios.DtResultados
|
|
End If
|
|
ObjInventarios.Dispose()
|
|
GvProductoCaducidad.DataBind()
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region " IMPRIMIR "
|
|
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
|
'Imprimir("Excel")
|
|
GenerarPDF("Excel")
|
|
End Sub
|
|
Private Sub Imprimir(Optional reporte As String = "PDF")
|
|
|
|
Dim DtKardex As DataTable = Nothing
|
|
DtKardex = CargarKardex(ddlProducto2.SelectedValue.ToEntero)
|
|
If (Not IsNothing(DtKardex)) Then
|
|
Dim params As New List(Of ReportParameter)
|
|
If IO.File.Exists(String.Format("{0}/Formatos/Kardex.rdlc", UsuarioActual.Empresa.Ruta)) Then
|
|
ImprimirPDF(String.Format("Empresas/{0}/Formatos/Kardex.rdlc", UsuarioActual.CveEmpresa), DtKardex, params, "ReporteKardex", reporte)
|
|
Else
|
|
ImprimirPDF("Empresas/Grales/Formatos/Kardex.rdlc", DtKardex, params, "Reporte Kardex", reporte)
|
|
End If
|
|
DtKardex.Dispose()
|
|
End If
|
|
|
|
End Sub
|
|
Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
|
|
GenerarPDF()
|
|
End Sub
|
|
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
|
Dim Movimientos As New ClsInventarios
|
|
Dim CvePS As Integer = ddlProducto2.SelectedValue.ToEntero
|
|
Dim Entrada As Boolean = cbEntrada.Checked
|
|
Dim Salida As Boolean = cbSalida.Checked
|
|
|
|
Dim FechaI As String = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
|
|
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
|
|
Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero
|
|
|
|
|
|
Dim Almacen = If(ddlAlmacen.SelectedValue = "-1", "", $" <b>Almacén:</b> {ddlAlmacen.SelectedItem.Text}")
|
|
Dim UM = If(DdlUnidadMedida.SelectedValue = "-1", "", $" <b>Unidad de Medida:</b> {DdlUnidadMedida.SelectedItem.Text}")
|
|
Dim FechaIn As String = If(TxtFechaI.Text = "", "", $" <b>Fecha Inicio:</b> {TxtFechaI.Text}")
|
|
Dim FechaFn As String = If(TxtFechaF.Text = "", "", $" <b>Fecha Fin:</b> {TxtFechaF.Text}")
|
|
Dim EntradaSalida As String = ""
|
|
|
|
If cbEntrada.Checked And cbSalida.Checked Then
|
|
EntradaSalida = " Entradas y Salidas"
|
|
ElseIf cbEntrada.Checked And cbSalida.Checked = False Then
|
|
EntradaSalida = " Solo Entradas"
|
|
ElseIf cbEntrada.Checked = False And cbSalida.Checked Then
|
|
EntradaSalida = " Solo Salidas"
|
|
End If
|
|
|
|
Dim CveTiposAlmacen = ""
|
|
For Each item As ListItem In CBLTiposAlmacen.Items
|
|
CveTiposAlmacen += If(item.Selected, $"{item.Value},", "")
|
|
Next
|
|
|
|
Dim Serie As String = If(TxtSerie.Text <> "", TxtSerie.Text, "-1")
|
|
|
|
Dim SerieAgrupado As String = If(TxtSerie.Text = "", "", $"<b>Existencia y costos calculada por numero de serie:</b> {TxtSerie.Text} ")
|
|
|
|
If Movimientos.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked, Serie) Then
|
|
|
|
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
|
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
|
Dim dt As DataTable = Movimientos.DtResultados
|
|
Dim params As New List(Of ReportParameter)
|
|
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
|
params.Add(New ReportParameter("FechaInicio", FechaI))
|
|
params.Add(New ReportParameter("FechaFin", FechaF))
|
|
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
|
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
|
params.Add(New ReportParameter("Producto", ddlProducto2.SelectedText))
|
|
params.Add(New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {SerieAgrupado}{EntradaSalida}{Almacen}{UM}{FechaIn}{FechaFn}"))
|
|
|
|
If Imagen.Exists Then
|
|
params.Add(New ReportParameter("LogoPath", logouri))
|
|
Else
|
|
params.Add(New ReportParameter("LogoPath", ""))
|
|
End If
|
|
ImprimirPDF("Empresas/Grales/Formatos/RepKardex.rdlc", dt, params, "ReporteKardex", Formato)
|
|
Else
|
|
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
|
End If
|
|
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region "EDITAR FECHA"
|
|
|
|
Protected Sub LnkEditarFecha_Click(sender As Object, e As EventArgs)
|
|
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
|
CveMovimiento = gvRow.DataKey("CveMovimiento").ToEntero
|
|
TxtFecha.Text = gvRow.DataKey("FechaMovto").ToDateTime.ToString("yyyy-MM-ddTHH:mm")
|
|
RegistraScript("$('#DModalEditarFecha').modal()")
|
|
UpModalEditarFecha.Update()
|
|
End Sub
|
|
|
|
|
|
Protected Sub BtnEditarFecha_Click(sender As Object, e As EventArgs)
|
|
Dim ObjMov As New ClsMovimientos
|
|
If ObjMov.UpdateMovimientoFecha(TxtFecha.Text.ToDateTime, CveMovimiento) Then
|
|
Alert("Actualizada correctamente a : " + TxtFecha.Text.ToDateTime.ToString("yyyy-MM-dd HH:mm"))
|
|
RegistraScript("$('#DModalEditarFecha').modal('hide')")
|
|
CargaDatos()
|
|
UPDatos.Update()
|
|
End If
|
|
ObjMov.Dispose()
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Acciones"
|
|
Protected Sub LnkSeries_OnClick(sender As Object, e As EventArgs) Handles LnkSeries.Click
|
|
CargarExistenciasProductosSeries()
|
|
UpGridSeries.Update()
|
|
RegistraScript(String.Format("$('#{0}').modal('show');", "DivModalSerie"))
|
|
End Sub
|
|
|
|
Protected Sub LnkCaducidad_OnClick(sender As Object, e As EventArgs) Handles LnkCaducidad.Click
|
|
CargarCaducidadProducto()
|
|
UpProductoCaducidad.Update()
|
|
RegistraScript(String.Format("$('#{0}').modal('show');", "DivModalCaducidad"))
|
|
End Sub
|
|
#End Region
|
|
|
|
|
|
|
|
End Class
|