From f8390fb0a4a249b0206b19bdf2aefe88b1a9f7db Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 9 Oct 2020 12:17:15 -0700 Subject: [PATCH 01/24] -- cambio de parametro de envio en cveseccion cuando es aprtado, se manda ahora -3 --- Inventarios/RecepcionAlmacen.aspx.vb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 5022d6ebb..fb0028b30 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -2637,12 +2637,8 @@ Partial Class Inventarios_RecepcionAlmacen ErrorMovInv = True Exit For End If - If CBool(Dr("AplicaSeccion")) Then - CveSeccionDestino = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDestino, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero - Else - CveSeccionDestino = -1 - End If + CveSeccionDestino = -3 'se madna este dato, para que el trigger, obtenga la seccion automaticamente If Not ObjInventario.AddMovimientoDetalle(CveMovtoEntradaActual, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionDestino, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then ErrorMovInv = True From 21d6457c994126e0a2a8cefd96f19096f4bc7d41 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 9 Oct 2020 12:17:52 -0700 Subject: [PATCH 02/24] parametro de desglosaieps --- Ventas/Ventas.aspx.vb | 180 +++++++++++++++++++++--------------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index f66c6c5ef..6b1589eed 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -14555,116 +14555,116 @@ Partial Class Ventas If UsuarioActual.TienePermisoProceso(68) AndAlso Not PSCodigoSAT.Contiene("84111506", "80141610") Then TxtPrecio.Enabled = False If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count = 0 Then - DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString()) - CambiaMoneda() + DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString()) + CambiaMoneda() + End If + + 'SUGIERE PRECIO + Dim PrecioSugerido = 0.0 + PrecioSugerido = drPS("Precio").ToString().ToDouble + + If UsuarioActual.CveEmpresa.Contiene(1) Then + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetPorcentajeProductos(CveCliente) Then + Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDouble + If PrecioAplicado > 0 Then + PrecioSugerido = PrecioAplicado + End If + End If + ObjPS.Dispose() + End If + + If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'cuando el valor es 10.- secuencia Cliente/Sucursal, 20 - sucursal/cliente + Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero + ' si es 10. primero el cliente + Dim CvePrecioListaPS As Integer + Dim PorcentajePrecio As Double = 0 + + If TipoPrecioLista = 10 Then + + CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero() + If CvePrecioListaPS <= 0 Then + + CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero() + + End If + + Else + + CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero() + If CvePrecioListaPS <= 0 Then + + CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero() + + End If + End If - 'SUGIERE PRECIO - Dim PrecioSugerido = 0.0 - PrecioSugerido = drPS("Precio").ToString().ToDouble - - If UsuarioActual.CveEmpresa.Contiene(1) Then + If CvePrecioListaPS > 0 Then Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPorcentajeProductos(CveCliente) Then - Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDouble - If PrecioAplicado > 0 Then - PrecioSugerido = PrecioAplicado - End If + If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then + PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble + PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble End If ObjPS.Dispose() End If - If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'cuando el valor es 10.- secuencia Cliente/Sucursal, 20 - sucursal/cliente - Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero - ' si es 10. primero el cliente - Dim CvePrecioListaPS As Integer - Dim PorcentajePrecio As Double = 0 - - If TipoPrecioLista = 10 Then - - CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero() - If CvePrecioListaPS <= 0 Then - - CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero() - - End If - - Else - - CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero() - If CvePrecioListaPS <= 0 Then - - CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero() - - End If - + If PrecioSugerido = 0 Then + Dim ObjInventarios As New ClsInventarios + Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) + 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal + If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1) + ObjInventarios.Dispose() + If CostoPS > 0 And PorcentajePrecio > 0 Then + PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS End If - - If CvePrecioListaPS > 0 Then - Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then - PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble - PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble - End If - ObjPS.Dispose() - End If - - If PrecioSugerido = 0 Then - Dim ObjInventarios As New ClsInventarios - Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) - 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal - If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1) - ObjInventarios.Dispose() - If CostoPS > 0 And PorcentajePrecio > 0 Then - PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS - End If - End If - CvePrecioLista = CvePrecioListaPS End If + CvePrecioLista = CvePrecioListaPS + End If - 'Dim ObjClasificaciones As New ClsClasificaciones - 'If ObjClasificaciones.GetClasificaciones() Then - ' PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal - 'End If + 'Dim ObjClasificaciones As New ClsClasificaciones + 'If ObjClasificaciones.GetClasificaciones() Then + ' PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal + 'End If - If PrecioSugerido > 0 Then - Dim PrecioBaseCosto As Decimal = 0 - PrecioBaseCosto = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=drPS("CveClasificacion").ToString().ToEntero()).FiltroPrimeroValor("PrecioBaseCosto", "").ToDecimal + If PrecioSugerido > 0 Then + Dim PrecioBaseCosto As Decimal = 0 + PrecioBaseCosto = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=drPS("CveClasificacion").ToString().ToEntero()).FiltroPrimeroValor("PrecioBaseCosto", "").ToDecimal - If PrecioBaseCosto > 0 Then - PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1) - End If - TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere + If PrecioBaseCosto > 0 Then + PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1) End If + TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere + End If - If IsNumeric(TxtCantidad.Text.Trim) Then - LblTotalPS.Text = (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.ToDouble).ToString().FormatoNumero(2) + If IsNumeric(TxtCantidad.Text.Trim) Then + LblTotalPS.Text = (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.ToDouble).ToString().FormatoNumero(2) + Else + LblTotalPS.Text = "0.00" + End If + LblPrecio1.Text = TxtPrecio.Text + UPPDescuento.Update() + + HdnIVAPS.Value = If(drPS("IVA").ToString() = "-1", ViewState("IVA"), drPS("IVA").ToString()).ToString() + HdnIVARetAPS.Value = drPS("RetIVA").ToString() + HdnAsientoContable.Value = drPS("AsientoContableVentas").ToString() + HdnCtaContable.Value = drPS("IdCtaContVentas").ToString() + HdnAplicaParaConcepto.Value = drPS("AplicaParaConcepto").ToString() + HdnCodigo.Value = drPS("Codigo").ToString() + If DdlClasificacion.SelectedIndex = 0 Then + If drPS("CveClasificacion").ToString() IsNot Nothing Then + DdlClasificacion.SelectedValueExist(drPS("CveClasificacion").ToString()) Else - LblTotalPS.Text = "0.00" - End If - LblPrecio1.Text = TxtPrecio.Text - UPPDescuento.Update() - - HdnIVAPS.Value = If(drPS("IVA").ToString() = "-1", ViewState("IVA"), drPS("IVA").ToString()).ToString() - HdnIVARetAPS.Value = drPS("RetIVA").ToString() - HdnAsientoContable.Value = drPS("AsientoContableVentas").ToString() - HdnCtaContable.Value = drPS("IdCtaContVentas").ToString() - HdnAplicaParaConcepto.Value = drPS("AplicaParaConcepto").ToString() - HdnCodigo.Value = drPS("Codigo").ToString() - If DdlClasificacion.SelectedIndex = 0 Then - If drPS("CveClasificacion").ToString() IsNot Nothing Then - DdlClasificacion.SelectedValueExist(drPS("CveClasificacion").ToString()) - Else - Alert("El Productos/Servicio no tiene asignada una Clasificación.", TipoMensaje.MsgInformacion) - End If - + Alert("El Productos/Servicio no tiene asignada una Clasificación.", TipoMensaje.MsgInformacion) End If End If - ElseIf CvePSParametro = -2 Then + End If + + ElseIf CvePSParametro = -2 Then CargaPS(DdlClasificacion.SelectedValue.ToEntero(), Ddl) End If @@ -15774,7 +15774,7 @@ Partial Class Ventas End If 'VERIFICA SI EN LA FACTURA PADRE SE DESGLOSO EL IEPS - Dim FacturaDesglosoIEPS As Boolean = ((CveDevolucion > 0 AndAlso NuevaFactura = 1) AndAlso (Me.ObjFacturaNC IsNot Nothing AndAlso Me.ObjFacturaNC.VentaDesglosaIEPS)) + Dim FacturaDesglosoIEPS As Boolean = ((CveDevolucion > 0 AndAlso NuevaFactura = 1) AndAlso (Me.ObjFacturaNC IsNot Nothing AndAlso Not Me.ObjFacturaNC.VentaDesglosaIEPS)) If Not ClienteDesglosaIEPS Then If Not RegeneraIEPS AndAlso Not FacturaDesglosoIEPS Then From 73a0720e7b56d710990a31cb4b8b74306d724dce Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 9 Oct 2020 12:18:56 -0700 Subject: [PATCH 03/24] -- cambios en aletamiento d xml codigos 01010101 --- Compras/Compras.aspx.vb | 103 ++++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 47 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 7838361a3..14c97bc31 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1333,9 +1333,9 @@ Partial Class Compras_Compras ViewState("CveFactura") = Request("CveFactura").ToEntero Dim RFC As String = CargaFactura(CveFactura) - If Not VerificarProductosSATPS() Then - Exit Sub - End If + 'If Not VerificarProductosSATPS() Then + ' Exit Sub + 'End If If RFC.Trim <> String.Empty Then DdlProveedor.Visible = False HplProveedor.Visible = True @@ -1663,14 +1663,10 @@ Partial Class Compras_Compras If Not UsuarioActual.Empresa.Funcionalidad(529) = "1" Then 'verificacion doble, si no la han cancelado, ya tiene una validaci[on para que llegue aqui - - - Dim SWatch As New Stopwatch SWatch.Start() Dim ts As New TimeSpan - Dim Valida As New ClsValidaCFDi(dr("UUID").ToString(), dr("RFCDe").ToString, dr("RFCPara").ToString(), dr("Total").ToString.ToDecimal) SWatch.Stop() @@ -1764,6 +1760,21 @@ Partial Class Compras_Compras SubTotalConceptos = Math.Round(TmpDT.SUM("Total"), 2).ToDecimal AddPS2(False) + + 'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101 + Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") + For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows + + ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", drr("PS")) + + Next + + If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then + Dim mensajeAdvertencia As String = String.Format("El comprobante contiene productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) + Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) + + End If + End If Else CargaConceptosXML(XMLDoc) @@ -1785,8 +1796,6 @@ Partial Class Compras_Compras DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) ChkAplicaNotaCredito.Enabled = False - - DdlTipoCompra.Items.Clear() DdlTipoCompra.Items.Add(New ListItem("Seleccione", "-1")) DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6")) @@ -4006,7 +4015,7 @@ Partial Class Compras_Compras If UsuarioActual.Empresa.Funcionalidad(702) = "1" Then If Not EstaAsociadoACajaChica And Not EstaAsociadoAPersonal Then If Not CompraEstaVinculadaOC Then - Alert("Debe de vincular una orden de compra para realizar esta factura") + Alert("Debe de vincular una orden de compra para registrar la factura") Exit Sub End If End If @@ -15428,21 +15437,21 @@ Partial Class Compras_Compras Dim DiferenciaPermitida = 1 Dim Cont = 0 'Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") - 'For Each gvr As GridViewRow In GvOC1.Rows - ' SubTotalGV += gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal - ' If Cont = 0 Then DdlProveedorSucursal.SelectedValueExist(gvr.DataKey("CveProveedorSucursal").ToEntero()) - ' Cont = 1 - ' If GvOC1.Columns(6).Visible Then - ' Dim SatPS As String = gvr.FCDropDownLost("DdlSATPS").SelectedText() - ' Dim NombreProducto As String = gvr.FCLabel("LbProductoServicio").Text - ' If SatPS.Contains("01010101") Then - ' ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", NombreProducto) - ' 'Dim mensajeAdvertencia As String = String.Format("Al vincular una Orden de Compra no se permiten productos con Producto/Servicio SAT igual a '{0}', revise el producto '{1}' en Orden(es) de Compra Vinculada(s)", SatPS, NombreProducto) - ' 'Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) + For Each gvr As GridViewRow In GvOC1.Rows + SubTotalGV += gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal + If Cont = 0 Then DdlProveedorSucursal.SelectedValueExist(gvr.DataKey("CveProveedorSucursal").ToEntero()) + Cont = 1 + ' If GvOC1.Columns(6).Visible Then + ' Dim SatPS As String = gvr.FCDropDownLost("DdlSATPS").SelectedText() + ' Dim NombreProducto As String = gvr.FCLabel("LbProductoServicio").Text + ' If SatPS.Contains("01010101") Then + ' ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", NombreProducto) + ' 'Dim mensajeAdvertencia As String = String.Format("Al vincular una Orden de Compra no se permiten productos con Producto/Servicio SAT igual a '{0}', revise el producto '{1}' en Orden(es) de Compra Vinculada(s)", SatPS, NombreProducto) + ' 'Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) - ' End If - ' End If - 'Next + ' End If + ' End If + Next 'If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then ' Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) ' Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) @@ -20204,35 +20213,35 @@ Partial Class Compras_Compras End Sub - Private Function VerificarProductosSATPS() As Boolean - Dim CvePSGRuposAux As New StringBuilder("") - For Each gvr As GridViewRow In GvPS.Rows - Dim CvePSIndividual As String = gvr.DataKey("CvePS") - CvePSGRuposAux.AppendFormat("{0},", CvePSIndividual) - Next + 'Private Function VerificarProductosSATPS() As Boolean + ' Dim CvePSGRuposAux As New StringBuilder("") + ' For Each gvr As GridViewRow In GvPS.Rows + ' Dim CvePSIndividual As String = gvr.DataKey("CvePS") + ' CvePSGRuposAux.AppendFormat("{0},", CvePSIndividual) + ' Next - Dim CvePSGRupos As String = Left(CvePSGRuposAux.ToString, CvePSGRuposAux.Length - 1) + ' Dim CvePSGRupos As String = Left(CvePSGRuposAux.ToString, CvePSGRuposAux.Length - 1) - Dim PSSat As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS IN ({0})", CvePSGRuposAux)) + ' Dim PSSat As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS IN ({0})", CvePSGRuposAux)) - Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") - For Each PS As GridViewRow In GvPS.Rows - Dim PSIndividual As String = PS.DataKey("PS") - Dim ClavePSSAT As String = PSSat.FiltroPrimeroValor("CveSATPS", String.Format("PS = '{0}'", PSIndividual)) - If ClavePSSAT = "46920" Then - ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", PSIndividual) - End If - Next + ' Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") + ' For Each PS As GridViewRow In GvPS.Rows + ' Dim PSIndividual As String = PS.DataKey("PS") + ' Dim ClavePSSAT As String = PSSat.FiltroPrimeroValor("CveSATPS", String.Format("PS = '{0}'", PSIndividual)) + ' If ClavePSSAT = "46920" Then + ' ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", PSIndividual) + ' End If + ' Next - If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then - Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) - Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) - Return False - End If + ' If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then + ' Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) + ' Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) + ' Return False + ' End If - Return True + ' Return True - End Function + 'End Function End Class From a3d77691fc891d45a1a65673ca5dc3b240eee65b Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 9 Oct 2020 12:19:16 -0700 Subject: [PATCH 04/24] cambio de double a decimal --- Bancos/IE.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 503feacc6..58043f9fb 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1945,7 +1945,7 @@ Partial Class Bancos_IE ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "003", .Clave = "003", .Concepto = "Viáticos (entregados al trabajador).", - .Importe = TxtImporte.Text.ToString.ToDouble + .Importe = TxtImporte.Text.ToString.ToDecimal } ) If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos From b3c210bd6203495f4a53e09cda1fe7a2c4cea4e9 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 9 Oct 2020 12:19:41 -0700 Subject: [PATCH 05/24] -- cambiod datakey a acreedor --- Compras/ReembolsosComprobaciones.aspx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compras/ReembolsosComprobaciones.aspx b/Compras/ReembolsosComprobaciones.aspx index 760c32799..02d0f7f59 100644 --- a/Compras/ReembolsosComprobaciones.aspx +++ b/Compras/ReembolsosComprobaciones.aspx @@ -292,7 +292,7 @@ + DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContAcreedor,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible,CveTipoConcepto,CveSubProyecto"> From 3faf02bc6ededd3347e4f2c2543136ec95b49d72 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 9 Oct 2020 12:20:01 -0700 Subject: [PATCH 06/24] parametro global bancos --- Sistemas/CatSesiones.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index 88f01e6ec..d37d08cc2 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -419,7 +419,7 @@ Partial Class Sistemas_CatSesiones Private Sub CargaBancosCuentas() Dim Banc As New ClsBancos - If Banc.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = Banc.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing + If Banc.GetBancosCuentasUsuarios(-1, UsuarioActual.CveEmpresa) Then Application("GlobalDTBancosCuentas") = Banc.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing Banc.Dispose() End Sub From 4654a4cafe90f2a43e80e420e56a87b84f091a27 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 9 Oct 2020 12:20:31 -0700 Subject: [PATCH 07/24] -- correccion de cleinte general, en titulo de sucursales --- Ventas/Clientes.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index de17079a9..ad9f29627 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1902,7 +1902,7 @@ Partial Class Clientes GvDireccionesEnvio.DataBind() If TxtRFC.Text = "XAXX010101000" Then - GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal").Text = "Cliente" + If GvDireccionesEnvio.HeaderRow IsNot Nothing AndAlso GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal") IsNot Nothing Then GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal").Text = "Cliente" LtlNombreSucursal.Text = "Cliente" LtlNombreSucursalTitulo.Text = "Cliente" LtlTituloSurcusalCliente.Text = "Datos del cliente" From afd7b0c7b5cc336f278b28c91e7493328ed8a8a9 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 9 Oct 2020 12:20:54 -0700 Subject: [PATCH 08/24] cambio de titulos en div equivalencias --- Inventarios/PopUpExistenciasAlmacen.aspx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx b/Inventarios/PopUpExistenciasAlmacen.aspx index eec03b6a6..2528fc984 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx +++ b/Inventarios/PopUpExistenciasAlmacen.aspx @@ -46,7 +46,7 @@
- + From 28b8e96dee2dca65c5eabcf4e3e813dbed89991a Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 9 Oct 2020 13:25:35 -0700 Subject: [PATCH 09/24] Mostrar complementos de Egresos --- Bancos/IE.aspx | 2 +- Bancos/IE.aspx.vb | 30 +++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index c5e19185d..574ec5150 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -1291,7 +1291,7 @@
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 503feacc6..663b0e342 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1945,7 +1945,7 @@ Partial Class Bancos_IE ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "003", .Clave = "003", .Concepto = "Viáticos (entregados al trabajador).", - .Importe = TxtImporte.Text.ToString.ToDouble + .Importe = TxtImporte.Text.ToString.ToDecimal } ) If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos @@ -5678,15 +5678,31 @@ Partial Class Bancos_IE Protected Sub GvComplementoPagos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvComplementoPagos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) - e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) - If e.Row.DataKey("Estatus").Contiene("1", "3") Then - e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True - Else - e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = False + If e.Row.DataKey("Tipo") = "Ing" Then + e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) + e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) + + If e.Row.DataKey("Estatus").Contiene("1", "3") Then + e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True + Else + e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = False + End If + + ElseIf e.Row.DataKey("Tipo") = "Egs" Then + + e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=Fact&EXT=xml&CveFactura={0}&RFC={1}", e.Row.DBCampo("CveFactura"), e.Row.DBCampo(("RFCde").ToString.Replace("&", "%26%"))))) + e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=Fact&EXT=pdf&CveFactura={0}&RFC={1}", e.Row.DBCampo("CveFactura"), e.Row.DBCampo("RFCde").ToString.Replace("&", "%26%")))) + + GvComplementoPagos.Columns(6).Visible = False + GvComplementoPagos.Columns(7).Visible = False + GvComplementoPagos.Columns(8).Visible = False + End If + + + End If End Sub From 6df86a6ba6fb56a2693a8eb283808bf70313d663 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 9 Oct 2020 13:53:25 -0700 Subject: [PATCH 10/24] =?UTF-8?q?Fluctuaciones=20tama=C3=B1o=20Concepto=20?= =?UTF-8?q?y=20subproyecto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bancos/FluctuacionCambiaria.aspx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 56c76c41c..93673c3d1 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -333,7 +333,7 @@
-
+
@@ -341,7 +341,7 @@
-
+
@@ -385,7 +385,7 @@
-
+
@@ -393,7 +393,7 @@
-
+
@@ -443,7 +443,7 @@
-
+
@@ -451,7 +451,7 @@
-
+
@@ -492,7 +492,7 @@
-
+
@@ -500,7 +500,7 @@
-
+
@@ -539,7 +539,7 @@
-
+
@@ -547,7 +547,7 @@
-
+
From e6e0d4cf4dd7caf46ca33802b58ab60d029585ec Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 9 Oct 2020 13:55:05 -0700 Subject: [PATCH 11/24] -- mandar la seccionalmacen = -3, en lugar de usar el global --- Inventarios/EntregaAlmacen.aspx.vb | 51 ++++++++++++++++-------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 6d6e99153..684c2edd3 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2040,12 +2040,13 @@ Partial Class Inventarios_EntregaAlmacen CantidadPendiente = 1 - If CBool(Dr("AplicaSeccion")) Then - CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr2("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero - Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr2("CveAlmacen"), Dr("CvePS"), CveSeccionAlmacen) - Else - CveSeccionAlmacen = -1 - End If + 'If CBool(Dr("AplicaSeccion")) Then + ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr2("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + ' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr2("CveAlmacen"), Dr("CvePS"), CveSeccionAlmacen) + 'Else + ' CveSeccionAlmacen = -1 + 'End If + CveSeccionAlmacen = -3 If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then ErrorMovInv = True @@ -2501,12 +2502,14 @@ Partial Class Inventarios_EntregaAlmacen TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados") Exit For End If - If CBool(Dr("AplicaSeccion")) Then - CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenOrigen, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero - Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", CveAlmacenOrigen, Dr("CvePS"), CveSeccionAlmacen) - Else - CveSeccionAlmacen = -1 - End If + 'If CBool(Dr("AplicaSeccion")) Then + ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenOrigen, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + ' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", CveAlmacenOrigen, Dr("CvePS"), CveSeccionAlmacen) + 'Else + ' CveSeccionAlmacen = -1 + 'End If + CveSeccionAlmacen = -3 + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, CveSeccionAlmacen:=CveSeccionAlmacen) Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados") @@ -2535,12 +2538,13 @@ Partial Class Inventarios_EntregaAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If CBool(Dr("AplicaSeccion")) Then - CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero - Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS"), CveSeccionAlmacen) - Else - CveSeccionAlmacen = -1 - End If + 'If CBool(Dr("AplicaSeccion")) Then + ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + ' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS"), CveSeccionAlmacen) + 'Else + ' CveSeccionAlmacen = -1 + 'End If + CveSeccionAlmacen = -3 If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, CveSeccionAlmacen:=CveSeccionAlmacen) Then ErrorMovInv = True @@ -3124,11 +3128,12 @@ Partial Class Inventarios_EntregaAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim CveSeccionAlmacen As Integer = -1 For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If CBool(Dr("AplicaSeccion")) Then - CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Almacen2, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero - Else - CveSeccionAlmacen = -1 - End If + 'If CBool(Dr("AplicaSeccion")) Then + ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Almacen2, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + 'Else + ' CveSeccionAlmacen = -1 + 'End If + CveSeccionAlmacen = -3 If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then ErrorMovInv = True From 9773f372e8b0dc6c28d636333657cba7aa40e61e Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 9 Oct 2020 14:07:08 -0700 Subject: [PATCH 12/24] -- cambio en envios de seccion -3 --- Ventas/Ventas.aspx.vb | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 6b1589eed..84a238764 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -12073,8 +12073,8 @@ Partial Class Ventas Exit For End If End If - Dim CveSeccionAlmacen As Integer = -1 - If AplicaSeccion Then CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacen, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen", "").ToEntero + 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 OcurrioError = True @@ -21609,11 +21609,12 @@ Partial Class Ventas Return False End If - If AplicaSeccion Then - CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero - Else - CveSeccionAlmacen = -1 - End If + 'If AplicaSeccion Then + ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + 'Else + ' CveSeccionAlmacen = -1 + 'End If + CveSeccionAlmacen = -3 If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, Serie:=Dr2("Serie").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then Return False @@ -21625,11 +21626,12 @@ Partial Class Ventas Return False End If - If AplicaSeccion Then - CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero - Else - CveSeccionAlmacen = -1 - End If + 'If AplicaSeccion Then + ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + 'Else + ' CveSeccionAlmacen = -1 + 'End If + CveSeccionAlmacen = -3 If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, Cantidad, CveUnidad, CveProducto, 0, -1, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then Return False From c1d3268b5391befd618f2bc8f7f708c3164b3cab Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 9 Oct 2020 18:56:19 -0700 Subject: [PATCH 13/24] =?UTF-8?q?se=20agreg=C3=B3=20una=20validaci=C3=B3n?= =?UTF-8?q?=20para=20agregar=20el=20numero=20de=20reembolso?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx | 11 ++++++++-- Compras/Compras.aspx.vb | 47 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 8c1422c57..5f3084c38 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -3732,11 +3732,18 @@
- +

+
+ + + +
+ +
@@ -4142,7 +4149,7 @@
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 47d1eb77c..579c5f9a5 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -3946,6 +3946,15 @@ Partial Class Compras_Compras Dim EstatusCredito As Integer = 0 Dim CveSubProyecto As Integer = 0 'Credito Multiple + If RBLPago.SelectedValue.ToEntero = 2 Then + If RBLContado.SelectedValue.ToEntero = 6 Or RBLContado.SelectedValue.ToEntero = 2 Then + If Not TxtRembolsoNumero.Text.Length > 0 Then + Alert("Falta especificar un número de reembolso", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + End If + If RBLPago.SelectedValue.ToEntero = 4 Then Dim DifCreCompra As Decimal = 0 @@ -12827,7 +12836,6 @@ Partial Class Compras_Compras Select Case RBLPago.SelectedValue Case "1" 'Credito PnlContado.Visible = False - If Not UsuarioActual.Empresa.UsaAC Then TxtNumeroReembolso.Text = "" tdNumeroReembolso.Visible = False @@ -12836,7 +12844,6 @@ Partial Class Compras_Compras romCreditosTabla.Visible = False Case "2" 'Contado PnlContado.Visible = True - TxtNumeroReembolso.Text = "" tdNumeroReembolso.Visible = False @@ -12870,7 +12877,6 @@ Partial Class Compras_Compras Case "3" 'Reembolso/Comprobacion PnlContado.Visible = True - ''AGARRA VALORES DE SESSION PARA REEMBOLSO -- SI YA ESTA REGISTRADA LA COMPRA IGNORA DATOS DE REEMBOLSO If Not CveCompra > 0 Then If UsuarioActual.Sesion("Comp-NumeroReembolso") <> Nothing AndAlso UsuarioActual.Sesion("Comp-NumeroReembolso").ToString <> "" Then @@ -12998,26 +13004,61 @@ Partial Class Compras_Compras Case "1" ' Bancos PnlContadoBancos.Visible = True TxtDocumentoImporte.Text = (TxtTotal.Text.ToDecimal - LblAmortizacion.Text.ToDecimal).FormatoNumero + ChkCreditoMultiple.Visible = False + DivReembolsoModal.Visible = False + RfvTxtRembolsoModal.Enabled = False + TxtRembolsoModal.Text = "" + TxtRembolsoNumero.Text = "" Case "2" ' F y E PnlContadoFyE.Visible = True CargaFuncionariosEmpleados() + ChkCreditoMultiple.Visible = False + DivReembolsoModal.Visible = True + RfvTxtRembolsoModal.Enabled = True + TxtRembolsoNumero.Text = "" + TxtRembolsoModal.Text = "" Case "3" ' Creditos PnlContadoCreditos.Visible = True + ChkCreditoMultiple.Visible = True CargaCreditos() + DivReembolsoModal.Visible = False + RfvTxtRembolsoModal.Enabled = False + TxtRembolsoModal.Text = "" + TxtRembolsoNumero.Text = "" Case "4" ' Deudores PnlContadoDeudores.Visible = True CargaDeudores() + ChkCreditoMultiple.Visible = False + DivReembolsoModal.Visible = False + RfvTxtRembolsoModal.Enabled = False + TxtRembolsoModal.Text = "" + TxtRembolsoNumero.Text = "" Case "5" ' ACREEDORES PnlContadoAcreedores.Visible = True + ChkCreditoMultiple.Visible = True CargaAcreedores() + DivReembolsoModal.Visible = False + RfvTxtRembolsoModal.Enabled = False + TxtRembolsoModal.Text = "" + TxtRembolsoNumero.Text = "" Case "6" ' Caja Chica PnlContadoCajaChica.Visible = True TxtDocumentoImporteCaja.Text = (TxtTotal.Text.ToDecimal - LblAmortizacion.Text.ToDecimal).FormatoNumero + ChkCreditoMultiple.Visible = False + DivReembolsoModal.Visible = True + RfvTxtRembolsoModal.Enabled = True + TxtRembolsoModal.Text = "" + TxtRembolsoNumero.Text = "" End Select UpContado.Update() End Sub + Protected Sub BtnContado_Click(sender As Object, e As EventArgs) + TxtRembolsoNumero.Text = TxtRembolsoModal.Text + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal")) + End Sub + Protected Sub RblRembolso_SelectedIndexChanged(sender As Object, e As EventArgs) TrRembolsoCajaChica.Visible = False TrRembolsoPersonal.Visible = False From 7eb0aa960bdec6c265e26bcc6309ef7b12c028d8 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Sat, 10 Oct 2020 11:58:01 -0700 Subject: [PATCH 14/24] quitar funcionalidad 157 --- App_Code/ClsPaginas.vb | 3 +++ Compras/Compras.aspx.vb | 13 ++----------- Inventarios/RecepcionAlmacen.aspx.vb | 10 ++++------ 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 8cef487fc..a3d763c62 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4386,6 +4386,9 @@ Public Class ClsPaginas PaginaDict.Add("/Finanzas/RazonesFinancierasCuentas.aspx".ToUpper(), -1) PaginaDict.Add("/Finanzas/RepRotacionCartera.aspx".ToUpper(), 649) PaginaDict.Add("/Finanzas/RepRotacionCarteraDetalle.aspx".ToUpper(), 649) + + + PaginaDict.Add("/Finanzas/RepBalanceGeneralHorizontal2.aspx".ToUpper(), -1) #End Region #Region "Flotillas" diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 47d1eb77c..3bc7be0e9 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1266,10 +1266,6 @@ Partial Class Compras_Compras TieneOC = False CveMoneda = -1 - '[IPP] Eliminar 22Junio2018 - 'If UsuarioActual.Empresa.UsaInventarios Then - ' TabAlmacen.Enabled = Not UsuarioActual.Empresa.Funcionalidad(153).ToEntero > 0 - 'End If ImgAnticiposPendientes.Attributes.Add("OnClick", "MuestraAnticipos();") 'ImgCerrar.Attributes.Add("OnClick", "$('#DivAnticipos').hide(200);") @@ -15126,12 +15122,7 @@ Partial Class Compras_Compras Dr("RetISRTC") = Dr("RetISR") Dr("TotalTC") = Dr("ImporteAjustadoDescuento") - '[IPP] - JAMEntregaAdelantado | AJUSTE DE CANITDAD POR RECIBIR EN BASE A SALDOS DE INV-COMPRAS - 'If UsuarioActual.CveUsuario = 100 Then - 'If Dr("CveTipoPS").ToString.ToEntero = 2 And UsuarioActual.Empresa.Funcionalidad(153).ToEntero > 0 Then - ' Dr("CantidadDisponible") = If(Dr("CantidadDisponible").ToString.ToDouble > Dr("CantidadPendienteVincular").ToString.ToDouble, Dr("CantidadPendienteVincular"), Dr("CantidadDisponible")) - 'End If - 'End If + Next 'DESCRIPCION DE OC CUANDO NO ES COMPRA REGISTRADA @@ -15163,7 +15154,7 @@ Partial Class Compras_Compras 'SI PUEDE RECIBIR POR OC Y COMPRA If UsuarioActual.CveEmpresa.Contiene(119) Then - If UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 And Not UsuarioActual.Empresa.Funcionalidad(153).ToEntero > 0 Then + If UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Then Select Case DdlOCVinculaInv.SelectedValue.ToEntero Case 176 DTOCGV = DTOCGV.FiltraParametros("((EstatusInventario IN (3,5) AND CveTipoPS = 2) OR CveTipoPS = 1)") diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index e5b39aeef..544cb3ba9 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -535,11 +535,9 @@ Partial Class Inventarios_RecepcionAlmacen If UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Then DdlTipo.Items.Insert(1, New ListItem("OC", "2")) - If UsuarioActual.Empresa.Funcionalidad(153).ToEntero > 0 Then - DdlTipo.Items.RemoveAt(0) - DdlTipo.SelectedValue = "2" - ModalidadRecepcion() - End If + + + End If If UsuarioActual.Empresa.Funcionalidad(155).ToEntero > 0 Then @@ -3754,7 +3752,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim ObjOC As New ClsOC If ObjOC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, -1, -1, FolioOC, -1, -1, UsuarioActual.CveEmpresa, -1) Then 'If ObjOC.DtResultados.FiltraParametros("TipoTermino = 3").Rows.Count = 1 Then - If ObjOC.DtResultados.Rows(0)("TieneCompra").ToString.ToEntero > 0 And UsuarioActual.Empresa.Funcionalidad(153).ToEntero > 0 Then 'Or UsuarioActual.Empresa.Funcionalidad(153).ToEntero > 0 + If ObjOC.DtResultados.Rows(0)("TieneCompra").ToString.ToEntero > 0 Then 'Or UsuarioActual.Empresa.Funcionalidad(153).ToEntero > 0 MensajeCompra = String.Format("{1}", ObjOC.DtResultados.Rows(0)("CveCompraVinculada").ToString, ObjOC.DtResultados.Rows(0)("SerieFolioCompraVinculada").ToString) Else CveOC = ObjOC.DtResultados.FiltroPrimeroValor("CveOrdenCompra").ToString.ToEntero From e58a2fd8d63806fd8661ec4969d2d77149509863 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Sat, 10 Oct 2020 12:01:35 -0700 Subject: [PATCH 15/24] Correcion codigo mal comentado en compras --- Compras/Compras.aspx.vb | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 3ca861b3e..e8820574f 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -19444,7 +19444,7 @@ Partial Class Compras_Compras Case 237 Select Case FleteImportacionOpcion Case 1 - If Not ObjInventario.AddFletescompras(CveFlete, CveCompra) Then + 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 @@ -20252,24 +20252,24 @@ Partial Class Compras_Compras ' CvePSGRuposAux.AppendFormat("{0},", CvePSIndividual) ' Next - Dim CvePSGRupos As String = Left(CvePSGRuposAux.ToString, CvePSGRuposAux.Length - 1) + 'Dim CvePSGRupos As String = Left(CvePSGRuposAux.ToString, CvePSGRuposAux.Length - 1) - Dim PSSat As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS IN ({0})", CvePSGRuposAux)) + 'Dim PSSat As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS IN ({0})", CvePSGRuposAux)) - Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") - For Each PS As GridViewRow In GvPS.Rows - Dim PSIndividual As String = PS.DataKey("PS") - Dim ClavePSSAT As String = PSSat.FiltroPrimeroValor("CveSATPS", String.Format("PS = '{0}'", PSIndividual)) - If ClavePSSAT = "46920" Then - ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", PSIndividual) - End If - Next + 'Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") + 'For Each PS As GridViewRow In GvPS.Rows + 'Dim PSIndividual As String = PS.DataKey("PS") + 'Dim ClavePSSAT As String = PSSat.FiltroPrimeroValor("CveSATPS", String.Format("PS = '{0}'", PSIndividual)) + 'If ClavePSSAT = "46920" Then + ' ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", PSIndividual) + ' End If + 'Next - If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then - Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) - Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) - Return False - End If + 'If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then + 'Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) + ' Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) + ' Return False + 'End If ' Return True From 3756303dbd77f71ec1f1e276d8aace8b6d4d7cd5 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Sat, 10 Oct 2020 17:37:49 -0700 Subject: [PATCH 16/24] Compras pagos conciliados al cancelar compra --- App_Code/ClsCompras.vb | 24 ++++++++++++++++++++++++ Compras/Compras.aspx.vb | 29 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index cd1106378..a32033f8e 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -2445,6 +2445,30 @@ Public Class ClsCompras Return Retorno End Function + Public Function GetComprasPagosConciliados(CveCompra As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ComprasPagosConciliadosGet") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los de pagos de compra", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + + + + Public Function RemoveComplementoPagoDesVincular(CveFactura As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_CompraComplementoDesVincular") diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index e8820574f..341e1a52a 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -14637,6 +14637,35 @@ Partial Class Compras_Compras Protected Sub BtnCancelarCompra2_Click(sender As Object, e As EventArgs) RegistraScript("$('#DivCancelarCompra').modal('hide');") + + Dim ObjComprasComprobacion As New ClsCompras + + + If ObjComprasComprobacion.GetComprasPagosConciliados(CveCompra, UsuarioActual.CveEmpresa) Then + + Dim TienePagosConciliados As Boolean = False + + If ObjComprasComprobacion.DtResultados.Rows.Count > 0 Then + TienePagosConciliados = True + Dim PagosConciliados As New StringBuilder + + For Each Drow As DataRow In ObjComprasComprobacion.DtResultados.Rows + PagosConciliados.AppendLine($"{Drow("Folio").ToString}
") + Next + + + Alert($"La compra no se puede cancelar, tiene pagos conciliados:
{PagosConciliados.ToString}", TipoMensaje.MsgAdvertencia) + End If + + If TienePagosConciliados Then + ObjComprasComprobacion.Dispose() + Exit Sub + End If + + + End If + ObjComprasComprobacion.Dispose() + Dim ObjAC As ClsContPAQi = Nothing If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then ObjAC = New ClsContPAQi(UsuarioActual.Empresa) From c92fb2fdd791cb072775ef79b121c5121a69cf29 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 10 Oct 2020 17:50:41 -0700 Subject: [PATCH 17/24] -- cambios en contabilidad --- App_Code/ClsCompras.vb | 6 +- App_Code/ClsContabilidad.vb | 401 ++++++++++++++++++------------------ App_Code/Modelos.vb | 4 +- 3 files changed, 208 insertions(+), 203 deletions(-) diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index cd1106378..d2fef34d1 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -2183,13 +2183,14 @@ Public Class ClsCompras #Region " ESTATUS ALMACEN " - Public Function UpdateEstatusAlmacen(CveCompra As Integer, ValorEstatus As Integer) As Boolean + Public Function UpdateEstatusAlmacen(CveCompra As Integer, ValorEstatus As Integer, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_ComprasEstatusAlmacenUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveCompra", SqlDbType.Int).Value = CveCompra .Add("@Estatus", SqlDbType.Int).Value = ValorEstatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With Try @@ -2201,13 +2202,14 @@ Public Class ClsCompras Return Retorno End Function - Public Function UpdateEstatusAlmacenDetalle(CveCompraDetalle As Integer, ValorEstatus As Integer) As Boolean + Public Function UpdateEstatusAlmacenDetalle(CveCompraDetalle As Integer, ValorEstatus As Integer, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_ComprasDetalleEstatusAlmacenUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle .Add("@Estatus", SqlDbType.Int).Value = ValorEstatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With Try diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 4085f9b24..c175d592d 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -153,22 +153,22 @@ Public Class ClsContabilidad - Public Function CuentasContablesSigGet(cveEmpresa As Int32) As Boolean - Dim retorno As Boolean = False - DataAdapter("PA_Conta_CuentasContablesSigGet", CommandType.StoredProcedure) - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa - End With - Try - SqlAdapter.Fill(Data) - retorno = True - Catch ex1 As SqlException - OnError("Ocurrió un error al obtener las Cuentas Contables", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Catch ex As Exception - OnError("Ocurrió un error al obtener las Cuentas Contables", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return retorno - End Function + 'Public Function CuentasContablesSigGet(cveEmpresa As Int32) As Boolean + ' Dim retorno As Boolean = False + ' DataAdapter("PA_Conta_CuentasContablesSigGet", CommandType.StoredProcedure) + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + ' End With + ' Try + ' SqlAdapter.Fill(Data) + ' retorno = True + ' Catch ex1 As SqlException + ' OnError("Ocurrió un error al obtener las Cuentas Contables", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener las Cuentas Contables", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try + ' Return retorno + 'End Function #Region " C O N T A B I L I D A D - P R E P O L I Z A" Public Function ObtenerTipoPoliza(Valor1 As String, Valor2 As String, CveEmpresa As Integer) As Integer @@ -1118,8 +1118,9 @@ Public Class ClsContabilidad Public Function ContabilizarPrePoliza(CvePrePoliza As Integer, CveUsuario As Integer, Empresa As Empresa, Optional Fecha As Date = MinFecha, Optional Concepto As String = "", Optional ObjConta As ClsContPAQi = Nothing, Optional pIDPoliza As Integer = -1) As Boolean - + Dim StrLog As New StringBuilder Dim Retorno As Boolean = False + StrLog.AppendFormat("CvePrep:{0} - Inicio", CvePrePoliza) If Empresa.TipoContabilizacion = 1 Then ' contabilidad en SIG @@ -1396,6 +1397,8 @@ Public Class ClsContabilidad If Not ContaCompartida Then ObjConta.Dispose() End If + StrLog.AppendFormat(" - Fin") + StrLog.ToString.GuardaLogAD("LogContabilidazacion") Return Retorno End Function @@ -4645,25 +4648,25 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function GetSaldoCuenta(IdCuenta As Integer, TipoMovto As Integer, Ejercicio As Integer) As Boolean - Dim Retorno As Boolean + 'Public Function GetSaldoCuenta(IdCuenta As Integer, TipoMovto As Integer, Ejercicio As Integer) As Boolean + ' Dim Retorno As Boolean - If TipoMovto = 0 Then - DataAdapter(String.Format("SELECT SUM(CASE WHEN TipoMovto = 1 THEN -1 ELSE 1 END * Importe) AS Saldo from Conta_PolizasDetalle CD inner join Conta_Polizas CP on CP.CvePoliza=CD.CvePoliza and year(CP.Fecha)={1} WHERE CveCuenta = {0}", IdCuenta, Ejercicio), CommandType.Text) - Else - DataAdapter(String.Format("SELECT SUM(CASE WHEN TipoMovto = 0 THEN -1 ELSE 1 END * Importe) AS Saldo from Conta_PolizasDetalle CD inner join Conta_Polizas CP on CP.CvePoliza=CD.CvePoliza and year(CP.Fecha)={1} WHERE CveCuenta = {0} ", IdCuenta, Ejercicio), CommandType.Text) - End If + ' If TipoMovto = 0 Then + ' DataAdapter(String.Format("SELECT SUM(CASE WHEN TipoMovto = 1 THEN -1 ELSE 1 END * Importe) AS Saldo from Conta_PolizasDetalle CD inner join Conta_Polizas CP on CP.CvePoliza=CD.CvePoliza and year(CP.Fecha)={1} WHERE CveCuenta = {0}", IdCuenta, Ejercicio), CommandType.Text) + ' Else + ' DataAdapter(String.Format("SELECT SUM(CASE WHEN TipoMovto = 0 THEN -1 ELSE 1 END * Importe) AS Saldo from Conta_PolizasDetalle CD inner join Conta_Polizas CP on CP.CvePoliza=CD.CvePoliza and year(CP.Fecha)={1} WHERE CveCuenta = {0} ", IdCuenta, Ejercicio), CommandType.Text) + ' End If - Try - SqlAdapter.Fill(Data) - 'Retorno = Math.Round(SqlCommand.ExecuteScalar.ToString.ToDouble, 2) - Retorno = True - Catch ex As Exception - Me.OnError("Ocurrió un error al obtener eL saldo de la cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' 'Retorno = Math.Round(SqlCommand.ExecuteScalar.ToString.ToDouble, 2) + ' Retorno = True + ' Catch ex As Exception + ' Me.OnError("Ocurrió un error al obtener eL saldo de la cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function + ' Return Retorno + 'End Function Public Function GetRepPresupuestosEgresosSaldos(Ejercicio As Integer, Fecha As Date, Capitulo As String, CveClasificacion As Integer, CveFuenteFinanciamiento As Integer, CveProgramaOperativo As Integer, CveUnidadAdministrativa As Integer, CveTipoGasto As Integer, Gpo As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_PresupuestosEgresosSaldosRep") @@ -4742,138 +4745,138 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function Conta_ContabilizaPrePoliza(CvePrepoliza As Integer, Ejercicio As Integer) As Boolean - Dim Retorno = False + 'Public Function Conta_ContabilizaPrePoliza(CvePrepoliza As Integer, Ejercicio As Integer) As Boolean + ' Dim Retorno = False - DataAdapter("PA_Conta_ContabilizaPrepolizas") + ' DataAdapter("PA_Conta_ContabilizaPrepolizas") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePrepoliza", SqlDbType.Int).Value = CvePrepoliza - .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio - .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output - End With + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CvePrepoliza", SqlDbType.Int).Value = CvePrepoliza + ' .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio + ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output + ' End With - Try - SqlAdapter.Fill(Data) - If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then - Retorno = True - Else - Retorno = False - End If - Catch ex As Exception - Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then + ' Retorno = True + ' Else + ' Retorno = False + ' End If + ' Catch ex As Exception + ' Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function - Public Function Conta_CompactaPrePoliza(CvePrepoliza As Integer) As Boolean - Dim Retorno = False + ' Return Retorno + 'End Function + 'Public Function Conta_CompactaPrePoliza(CvePrepoliza As Integer) As Boolean + ' Dim Retorno = False - DataAdapter("PA_Comp_CompactaPrepoliza") + ' DataAdapter("PA_Comp_CompactaPrepoliza") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrepoliza - .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output - End With + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrepoliza + ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output + ' End With - Try - SqlAdapter.Fill(Data) - If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then - Retorno = True - Else - Retorno = False - End If - Catch ex As Exception - Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then + ' Retorno = True + ' Else + ' Retorno = False + ' End If + ' Catch ex As Exception + ' Me.OnError("Ocurrió un error al contabilizar la prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function - Public Function Conta_GeneraPptarias(CveCompra As Integer) As Boolean - Dim Retorno = False + ' Return Retorno + 'End Function + 'Public Function Conta_GeneraPptarias(CveCompra As Integer) As Boolean + ' Dim Retorno = False - DataAdapter("PA_Conta_GeneraPptarias") + ' DataAdapter("PA_Conta_GeneraPptarias") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output - End With + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output + ' End With - Try - SqlAdapter.Fill(Data) - If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then - Retorno = True - Else - Retorno = False - End If - Catch ex As Exception - Me.OnError("Ocurrió un error al Generar las Cuentas Presupuestarias", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero = 0 Then + ' Retorno = True + ' Else + ' Retorno = False + ' End If + ' Catch ex As Exception + ' Me.OnError("Ocurrió un error al Generar las Cuentas Presupuestarias", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function + ' Return Retorno + 'End Function - Public Function AddConta_Poliza(CveTipoPoliza As Integer, CveEjercicio As Integer, Folio As Integer, FechaPoliza As Date, Concepto As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer - Dim Retorno As Integer = 0 + 'Public Function AddConta_Poliza(CveTipoPoliza As Integer, CveEjercicio As Integer, Folio As Integer, FechaPoliza As Date, Concepto As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer + ' Dim Retorno As Integer = 0 - DataAdapter("PA_Add_Conta_Polizas") + ' DataAdapter("PA_Add_Conta_Polizas") - With SqlAdapter.SelectCommand.Parameters - .Add("@Folio", SqlDbType.Int).Value = Folio - ' .Add("@CveTipoPoliza", SqlDbType.Int).Value = CveTipoPoliza - .Add("@Ejercicio", SqlDbType.Int).Value = CveEjercicio - .Add("@Concepto", SqlDbType.VarChar).Value = Concepto - .Add("@FechaPoliza", SqlDbType.DateTime).Value = FechaPoliza - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CvePoliza", SqlDbType.Int).Direction = ParameterDirection.Output - End With - Try - SqlAdapter.Fill(Data) - Retorno = SqlAdapter.SelectCommand.Parameters("@CvePoliza").Value.ToString.ToEntero - Catch ex As Exception - OnError("Ocurrió un error al agregar la poliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@Folio", SqlDbType.Int).Value = Folio + ' ' .Add("@CveTipoPoliza", SqlDbType.Int).Value = CveTipoPoliza + ' .Add("@Ejercicio", SqlDbType.Int).Value = CveEjercicio + ' .Add("@Concepto", SqlDbType.VarChar).Value = Concepto + ' .Add("@FechaPoliza", SqlDbType.DateTime).Value = FechaPoliza + ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' .Add("@CvePoliza", SqlDbType.Int).Direction = ParameterDirection.Output + ' End With + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = SqlAdapter.SelectCommand.Parameters("@CvePoliza").Value.ToString.ToEntero + ' Catch ex As Exception + ' OnError("Ocurrió un error al agregar la poliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function - Public Function AddConta_PolizaDetalle(CvePoliza As Integer, CveCuenta As Integer, TipoMovto As Boolean, Importe As Double, Referencia As String, - Concepto As String, FechaMovto As Date, CveUsuario As Integer, Optional ImporteMonedaExtranjera As Double = 0) As Boolean - Dim Retorno As Boolean = False + ' Return Retorno + 'End Function + 'Public Function AddConta_PolizaDetalle(CvePoliza As Integer, CveCuenta As Integer, TipoMovto As Boolean, Importe As Double, Referencia As String, + ' Concepto As String, FechaMovto As Date, CveUsuario As Integer, Optional ImporteMonedaExtranjera As Double = 0) As Boolean + ' Dim Retorno As Boolean = False - If CvePoliza <= 0 Or CveCuenta <= 0 Then - Return False - End If + ' If CvePoliza <= 0 Or CveCuenta <= 0 Then + ' Return False + ' End If - DataAdapter("PA_Add_Conta_PolizasDetalles") - 'DataAdapter("PA_Conta_PolizasDetalleAdd") + ' DataAdapter("PA_Add_Conta_PolizasDetalles") + ' 'DataAdapter("PA_Conta_PolizasDetalleAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePoliza", SqlDbType.Int).Value = CvePoliza - .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta - .Add("@TipoMovto", SqlDbType.Int).Value = TipoMovto - .Add("@Total", SqlDbType.Money).Value = Math.Round(Importe, 2) - .Add("@ImporteME", SqlDbType.Money).Value = ImporteMonedaExtranjera - .Add("@Referencia", SqlDbType.VarChar).Value = Referencia - .Add("@Concepto", SqlDbType.VarChar).Value = Concepto - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output - End With + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CvePoliza", SqlDbType.Int).Value = CvePoliza + ' .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta + ' .Add("@TipoMovto", SqlDbType.Int).Value = TipoMovto + ' .Add("@Total", SqlDbType.Money).Value = Math.Round(Importe, 2) + ' .Add("@ImporteME", SqlDbType.Money).Value = ImporteMonedaExtranjera + ' .Add("@Referencia", SqlDbType.VarChar).Value = Referencia + ' .Add("@Concepto", SqlDbType.VarChar).Value = Concepto + ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + ' .Add("@Error", SqlDbType.Int).Direction = ParameterDirection.Output + ' End With - Try - SqlAdapter.Fill(Data) - If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero <> 0 Then - Retorno = False - Else - Retorno = True - End If - Catch ex As Exception - OnError("Ocurrió un error al agregar el movimiento en la póliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' If SqlAdapter.SelectCommand.Parameters("@Error").Value.ToString.ToEntero <> 0 Then + ' Retorno = False + ' Else + ' Retorno = True + ' End If + ' Catch ex As Exception + ' OnError("Ocurrió un error al agregar el movimiento en la póliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function + ' Return Retorno + 'End Function Public Function GetSaldoCuentaAC(TipoMovto As Integer, CveCuentaAprobado As Integer, CveCuentaDevengado As Integer, Ejercicio As Integer) As Decimal Dim Retorno As Decimal DataAdapter("PA_Conta_CalculaSaldo") @@ -4895,51 +4898,51 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function GetSegmentosNegocio(Id As Integer, Codigo As String) As Boolean - Dim Retorno As Boolean = False - Dim StrSQl = New StringBuilder + 'Public Function GetSegmentosNegocio(Id As Integer, Codigo As String) As Boolean + ' Dim Retorno As Boolean = False + ' Dim StrSQl = New StringBuilder - StrSQl.Clear() - StrSQl.Append(" SELECT Id, RTRIM (LTRIM (Codigo)) AS Codigo, Nombre, '' AS CveProyecto, '' AS CveSubProyecto ") - StrSQl.Append(" FROM SegmentosNegocio ") - StrSQl.Append(" WHERE (@Id = -1 OR Id = @Id) ") - StrSQl.Append(" AND (@Codigo = '-1' OR Codigo = @Codigo) ") + ' StrSQl.Clear() + ' StrSQl.Append(" SELECT Id, RTRIM (LTRIM (Codigo)) AS Codigo, Nombre, '' AS CveProyecto, '' AS CveSubProyecto ") + ' StrSQl.Append(" FROM SegmentosNegocio ") + ' StrSQl.Append(" WHERE (@Id = -1 OR Id = @Id) ") + ' StrSQl.Append(" AND (@Codigo = '-1' OR Codigo = @Codigo) ") - DataAdapter(StrSQl.ToString, CommandType.Text) - SqlAdapter.SelectCommand.Parameters.Add("@Id", SqlDbType.Int).Value = Id - SqlAdapter.SelectCommand.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo + ' DataAdapter(StrSQl.ToString, CommandType.Text) + ' SqlAdapter.SelectCommand.Parameters.Add("@Id", SqlDbType.Int).Value = Id + ' SqlAdapter.SelectCommand.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex) + ' End Try - Return Retorno - End Function + ' Return Retorno + 'End Function - Public Function GetSubProyectos(CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - Dim StrSQl = New StringBuilder + 'Public Function GetSubProyectos(CveEmpresa As Integer) As Boolean + ' Dim Retorno As Boolean = False + ' Dim StrSQl = New StringBuilder - DataAdapter("PA_Comp_Compras_Pptarias") + ' DataAdapter("PA_Comp_Compras_Pptarias") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' End With - SqlAdapter.Fill(Data) - Retorno = True - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex) - End Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al consultar los Segmentos de Negocio.", ex) + ' End Try - Return Retorno - End Function + ' Return Retorno + 'End Function Public Function GetNumeroPoliza(CveTipoPoliza As Integer, Tipo As String, Fecha As DateTime, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -4962,29 +4965,29 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function Compras_Pptarias(CveCompra As Integer, Importe As Decimal, CveConceptoContable As Integer) As Boolean + 'Public Function Compras_Pptarias(CveCompra As Integer, Importe As Decimal, CveConceptoContable As Integer) As Boolean - Dim Retorno As Boolean = False + ' Dim Retorno As Boolean = False - DataAdapter("PA_Comp_Compras_Pptarias") + ' DataAdapter("PA_Comp_Compras_Pptarias") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@Importe", SqlDbType.Decimal).Value = Importe - .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable - End With + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + ' .Add("@Importe", SqlDbType.Decimal).Value = Importe + ' .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable + ' End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex1 As SqlException - OnError("Ocurrió un error al obtener las Plantillas", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Catch ex As Exception - OnError("Ocurrió un error al obtener las Plantillas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex1 As SqlException + ' OnError("Ocurrió un error al obtener las Plantillas", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener las Plantillas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try - Return Retorno - End Function + ' Return Retorno + 'End Function #End Region #Region "FIS IMPUESTOS" @@ -5878,7 +5881,7 @@ Public Class ClsContabilidad End Function Public Function GetPrePolizasImpresion(CveEmpresa As Integer, FechaI As String, FechaF As String, Optional CveTipoPoliza As Integer = -1, Optional FolioI As Integer = -1, - Optional FolioF As Integer = -1, Optional CveUsuario As Integer = -1, Optional IdSegNegocio As Integer = -1, + Optional FolioF As Integer = -1, Optional CveUsuario As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveCuenta As Integer = -1, Optional CvePlantillaPoliza As Integer = -1, Optional CveProveedor As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -5892,7 +5895,7 @@ Public Class ClsContabilidad .Add("@FolioI", SqlDbType.Int).Value = FolioI .Add("@FolioF", SqlDbType.Int).Value = FolioF .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@IdSegNegocio", SqlDbType.Int).Value = IdSegNegocio + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@CvePlantillaPoliza", SqlDbType.Int).Value = CvePlantillaPoliza .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 6df233d4e..deb17d739 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4631,7 +4631,7 @@ Namespace Modelos Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero - Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero + 'Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero Dim IdCtaContable As Integer = 0 Dim CveCuenta As Integer = 0 If tmpCostos.Rows.Count > 0 Then @@ -4668,7 +4668,7 @@ Namespace Modelos cont += 1 Next - If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, -1 * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=-1 * TotalCosto, CveCuenta:=CveCuentaAlmacen) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, -1 * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=-1 * TotalCosto) Then ErrorCancelar = True End If From 1fb4c59208774022294f1b28ca60ebbdea26a9d9 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 10 Oct 2020 17:52:38 -0700 Subject: [PATCH 18/24] -- parametro de usuarios, en asolicitar devolucion --- Compras/Compras.aspx.vb | 82 ++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index b8f36c0f5..762ed68de 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -3992,23 +3992,23 @@ Partial Class Compras_Compras End If End If - 'VERIFICA SI LOS PRODUCTOS/SERVICIOS EXISTEN EN EL CATALOGO DEL SAT - If UsuarioActual.CveEmpresa = 72 Then + ''VERIFICA SI LOS PRODUCTOS/SERVICIOS EXISTEN EN EL CATALOGO DEL SAT + 'If UsuarioActual.CveEmpresa = 72 Then - Dim DtNoEncontrados As DataTable = TmpDT.FiltraParametros("ISNULL(CveSATPS,0) = 46920 ") - If DtNoEncontrados IsNot Nothing AndAlso DtNoEncontrados.Rows.Count > 0 Then - Dim StrNoEncontrados As New StringBuilder - StrNoEncontrados.Append("Los siguientes productos no tiene asignado la clave Producto SAT o Unidad Medida SAT

") - For Each drt As DataRow In DtNoEncontrados.Rows - StrNoEncontrados.AppendFormat("{0}
", drt("CodigoPS")) - Next - Alert(StrNoEncontrados.ToString(), TipoMensaje.MsgAdvertencia) - DtNoEncontrados.Dispose() - StrNoEncontrados.Clear() - Exit Sub - End If - DtNoEncontrados.Dispose() - End If + ' Dim DtNoEncontrados As DataTable = TmpDT.FiltraParametros("ISNULL(CveSATPS,0) = 46920 ") + ' If DtNoEncontrados IsNot Nothing AndAlso DtNoEncontrados.Rows.Count > 0 Then + ' Dim StrNoEncontrados As New StringBuilder + ' StrNoEncontrados.Append("Los siguientes productos no tiene asignado la clave Producto SAT o Unidad Medida SAT

") + ' For Each drt As DataRow In DtNoEncontrados.Rows + ' StrNoEncontrados.AppendFormat("{0}
", drt("CodigoPS")) + ' Next + ' Alert(StrNoEncontrados.ToString(), TipoMensaje.MsgAdvertencia) + ' DtNoEncontrados.Dispose() + ' StrNoEncontrados.Clear() + ' Exit Sub + ' End If + ' DtNoEncontrados.Dispose() + 'End If 'Verifica funcionalidad 702 "Require orden de compra para factura de compra" @@ -4641,7 +4641,7 @@ Partial Class Compras_Compras 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 + If Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 2, UsuarioActual.CveUsuario) Then ErrorOC = True End If End Select @@ -4656,7 +4656,7 @@ Partial Class Compras_Compras 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 + If Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 2, UsuarioActual.CveUsuario) Then ErrorOC = True End If End Select @@ -18659,14 +18659,14 @@ Partial Class Compras_Compras For Each gvr As GridViewRow In GvSolDev.Rows If gvr.FCTextBox("TxtCant").Text.ToDecimal > 0 Then 'actualiza el estatus del detalle - ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 0) + ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 0, UsuarioActual.CveUsuario) Else - ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 1) + ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 1, UsuarioActual.CveUsuario) End If Next End If - If ObjCompras.UpdateEstatusAlmacen(CveCompra, If(EstatusAlmacen = 1, 0, 1)) Then + If ObjCompras.UpdateEstatusAlmacen(CveCompra, If(EstatusAlmacen = 1, 0, 1), UsuarioActual.CveUsuario) Then EstatusAlmacen = If(EstatusAlmacen = 1, 0, 1) Alert(If(EstatusAlmacen = 1, "La solicitud de devolución de almacen se guardo correctamente.", "La solicitud de almacen se canceló correctamente.")) End If @@ -19029,7 +19029,7 @@ Partial Class Compras_Compras End If CveMovimientoInventario = DtInv.MAX("CveMovimiento", $"CveCompraDetalle = {Row2("CveCompraDetalle")}").ToEntero IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DtInv.MIN("CveAlmacen", $"CveCompraDetalle = {Row2("CveCompraDetalle")}")}").ToEntero - CveCuenta = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DtInv.MIN("CveAlmacen", $"CveCompraDetalle = {Row2("CveCompraDetalle")}")}").ToEntero + ' CveCuenta = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DtInv.MIN("CveAlmacen", $"CveCompraDetalle = {Row2("CveCompraDetalle")}")}").ToEntero ImporteMovimiento = DtInv.SUM(If(DdlMoneda.SelectedValue = "1", "Total", "TotalExtranjero"), $"CveCompraDetalle = {Row2("CveCompraDetalle")}").ToDecimal ImporteMovimiento = If(ImporteMovimiento > Row2("Total").ToString.ToDecimal, Row2("Total").ToString.ToDecimal, ImporteMovimiento) * Multiplicador @@ -19059,15 +19059,15 @@ Partial Class Compras_Compras If IdCtaContable = 0 Then CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString) End If - If CveCuenta = 0 Then - CuentasContablesInvalidasSIG.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString) - End If + 'If CveCuenta = 0 Then + ' CuentasContablesInvalidasSIG.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString) + 'End If Dim SeContabiliza As Boolean = True 'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68 If DdlTipoCompra.SelectedValue = "10" Then SeContabiliza = False End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Concepto, 68, Concepto, FechaMovimiento, Row("IdCtaContable").ToString.ToEntero, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveMovimientoAlmacen:=Row("CveMovimiento").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(TipoCambioActual = 1, 0, ImporteMovimiento), CveCuenta:=Row("CveCuenta").ToString.ToEntero, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Concepto, 68, Concepto, FechaMovimiento, Row("IdCtaContable").ToString.ToEntero, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveMovimientoAlmacen:=Row("CveMovimiento").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(TipoCambioActual = 1, 0, ImporteMovimiento), Contabilizable:=SeContabiliza) Then TieneError = True Exit For End If @@ -20220,24 +20220,24 @@ Partial Class Compras_Compras ' CvePSGRuposAux.AppendFormat("{0},", CvePSIndividual) ' Next - Dim CvePSGRupos As String = Left(CvePSGRuposAux.ToString, CvePSGRuposAux.Length - 1) + 'Dim CvePSGRupos As String = Left(CvePSGRuposAux.ToString, CvePSGRuposAux.Length - 1) - Dim PSSat As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS IN ({0})", CvePSGRuposAux)) + 'Dim PSSat As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS IN ({0})", CvePSGRuposAux)) - Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") - For Each PS As GridViewRow In GvPS.Rows - Dim PSIndividual As String = PS.DataKey("PS") - Dim ClavePSSAT As String = PSSat.FiltroPrimeroValor("CveSATPS", String.Format("PS = '{0}'", PSIndividual)) - If ClavePSSAT = "46920" Then - ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", PSIndividual) - End If - Next + 'Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") + 'For Each PS As GridViewRow In GvPS.Rows + 'Dim PSIndividual As String = PS.DataKey("PS") + 'Dim ClavePSSAT As String = PSSat.FiltroPrimeroValor("CveSATPS", String.Format("PS = '{0}'", PSIndividual)) + 'If ClavePSSAT = "46920" Then + ' ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", PSIndividual) + ' End If + 'Next - If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then - Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) - Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) - Return False - End If + 'If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then + 'Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) + ' Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) + ' Return False + 'End If ' Return True From 6f47b2e10d5fb8f167ad64aadd2ece91f02d4333 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 10 Oct 2020 17:53:28 -0700 Subject: [PATCH 19/24] -- cambios en contabilidad, partes quitar la obtencion de cvecuenta --- AF/AF.aspx.vb | 4 +- Contabilidad/ContabilizacionVentas.aspx.cs | 2 +- Contabilidad/RegPrePolizaS.aspx | 8 +- Contabilidad/RegPrePolizaS.aspx.vb | 25 +++-- Contabilidad2/PolizasImpresion.aspx | 4 +- Contabilidad2/PolizasImpresion.aspx.vb | 30 +++--- Inventarios/Apartados.aspx.vb | 2 +- Inventarios/CatAlmacenes.aspx | 4 +- Inventarios/CatAlmacenes.aspx.vb | 108 +++++++++++---------- Inventarios/Consignaciones.aspx.vb | 4 +- Inventarios/EntregaAlmacen.aspx.vb | 4 +- Inventarios/RecepcionAlmacen.aspx.vb | 14 +-- Inventarios/TraspasoAlmacen.aspx.vb | 4 +- OC/OC.aspx.vb | 5 +- Ventas/CatClasificaciones.aspx.vb | 17 ++-- 15 files changed, 124 insertions(+), 111 deletions(-) diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index 690738748..2dcae1e8e 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -2135,12 +2135,12 @@ Partial Class AF_AF 'PREPOLIZA DE IMPORTACION DESDE ALMACEN If AFInvCvePS > 0 AndAlso AFInvCveAlmacen > 0 Then Dim IDCtaContableInv = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={AFInvCveAlmacen}").ToEntero - Dim CveCuentaInv = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen={AFInvCveAlmacen}").ToEntero + 'Dim CveCuentaInv = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen={AFInvCveAlmacen}").ToEntero If Not ErrorGuardar Then Dim CvePrePoliza As Integer = ObjContabilidad.AddPrePolizas("AF/ImportadoInv", 4, TxtValorCompra.Text.ToDouble, TxtValorCompra.Text.ToDouble, 1, Now, $"AF importado de Almacén {TxtCodigo.Text.Trim}", UsuarioActual.CveUsuario, CveEmpresaActual) If ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, False, TxtValorCompra.Text.ToDecimal, $"{TxtCodigo.Text.Trim} - {TxtDescripcion.Text.Trim}", 49, $"{TxtCodigo.Text.Trim} - {TxtDescripcion.Text.Trim}", Now, DdlCtaContable.SelectedValue.Trim.ToEntero, -1, CveActivoFijo:=CveActivoFijo, ImporteMX:=TxtValorCompra.Text.ToDecimal, CveCuenta:=If(UsuarioActual.Empresa.UsaContabilidad AndAlso UsuarioActual.Empresa.UsaContabilidadSIG, ObtenerCuentaDobleConta(DdlCtaContable.SelectedValue.Trim.ToEntero, UsuarioActual.CveEmpresa), -1)) Then If Not ErrorGuardar Then - If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, True, TxtValorCompra.Text.ToDecimal, TxtCodigo.Text.Trim, 68, TxtCodigo.Text.Trim, Now, IDCtaContableInv, -1, CveMovimientoAlmacen:=CveMovimientoSalidaInv, ImporteMX:=TxtValorCompra.Text.ToDecimal, CveCuenta:=CveCuentaInv) Then + If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, True, TxtValorCompra.Text.ToDecimal, TxtCodigo.Text.Trim, 68, TxtCodigo.Text.Trim, Now, IDCtaContableInv, -1, CveMovimientoAlmacen:=CveMovimientoSalidaInv, ImporteMX:=TxtValorCompra.Text.ToDecimal) Then ErrorGuardar = True End If End If diff --git a/Contabilidad/ContabilizacionVentas.aspx.cs b/Contabilidad/ContabilizacionVentas.aspx.cs index 0b85ddfa4..93878626d 100644 --- a/Contabilidad/ContabilizacionVentas.aspx.cs +++ b/Contabilidad/ContabilizacionVentas.aspx.cs @@ -42,7 +42,7 @@ public partial class Contabilidad_ContabilizacionVentas : ClsPaginas TienePermisoVerPoliza = true; } - if (UsuarioActual.Empresa.TipoContabilidad == 2 && UsuarioActual.Empresa.UsaContabilidad) + if (UsuarioActual.Empresa.TipoContabilizacion != 1 ) { ClsContPAQi ObjCont = new ClsContPAQi(UsuarioActual.Empresa); diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index 56ac1ea7e..e3b61c3c4 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -266,11 +266,15 @@
-
+
Si
+ +
+ +
@@ -575,7 +579,7 @@
- +
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 074017309..cfa135354 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -388,14 +388,23 @@ Partial Class ContabilidadC_RegPrePolizaS LnkComplementoPago.Visible = True End If - If dr("IdPoliza").ToString.ToEntero > 0 Then - HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza")) - divContabilziada.Visible = True - ElseIf TxtTotalCargos.Text.ToDouble = TxtTotalAbonos.Text.ToDouble Then - 'sino está contabilizada, se activa el botón - BtnContabilizar.Visible = True - End If - + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then + If dr("FolioPoliza").ToString.ToEntero > 0 Then + divContabilizada.Visible = True + LblFolio.Text = dr("FolioPoliza").ToString + End If + Else + If dr("IdPoliza").ToString.ToEntero > 0 Then + HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza")) + divContabilizada.Visible = True + ElseIf TxtTotalCargos.Text.ToDouble = TxtTotalAbonos.Text.ToDouble Then + 'sino está contabilizada, se activa el botón + BtnContabilizar.Visible = True + End If + End If + + + divDatosPrincipales.Visible = False divObservaciones.Visible = False UPMovs.Visible = False diff --git a/Contabilidad2/PolizasImpresion.aspx b/Contabilidad2/PolizasImpresion.aspx index f266fa9be..7664693c0 100644 --- a/Contabilidad2/PolizasImpresion.aspx +++ b/Contabilidad2/PolizasImpresion.aspx @@ -73,9 +73,9 @@
- +
- +
diff --git a/Contabilidad2/PolizasImpresion.aspx.vb b/Contabilidad2/PolizasImpresion.aspx.vb index 72185a306..992887fb8 100644 --- a/Contabilidad2/PolizasImpresion.aspx.vb +++ b/Contabilidad2/PolizasImpresion.aspx.vb @@ -18,7 +18,7 @@ Partial Class Contabilidad2_PolizasImpresion DdlUsuarioRegistro.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa) DdlUsuarioRegistro.DataBind() cargaddlpolizas() - CargaSegmentoNeg() + CargaSubProyectos() CargaCuentas() End If End Sub @@ -34,13 +34,13 @@ Partial Class Contabilidad2_PolizasImpresion Dim ArchivoReporte As String = "Empresas/Grales/Formatos/Polizas.rdlc" - 'If IO.File.Exists(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) Then - ' ArchivoReporte = String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta) - 'End If + If IO.File.Exists(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) Then + ArchivoReporte = String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta) + End If Dim ObjConta As New ClsContabilidad If ObjConta.GetPrePolizasImpresion(UsuarioActual.CveEmpresa, TxtFechaInicio.Text, TxtFechaFin.Text, CveTipoPoliza:=ddlTipoPoliza.SelectedValue.ToEntero, FolioI:=foli, - FolioF:=folf, CveUsuario:=DdlUsuarioRegistro.SelectedValue.ToEntero, IdSegNegocio:=DdlSegmentoNeg.SelectedValue.ToEntero, + FolioF:=folf, CveUsuario:=DdlUsuarioRegistro.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveCuenta:=DdlCuenta.SelectedValue.ToEntero, CvePlantillaPoliza:=DdlGrupoPlantilla.SelectedValue.ToEntero, CveProveedor:=DdlTipoProveedor.SelectedValue.ToEntero) Then If ObjConta.DtResultados.Rows.Count < 10000 Then @@ -60,9 +60,9 @@ Partial Class Contabilidad2_PolizasImpresion params.Add(New ReportParameter("Moneda", "")) params.Add(New ReportParameter("CodigoPostal", "")) - 'If UsuarioActual.CveEmpresa = 119 Then - ' params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(dr("IdUsuario").ToString.ToEntero).FiltroPrimeroValor("Nombre"))) - 'End If + If UsuarioActual.CveEmpresa = 119 Then + params.Add(New ReportParameter("UsuarioRegistro", dr("NombreUsuario").ToString)) + End If ImprimirPDF(ArchivoReporte, ObjConta.DtResultados, params) @@ -89,15 +89,11 @@ Partial Class Contabilidad2_PolizasImpresion DdlUsuarioRegistro.Items.Insert(0, New ListItem("Todos", "-1")) End Sub - Private Sub CargaSegmentoNeg() - Dim objtcont As New ClsContabilidad - If objtcont.GetSegmentosNegocio(-1, "-1") Then - DdlSegmentoNeg.DataSource = objtcont.DtResultados - DdlSegmentoNeg.DataBind() - End If - objtcont.Dispose() - DdlSegmentoNeg.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSegmentoNeg.Items.Insert(1, New ListItem("Sin Asignar", "-2")) + Private Sub CargaSubProyectos() + DdlSubProyectos.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa) + DdlSubProyectos.DataBind() + DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSubProyectos.Items.Insert(1, New ListItem("Sin Asignar", "-2")) End Sub Private Sub CargaCuentas() diff --git a/Inventarios/Apartados.aspx.vb b/Inventarios/Apartados.aspx.vb index fd119f2c7..7cbe8dca6 100644 --- a/Inventarios/Apartados.aspx.vb +++ b/Inventarios/Apartados.aspx.vb @@ -722,7 +722,7 @@ Partial Class Inventarios_Apartados Dim CveSec As Integer = 0 For Each Dr As DataRow In ObjInventario.DtResultados.Rows - CveSec = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestino.SelectedValue.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen", "").ToEntero + CveSec = -3 'GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestino.SelectedValue.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen", "").ToEntero If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSec, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then ErrorMovInv = True diff --git a/Inventarios/CatAlmacenes.aspx b/Inventarios/CatAlmacenes.aspx index 011c6115b..5810385a9 100644 --- a/Inventarios/CatAlmacenes.aspx +++ b/Inventarios/CatAlmacenes.aspx @@ -175,7 +175,7 @@ -   +   @@ -265,7 +265,7 @@
- + diff --git a/Inventarios/CatAlmacenes.aspx.vb b/Inventarios/CatAlmacenes.aspx.vb index fe6ef2857..a0b990035 100644 --- a/Inventarios/CatAlmacenes.aspx.vb +++ b/Inventarios/CatAlmacenes.aspx.vb @@ -99,31 +99,34 @@ Partial Class Inventarios_CatAlmacenes End Sub Private Sub CargaCuentasContables() - If UsuarioActual.Empresa.TipoContabilidad = 1 Then - divCuentasCompac.Visible = False + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then + divCuentasCompac.Visible = False pnlCuentassig.Visible = True Using ObjContabilidad As New ClsContabilidad 'UsuarioActual.Empresa.Funcionalidad(208).ToEntero - If ObjContabilidad.CuentasContablesSigGet(UsuarioActual.CveEmpresa) Then + If ObjContabilidad.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then DdlCuentasSig.DataSource = ObjContabilidad.DtResultados DdlCuentasSig.DataBind() DdlCuentasSig.Items.Insert(0, New ListItem("Selecione", "-1")) End If End Using Else - divCuentasCompac.Visible = True - pnlCuentassig.Visible = False - Using ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) - 'UsuarioActual.Empresa.Funcionalidad(208).ToEntero - If ObjContabilidad.GetCuentasRecursiva(UsuarioActual.Empresa.Funcionalidad(208).ToEntero, 1) Then - DtCuentasContables = ObjContabilidad.DtResultados - Else - DtCuentasContables = Nothing - End If - End Using - - DdlCuentasContables.DataSource = DtCuentasContables - DdlCuentasContables.DataBind() + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + divCuentasCompac.Visible = True + pnlCuentassig.Visible = False + Using ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) + 'UsuarioActual.Empresa.Funcionalidad(208).ToEntero + If ObjContabilidad.GetCuentasRecursiva(UsuarioActual.Empresa.Funcionalidad(208).ToEntero, 1) Then + DtCuentasContables = ObjContabilidad.DtResultados + Else + DtCuentasContables = Nothing + End If + End Using + + DdlCuentasContables.DataSource = DtCuentasContables + DdlCuentasContables.DataBind() + End If + End If UpAddAlmacen.Update() @@ -156,9 +159,9 @@ Partial Class Inventarios_CatAlmacenes 'e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center If e.Row.DBCampo("IdCtaContable").ToEntero > 0 Then - e.Row.FCLiteral("LtlCuentaContable").Text = DtCuentasContables.FiltroPrimeroValor("CtaCodigo", $"Id = {e.Row.DBCampo("IdCtaContable")}") - Else - e.Row.FCLiteral("LtlCuentaContable").Text = "Sin Cuenta" + e.Row.FCLiteral("LtlCuentaContable").Text = DtCuentasContables.FiltroPrimeroValor("CtaCodigo", $"Id = {e.Row.DBCampo("IdCtaContable")}") + 'Else + ' e.Row.FCLiteral("LtlCuentaContable").Text = "Sin Cuenta" End If End If @@ -181,15 +184,14 @@ Partial Class Inventarios_CatAlmacenes e.Row.FCDropDownList("DdlTipoAlmacen").DataSource = GlobalDTTipoAlmacen(-1) e.Row.FCDropDownList("DdlTipoAlmacen").DataBind() - e.Row.FCDropDownList("DdlTipoAlmacen").SelectedValue = e.Row.DBCampo("CveTipoAlmacen") - - e.Row.FCDropDownList("DdlCuentasContables").DataSource = DtCuentasContables - e.Row.FCDropDownList("DdlCuentasContables").DataBind() - e.Row.FCDropDownList("DdlCuentasContables").Items.Add(New ListItem("Seleccione", "-1")) - e.Row.FCDropDownList("DdlCuentasContables").SelectedValue = e.Row.DBCampo("IdCtaContable") - - 'e.Row.FCDropDownList("DdlModalidad").DataSource = - 'e.Row.FCDropDownList("DdlModalidad").DataBind() + e.Row.FCDropDownList("DdlTipoAlmacen").SelectedValue = e.Row.DBCampo("CveTipoAlmacen") + + + + + + 'e.Row.FCDropDownList("DdlModalidad").DataSource = + 'e.Row.FCDropDownList("DdlModalidad").DataBind() e.Row.FCDropDownList("DdlModalidad").Items.Add(New ListItem("Solo Existencia", "0")) e.Row.FCDropDownList("DdlModalidad").Items.Add(New ListItem("Contable", "1")) e.Row.FCDropDownList("DdlModalidad").SelectedValue = If(e.Row.DBCampo("Modalidad").ToString = "Contable", "1", "0") @@ -197,26 +199,27 @@ Partial Class Inventarios_CatAlmacenes End If End If - End Sub - + End Sub + #End Region - + #Region "O R D E N A M I E N T O" - 'Private Sub OrdenaDatos() - ' If (GvDatos.Rows.Count > 0) Then - ' GvDatos.UseAccessibleHeader = True - ' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader - ' RegistraScript("OrdenarGV();") - ' End If - 'End Sub + 'Private Sub OrdenaDatos() + ' If (GvDatos.Rows.Count > 0) Then + ' GvDatos.UseAccessibleHeader = True + ' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader + ' RegistraScript("OrdenarGV();") + ' End If + 'End Sub #End Region - + Private Sub RecargaGlobalAlmacenes() - Dim ObjAlmacen As New ClsInventarios - If ObjAlmacen.GetAlmacenes(-1, -1, -1, -1) Then - GlobalDTAlmacen(-1) = ObjAlmacen.DtResultados - End If - ObjAlmacen.Dispose() + GlobalDTAlmacen(UsuarioActual.CveEmpresa) = Nothing + 'Dim ObjAlmacen As New ClsInventarios + 'If ObjAlmacen.GetAlmacenes(-1, -1, -1, -1) Then + ' GlobalDTAlmacen(-1) = ObjAlmacen.DtResultados + 'End If + 'ObjAlmacen.Dispose() End Sub Private Sub RecargaGlobalAlmacenesUsuarios() @@ -238,14 +241,15 @@ Partial Class Inventarios_CatAlmacenes Dim CuentaContable As Integer = 0 Dim CveCuenta As Integer = 0 - If divddlcc.Visible Then - If pnlCuentassig.Visible Then - CveCuenta = DdlCuentasSig.SelectedValue.ToEntero() - Else - CuentaContable = DdlCuentasContables.SelectedValue.ToEntero() - End If - End If - + + If pnlCuentassig.Visible Then + CveCuenta = DdlCuentasSig.SelectedValue.ToEntero() + End If + If divCuentasCompac.Visible Then + CuentaContable = DdlCuentasContables.SelectedValue.ToEntero() + End If + + If HdnModalidad.Value = "A" Then If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero) Then Alert("El nuevo Almacen se guardó correctamente.", TipoMensaje.MsgInformacion) diff --git a/Inventarios/Consignaciones.aspx.vb b/Inventarios/Consignaciones.aspx.vb index e414a0e36..e6886a8f2 100644 --- a/Inventarios/Consignaciones.aspx.vb +++ b/Inventarios/Consignaciones.aspx.vb @@ -1153,8 +1153,8 @@ Partial Class Inventarios_Consignaciones End If Next IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacenCI}").ToEntero - CveCuenta = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen={CveAlmacenCI}").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DtCostos.SUM("Total").ToDecimal * TipoMovto, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoCI, ImporteMX:=DtCostos.SUM("Total").ToDecimal * TipoMovto, CveCuenta:=CveCuenta) Then + 'CveCuenta = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen={CveAlmacenCI}").ToEntero + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DtCostos.SUM("Total").ToDecimal * TipoMovto, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoCI, ImporteMX:=DtCostos.SUM("Total").ToDecimal * TipoMovto) Then ErrorMovInv = True End If Else diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index b3997b144..ec68fe2b0 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2816,7 +2816,7 @@ Partial Class Inventarios_EntregaAlmacen Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero - Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero + 'Dim CveCuentaAlmacen As Integer = 0 'GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero Dim IdCtaContable As Integer = 0 Dim CveCuenta As Integer = 0 If tmpCostos.Rows.Count > 0 Then @@ -2868,7 +2868,7 @@ Partial Class Inventarios_EntregaAlmacen cont += 1 Next - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ValorMultiplicador * TotalCosto, Serie, 68, Serie, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVentaSurtir, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=CveSubProyecto, ImporteMX:=ValorMultiplicador * TotalCosto, CveCuenta:=CveCuentaAlmacen) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ValorMultiplicador * TotalCosto, Serie, 68, Serie, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVentaSurtir, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=CveSubProyecto, ImporteMX:=ValorMultiplicador * TotalCosto) Then ErrorMovInv = True End If diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index ba9bcf526..819e9bf71 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -2863,7 +2863,7 @@ Partial Class Inventarios_RecepcionAlmacen 'ACTUALIZA ESTATUS ALMACEN If TipoMovimiento = 2 Then - If Not ObjCompras.UpdateEstatusAlmacen(CveCompraSurtir, 0) Then + If Not ObjCompras.UpdateEstatusAlmacen(CveCompraSurtir, 0, UsuarioActual.CveUsuario) Then ErrorMovInv = True End If End If @@ -2885,7 +2885,7 @@ Partial Class Inventarios_RecepcionAlmacen 'VARIABLES Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero - Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero + ' Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero Dim IdCtaContableRecepcion = -1 Dim IdCtaContableRecepcionME = -1 Dim IdCtaContableRecepcionComplementaria = -1 @@ -2959,7 +2959,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen", 74, TotalCosto, TotalCosto, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If CvePrePoliza > 0 Then - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveSubProyecto:=CveSubProyecto, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=CveCuentaAlmacen, Contabilizable:=If(CveTipoCompra = 10, False, EsContabilizable)) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveSubProyecto:=CveSubProyecto, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, Contabilizable:=If(CveTipoCompra = 10, False, EsContabilizable)) Then 'AGREGA POR CONCEPTO POR CVEOCDETALLE If CveOCSurtir > 0 Then @@ -3099,7 +3099,7 @@ Partial Class Inventarios_RecepcionAlmacen 'VARIABLES Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero - Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero + 'Dim CveCuentaAlmacen As Integer = 0 'GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero Dim Fecha As Date = TxtFecha.Text.ToDate Dim CveProveedor As Integer = -1 Dim ProveedorNombre As String = "" @@ -3132,7 +3132,7 @@ Partial Class Inventarios_RecepcionAlmacen CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen-NC", 74, TotalCosto, TotalCosto, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If CvePrePoliza > 0 Then If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalNC, SerieFolio, CveConceptoContableNC, SerieFolio, Fecha, IdCtaContableNC, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalNC, Contabilizable:=EsContabilizable) Then - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto * -1, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto * -1, CveCuenta:=CveCuentaAlmacen, Contabilizable:=If(CveTipoCompra = 10, False, EsContabilizable)) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto * -1, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto * -1, Contabilizable:=If(CveTipoCompra = 10, False, EsContabilizable)) Then If DifCostoNC <> 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifCostoNC * -1, SerieFolio, 69, SerieFolio, Fecha, IdCtaContableClasificacion, -1, CveClasificacion:=CveClasificacionDifCostoNC, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DifCostoNC * -1, CveCuenta:=CveCuentaClasificacion, Contabilizable:=EsContabilizable, CveSubProyecto:=CveSubProyecto) Then ErrorMovInv = True @@ -3542,7 +3542,7 @@ Partial Class Inventarios_RecepcionAlmacen End If If CvePrePoliza > 0 Then Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero - Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero + ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Dim TotalCosto As Decimal = ObjInventario.DtResultados.SUMD("Total").RoundSQL() Dim IdCtaContableCostoInd As Integer = 0 @@ -3550,7 +3550,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim PorcentajeRecepcionCompras As Decimal = TotalCosto / DtTempCompras.SUMD("SubTotalTC") Dim ConceptoPartida As String = String.Format("{0}- Inv#{1}", HLFolio.Text, InvFolio) - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, InvFolio, 68, InvFolio, FechaMovto, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=CveCuentaAlmacen, Contabilizable:=If(CveTipoCompra = 10, False, True)) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, InvFolio, 68, InvFolio, FechaMovto, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, Contabilizable:=If(CveTipoCompra = 10, False, True)) Then 'se recorren las facturas a descontar el recepción If DtTempCompras IsNot Nothing AndAlso DtTempCompras.Rows.Count > 0 Then diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index efb17de68..58ddb7411 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1125,8 +1125,8 @@ Partial Class Inventarios_TraspasoAlmacen Next IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacenCI}").ToEntero - CveCuenta = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen={CveAlmacenCI}").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DtCostos.SUM("Total").ToDecimal * TipoMovto, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUM("Total").ToDecimal * TipoMovto, CveCuenta:=CveCuenta) Then + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DtCostos.SUM("Total").ToDecimal * TipoMovto, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUM("Total").ToDecimal * TipoMovto) Then ErrorMovInv = True End If diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 146939ec4..dc0d4a830 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -2747,7 +2747,6 @@ Partial Class OC Dim CveOCDetalle = -1 Dim CveAlmacen = -1 Dim IdCtaContableAlmacen As Integer = -1 - Dim CveCuentaAlmacen As Integer = -1 Dim IdCtaContableRecepcionOC = -1 Dim IdCtaContableRecepcionOCME = -1 Dim IdCtaContableRecepcionOCComplementaria = -1 @@ -2813,7 +2812,6 @@ Partial Class OC DiferenciaInvOC = DrDiferencias("Diferencia").ToString.ToDecimal ' DtInvOCDiferencias.SUMD("Diferencia", $"CveAlmacen = {CveAlmacen} AND CveMovimiento = {CveMovimientoAlmacen} AND ConceptoSalida = {ConceptoSalida}") TCInvOC = DrDiferencias("TipoCambioAjuste").ToString.ToDecimal ' DtInvOCDiferencias.FiltroPrimeroValor("TipoCambioAjuste", $"CveAlmacen = {CveAlmacen} AND CveMovimiento = {CveMovimientoAlmacen} AND ConceptoSalida = {ConceptoSalida}").ToDecimal IdCtaContableAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DrDiferencias("CveAlmacen").ToString.ToEntero}").ToEntero - CveCuentaAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DrDiferencias("CveAlmacen").ToString.ToEntero}").ToEntero If DiferenciaInvOC.RoundSQL() <> 0 Then @@ -2858,7 +2856,7 @@ Partial Class OC '2018.11.24 se cambia concepto 176, de cargo a abono negativo., petición MALL '2019.03.26 se cambia concepto 177, de abono a cargo., petición MALL '2019.04.10 se cambia concepto 177, de cargo a abono., petición MALL - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveCuenta:=CveCuentaAlmacen, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaInvOC, SerieFolio, 176, SerieFolio, Fecha, IdCtaContableRecepcionOC, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then TieneError = True Exit For @@ -2896,7 +2894,6 @@ Partial Class OC ' DiferenciaInvOC = DtInvOCDiferencias.SUMD("Diferencia", $"CveAlmacen = {CveAlmacen} And CveMovimiento = {CveMovimientoAlmacen} And ConceptoSalida = {ConceptoSalida}") ' TCInvOC = DtInvOCDiferencias.FiltroPrimeroValor("TipoCambioAjuste", $"CveAlmacen = {CveAlmacen} And CveMovimiento = {CveMovimientoAlmacen} And ConceptoSalida = {ConceptoSalida}").ToDecimal ' IdCtaContableAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DrDiferencias("CveAlmacen").ToString.ToEntero}").ToEntero - ' CveCuentaAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DrDiferencias("CveAlmacen").ToString.ToEntero}").ToEntero ' 'MODIFICACIÓN CONCEPTO ' If ConceptoSalida = 0 Then diff --git a/Ventas/CatClasificaciones.aspx.vb b/Ventas/CatClasificaciones.aspx.vb index d23b8bc90..eb1ea5c8c 100644 --- a/Ventas/CatClasificaciones.aspx.vb +++ b/Ventas/CatClasificaciones.aspx.vb @@ -109,7 +109,7 @@ Partial Class CatClasificaciones End If UpModalClasif.Update() - If UsuarioActual.Empresa.UsaContabilidad Then + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then ''COMENTADO DF 30 JUNIO 2017 'Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa) @@ -118,13 +118,16 @@ Partial Class CatClasificaciones 'End If 'Cuenta.Dispose() Else - DivCuentaIngresos.Visible = False - DivCuentaCostos.Visible = False - DivCuentaGasto.Visible = False + If UsuarioActual.Empresa.TipoContabilizacion = 2 Then + DivCuentaIngresos.Visible = False + DivCuentaCostos.Visible = False + DivCuentaGasto.Visible = False + + GvDatos.Columns(1).Visible = False + GvDatos.Columns(2).Visible = False + GvDatos.Columns(3).Visible = False + End If - GvDatos.Columns(1).Visible = False - GvDatos.Columns(2).Visible = False - GvDatos.Columns(3).Visible = False End If DdlCuentaGasto.Items.Insert(0, New ListItem("-", "-1")) From 1ec0c8613d12cff087322b4bdac4f68076419987 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 10 Oct 2020 17:57:00 -0700 Subject: [PATCH 20/24] -- cambios en e lcambio de cuenta de contabilidad --- Ventas/Ventas.aspx.vb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 81c0b9d88..20d6b1a1b 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -14252,14 +14252,13 @@ Partial Class Ventas End If IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {ddlAlmacen.SelectedValue}").ToEntero() - CveCuenta = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {ddlAlmacen.SelectedValue}").ToEntero() ValorInventario = DTMovimientosDetalles.SUMD("Total", $"CveMovimiento = {Mov("CveMovimiento")}").RoundSQL() If ValorInventario <> 0 Then 'Entrada - If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveDevolucion, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimientoInventarioEntrada, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then + If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveDevolucion, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimientoInventarioEntrada, ImporteMX:=ValorInventario) Then 'Salida - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, ValorInventario, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimientoInventarioSalida, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, ValorInventario, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimientoInventarioSalida, ImporteMX:=ValorInventario) Then OcurrioError = True Exit For End If From 478dfb6780949612194ce71bf25c91c46993101f Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 10 Oct 2020 18:02:24 -0700 Subject: [PATCH 21/24] - parametro de envio de esatus --- Compras/Compras.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index a81131917..86ede1ae8 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -19485,7 +19485,7 @@ Partial Class Compras_Compras 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 + If Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 2, UsuarioActual.CveUsuario) Then ErrorTrans = True End If End Select @@ -19500,7 +19500,7 @@ Partial Class Compras_Compras 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 + If Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 2, UsuarioActual.CveUsuario) Then ErrorTrans = True End If End Select From 2f25a6b2b22a6882388e6e504b4f8e465e09c0cb Mon Sep 17 00:00:00 2001 From: rrene Date: Sun, 11 Oct 2020 10:53:09 -0700 Subject: [PATCH 22/24] -- parametro de usuarioactual --- Sistemas/PopUpAddUsuario.aspx.vb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sistemas/PopUpAddUsuario.aspx.vb b/Sistemas/PopUpAddUsuario.aspx.vb index 22ed375a3..9380667be 100644 --- a/Sistemas/PopUpAddUsuario.aspx.vb +++ b/Sistemas/PopUpAddUsuario.aspx.vb @@ -263,14 +263,14 @@ Partial Class Sistemas_PopUpAddUsuario 'Nota, permitir, tiene 3 valores, ''(Vacio), no se ha estipulado, '0' que se denego, '1' permitido(aplicado solo cuando no viene del rol If Row.DataKey("CveModuloAcceso") <> "" Then If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkDenegar").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkDenegar").Checked = False Then - If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked) Then + If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked, UsuarioActual.CveUsuario) Then HuboError = True Exit For End If End If Else If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkPermitir").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkPermitir").Checked = False Then - If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Row.FCCheckBox("ChkPermitir").Checked) Then + If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Row.FCCheckBox("ChkPermitir").Checked, UsuarioActual.CveUsuario) Then HuboError = True Exit For End If @@ -417,14 +417,14 @@ Partial Class Sistemas_PopUpAddUsuario 'Nota, permitir, tiene 3 valores, ''(Vacio), no se ha estipulado, '0' que se denego, '1' permitido(aplicado solo cuando no viene del rol If Row.DataKey("CveModuloAcceso") <> "" Then If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkDenegar").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkDenegar").Checked = False Then - If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked) Then + If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked, UsuarioActual.CveUsuario) Then HuboError = True Exit For End If End If Else If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkPermitir").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkPermitir").Checked = False Then - If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Row.FCCheckBox("ChkPermitir").Checked) Then + If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Row.FCCheckBox("ChkPermitir").Checked, UsuarioActual.CveUsuario) Then HuboError = True Exit For End If @@ -435,14 +435,14 @@ Partial Class Sistemas_PopUpAddUsuario 'Nota, permitir, tiene 3 valores, ''(Vacio), no se ha estipulado, '0' que se denego, '1' permitido(aplicado solo cuando no viene del rol If Row.DataKey("CveModuloAcceso") <> "" Then If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkDenegar").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkDenegar").Checked = False Then - If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked) Then + If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked, UsuarioActual.CveUsuario) Then HuboError = True Exit For End If End If Else If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkPermitir").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkPermitir").Checked = False Then - If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Row.FCCheckBox("ChkPermitir").Checked) Then + If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Row.FCCheckBox("ChkPermitir").Checked, UsuarioActual.CveUsuario) Then HuboError = True Exit For End If From 72c0ae360c6fbda88d6193f430b7c0879fe61bb5 Mon Sep 17 00:00:00 2001 From: rrene Date: Sun, 11 Oct 2020 10:53:37 -0700 Subject: [PATCH 23/24] - cambio en parametro de marcar la factura para surtir --- Inventarios/RepNotasSinAlmacen.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/RepNotasSinAlmacen.aspx.vb b/Inventarios/RepNotasSinAlmacen.aspx.vb index d558f6498..af54ebcf6 100644 --- a/Inventarios/RepNotasSinAlmacen.aspx.vb +++ b/Inventarios/RepNotasSinAlmacen.aspx.vb @@ -300,7 +300,7 @@ Partial Class RepNotasSinAlmacen Dim ObjCompras As New ClsCompras Dim ObjEventos As New ClsOIEventos - If ObjCompras.UpdateEstatusAlmacenDetalle(CveCompraDetalle, 1) Then + If ObjCompras.UpdateEstatusAlmacenDetalle(CveCompraDetalle, 1, Usuarioactual.CveUsuario) Then If ObjEventos.AddEventoBitacora(String.Format("El producto: {0} se marcó como no recibido", PS), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompra) Then Alert("El producto se marcó como 'no recibido' correctamente.") End If From 6baa2b002e903c3120aa53fb75ca33c8afa1755e Mon Sep 17 00:00:00 2001 From: rrene Date: Sun, 11 Oct 2020 10:53:52 -0700 Subject: [PATCH 24/24] -- cambios de contabilidad --- App_Code/ClsBancos.vb | 4 +- App_Code/ClsContabilidad.vb | 2 +- Bancos/CuentasBancariasDetalle.aspx.vb | 106 +++++++++++++++++-------- 3 files changed, 74 insertions(+), 38 deletions(-) diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 41a2511cb..eacb04c20 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -417,8 +417,8 @@ Public Class ClsBancos Me.FFinal = Data.Rows(0)("FFinal").ToString.ToEntero Me.IdCtaContable = Data.Rows(0)("IdCtaContable").ToString.ToEntero Me.IdCtaContableComplementaria = Data.Rows(0)("IdCtaContableComplementaria").ToString.ToEntero - Me.CveCuentaConta = Data.Rows(0)("IdCtaContableSIG").ToString.ToEntero - Me.CveCuentaContaComplementaria = Data.Rows(0)("IdCtaContableComplementariaSIG").ToString.ToEntero + Me.CveCuentaConta = Data.Rows(0)("CveCuentaContable").ToString.ToEntero + Me.CveCuentaContaComplementaria = Data.Rows(0)("CveCuentaComplementaria").ToString.ToEntero Me.FormatoCheque = Data.Rows(0)("FormatoCheque").ToString Me.Estatus = Data.Rows(0)("Estatus").ToString Me.Fecha = Data.Rows(0)("Fecha").ToString.ToDate diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index c175d592d..a3e36c05a 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -62,7 +62,7 @@ Public Class ClsContabilidad Public Property CveEmpresa As Integer Public Property CveTipoPlantillaPoliza As Integer - Public Property ContaIdPoliza As Integer + Public Property ContaIdPoliza As Integer = 0 Public Property ContaFolio As Integer Public Property ValorPolizaDescuadre As Integer diff --git a/Bancos/CuentasBancariasDetalle.aspx.vb b/Bancos/CuentasBancariasDetalle.aspx.vb index 2b4c1f02f..656a2aa10 100644 --- a/Bancos/CuentasBancariasDetalle.aspx.vb +++ b/Bancos/CuentasBancariasDetalle.aspx.vb @@ -41,9 +41,8 @@ Partial Class Bancos_CuentasBancariasDetalle ViewState("CveCuenta") = Request("CveCuenta") - If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then - trCuentaContable.Visible = True - trCuentaContableComplementaria.Visible = True + If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then + CargaCuentasContables() End If @@ -60,9 +59,8 @@ Partial Class Bancos_CuentasBancariasDetalle ViewState("CveCuenta") = -1 BtnEliminar.Visible = False CreaDTUsuarios() - If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then - trCuentaContable.Visible = True - trCuentaContableComplementaria.Visible = True + If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then + CargaCuentasContables() End If 'LbAgregarSucursal.Enabled = False @@ -98,37 +96,69 @@ Partial Class Bancos_CuentasBancariasDetalle DdlMoneda.DataSource = GlobalDTMonedas DdlMoneda.DataBind() End Sub - Private Sub CargaCuentasContables() - Dim IdPadre As Integer - Dim Conta As New ClsContPAQi(UsuarioActual.Empresa) - - If DdlTipoCuenta.SelectedValue.ToEntero = 1 Then 'Caja Chica - IdPadre = UsuarioActual.Empresa.Funcionalidad(218).ToEntero - Else - Dim tesstr = UsuarioActual.Empresa.Funcionalidad(209) - IdPadre = UsuarioActual.Empresa.Funcionalidad(209).ToEntero - End If - - If IdPadre = 0 Then IdPadre = -1 + Private Sub CargaCuentasContables() Dim dt As DataTable = Nothing - If Conta.GetCuentasRecursiva(IdPadre, 1) Then - dt = Conta.DtResultados - End If - Conta.Dispose() - DDlCuentaContable.DataSource = dt - DDlCuentaContable.DataBind() - DDlCuentaContable.Items.Insert(0, New ListItem("-", "-1")) - DdlCuentaContableComplementaria.DataSource = dt - DdlCuentaContableComplementaria.DataBind() - DdlCuentaContableComplementaria.Items.Insert(0, New ListItem("-", "-1")) - If dt IsNot Nothing Then dt.Dispose() - End Sub + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then + Using ObjContabilidad As New ClsContabilidad + 'UsuarioActual.Empresa.Funcionalidad(208).ToEntero + If ObjContabilidad.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then + DDlCuentaContable.DataSource = ObjContabilidad.DtResultados + DDlCuentaContable.DataBind() + DDlCuentaContable.Items.Insert(0, New ListItem("Selecione", "-1")) + DDlCuentaContable.DataTextField = "Cuenta" + DDlCuentaContable.DataValueField = "CveCuenta" + End If + End Using + + DDlCuentaContable.DataSource = dt + DDlCuentaContable.DataBind() + DDlCuentaContable.Items.Insert(0, New ListItem("-", "-1")) + DdlCuentaContableComplementaria.DataSource = dt + DdlCuentaContableComplementaria.DataBind() + DdlCuentaContableComplementaria.Items.Insert(0, New ListItem("-", "-1")) + If dt IsNot Nothing Then dt.Dispose() + trCuentaContable.Visible = True + trCuentaContableComplementaria.Visible = True + + Else + If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then + Dim IdPadre As Integer + Dim Conta As New ClsContPAQi(UsuarioActual.Empresa) + + If DdlTipoCuenta.SelectedValue.ToEntero = 1 Then 'Caja Chica + IdPadre = UsuarioActual.Empresa.Funcionalidad(218).ToEntero + Else + Dim tesstr = UsuarioActual.Empresa.Funcionalidad(209) + IdPadre = UsuarioActual.Empresa.Funcionalidad(209).ToEntero + End If + + If IdPadre = 0 Then IdPadre = -1 + + If Conta.GetCuentasRecursiva(IdPadre, 1) Then + dt = Conta.DtResultados + End If + + Conta.Dispose() + DDlCuentaContable.DataSource = dt + DDlCuentaContable.DataBind() + DDlCuentaContable.Items.Insert(0, New ListItem("-", "-1")) + DdlCuentaContableComplementaria.DataSource = dt + DdlCuentaContableComplementaria.DataBind() + DdlCuentaContableComplementaria.Items.Insert(0, New ListItem("-", "-1")) + If dt IsNot Nothing Then dt.Dispose() + trCuentaContable.Visible = True + trCuentaContableComplementaria.Visible = True + End If + End If + + + End Sub #End Region - + #End Region - - + + #Region " CARGA DATOS " Private Sub CargaDatos() Dim ObjCuentasBancariasDetalle As New ClsBancos() @@ -164,8 +194,14 @@ Partial Class Bancos_CuentasBancariasDetalle DdlTipoCuenta.SelectedValue = ObjCuentasBancariasDetalle.CveTipoCuenta.ToString DdlTipoCuenta_SelectedIndexChanged(DdlTipoCuenta, EventArgs.Empty) - DDlCuentaContable.SelectedValueExist(ObjCuentasBancariasDetalle.IdCtaContable.ToString) - DdlCuentaContableComplementaria.SelectedValueExist(ObjCuentasBancariasDetalle.IdCtaContableComplementaria.ToString) + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then + DDlCuentaContable.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaConta.ToString) + DdlCuentaContableComplementaria.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaContaComplementaria.ToString) + Else + DDlCuentaContable.SelectedValueExist(ObjCuentasBancariasDetalle.IdCtaContable.ToString) + DdlCuentaContableComplementaria.SelectedValueExist(ObjCuentasBancariasDetalle.IdCtaContableComplementaria.ToString) + End If + Else Alert("El Banco Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia) BtnGuardar.Enabled = False