-- corrección para tomar la última existencia
This commit is contained in:
@@ -281,45 +281,7 @@ Partial Class Inventarios_Kardex
|
|||||||
If UsuarioActual.CveEmpresa = 172 AndAlso UsuarioActual.CveRol = 1 Then
|
If UsuarioActual.CveEmpresa = 172 AndAlso UsuarioActual.CveRol = 1 Then
|
||||||
LnkExistenciasPorCapas.Visible = True
|
LnkExistenciasPorCapas.Visible = True
|
||||||
End If
|
End If
|
||||||
'CARGA INDICADORES
|
|
||||||
|
|
||||||
If UsuarioActual.TienePermisoProceso(201) Then
|
|
||||||
DivIndicadores.Visible = True
|
|
||||||
|
|
||||||
Dim Dr = DtTemp.FiltroUltimo("")
|
|
||||||
Dim TC = If(GlobalTipoCambio(NowADS()) > 0, GlobalTipoCambio(NowADS()), 1)
|
|
||||||
|
|
||||||
LtIndicador_Existencia.Text = Dr("Existencias").ToString.ToDecimal.ToString("#,##0.####")
|
|
||||||
|
|
||||||
LtIndicador_ValorPesos.Text = Dr("ValorInventario").ToString.FormatoNumero()
|
|
||||||
LtIndicador_ValorDolares.Text = (Dr("ValorInventario").ToString.ToDouble / TC).FormatoNumero()
|
|
||||||
|
|
||||||
Dim CostoPromedio As Decimal = If(Dr("Existencias").ToString.ToDecimal.RoundSQL(4) > 0, Dr("ValorInventario").ToString.ToDecimal.RoundSQL(4) / Dr("Existencias").ToString.ToDecimal.RoundSQL(4), 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 día <b> $ {TC.FormatoNumero(4)} </b>"
|
|
||||||
|
|
||||||
If TxtSerie.Text <> "" Then
|
|
||||||
LtIndicador_MensajeSerie.Text = $"* Existencia y costos calculada por número de serie: <b> {TxtSerie.Text} </b>"
|
|
||||||
Else
|
|
||||||
LtIndicador_MensajeSerie.Text = ""
|
|
||||||
End If
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
|
||||||
CargarOCPendientesCompra()
|
|
||||||
DivIndicadorOC.Visible = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
UpIndicadores.Update()
|
|
||||||
|
|
||||||
GvM.Attributes.Add("data-heighterror", "430")
|
|
||||||
Else
|
|
||||||
GvM.Attributes.Add("data-heighterror", "270")
|
|
||||||
End If
|
|
||||||
GvM.DataSource = DtTemp
|
GvM.DataSource = DtTemp
|
||||||
GvM.DataBind()
|
GvM.DataBind()
|
||||||
UpAcciones.Update()
|
UpAcciones.Update()
|
||||||
@@ -382,6 +344,46 @@ Partial Class Inventarios_Kardex
|
|||||||
If ObjInventarios.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
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
|
ChkAgruparAlmacen.Checked, Serie, CveAlmacenes) Then
|
||||||
dt = ObjInventarios.DtResultados.Copy
|
dt = ObjInventarios.DtResultados.Copy
|
||||||
|
|
||||||
|
'CARGA INDICADORES
|
||||||
|
|
||||||
|
If UsuarioActual.TienePermisoProceso(201) Then
|
||||||
|
DivIndicadores.Visible = True
|
||||||
|
|
||||||
|
Dim Dr = dt.FiltroUltimo("")
|
||||||
|
Dim TC = If(GlobalTipoCambio(NowADS()) > 0, GlobalTipoCambio(NowADS()), 1)
|
||||||
|
|
||||||
|
LtIndicador_Existencia.Text = Dr("Existencias").ToString.ToDecimal.ToString("#,##0.####")
|
||||||
|
|
||||||
|
LtIndicador_ValorPesos.Text = Dr("ValorInventario").ToString.FormatoNumero()
|
||||||
|
LtIndicador_ValorDolares.Text = (Dr("ValorInventario").ToString.ToDouble / TC).FormatoNumero()
|
||||||
|
|
||||||
|
Dim CostoPromedio As Decimal = If(Dr("Existencias").ToString.ToDecimal.RoundSQL(4) > 0, Dr("ValorInventario").ToString.ToDecimal.RoundSQL(4) / Dr("Existencias").ToString.ToDecimal.RoundSQL(4), 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 día <b> $ {TC.FormatoNumero(4)} </b>"
|
||||||
|
|
||||||
|
If TxtSerie.Text <> "" Then
|
||||||
|
LtIndicador_MensajeSerie.Text = $"* Existencia y costos calculada por número de serie: <b> {TxtSerie.Text} </b>"
|
||||||
|
Else
|
||||||
|
LtIndicador_MensajeSerie.Text = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||||
|
CargarOCPendientesCompra()
|
||||||
|
DivIndicadorOC.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
UpIndicadores.Update()
|
||||||
|
|
||||||
|
GvM.Attributes.Add("data-heighterror", "430")
|
||||||
|
Else
|
||||||
|
GvM.Attributes.Add("data-heighterror", "270")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then dt = dt.FiltraParametros("", "FechaMovto DESC") ' ordenamiento descendente
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then dt = dt.FiltraParametros("", "FechaMovto DESC") ' ordenamiento descendente
|
||||||
ObjInventarios.Dispose()
|
ObjInventarios.Dispose()
|
||||||
|
|||||||
Reference in New Issue
Block a user