From 339d4f0efb8fc78dc6ddc69b56960506009e5285 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 30 Sep 2020 09:46:56 -0700 Subject: [PATCH 1/5] -- recepcion por costo indirecto de multiples facturas(fletes) --- App_Code/ClsCompras.vb | 33 ---------------- App_Code/ClsInventarios.vb | 59 ++++++++++++++++++++++++++++ Compras/Compras.aspx.vb | 37 ++++++----------- Inventarios/Fletes.aspx.vb | 16 +++----- Inventarios/RecepcionAlmacen.aspx | 8 +++- Inventarios/RecepcionAlmacen.aspx.vb | 28 ++++++++++++- 6 files changed, 110 insertions(+), 71 deletions(-) diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index eea2fc4d8..ad35ebb1e 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -3074,39 +3074,6 @@ Public Class ClsCompras Return Retorno End Function - Public Function GetFletesCompras(CveFlete As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Comp_FletesComprasGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFlete", SqlDbType.Int).Value = CveFlete - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al querer obtener las compras relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - End Function - - Public Function AddFletesCompras(CveFlete As Integer, Optional CveCompra As Integer = -1, Optional CveOC As Integer = -1) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Comp_FletesComprasAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFlete", SqlDbType.Int).Value = CveFlete - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@CveOC", SqlDbType.Int).Value = CveOC - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al querer agregar las compras relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - End Function - #Region "REPORTE PUE SIN PAGO" Public Function GetPUESinPago(FI As DateTime, FF As DateTime, CveProveedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1) As Boolean diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 293c971d4..4f57d07db 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -4588,6 +4588,65 @@ Public Class ClsInventarios End Function #End Region +#Region " FLETES COMPRAS " + + Public Function GetFletesCompras(CveFlete As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_FletesComprasGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFlete", SqlDbType.Int).Value = CveFlete + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al querer obtener las compras relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + Public Function AddFletesCompras(CveFlete As Integer, Optional CveCompra As Integer = -1, Optional CveOC As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_FletesComprasAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFlete", SqlDbType.Int).Value = CveFlete + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveOC", SqlDbType.Int).Value = CveOC + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al querer agregar las compras relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + Public Function PendientesAlmacenFletesComprasGet(CveFlete As Integer, CveProveedor As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_PendientesAlmacenFletesComprasGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFlete", SqlDbType.Int).Value = CveFlete + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Importaciones pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + +#End Region + + #Region " FLETES DETALLE " Public Function AddFleteDetalle(CveFlete As Integer, CveCompra As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 963b4f3a6..e37fd5697 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4561,19 +4561,13 @@ Partial Class Compras_Compras Case 237 Select Case FleteImportacionOpcion Case 1 - Dim Dr As DataRow = Nothing - If ObjInventario.GetFletes(UsuarioActual.CveEmpresa, CveFlete) Then - If ObjInventario.DtResultados.Rows.Count > 0 Then - Dr = ObjInventario.DtResultados.Rows(0) - End If - End If - If Dr IsNot Nothing Then - If Not ObjInventario.UpdateFlete(CveFlete, Dr("Descripcion").ToString, Dr("Fecha").ToString.ToDate, -1, CveCompra, UsuarioActual.CveUsuario) Then - ErrorOC = True - End If - Else + If Not ObjInventario.AddFletesCompras(CveFlete, CveCompra) Then ErrorOC = True End If + ''actualiza la compra para que no se surta en almacen. sino por el flete o importación + 'If Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 2) Then + ' ErrorOC = True + 'End If Case 2 If Not ObjInventario.AddFleteDetalle(CveFlete, CveCompra) Then ErrorOC = True @@ -19272,22 +19266,13 @@ Partial Class Compras_Compras Case 237 Select Case FleteImportacionOpcion Case 1 - Dim Dr As DataRow = Nothing - If ObjInventario.GetFletes(UsuarioActual.CveEmpresa, CveFlete) Then - If ObjInventario.DtResultados.Rows.Count > 0 Then - Dr = ObjInventario.DtResultados.Rows(0) - End If - End If - If Dr IsNot Nothing Then - If Not ObjInventario.UpdateFlete(CveFlete, Dr("Descripcion").ToString, Dr("Fecha").ToString.ToDate, -1, CveCompra, UsuarioActual.CveUsuario) Then - ErrorTrans = True - End If - If Not ObjCompras.AddFletesCompras(CveFlete, CveCompra:=CveCompra) Then - ErrorTrans = True - End If - Else - ErrorTrans = True + If Not ObjInventario.AddFletescompras(CveFlete, CveCompra) Then + ErrorTrans = True End If + '''actualiza la compra para que no se surta en almacen. sino por el flete o importación + ''If Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 2) Then + '' ErrorTrans = True + ''End If Case 2 If Not ObjInventario.AddFleteDetalle(CveFlete, CveCompra) Then ErrorTrans = True diff --git a/Inventarios/Fletes.aspx.vb b/Inventarios/Fletes.aspx.vb index 27c2b1c77..31217cb1a 100644 --- a/Inventarios/Fletes.aspx.vb +++ b/Inventarios/Fletes.aspx.vb @@ -99,7 +99,11 @@ Partial Class Compras_Fletes Else Alert("Ocurrió un error al cargar el detalle del flete", TipoMensaje.MsgError) End If - CargarComprasRelacionadas() + + If ObjInv.GetFletesCompras(CveFlete, UsuarioActual.CveEmpresa) Then + GvComprasVinculadas.DataSource = ObjInv.DtResultados + End If + Else Alert("No se encontró el flete", TipoMensaje.MsgAdvertencia) End If @@ -109,6 +113,7 @@ Partial Class Compras_Fletes ObjInv.Dispose() CargaGrid() + GvComprasVinculadas.DataBind() UpRegistro.Update() End Sub @@ -428,14 +433,5 @@ Partial Class Compras_Fletes End Sub - Private Sub CargarComprasRelacionadas() - Dim ObjCompras As New ClsCompras - If ObjCompras.GetFletesCompras(CveFlete, UsuarioActual.CveEmpresa) Then - GvComprasVinculadas.DataSource = ObjCompras.DtResultados - End If - ObjCompras.Dispose() - GvComprasVinculadas.DataBind() - End Sub - End Class diff --git a/Inventarios/RecepcionAlmacen.aspx b/Inventarios/RecepcionAlmacen.aspx index e0791c45f..44dbb2eb4 100644 --- a/Inventarios/RecepcionAlmacen.aspx +++ b/Inventarios/RecepcionAlmacen.aspx @@ -79,7 +79,13 @@
- + +
+
+ +
+
+
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 2872e1c6c..53d9e0acb 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -613,6 +613,8 @@ Partial Class Inventarios_RecepcionAlmacen Case 4 LblFletes.Visible = True DivFletes.Visible = True + LblIndirectoFactura.Visible = True + DivDdlIndirectoFactura.Visible = True End Select CargaFoliosRecepcion() @@ -711,6 +713,30 @@ Partial Class Inventarios_RecepcionAlmacen DdlFletes.DataBind() DdlFletes.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub + + Protected Sub DdlFletes_SelectedIndexChanged(sender As Object, e As EventArgs) + CargaFletesFactura() + End Sub + Private Sub CargaFletesFactura() + + DdlIndirectoFactura.Items.Clear() + + Dim ObjInventarios As New ClsInventarios + If DdlFletes.SelectedValue.ToEntero > 0 Then + If ObjInventarios.GetFletesCompras(DdlFletes.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + DdlIndirectoFactura.DataSource = ObjInventarios.DtResultados + Else + Alert("Ocurrió un error al obtener las Compras pendientes de recibir del proveedor. Por favor vuelva a intentar", TipoMensaje.MsgError) + End If + End If + ObjInventarios.Dispose() + + DdlIndirectoFactura.DataBind() + DdlIndirectoFactura.Items.Insert(0, New ListItem("Todos", "-1")) + + End Sub + + #End Region #Region " CARGA POR SURTIR - GV " @@ -1119,7 +1145,7 @@ Partial Class Inventarios_RecepcionAlmacen If ObjInventario.DtResultados.Rows.Count > 0 Then CveFleteSurtir = pCveImportacion CveFleteOrdenCompra = ObjInventario.DtResultados.Rows(0)("CveOC").ToString.ToEntero - CveFleteCompra = ObjInventario.DtResultados.Rows(0)("CveCompra").ToString.ToEntero + CveFleteCompra = DdlIndirectoFactura.SelectedValue.ToEntero 'ObjInventario.DtResultados.Rows(0)("CveCompra").ToString.ToEntero CveImportacionCompra = CveFleteCompra ' se iguala para que al guardar el movimiento, se toma esta variable LbProveedor.Text = ObjInventario.DtResultados.Rows(0)("RazonSocial").ToString HLFolio.Text = ObjInventario.DtResultados.Rows(0)("Folio").ToString From f2707061ad92d21c9287fa8b08d2bb51a553220d Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 30 Sep 2020 09:47:27 -0700 Subject: [PATCH 2/5] -- que tome la cantidad -- considere almacenes mermas --- Inventarios/AjustesSeccionAlmacen.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index 8a46beef4..171409d9b 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -13,7 +13,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen End Sub Private Sub CargaCombos() - Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen in (1,14)") + Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen in (1,14,16)") DdlAlmacen.DataSource = DtAlmacenes DdlAlmacen.DataBind() @@ -121,7 +121,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen For Each Row As DataRow In resultado.Rows Dim CvePS = Row("CvePS").ToString().ToEntero() - 'Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() + Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal() Dim CveUM As Integer = Row("CveUM").ToString().ToEntero() Dim CveSeccionAlmacen As Integer = Lista(Row("CvePS").ToString().ToEntero()) 'GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero() From bd36e4617f5e83af08b1a884c4ed5c5515912ce5 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Wed, 30 Sep 2020 15:38:43 -0700 Subject: [PATCH 3/5] Carga de DdlSubProyectos --- Ventas/Clientes.aspx.vb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 1e3cdac65..4601aba6d 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1196,15 +1196,14 @@ Partial Class Clientes End Sub - Private Sub CargaSubProyectoss() - DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1).FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DdlSubProyecto.DataBind() + Private Sub CargaSubProyectoss() + + 'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1).FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - 'If UsuarioActual.CveSucursal = -1 Then - ' DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - 'Else - ' DdlSubProyecto.SelectedValue = UsuarioActual.CveSucursal.ToString - 'End If + DdlSubProyecto.DataBind() + + End Sub Private Sub CargaMetodosPago() DdlMetodoPago.DataSource = GlobalDTMetodosPago.FiltraParametros("Estatus = 'Activo'", "ClaveSAT") '.FiltraParametros("CveMetodoPago > 0 ") From 338acaf0b341c72d39c9c9c2d5dac8165a1e54ca Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 30 Sep 2020 19:42:31 -0700 Subject: [PATCH 4/5] SOPORTES, ACTIVOS FIJIS (Interno,externo), generar remision del pescadito --- .../RepPedidosDevolucionesXContrato.aspx | 6 +- .../RepPedidosDevolucionesXContrato.aspx.vb | 6 +- asmx/WSApp.asmx | 121 +++++++++++------- 3 files changed, 80 insertions(+), 53 deletions(-) diff --git a/Contratos/RepPedidosDevolucionesXContrato.aspx b/Contratos/RepPedidosDevolucionesXContrato.aspx index 834e5f7d5..335c87aea 100644 --- a/Contratos/RepPedidosDevolucionesXContrato.aspx +++ b/Contratos/RepPedidosDevolucionesXContrato.aspx @@ -140,7 +140,8 @@ - + + @@ -180,7 +181,8 @@ - + + diff --git a/Contratos/RepPedidosDevolucionesXContrato.aspx.vb b/Contratos/RepPedidosDevolucionesXContrato.aspx.vb index dcaf3497f..0c7ce6161 100644 --- a/Contratos/RepPedidosDevolucionesXContrato.aspx.vb +++ b/Contratos/RepPedidosDevolucionesXContrato.aspx.vb @@ -111,7 +111,8 @@ Partial Class Ventas_RepPedidosDevolucionesXContrato e.Row.Attributes.Add("style", "background-color:#B9B5B4 !important;") e.Row.Cells(1).Text = "" e.Row.Cells(5).Text = "" - e.Row.Cells(6).Text = "" + e.Row.Cells(6).Text = "" + e.Row.Cells(7).Text = "" Dim Texto = $"Pedido: {e.Row.DBCampo("SerieFolio")} | " Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: {e.Row.DBCampo("Folio")}") @@ -134,7 +135,8 @@ Partial Class Ventas_RepPedidosDevolucionesXContrato e.Row.Attributes.Add("style", "background-color:#B9B5B4 !important;") e.Row.Cells(1).Text = "" e.Row.Cells(5).Text = "" - e.Row.Cells(6).Text = "" + e.Row.Cells(6).Text = "" + e.Row.Cells(7).Text = "" Dim Texto = $"Devolución: {e.Row.DBCampo("SerieFolio")} | " Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: {e.Row.DBCampo("Folio")}") diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx index 7917b12e9..df4519040 100644 --- a/asmx/WSApp.asmx +++ b/asmx/WSApp.asmx @@ -43,6 +43,7 @@ Public Class WSApp ObjPS.Dispose() End Get End Property + Property GlobalDTMonedas() As DataTable Get GlobalDTMonedas = DirectCast(Application("GlobalDTMonedas"), DataTable) @@ -326,33 +327,42 @@ Public Class WSApp Application("GlobalDTCompProveedores") = value End Set End Property - Property GlobalDTProductosServicios(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional Estatus As Integer = 1, Optional CvePS As Integer = -1, Optional AplicaParaVenta As Integer = -1, Optional CveTipoPS As Integer = -1) As DataTable - Get - If CveEmpresa = -1 Then - GlobalDTProductosServicios = DirectCast(Application("GlobalDTProductosServicios"), EnumerableRowCollection(Of DataRow)).CopyToDataTable - Else - - Dim Cons = DirectCast(Application("GlobalDTProductosServicios"), EnumerableRowCollection(Of DataRow)) - Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa)) - If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion)) - If CveClasificacionCosto >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacionCosto) = CveClasificacionCosto)) - If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus)) - If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS)) - If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta)) - If CveTipoPS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = CveTipoPS)) - - 'Try, generado para cuando el resultado no tiene valores(The source contains no DataRows.), no detenga la ejecucion, no se le puso un count previo, porque el costo se duplica, al preguntar y luego ordenar y convertir a datatable - Try - GlobalDTProductosServicios = Cons.OrderBy(Function(a) a!PS).CopyToDataTable - Catch ex As Exception - GlobalDTProductosServicios = New DataTable - End Try - End If - - End Get - Set(value As DataTable) - Application("GlobalDTProductosServicios") = value - End Set + Public Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1, Optional CvePS As Integer = -1) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa) + If CveEmpresa <> -1 Then + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetPSSimplificado(CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados.AsEnumerable() + ObjPS.Dispose() + + End If + + + Dim Cons = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)) + + Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa)) + If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion)) + If PSCodigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!PSCodigo) = PSCodigo)) + If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus)) + If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta)) + If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS)) + + Try + GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable + Catch ex As Exception + GlobalDTPSSimplificado = New DataTable + End Try + + Else + GlobalDTPSSimplificado = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable + End If + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa) + Application(AppNombre) = value + End Set End Property Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable Get @@ -715,26 +725,39 @@ Public Class WSApp End If If ListaPS IsNot Nothing Then Dim Continuar As Boolean = False - Dim ObjPS As New ClsProductosServicios - For Each PS In ListaPS - If ObjPS.GetPSExistencias(PS.CvePS, -1, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm")) Then - If ObjPS.DtResultados.Rows.Count > 0 Then - Dim Existencia As Decimal = ObjPS.DtResultados.Rows(0)("Existencia").ToString().ToDecimal() - Dim CveTipoPS As Integer = ObjPS.DtResultados.Rows(0)("CveTipoPS").ToString().ToEntero() - - Continuar = (CveTipoPS = 2 AndAlso Existencia > 0) OrElse (CveTipoPS = 1) - - If Not Continuar Then - Retorno.Mensajes.Add($"El producto/servicio {ObjPS.DtResultados.Rows(0)("PS")} no tiene existencia.") - Exit For - End If - Else - Continuar = False - Retorno.Mensajes.Add("No se pudo comprobar la existencia.") - Exit For - End If - End If - Next + Dim ObjPS As New ClsProductosServicios + Try + For Each PS In ListaPS + Dim CveTipoPS As Integer = GlobalDTPSSimplificado(CveEmpresa, CvePS:=PS.CvePS).FiltroPrimeroValor("CveTipoPS").ToEntero() + If CveTipoPS > 0 Then + If CveTipoPS = 2 Then + If ObjPS.GetPSExistencias(PS.CvePS, -1, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm")) Then + If ObjPS.DtResultados.Rows.Count > 0 Then + Dim Existencia As Decimal = ObjPS.DtResultados.Rows(0)("Existencia").ToString().ToDecimal() + 'Dim CveTipoPS As Integer = ObjPS.DtResultados.Rows(0)("CveTipoPS").ToString().ToEntero() + + Continuar = Existencia > 0 + + If Not Continuar Then + Retorno.Mensajes.Add($"El producto/servicio {ObjPS.DtResultados.Rows(0)("PS")} no tiene existencia.") + Exit For + End If + Else + Continuar = False + Retorno.Mensajes.Add("No se pudo comprobar la existencia.") + Exit For + End If + End If + End If + Else + Continuar = False + Retorno.Mensajes.Add("No se pudo comprobar si es producto o servicio.") + End If + Next + Catch ex As Exception + OnError("Ocurrió un error al consultar la existencia", ex) + Continuar = False + End Try ObjPS.Dispose() If Continuar Then @@ -1374,8 +1397,8 @@ Public Class WSApp Row("Total") = (PS.Cantidad.Value * PS.Precio) Row("TotalImporte") = Math.Round(PS.Cantidad.Value * PS.Precio, 2) - - Row("SATClaveProdServ") = DrPS("SATClavePS") + + Row("SATClaveProdServ") = DrPS("SATClavePS") Row("SATClaveUM") = DrPS("SATClaveUnidadMedida") Row("EntregaDirecta") = EntregaDirecta From 6ef3ae0071f10847cbc856919c4bc76cce8d02f0 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Thu, 1 Oct 2020 13:53:06 -0700 Subject: [PATCH 5/5] Correcion Filtro Estatus Cliente --- Bancos/PolizaCheque.aspx.vb | 100 +++++++++++++++++++----------------- Ventas/CatClientes.aspx | 2 +- 2 files changed, 53 insertions(+), 49 deletions(-) diff --git a/Bancos/PolizaCheque.aspx.vb b/Bancos/PolizaCheque.aspx.vb index 56533019e..f27450da1 100644 --- a/Bancos/PolizaCheque.aspx.vb +++ b/Bancos/PolizaCheque.aspx.vb @@ -403,54 +403,58 @@ Partial Class Bancos_PolizaCheque CodigoCuenta = "" NombreCuenta = "" - If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) - - - If drr IsNot Nothing Then - IdCuenta = drt("IdCtaContable").ToString.ToEntero - CodigoCuenta = drr("CuentaFormato").ToString() - NombreCuenta = drr("Nombre").ToString() - 'Cuenta = drr("Nombre").ToString() - End If - EsComodin = 0 - - - ElseIf drt("CveConcepto").ToString = "30" Then - 'saco la clave de la cuenta bancaria seleccionada - If DdlCuenta.SelectedValue.ToEntero > 0 And drt("CveConcepto").ToString = "30" Then 'DtCuentasContables - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero))) - If drr IsNot Nothing Then - IdCuenta = drr("Id").ToString.ToEntero - CodigoCuenta = drr("CuentaFormato").ToString() - NombreCuenta = drr("Nombre").ToString() - ' Cuenta = drr("Nombre").ToString() - EsComodin = 1 - Else - - ' Rad.Checked = False - If UsuarioActual.CveEmpresa <> 126 Then - Alert("La Cuenta Bancaria no se ha vinculado a la cuenta contable", TipoMensaje.MsgAdvertencia) - GvMov.DataBind() - UPMovs.Update() - Exit Sub - End If - - End If - End If - ElseIf drt("CveConcepto").ToString.ToEntero = 135 And IdCtaFondoGarantia > 0 Then - - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCtaFondoGarantia)) - - IdCuenta = IdCtaFondoGarantia - CodigoCuenta = drr("CuentaFormato").ToString() - NombreCuenta = drr("Nombre").ToString() - 'Cuenta = drr("Nombre").ToString() - - EsComodin = 0 - - End If - + If UsuarioActual.Empresa.UsaContabilidad Then + If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) + + + If drr IsNot Nothing Then + IdCuenta = drt("IdCtaContable").ToString.ToEntero + CodigoCuenta = drr("CuentaFormato").ToString() + NombreCuenta = drr("Nombre").ToString() + 'Cuenta = drr("Nombre").ToString() + End If + EsComodin = 0 + + + ElseIf drt("CveConcepto").ToString = "30" Then + 'saco la clave de la cuenta bancaria seleccionada + If DdlCuenta.SelectedValue.ToEntero > 0 And drt("CveConcepto").ToString = "30" Then 'DtCuentasContables + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero))) + If drr IsNot Nothing Then + IdCuenta = drr("Id").ToString.ToEntero + CodigoCuenta = drr("CuentaFormato").ToString() + NombreCuenta = drr("Nombre").ToString() + ' Cuenta = drr("Nombre").ToString() + EsComodin = 1 + Else + + ' Rad.Checked = False + If UsuarioActual.CveEmpresa <> 126 Then + Alert("La Cuenta Bancaria no se ha vinculado a la cuenta contable", TipoMensaje.MsgAdvertencia) + GvMov.DataBind() + UPMovs.Update() + Exit Sub + End If + + End If + End If + ElseIf drt("CveConcepto").ToString.ToEntero = 135 And IdCtaFondoGarantia > 0 Then + + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCtaFondoGarantia)) + + IdCuenta = IdCtaFondoGarantia + CodigoCuenta = drr("CuentaFormato").ToString() + NombreCuenta = drr("Nombre").ToString() + 'Cuenta = drr("Nombre").ToString() + + EsComodin = 0 + + End If + End If + + + Dim dr As DataRow = DtMovimientos.NewRow dr("IdCuenta") = IdCuenta dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta diff --git a/Ventas/CatClientes.aspx b/Ventas/CatClientes.aspx index 08b7edadf..cb3868201 100644 --- a/Ventas/CatClientes.aspx +++ b/Ventas/CatClientes.aspx @@ -60,7 +60,7 @@ Todos Activo - Inactivo + Inactivo