diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 08090d2a5..03d47a895 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -138,6 +138,8 @@ Public Class ClsBancos Public Property LimiteCredito As Double Public Property ConvenioPagoElectronico As String Public Property UsaLayout As Boolean + Public Property UsaLayoutGrupos As Boolean + Public Property UsaTarjeta As Boolean #End Region @@ -424,6 +426,7 @@ Public Class ClsBancos Me.LimiteCredito = Data.Rows(0)("LimiteCredito").ToString.ToDouble Me.ConvenioPagoElectronico = Data.Rows(0)("ConvenioPagoElectronico").ToString Me.UsaLayout = If(Data.Rows(0)("UsaLayout").ToString = "True", True, False) + Me.UsaLayoutGrupos = If(Data.Rows(0)("UsaLayoutGrupos").ToString = "True", True, False) Me.UsaTarjeta = If(Data.Rows(0)("UsaTarjeta").ToString = "True", True, False) End If @@ -457,7 +460,9 @@ Public Class ClsBancos Return Retorno + 1 End Function - Public Function AddBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer, LimiteCredito As Double, IdCtaContable As Integer, IdCtaContableComplementaria As Integer, FormatoCheque As String, CveUsuario As Integer, CveEmpresa As Integer, ConvenioPagoElectronico As String, UsaLayout As Boolean, UsaTarjeta As Boolean, Optional SaldoInicial As Double = 0) As Boolean + Public Function AddBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer, + LimiteCredito As Double, IdCtaContable As Integer, IdCtaContableComplementaria As Integer, FormatoCheque As String, CveUsuario As Integer, CveEmpresa As Integer, ConvenioPagoElectronico As String, + UsaLayout As Boolean, UsaTarjeta As Boolean, Optional SaldoInicial As Double = 0, Optional UsaLayoutGrupos As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_BancosCuentasAdd") @@ -483,6 +488,10 @@ Public Class ClsBancos .Add("@UsaLayout", SqlDbType.Bit).Value = UsaLayout .Add("@UsaTarjeta", SqlDbType.Bit).Value = UsaTarjeta .Add("@SaldoInicial", SqlDbType.Money).Value = SaldoInicial + .Add("@UsaLayoutGrupos", SqlDbType.Bit).Value = UsaLayoutGrupos + + + End With Try @@ -502,7 +511,9 @@ Public Class ClsBancos Return Retorno End Function - Public Function UpdateBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer, LimiteCredito As Double, IdCtaContable As Integer, IdCtaContableComplementaria As Integer, FormatoCheque As String, Estatus As Boolean, CveCuenta As Integer, ConvenioPagoElectronico As String, UsaLayout As Boolean, UsaTarjeta As Boolean) As Boolean + Public Function UpdateBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer, + LimiteCredito As Double, IdCtaContable As Integer, IdCtaContableComplementaria As Integer, FormatoCheque As String, Estatus As Boolean, CveCuenta As Integer, ConvenioPagoElectronico As String, + UsaLayout As Boolean, UsaTarjeta As Boolean, Optional UsaLayoutGrupos As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_BancosCuentasUpdate") @@ -526,6 +537,9 @@ Public Class ClsBancos .Add("@ConvenioPagoElectronico", SqlDbType.VarChar).Value = ConvenioPagoElectronico .Add("@UsaLayout", SqlDbType.Bit).Value = UsaLayout .Add("@UsaTarjeta", SqlDbType.Bit).Value = UsaTarjeta + .Add("@UsaLayoutGrupos", SqlDbType.Bit).Value = UsaLayoutGrupos + + End With Try @@ -3067,7 +3081,7 @@ Public Class ClsBancos Return Retorno End Function - Public Function UpdateLayoutEnviosDetalle(CveLayoutEnvioDetalle As Integer, CveLayoutEnvio As Integer, CveIE As Integer, CveProveedor As Integer, Estatus As Integer, Observaciones As String) As Boolean + Public Function UpdateLayoutEnviosDetalle(CveLayoutEnvioDetalle As Integer, CveLayoutEnvio As Integer, CveIE As Integer, CveProveedor As Integer, Estatus As Integer, Observaciones As String, Optional Confirmado As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_LayoutEnviosDetalleUpdate") @@ -3079,6 +3093,7 @@ Public Class ClsBancos .Add("@Estatus", SqlDbType.SmallInt).Value = Estatus .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@CveLayoutEnvioDetalle", SqlDbType.Int).Value = CveLayoutEnvioDetalle + .Add("@Confirmado", SqlDbType.Bit).Value = Confirmado End With Try @@ -3091,6 +3106,29 @@ Public Class ClsBancos Return Retorno End Function + + Public Function UpdateBancos_IEFolio(CveIE As Integer, NuevoFolio As String, Comprobante As String) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Banc_LayoutIEFolioUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveIE", SqlDbType.Int).Value = CveIE + .Add("@NuevoFolio", SqlDbType.Char).Value = NuevoFolio + .Add("@Comprobante", SqlDbType.Char).Value = Comprobante + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar El movimiento Bancario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + 'ESTE SE PUEDE ELIMINAR YA NO SE USA 'Public Function UpdateProveedorPagoElectronico(CveProveedor As Integer, CveEmpresa As Integer) As Boolean ' Dim Retorno As Boolean = False diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index 78f93277e..d49f390ca 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -21,11 +21,13 @@ Public Class ClsClasificaciones Private Data As DataTable Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'REGISTRAR CONEXIÓN - Private CveConexion As Integer = 0 + Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False + #End Region - + #Region "Propiedades" - + Public ReadOnly Property DtResultados() As DataTable Get DtResultados = Data @@ -46,7 +48,8 @@ Public Class ClsClasificaciones End Try Else SqlConexion = TransaccionCompartida.Connection - SqlTransacc = TransaccionCompartida + SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlCommand = New SqlCommand("", SqlConexion) @@ -67,7 +70,7 @@ Public Class ClsClasificaciones #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 2db192a9c..dcb1ca78e 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -1506,7 +1506,7 @@ Public Class ClsGenerales Return Retorno End Function - Public Function UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito As Integer, EstatusPagoElectronicoGrupos As Boolean) As Boolean + Public Function UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito As Integer, EstatusPagoElectronicoGrupos As Boolean, CveSATBanco As Integer, BBVAAlias As String) As Boolean Dim Retorno As Boolean = False @@ -1515,6 +1515,8 @@ Public Class ClsGenerales With SqlAdapter.SelectCommand.Parameters .Add("@CveCuentaDeposito", SqlDbType.VarChar).Value = CveCuentaDeposito .Add("@EstatusPagoElectronicoGrupos", SqlDbType.Bit).Value = EstatusPagoElectronicoGrupos + .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco + .Add("@BBVAAlias", SqlDbType.VarChar).Value = BBVAAlias End With @@ -2724,7 +2726,8 @@ Public Class ClsGenerales Public Function GetPaqueteriasGuias(CvePaqueteriaGuia As Integer, CvePaqueteriaGuiaTipo As Integer, CvePaqueteria As Integer, CveEstatus As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Guia As String, FechaInicio As String, FechaFin As String, Optional FechaIngInicio As String = "-1", - Optional FechaIngFin As String = "-1", Optional Filtro As Integer = -1, Optional CveUsuarioEntrega As Integer = -1) As Boolean + Optional FechaIngFin As String = "-1", Optional Filtro As Integer = -1, Optional CveUsuarioEntrega As Integer = -1, + Optional EsEntregaInterna As Boolean = False) As Boolean Dim Retorno As Boolean = False @@ -2744,6 +2747,7 @@ Public Class ClsGenerales .Add("@FechaIngFin", SqlDbType.VarChar).Value = FechaIngFin .Add("@Filtro", SqlDbType.Int).Value = Filtro .Add("@CveUsuarioEntrega", SqlDbType.Int).Value = CveUsuarioEntrega + .Add("@EsEntregaInterna", SqlDbType.Bit).Value = EsEntregaInterna End With Try SqlAdapter.Fill(Data) @@ -2833,7 +2837,7 @@ Public Class ClsGenerales DataAdapter("PA_Gral_AsignarEntregasPorRealizar") With SqlAdapter.SelectCommand.Parameters .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia - .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CvePersonal End With Try SqlAdapter.Fill(Data) @@ -2845,6 +2849,72 @@ Public Class ClsGenerales Return Retorno End Function + Public Function GetMotivoRechazoPaqueteria(CveMotivoRechazoPaqueteria As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("Gral_MotivoRechazoPaqueteriaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMotivoRechazoPaqueteria", SqlDbType.Int).Value = CveMotivoRechazoPaqueteria + .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 motivos de rechazo de entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function AddMotivoRechazoPaqueteria(Descripcion As String, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("Gral_MotivoRechazoPaqueteriaAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el motivos de rechazo de entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function RemoveMotivoRechazoPaqueteria(CveMotivoRechazoPaqueteria As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("Gral_MotivoRechazoPaqueteriaDelete") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMotivoRechazoPaqueteria", SqlDbType.Int).Value = CveMotivoRechazoPaqueteria + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el motivos de rechazo de entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateMotivoRechazoPaqueteria(CveMotivoRechazoPaqueteria As Integer, Optional Descripcion As String = "-1") As Boolean + Dim Retorno As Boolean = False + DataAdapter("Gral_MotivoRechazoPaqueteriaUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMotivoRechazoPaqueteria", SqlDbType.Int).Value = CveMotivoRechazoPaqueteria + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al modificar el motivos de rechazo de entrega", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function #End Region #Region "P A Q U E T E R I A S G U I A S D E T A L L E S" diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 4e2ca49e7..f05686a6c 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -630,7 +630,7 @@ Public Class ClsInventarios SqlAdapter.Fill(Data) Retorno = True Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Then + If Ex1.Message.Contains("Número: 2601;") Then Alert("Ya existe una Sección de Almacén con el mismo nombre: " & Seccion & ".", TipoMensaje.MsgAdvertencia) Else Me.OnError("Ocurrió un error al Guardar la Sección de Almacén.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index fe4714eff..7849671d9 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -542,7 +542,10 @@ Public Class ClsMovimientos End With - Try + + Try + SqlAdapter.SelectCommand.CommandTimeout = 0 + SqlAdapter.Fill(Data) Retorno = True Catch ex As SqlException diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index 2aa435c09..20d2c9d8f 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -2532,7 +2532,23 @@ Public Class ClsOC End Function #End Region + Public Function GetVentasRelacionadas(CveOCDetalle As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_OC_VentaRelacionada") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOCDetalles", SqlDbType.NVarChar).Value = CveOCDetalle + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la venta relacionada", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function #Region " IDisposable Support " ' IDisposable diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index a7b7a4a24..cfe34dbcd 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1730,7 +1730,7 @@ Public Class ClsPaginas End Set End Property - Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1) As DataTable + Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable Get Dim Str As New StringBuilder @@ -1738,6 +1738,7 @@ Public Class ClsPaginas If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen) If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus) + If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen) Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) GlobalDTAlmacen = Dv.ToTable @@ -3667,6 +3668,7 @@ Public Class ClsPaginas PaginaDict.Add("/Sistemas/CatPlataformas.aspx".ToUpper(), -1) PaginaDict.Add("/Sistemas/PopUpAddUsuario.aspx".ToUpper(), -1) PaginaDict.Add("/General/JAMComparativos.aspx".ToUpper(), 643) + PaginaDict.Add("/General/CatMotivoRechazoGuias.aspx".ToUpper(), 729) '-------------------------------------------Q U I T A R---------------------------------- #Region "Q U I T A R" diff --git a/App_Code/ClsUnidadesMedida.vb b/App_Code/ClsUnidadesMedida.vb index 5df5ed959..69e51e5f8 100644 --- a/App_Code/ClsUnidadesMedida.vb +++ b/App_Code/ClsUnidadesMedida.vb @@ -19,6 +19,7 @@ Public Class ClsUnidadesMedida Private disposedValue As Boolean = False 'PARA REGISTRAR CONEXION Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False #End Region #Region "Propiedades" @@ -69,6 +70,7 @@ Public Class ClsUnidadesMedida Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlAdapter = New SqlDataAdapter("", SqlConexion) @@ -86,7 +88,7 @@ Public Class ClsUnidadesMedida #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try 'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index f78d1e3bf..c348cebec 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -341,7 +341,7 @@ Public Class ClsVentas Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveUsoCFDI As Integer = -1, Optional OrdenCompra As String = "-1", Optional CveCuentaTerminal As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ImpuestoLocal As Double = 0, Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0, - Optional CorreoNotificacion As String = "") As Boolean + Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasAdd") @@ -431,6 +431,7 @@ Public Class ClsVentas .Add("@EsAmortizacion", SqlDbType.Bit).Value = EsAmortizacion .Add("@CveTipoRetencion", SqlDbType.TinyInt).Value = CveTipoRetencion .Add("@CorreoNotificacion", SqlDbType.VarChar).Value = CorreoNotificacion + .Add("@FormaPaqueteria", SqlDbType.Int).Value = FormaPaqueteria .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -4461,6 +4462,21 @@ Public Class ClsVentas End Try Return retorno End Function + + Public Function GetOCRelacionadas(CveVentasDetalles As String) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Vta_OrdenCompraRelacionada", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVentasDetalles", SqlDbType.NVarChar).Value = CveVentasDetalles + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la orden de compra relacionada", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function #Region "Conciliación emitidas SAT" Public Function ConciliacionemitidasSATGet(cveEmpresa As Int32) As Boolean diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 07f8fecbf..08b59bea8 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4571,7 +4571,7 @@ Namespace Modelos Next - 'SI EXISTEN HAY EXISTENCIA EN (ENTREGA POR ADELANTADO) SE TIENE QUE REGRESAR AL ALMACEN GENERAL + 'SI EXISTEN HAY EXISTENCIA EN (ENTREGA POR ADELANTADO) SE TIENE QUE REGRESAR AL ALMACEN ORGINAL (GENERAL,SIN COSTO) If Not ErrorCancelar AndAlso ListaRemisionesCancelar IsNot Nothing AndAlso ListaRemisionesCancelar.Count > 0 Then 'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO) @@ -4584,24 +4584,25 @@ Namespace Modelos End If End If - 'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN GENERAL - If Not ErrorCancelar AndAlso DtDevoluciones IsNot Nothing Then + 'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN ORGINAL (GENERAL,SIN COSTO) + If Not ErrorCancelar AndAlso DtDevoluciones IsNot Nothing AndAlso DtDevoluciones.Rows.Count > 0 Then For Each CveRemision As Integer In ListaRemisionesCancelar Dim DtDevRemision As DataTable = DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}") - Dim RowDevolucion As DataRow = DtDevRemision.FiltraParametros("", DistinctColumns:={"CveRemision", "CveAlmacen", "CveAlmacenDestino"}).Rows(0) + Dim DtDevMovs = DtDevRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveRemision", "CveAlmacen", "CveAlmacenDestino"}) - CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero() - CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero() + For Each RowDevolucion As DataRow In DtDevMovs.Rows + CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero() + CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero() + + If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión." + Exit For + End If + Next - If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision, ObjVentas, ObjInventario) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión." - Exit For - End If Next - Else - ErrorCancelar = True End If End If @@ -5028,7 +5029,7 @@ Namespace Modelos 'SALIDA DE (ENTREGA POR ADELANTADO) If Not ErrorCancelar Then - For Each DrRem As DataRow In DtMovDetalle.FiltraParametros($"CveRemision = {CveRemision}").Rows + For Each DrRem As DataRow In DtMovDetalle.Rows Dim CveVentaDetalleRem = DrRem("CveVentaDetalleRemision").ToString.ToEntero Dim CantidadRem = DrRem("Cantidad").ToString.ToDecimal @@ -5037,7 +5038,7 @@ Namespace Modelos Exit For End If - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, DrRem("Cantidad").ToString.ToDecimal, DrRem("CveUM").ToString.ToEntero, DrRem("CvePS").ToString.ToEntero, DrRem("PU").ToString.ToDecimal, CveAF:=DrRem("CveActivoFijo").ToString.ToEntero, Serie:=DrRem("Serie").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=DrRem("Lote").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, DrRem("Cantidad").ToString.ToDecimal, DrRem("CveUM").ToString.ToEntero, DrRem("CvePS").ToString.ToEntero, DrRem("PU").ToString.ToDecimal, CveAF:=DrRem("CveActivoFijo").ToString.ToEntero, Serie:=DrRem("Serie").ToString, Lote:=DrRem("Lote").ToString, CveVentaDetalle:=CveVentaDetalleRem, CveMovimientoDetalleEntrada:=DrRem("CveMovimientoDetalle").ToString().ToEntero()) Then ErrorCancelar = True Exit For End If diff --git a/App_Code/Thalamus.vb b/App_Code/Thalamus.vb new file mode 100644 index 000000000..575b897b8 --- /dev/null +++ b/App_Code/Thalamus.vb @@ -0,0 +1,179 @@ +Imports System.IO +Imports System.Net +Imports System.Web +Imports System.Web.Services +Imports System.Web.Services.Protocols +Imports Extensiones.ModExtensiones +Imports GemBox.Spreadsheet +Imports System.Data + +' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. +' _ + + _ + _ +Public Class Thalamus + Inherits System.Web.Services.WebService + + + Public Function GenerarArchivos(CveEmpresa As Integer) As Boolean + + Dim RutaArchivoVentas As String = $"C:\Temp\Ventas{Now.ToString("yyyyMMdd")}.xlsx" + + Dim DTVentas As New DataTable + DTVentas.Columns.Add("systemId") + DTVentas.Columns.Add("Branch") + DTVentas.Columns.Add("Code") + DTVentas.Columns.Add("Sale Date") + DTVentas.Columns.Add("Quantity") + DTVentas.Columns.Add("Amount") + DTVentas.Columns.Add("Transaction ID") + + + For x = 0 To 50 + Dim dr As DataRow = DTVentas.NewRow + + dr(0) = $"systemId {x}" + dr(1) = $"Branch {x}" + dr(2) = $"{x}" + dr(3) = $"{Now.ToString("yyyy-MM-dd")}" + dr(4) = $"{x}" + dr(5) = $"{x}.00" + dr(6) = $"{x}" + + DTVentas.Rows.Add(dr) + + Next + + SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet()) + + Dim workbook = New ExcelFile + Dim worksheet = workbook.Worksheets.Add("Ventas") + + worksheet.InsertDataTable(DTVentas, + New InsertDataTableOptions() With + { + .ColumnHeaders = True, + .StartRow = 0 + }) + + workbook.Save(RutaArchivoVentas) + + Dim FTPServer As String = "ftp://127.0.0.1/" + Dim TFPUsr As String = "Toor" + Dim FTPPass As String = "agj-3500" + + + Dim FInfo As New FileInfo(RutaArchivoVentas) + + + Dim Carga As Boolean = CargarArchivos(FInfo.FullName, FTPServer, TFPUsr, FTPPass) + If Carga Then + Carga = VerificarArchivo(FInfo.Name, FInfo.Length, FTPServer, TFPUsr, FTPPass) + End If + + + + Return Carga + + End Function + + Private Function CargarArchivos(RutaArchivo As String, FTPServer As String, FTPUsr As String, FTPPass As String) As Boolean + + Dim Respuesta As Boolean + + Dim FInfo As New FileInfo(RutaArchivo) + + If FInfo.Exists Then + + Dim request As FtpWebRequest = DirectCast(WebRequest.Create($"{FTPServer}/{FInfo.Name}"), FtpWebRequest) + request.Method = WebRequestMethods.Ftp.UploadFile + + Dim tamanio As Integer = 1024 + Dim buffer As Byte() = New Byte(tamanio) {} + Dim byteRead As Integer = 0 + + Dim Conected As Boolean = False + + + + request.Credentials = New NetworkCredential(FTPUsr, FTPPass) + + Try + request.GetResponse() + Conected = True + Catch ex As Exception + + End Try + + + If Conected Then + + Dim ftpStream As Stream + Dim f As FileStream + + ftpStream = request.GetRequestStream + f = File.OpenRead(FInfo.FullName) + + Try + Do + byteRead = f.Read(buffer, 0, tamanio) + ftpStream.Write(buffer, 0, byteRead) + + Loop While byteRead <> 0 + + Respuesta = True + 'validar si existe archivo si coincide en tamaño + Catch ex As Exception + Respuesta = False + End Try + + + If f IsNot Nothing Then + f.Close() + End If + + If ftpStream IsNot Nothing Then + ftpStream.Close() + End If + + Else + Respuesta = False + 'no se conecto al ftp probablemente credenciales erroneas + End If + Else + Respuesta = False + 'El archivo no existe en el disco local + End If + + Return Respuesta + + End Function + + Private Function VerificarArchivo(Archivo As String, Tamanio As Long, FTPServer As String, FTPUsr As String, FTPPass As String) As Boolean + + Dim Respuesta As Boolean = False + + Dim reqSize As FtpWebRequest = DirectCast(FtpWebRequest.Create(New Uri(FTPServer & Archivo)), FtpWebRequest) + reqSize.Credentials = New NetworkCredential(FTPUsr, FTPPass) + reqSize.Method = WebRequestMethods.Ftp.GetFileSize + reqSize.UseBinary = True + + Dim loginresponse As FtpWebResponse = DirectCast(reqSize.GetResponse(), FtpWebResponse) + Dim respSize As FtpWebResponse = DirectCast(reqSize.GetResponse(), FtpWebResponse) + respSize = DirectCast(reqSize.GetResponse(), FtpWebResponse) + Dim size As Long = respSize.ContentLength + + respSize.Close() + + + If Tamanio = size Then + Respuesta = True + End If + + Return Respuesta + + + End Function + +End Class \ No newline at end of file diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 0c2141fd0..ad51f25bc 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -1178,6 +1178,7 @@ Namespace Extensiones Else TmpDr = dt.Rows(0) End If + dt.Dispose() End If Return TmpDr @@ -1190,6 +1191,7 @@ Namespace Extensiones If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then dt.PrimaryKey = New DataColumn() {dt.Columns(PrimaryKey)} TmpDr = dt.Rows.Find(Valor) + dt.Dispose() End If Return TmpDr @@ -1250,6 +1252,7 @@ Namespace Extensiones Else Retorno = dt.Rows(0)(Columna).ToString End If + dt.Dispose() End If Return Retorno diff --git a/Bancos/ConciliacionesBancarias.aspx.vb b/Bancos/ConciliacionesBancarias.aspx.vb index 9175d0e91..c8957ee63 100644 --- a/Bancos/ConciliacionesBancarias.aspx.vb +++ b/Bancos/ConciliacionesBancarias.aspx.vb @@ -236,9 +236,19 @@ Partial Class Bancos_ConciliacionesBancariasaspx Seleccionados += 1 Fecha = Gvr.DataKey("FechaDocumento").ToDate If Gvr.DataKey("Tipo") = "Cargo" Then - SumaSIGCargo += Gvr.DataKey("Importe").ToDouble + If Gvr.DataKey("Importe").ToDouble < 0 Then ' cuando es negativo suma para el abono + SumaSIGAbono += Math.Abs(Gvr.DataKey("Importe").ToDouble) + Else + SumaSIGCargo += Gvr.DataKey("Importe").ToDouble + End If + ElseIf Gvr.DataKey("Tipo") = "Abono" Then - SumaSIGAbono += Gvr.DataKey("Importe").ToDouble + If Gvr.DataKey("Importe").ToDouble < 0 Then ' cuando es negativo suma para el cargo + SumaSIGCargo += Math.Abs(Gvr.DataKey("Importe").ToDouble) + Else + SumaSIGAbono += Gvr.DataKey("Importe").ToDouble + End If + End If End If Next diff --git a/Bancos/CuentasBancariasDetalle.aspx b/Bancos/CuentasBancariasDetalle.aspx index 034177278..3862302b9 100644 --- a/Bancos/CuentasBancariasDetalle.aspx +++ b/Bancos/CuentasBancariasDetalle.aspx @@ -88,6 +88,11 @@ Layout: + + + Layout Grupos: + + Convenio: diff --git a/Bancos/CuentasBancariasDetalle.aspx.vb b/Bancos/CuentasBancariasDetalle.aspx.vb index f4395d31a..698e4aab8 100644 --- a/Bancos/CuentasBancariasDetalle.aspx.vb +++ b/Bancos/CuentasBancariasDetalle.aspx.vb @@ -147,10 +147,12 @@ Partial Class Bancos_CuentasBancariasDetalle TxtCLABE.Text = ObjCuentasBancariasDetalle.CLABE DdlMoneda.SelectedValue = ObjCuentasBancariasDetalle.CveMoneda.ToString ChkEstatus.Checked = If((ObjCuentasBancariasDetalle.Estatus) = "Activo", True, False) + ChkEstatus.Checked = If((ObjCuentasBancariasDetalle.Estatus) = "Activo", True, False) LblFecha.Text = ObjCuentasBancariasDetalle.Fecha.ToShortDateString LblUsuario.Text = ObjCuentasBancariasDetalle.Usuario TxtConvenio.Text = ObjCuentasBancariasDetalle.ConvenioPagoElectronico.ToString ChkLayout.Checked = ObjCuentasBancariasDetalle.UsaLayout + ChkLayoutGrupos.Checked = ObjCuentasBancariasDetalle.UsaLayoutGrupos ChkUsaTarjeta.Checked = ObjCuentasBancariasDetalle.UsaTarjeta ChkUsaTarjeta_CheckedChanged(Nothing, Nothing) @@ -187,7 +189,7 @@ Partial Class Bancos_CuentasBancariasDetalle If ObjCuentasBancariasDetalle.AddBancosCuentas(DdlBanco.SelectedValue.ToEntero, DdlTipoCuenta.SelectedValue.ToEntero, TxtNumCuenta.Text.Trim, TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0, TxtLimiteCredito.Text.Trim.ToDouble, DDlCuentaContable.SelectedValue.ToEntero, - DdlCuentaContableComplementaria.SelectedValue.ToEntero, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, If(ChkLayout.Checked, TxtConvenio.Text, ""), ChkLayout.Checked, ChkUsaTarjeta.Checked) Then + DdlCuentaContableComplementaria.SelectedValue.ToEntero, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, If(ChkLayout.Checked, TxtConvenio.Text, ""), ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked) Then ViewState("CveCuenta") = ObjCuentasBancariasDetalle.TCveCuenta Else ErrorUsuarios = True @@ -217,7 +219,7 @@ Partial Class Bancos_CuentasBancariasDetalle End If Else - If ObjCuentasBancariasDetalle.UpdateBancosCuentas(DdlBanco.SelectedValue.ToEntero, DdlTipoCuenta.SelectedValue.ToEntero, TxtNumCuenta.Text.Trim, TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0, TxtLimiteCredito.Text.Trim.ToDouble, DDlCuentaContable.SelectedValue.ToEntero, DdlCuentaContableComplementaria.SelectedValue.ToEntero, "", ChkEstatus.Checked, CveCuenta, TxtConvenio.Text, ChkLayout.Checked, ChkUsaTarjeta.Checked) Then + If ObjCuentasBancariasDetalle.UpdateBancosCuentas(DdlBanco.SelectedValue.ToEntero, DdlTipoCuenta.SelectedValue.ToEntero, TxtNumCuenta.Text.Trim, TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0, TxtLimiteCredito.Text.Trim.ToDouble, DDlCuentaContable.SelectedValue.ToEntero, DdlCuentaContableComplementaria.SelectedValue.ToEntero, "", ChkEstatus.Checked, CveCuenta, TxtConvenio.Text, ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked) Then 'CargaDatos() If ObjCuentasBancariasDetalle.GetBancosCuentasUsuarios(-1) Then GlobalDTBancosCuentas(-1) = ObjCuentasBancariasDetalle.DtResultados diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 25ce1b6b2..c8a70dd0d 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -4653,6 +4653,26 @@ Partial Class Bancos_IE Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) End If + ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + + If Dep.DtResultados.Rows.Count > 0 Then + + DdlCuentaDeposito.DataSource = Dep.DtResultados + trCuentaDeposito.Visible = True + BtnGuardar.ToolTip = "" + + Else + + BtnGuardar.Enabled = False + Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + + End If + + + UpGuardar.Update() + Else DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("Estatus ='True'") If Dep.DtResultados.Rows.Count > 0 Then @@ -4663,6 +4683,19 @@ Partial Class Bancos_IE End If + Else + + If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then + + BtnGuardar.Enabled = False + Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + Else + trCuentaDeposito.Visible = True + BtnGuardar.Enabled = True + End If + + UpGuardar.Update() End If diff --git a/Bancos/PagoElectronicoGrupos.aspx b/Bancos/PagoElectronicoGrupos.aspx index f9242d7a1..a79a95981 100644 --- a/Bancos/PagoElectronicoGrupos.aspx +++ b/Bancos/PagoElectronicoGrupos.aspx @@ -11,10 +11,14 @@ Pago Electrónico + + + + @@ -254,6 +258,17 @@ + + + + + + + + + <%----%> @@ -262,35 +277,7 @@ -
-
- Layouts Enviados -
- - - - - - - - - - <%----%> - - - <%----%> - - - - - <%----%> - - - - - - -
+
@@ -305,59 +292,10 @@ - <%-- - -
-
-
-
    -
  • Cuenta: - -
  • -
  • Estatus: - - - - - - -
  • -
  • Fecha.I.: - - - - - - - - -
  • -
  • Fecha.F.: - - - - - - - - -
  • -
-
-
- -
-
-
-
-
--%> - - - +
@@ -424,56 +362,12 @@
- <%--
-
- - -
-
-
Cuenta:
-
-
- -
Estatus:
-
-
-
Fecha I:
-
-
-
Fecha F:
-
-
-
-
- -
- -
--%>
-
-
- <%-- - - - - - - - - - - - - - -
Cuenta:Estatus: Fecha.I.:  - -  Fecha.F.:  - -
+ +
-
--%> +

@@ -578,6 +472,195 @@
+ + + + + + + + + + +
+
+
+ + "> + +
+
+
    +
  • Cuenta + +
  • + +
  • Tipo: + + + + + + +
  • + +
  • Estatus + + + + + + +
  • +
  • F.I.   +
    + + + + + + + + + + + + + <%--
    +
  • +
  • F.F    +
    + + + + + + + + + + + + + + + +
    +
  • +
+
+ +
+
+ +
+ + + + +
+
+ + + + +
+
+ +
+
+ Prefijo Folio: +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ + + + + +
+
+ + + + +
@@ -622,7 +705,7 @@