From bbb0ef047674f55a87c32ba1b659a95ee2dae5b2 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 15 Nov 2023 10:20:26 -0700 Subject: [PATCH] -- vadilacion --- Ventas/Ventas.aspx.vb | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1e3bf8f75..c77e56988 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -14928,14 +14928,18 @@ Partial Class Ventas DtExistencias = ObjInventario.DtResultados.FiltraParametros($"CvePS Is Not NULL AND {Filtro}") End If - PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()}").ToString().ToDecimal - If PU <= 0 Then + Dim drPU As DataRow = DtExistencias.FiltroPrimero($"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero()}") + If drPU IsNot Nothing Then + PU = drPU("PU").ToString.ToDecimal + Else + 'sino se encontró valor, manda mensaje ErrorList.Add("Ocurrió un error al obtener el costo.
") OcurrioError = True Exit For End If + End If - Dim CveSeccionAlmacen As Integer = -3 + Dim CveSeccionAlmacen As Integer = -3 'If AplicaSeccion Then CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacen, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen", "").ToEntero If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Dr("Serie").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then @@ -14999,17 +15003,17 @@ Partial Class Ventas End If 'E119, verifica si la salida está con ps de importación para que se guarde el pedimento - If UsuarioActual.CveEmpresa = 119 AndAlso factura.TipoDocto.Contiene("Ing") Then + 'If UsuarioActual.CveEmpresa = 119 AndAlso factura.TipoDocto.Contiene("Ing") Then - 'If ObjInventario.GetVentasPedimento(CveVenta, UsuarioActual.CveEmpresa) Then - ' Dim dttped As DataTable = ObjInventario.DtResultados + ' 'If ObjInventario.GetVentasPedimento(CveVenta, UsuarioActual.CveEmpresa) Then + ' ' Dim dttped As DataTable = ObjInventario.DtResultados - ' For Each drt As DataRow In dttped.FiltraParametros("NumeroPedimento <> ''").Rows + ' ' For Each drt As DataRow In dttped.FiltraParametros("NumeroPedimento <> ''").Rows - ' ObjVentas.UpdateVentasDetalleNumeroPedimento(factura.CveVenta, drt("CveVentaDetalle").ToString.ToEntero, drt("NumeroPedimento").ToString) - ' Next - 'End If - End If + ' ' ObjVentas.UpdateVentasDetalleNumeroPedimento(factura.CveVenta, drt("CveVentaDetalle").ToString.ToEntero, drt("NumeroPedimento").ToString) + ' ' Next + ' 'End If + 'End If Else OcurrioError = True ErrorList.Add("Ocurrió un error al consultar los movimientos de almacen.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico")