diff --git a/App_Code/CFDITimbreRetenciones.vb b/App_Code/CFDITimbreRetenciones.vb index f7a977353..12cc0135b 100644 --- a/App_Code/CFDITimbreRetenciones.vb +++ b/App_Code/CFDITimbreRetenciones.vb @@ -27,6 +27,7 @@ Public Class CFDITimbreRetenciones Public ReadOnly Property TotalImpuestosGravado As Decimal Get Return (From c In RetencionesImpuestos + Where c.ImpuestoRetencion = "001" Select c.MontoRetencion).Sum End Get End Property @@ -34,6 +35,7 @@ Public Class CFDITimbreRetenciones Public ReadOnly Property TotalImpuestosRetenidos As Decimal Get Return (From c In RetencionesImpuestos + Where c.ImpuestoRetencion = "001" Select c.MontoRetencion).Sum End Get End Property diff --git a/App_Code/CalendarEvent.vb b/App_Code/CalendarEvent.vb index 316fdb6be..6bd2224a0 100644 --- a/App_Code/CalendarEvent.vb +++ b/App_Code/CalendarEvent.vb @@ -4,8 +4,6 @@ Public Class CalendarEvent Public Property id As Integer Public Property title As String - Public Property colorfont As String - Public Property description As String Public Property start As String Public Property [end] As String diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index e21d8dfd4..7bed46456 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -536,7 +536,7 @@ Public Class ClsAcumuladores Retorno = True Catch ex As SqlException - OnError("Ocurrió un error al agregar el folio de garantía", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError("Ocurrió un error al agregar el tamaño.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try @@ -1289,7 +1289,7 @@ Public Class ClsAcumuladores SqlAdapter.Fill(Data) Retorno = True Catch ex As SqlException - OnError("Ocurrió un error al actualizar la cancelación de garantía. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError("Ocurrió un error al actualizar los movimientos. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb index 23044581c..2829632c9 100644 --- a/App_Code/ClsCompProveedores.vb +++ b/App_Code/ClsCompProveedores.vb @@ -524,28 +524,28 @@ Public Class ClsCompProveedores Return Retorno End Function - Public Function UpdateProveedorLimiteCredito(CveProveedor As Integer, LimiteCredito As Decimal, PlazoPago As Integer, UsaLimiteCredito As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Comp_ProveedorLimiteCreditoUpdate") +Public Function UpdateProveedorLimiteCredito(CveProveedor As Integer, LimiteCredito As Decimal, PlazoPago As Integer, UsaLimiteCredito As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ProveedorLimiteCreditoUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@LimiteCredito", SqlDbType.Money).Value = LimiteCredito - .Add("@PlazoPago", SqlDbType.Int).Value = PlazoPago - .Add("@UsaLimiteCredito", SqlDbType.Bit).Value = UsaLimiteCredito - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@LimiteCredito", SqlDbType.Money).Value = LimiteCredito + .Add("@PlazoPago", SqlDbType.Int).Value = PlazoPago + .Add("@UsaLimiteCredito", SqlDbType.Bit).Value = UsaLimiteCredito + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al Actualizar el limite de crédito del Proveedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al Actualizar el limite de crédito del Proveedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try - Return Retorno - End Function + Return Retorno +End Function Public Function UpdateProveedorPagoElectronico(EstatusPagoElectronico As Boolean, CveUsuario As Integer, CveProveedor As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index c04c98792..c5682ee52 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -200,7 +200,7 @@ Public Class ClsCompras Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Decimal = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1, Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Integer = 0, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Decimal = 0, Optional CveTipoConcepto As Integer = 1, Optional CveFactura As Integer = -1, Optional CveContrato As Integer = -1, Optional EsImportacion As Boolean = False, Optional CveSubProyecto As Integer = -1, Optional DoctosRelacionados As String = "-1", Optional CveFolioGarantia As Integer = -1, - Optional CveCompraRelacionada As Integer = -1) As Boolean + Optional CveCompraRelacionada As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -256,7 +256,7 @@ Public Class ClsCompras .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@DoctosRelacionados", SqlDbType.VarChar).Value = DoctosRelacionados .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia - .Add("@CveCompraRelacionada", SqlDbType.Int).Value = CveCompraRelacionada + .Add("@CveCompraRelacionada", SqlDbType.Int).Value = CveCompraRelacionada End With Try diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index e9c1cd5c0..61f19afbb 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -343,7 +343,6 @@ Public Class ClsContabilidad - Public Function AddPrePolizasNegativa(CvePrePoliza As Integer, CveUsuario As Integer, Concepto As String, CveEmpresa As Integer, Fecha As Date) As Integer Dim Retorno As Integer = -1 @@ -865,8 +864,9 @@ Public Class ClsContabilidad Return Retorno End Function - - Public Function PrePolizaCompraCambiaReembolso(CvePrePoliza As Integer, CvePrePolizaVieja As Integer, CveCompra As Integer, CveEmpresa As Integer, Opcion As Integer) As Boolean + + + Public Function PrePolizaCompraCambiaReembolso(CvePrePoliza As Integer, CvePrePolizaVieja As Integer, CveCompra As Integer, CveEmpresa As Integer, Opcion As Integer) As Boolean Dim Retorno As Boolean = False SeUnifico = False @@ -910,9 +910,9 @@ Public Class ClsContabilidad SqlAdapter.Fill(Data) Retorno = True Catch ex1 As SqlException - OnError("Ocurrió un error al actualizar prepolizas", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError("Ocurrió un error al simplificar prepolizas", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) Catch ex As Exception - OnError("Ocurrió un error al actualizar prepolizas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError("Ocurrió un error al simplificar prepolizas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno @@ -6676,28 +6676,27 @@ Public Class ClsContabilidad Return Retorno End Function + + Public Function GetAjusteFluctuacion(Opcion As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Conta_Banc_FluctuacionesVerificaciones") - Public Function GetAjusteFluctuacion(Opcion As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False + With SqlAdapter.SelectCommand.Parameters + .Add("@Opcion", SqlDbType.Int).Value = Opcion + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With - DataAdapter("PA_Conta_Banc_FluctuacionesVerificaciones") + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + Me.OnError("Ocurrió un error al actualizar el tipo de cambio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try - With SqlAdapter.SelectCommand.Parameters - .Add("@Opcion", SqlDbType.Int).Value = Opcion - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - Me.OnError("Ocurrió un error al actualizar el tipo de cambio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function + Return Retorno +End Function #End Region diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 5dec86e7f..b36cf01da 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -4279,27 +4279,9 @@ Public Class ClsGenerales End Try Return Retorno - End Function - - Public Function GetReporteDiario(CveEmpresa As Integer) As Boolean + End Function - Dim Retorno As Boolean = False - DataAdapter("PA_Gral_RepCierreDia") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(DSet) - Retorno = True - Catch ex As Exception - OnError($"Ocurrió un error al obtener los datos de cultivo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - - End Function - #Region "C I T R I C O S" Public Function GetTipoOrganicos(Optional CveEmpresa As Integer = -1) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 6656873c3..68274613d 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -7,6 +7,7 @@ Imports Extensiones Public Class ClsInventarios Implements IDisposable + 'COMPILAAAA #Region " CAMPOS " 'SQL Private SqlConexion As SqlConnection @@ -6404,6 +6405,27 @@ Public Class ClsInventarios Return Retorno End Function + + Public Function ReplicarMovtoEmpresa(CveEmpresa As Integer, CveMovimiento As Integer, Optional CveMovimientoSecundario As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ReplicaMovtoInterEmpresa") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + .Add("@CveMovimientoSecundario", SqlDbType.Int).Value = CveMovimientoSecundario + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al replicar el movimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + #Region " IDisposable Support " ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsMetodosPagos.vb b/App_Code/ClsMetodosPagos.vb new file mode 100644 index 000000000..f6bf0b888 --- /dev/null +++ b/App_Code/ClsMetodosPagos.vb @@ -0,0 +1,144 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports System.Data.SqlClient +Imports Extensiones + +Public Class ClsMetodosPagos + Implements IDisposable + +#Region "Campos" + + 'SQL + Private SqlConexion As SqlConnection + Private SqlAdapter As SqlDataAdapter + Private SqlCommand As SqlCommand + Private Data As DataTable + + 'Atributos de la clase + Private disposedValue As Boolean = False ' Para detectar llamadas redundantes + 'REGISTRAR CONEXIONES ABIERTAS + Private CveConexion As Integer = 0 + +#End Region + +#Region "Propiedades" + + Public ReadOnly Property DtResultados() As DataTable + Get + DtResultados = Data + End Get + End Property + +#End Region + + Sub New() + SqlConexion = New SqlConnection + SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB + Try + SqlConexion.Open() + Catch ex As Exception + Me.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) + End Try + SqlAdapter = New SqlDataAdapter("", SqlConexion) + ConexionAdd() + End Sub +#Region "Conexiones" + + Private Sub ConexionAdd() + If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + Try + DataAdapter("PA_Sis_RegistrarConexion") + With SqlAdapter.SelectCommand.Parameters + .Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name + .Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString) + .Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output + End With + SqlAdapter.Fill(Data) + CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero + Catch ex As Exception + OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + End If + End Sub + + Private Sub ConexionClose() + If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + + DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text) + + Try + SqlAdapter.Fill(Data) + + Catch ex As Exception + OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + CveConexion = 0 + End If + + End Sub + Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) + With SqlAdapter.SelectCommand + .Parameters.Clear() + .CommandText = pStrSQL + .CommandType = TipoComando + End With + Data = New DataTable + End Sub +#End Region + 'Public Function GetMetodosPago() As Boolean + ' Dim Retorno As Boolean = False + ' Data = New DataTable + ' SqlAdapter = New SqlDataAdapter("PA_MetodosPagosGet", SqlConexion) + ' SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As SqlException + ' OnError("Ocurrió un error al consultar los Métodos de Pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try + ' SqlAdapter.Dispose() + ' Return Retorno + 'End Function + +#Region "IDisposable Support" + + + ' IDisposable + Protected Overridable Sub Dispose(disposing As Boolean) + If Not Me.disposedValue Then + If disposing Then + ' TODO: dispose managed state (managed objects). + If Not Data Is Nothing Then Data.Dispose() : Data = Nothing + If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing + If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing + If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close() + If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing + + End If + + ' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below. + ' TODO: set large fields to null. + End If + Me.disposedValue = True + End Sub + + ' TODO: override Finalize() only if Dispose(disposing As Boolean) above has code to free unmanaged resources. + 'Protected Overrides Sub Finalize() + ' ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + ' Dispose(False) + ' MyBase.Finalize() + 'End Sub + + ' This code added by Visual Basic to correctly implement the disposable pattern. + Public Sub Dispose() Implements IDisposable.Dispose + ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. + ConexionClose() + Dispose(True) + GC.SuppressFinalize(Me) + End Sub +#End Region + +End Class diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index b72b6e8a7..313d8bf18 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -342,11 +342,10 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function PersonalAplicaCalculoAnual(CveEmpresa As Integer, CveUsuario As Integer, Ejercicio As Integer, CvePersonal As Integer, Aplica As Integer, motivo As String) As Boolean + Public Function PersonalAplicaCalculoAnual(CveEmpresa As Integer, CveUsuario As Integer, CvePersonal As Integer, Aplica As Integer, motivo As String) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Nom_PersonalAplicaCalculoAnual", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters - .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario @@ -612,8 +611,8 @@ Public Class ClsNominas End Try Return retorno End Function - - Public Function GuardarAguinaldo(CveEmpresa As Integer, CveUsuario As Integer, registros As String, EJercicio As Integer) As Boolean + + Public Function GuardarAguinaldo(CveEmpresa As Integer, CveUsuario As Integer, registros As String) As Boolean Dim retorno As Boolean = False Try @@ -622,7 +621,6 @@ Public Class ClsNominas .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuario", SqlDbType.Decimal).Value = CveUsuario .Add("@registros", SqlDbType.Xml).Value = registros - .Add("@EJercicio", SqlDbType.Xml).Value = EJercicio End With SqlAdapter.Fill(Data) retorno = True @@ -2702,6 +2700,7 @@ Public Class ClsNominas End Function + Public Function ReporteVacaciones(CveProyecto As Integer, CveSubProyecto As Integer, cveEmpresa As Integer, fechaInicio As String, fechaFin As String) As Boolean Dim retorno As Boolean = False Try @@ -2726,6 +2725,32 @@ Public Class ClsNominas End Try Return retorno End Function + + Public Function ReporteVacacionesCalendario(CveProyecto As Integer, CveSubProyecto As Integer, cveEmpresa As Integer, fechaInicio As String, fechaFin As String) As Boolean + Dim retorno As Boolean = False + Try + DTSet = New DataSet() + DataAdapter("PA_Nom_ReporteVacacionesCalendario", CommandType.StoredProcedure) + SqlAdapter.SelectCommand.CommandTimeout = 2400 + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@FechaInicio", SqlDbType.Date).Value = fechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = fechaFin + End With + SqlAdapter.Fill(DTSet) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al realizar el reporte de vacaciones.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al realizar el reporte de vacaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function GetNominasSinTimbrar(CvePeriodo As Integer, CveEmpresa As Integer) As Boolean Dim retorno As Boolean = False Try diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 3f57aef6b..0b1e79fc8 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -2487,24 +2487,26 @@ Public Class ClsOIEventos #End Region #Region "A G E N D A" - Public Function AddEventoAgenda(CveAgendaTipo As Integer, Asunto As String, Descripcion As String, Prioridad As Integer, FechaInicio As DateTime, FechaFin As DateTime, CveUsuarioIng As Integer, CveEmpresa As Integer, - Optional CveActivoFijo As Integer = -1, Optional CveIE As Integer = -1, Optional CveProspecto As Integer = -1, Optional CveCliente As Integer = -1, - Optional CveOS As Integer = -1, Optional CveOC As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveEventoPadre As Integer = -1, - Optional RecurrenciaTipo As Integer = -1, Optional Frecuencia As Integer = -1, Optional DiasSemana As String = "-1", Optional Dia As Integer = -1, Optional Mes As Integer = -1, - Optional RecurrenciaFin As String = "-1", Optional CveTipoEvento As Integer = 2, Optional Importe As Double = -1, - Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1, - Optional CveSubProyecto As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveMovimiento As Integer = -1, - Optional CveContrato As Integer = -1) As Boolean - Dim Retorno As Boolean = False + + Public Function AddEventoAgenda(CveAgendaTipo As Integer, Asunto As String, Descripcion As String, Prioridad As Integer, FechaInicio As DateTime, FechaFin As DateTime, CveUsuarioIng As Integer, CveEmpresa As Integer, + Optional CveActivoFijo As Integer = -1, Optional CveIE As Integer = -1, Optional CveProspecto As Integer = -1, Optional CveCliente As Integer = -1, + Optional CveOS As Integer = -1, Optional CveOC As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveEventoPadre As Integer = -1, + Optional RecurrenciaTipo As Integer = -1, Optional Frecuencia As Integer = -1, Optional DiasSemana As String = "-1", Optional Dia As Integer = -1, Optional Mes As Integer = -1, + Optional RecurrenciaFin As String = "-1", Optional CveTipoEvento As Integer = 2, Optional Importe As Double = -1, + Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1, + Optional CveSubProyecto As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveMovimiento As Integer = -1, + Optional CveContrato As Integer = -1) As Boolean + Dim Retorno As Boolean = False - Retorno = AddEvento(CveTipoEvento, CveAgendaTipo, Asunto, Descripcion, Prioridad, CveUsuarioPara, CveUsuarioIng, FechaInicio, FechaFin, -1, -1, "-1", CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, - CvePersonal, CveProveedor, CveEventoPadre:=CveEventoPadre, RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dia, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, Importe:=Importe, - CveEmpresaCRM:=CveEmpresaCRM, CveContactoCRM:=CveContactoCRM, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoProcesoCRM:=CveTipoProcesoCRM, CveEtapaProcesoCRM:=CveEtapaProcesoCRM, CveSubProyecto:=CveSubProyecto, CveCompra:=CveCompra, - CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, CveContrato:=CveContrato) + Retorno = AddEvento(CveTipoEvento, CveAgendaTipo, Asunto, Descripcion, Prioridad, CveUsuarioPara, CveUsuarioIng, FechaInicio, FechaFin, -1, -1, "-1", CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, + CvePersonal, CveProveedor, CveEventoPadre:=CveEventoPadre, RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dia, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, Importe:=Importe, + CveEmpresaCRM:=CveEmpresaCRM, CveContactoCRM:=CveContactoCRM, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoProcesoCRM:=CveTipoProcesoCRM, CveEtapaProcesoCRM:=CveEtapaProcesoCRM, CveSubProyecto:=CveSubProyecto, CveCompra:=CveCompra, + CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, CveContrato:=CveContrato) - Return Retorno - End Function + Return Retorno + End Function + Public Function GetAgendas(CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index b29275701..38cec4aa4 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -8018,10 +8018,11 @@ Public Class ClsPaginas params.Add(New ReportParameter("ProveedorContacto", ObjOC.ProveedorContacto)) params.Add(New ReportParameter("Comprador", ObjOC.UsuarioAsignado)) End If + + If UsuarioActual.CveEmpresa.Contiene(189) Then + params.Add(New ReportParameter("DiasCreditoOC", dtOC(0)("DiasCreditoOC").ToString)) + End If - If UsuarioActual.CveEmpresa.Contiene(189) Then - params.Add(New ReportParameter("DiasCreditoOC", dtOC(0)("DiasCreditoOC").ToString)) - End If If UsuarioActual.CveEmpresa.Contiene(13, 83) Then 'Dim ObjCuentasBancos As New ClsGenerales() diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index ca7b91b0a..73bc2593f 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -2543,8 +2543,9 @@ Public Class ClsProductosServicios Return Retorno End Function - - + + + Public Function UpdateUltimoCosto(CvePS As Integer, UltimoCosto As Decimal, CveUsuarioModifico As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ProductosServiciosUpdateUltimoCostoUpdate") @@ -2554,6 +2555,7 @@ Public Class ClsProductosServicios .Add("@UltimoCosto", SqlDbType.Decimal).Value = UltimoCosto .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try diff --git a/App_Code/ClsPuntoVenta.vb b/App_Code/ClsPuntoVenta.vb index a0d04f707..c0b194cf8 100644 --- a/App_Code/ClsPuntoVenta.vb +++ b/App_Code/ClsPuntoVenta.vb @@ -17,7 +17,7 @@ Public Class ClsPuntoVenta Private SqlCommand As SqlCommand Private SqlTransacc As SqlTransaction Private Data As DataTable - Private Dataset As DataSet + Private Dataset As DataSet 'Atributos de la clase Private disposedValue As Boolean = False ' Para detectar llamadas redundantes @@ -400,31 +400,30 @@ Public Class ClsPuntoVenta End Try Return Retorno - End Function - - Public Function GetVta_EstadoCajas(CveCuenta As Integer, CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_VentasEstadoCajasGet") + End Function + + Public Function GetVta_EstadoCajas(CveCuenta As Integer, CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasEstadoCajasGet") - SqlAdapter.SelectCommand.Parameters.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta - SqlAdapter.SelectCommand.Parameters.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - SqlAdapter.SelectCommand.Parameters.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio - SqlAdapter.SelectCommand.Parameters.Add("@FechaFin", SqlDbType.Date).Value = FechaFin + SqlAdapter.SelectCommand.Parameters.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta + SqlAdapter.SelectCommand.Parameters.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + SqlAdapter.SelectCommand.Parameters.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + SqlAdapter.SelectCommand.Parameters.Add("@FechaFin", SqlDbType.Date).Value = FechaFin - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los Cortes del Punto de Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los Cortes del Punto de Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try - Return Retorno - End Function - + Return Retorno + End Function #Region "IDisposable Support" - - - ' IDisposable + + + ' IDisposable Protected Overridable Sub Dispose(disposing As Boolean) If Not Me.disposedValue Then If disposing Then diff --git a/App_Code/ClsSAT.vb b/App_Code/ClsSAT.vb index 61a3dc72c..35de3e019 100644 --- a/App_Code/ClsSAT.vb +++ b/App_Code/ClsSAT.vb @@ -4,7 +4,6 @@ Option Explicit On Imports System.Data Imports System.Data.SqlClient Imports System.Net -Imports System.Xml Imports Extensiones Imports GemBox.Spreadsheet @@ -253,37 +252,6 @@ Public Class ClsSAT End Function - Public Function SolicitudesDetalleProcesa(cveSolicitudDetalle As Int32, tipo As Int32, rutaxmls As List(Of String), cveEmpresa As Int32, insertaMetadata As Int32) As Boolean - Dim retorno As Boolean = False - Dim xmlDoc As New XmlDocument() - - ' Crear el elemento raíz - Dim rootElement As XmlElement = xmlDoc.CreateElement("folder") - xmlDoc.AppendChild(rootElement) - - ' Añadir los elementos con el atributo urlfile - For Each url In rutaxmls - Dim archivoElement As XmlElement = xmlDoc.CreateElement("archivo") - archivoElement.SetAttribute("urlfile", url) - rootElement.AppendChild(archivoElement) - Next - DataAdapter("PA_Gral_Sat_SolicitudesDetalleProcesa", CommandType.StoredProcedure) - With SqlAdapter.SelectCommand.Parameters - .Add("@CveSolicitudDetalle", SqlDbType.Int).Value = cveSolicitudDetalle - .Add("@Tipo", SqlDbType.Int).Value = tipo - .Add("@Xmlarchivos", SqlDbType.Xml).Value = xmlDoc.ToString() - .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa - .Add("@InsertaMetadata", SqlDbType.Int).Value = insertaMetadata - End With - Try - SqlAdapter.Fill(Data) - retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los registros", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return retorno - End Function #Region "LISTADO 69B" diff --git a/App_Code/ClsSisNotificaciones.vb b/App_Code/ClsSisNotificaciones.vb index 354cfa4c9..c2a954d5e 100644 --- a/App_Code/ClsSisNotificaciones.vb +++ b/App_Code/ClsSisNotificaciones.vb @@ -2393,7 +2393,7 @@ Public Class ClsSisNotificaciones _hubContext.Clients.Client(Notificaciones.UsuariosConexiones(cveusuarioPara)).ContadorCampana(notificacion) ClsPaginas.GlobalDTNotificacionesUsuarios(-1, cveEmpresa) = Nothing End If - + Return true End Function Private Function NotificacionesUsuariosMensajesAdd(cveOrigen As Int32, cveusuarioPara As Int32, cveUsuarioDe As Int32, notificaCorreo As Boolean, notificaToast As Boolean, notificaCampana As Boolean, icono As String, asunto As String, mensaje As String, cveEmpresa As Int32) As Boolean @@ -2420,7 +2420,7 @@ Public Class ClsSisNotificaciones Catch ex As Exception OnError("Ocurrió un error al intentar agregar Notificación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try - Return retorno + Return retorno End Function #End Region diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index f9331895a..2f25b01ec 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2481,34 +2481,36 @@ Public Class ClsVentas 'End Function #Region " PROMOCIONES " + Public Function GetPromociones(CvePromocion As Integer, Fecha As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer, - CveSubProyecto As Integer, Optional CveMarca As Integer = -1, Optional CveUsuario As Integer = -1, Optional CvePS As Integer = -1) As Boolean + CveSubProyecto As Integer, Optional CveMarca As Integer = -1, Optional CveUsuario As Integer = -1, Optional CvePS As Integer = -1) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_PromocionesGet") + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PromocionesGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@Estatus", SqlDbType.Int).Value = Estatus - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@CveMarca", SqlDbType.Int).Value = CveMarca - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario - .Add("@CvePS", SqlDbType.Int).Value = CvePS - End With + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario + .Add("@CvePS", SqlDbType.Int).Value = CvePS + End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las Promociones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Promociones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try - Return Retorno - End Function + Return Retorno + End Function + Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String, Optional CveMarca As Integer = -1, Optional EsDistribuidor As Integer = -1, Optional ReqAutorizacion As Boolean = False) As Integer @@ -2610,27 +2612,30 @@ Public Class ClsVentas Return Retorno End Function + + + Public Function UpdatePromocionEstatus(CvePromocion As Integer, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PromocionEstatusUpdate") - Public Function UpdatePromocionEstatus(CvePromocion As Integer, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_PromocionEstatusUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePromocion", SqlDbType.Float).Value = CvePromocion + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePromocion", SqlDbType.Float).Value = CvePromocion - .Add("@Estatus", SqlDbType.Bit).Value = Estatus - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el estatus la Promoción.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar el estatus la Promoción.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function + Return Retorno + End Function + + Public Function RemovePromociones(CvePromocion As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -3288,34 +3293,36 @@ Public Class ClsVentas Return Retorno End Function + Public Function GetRepRemisionesSinFacturar(FechaI As String, FechaF As String, FechaV As String, CveSubProyecto As String, CveCliente As Integer, CveContrato As Integer, CveVendedor As String, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional ConsultaInventario As Boolean = False, Optional PrimerProducto As Boolean = False) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_RepRemisionesGet") + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_RepRemisionesGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@FechaI", SqlDbType.VarChar).Value = FechaI - .Add("@FechaF", SqlDbType.VarChar).Value = FechaF - .Add("@FechaV", SqlDbType.VarChar).Value = FechaV - .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveContrato", SqlDbType.Int).Value = CveContrato - .Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta - .Add("@ConsultaInventario", SqlDbType.Bit).Value = ConsultaInventario - .Add("@PrimerProducto", SqlDbType.Bit).Value = PrimerProducto - End With + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.VarChar).Value = FechaI + .Add("@FechaF", SqlDbType.VarChar).Value = FechaF + .Add("@FechaV", SqlDbType.VarChar).Value = FechaV + .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@ConsultaInventario", SqlDbType.Bit).Value = ConsultaInventario + .Add("@PrimerProducto", SqlDbType.Bit).Value = PrimerProducto + End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las remisiones sin facturar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las remisiones sin facturar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try - Return Retorno - End Function + Return Retorno + End Function + Public Function GetRepRemisionesSinFacturarDetalle(FechaI As String, FechaF As String, FechaV As String, CveCliente As Integer, CveContrato As Integer, CveVenta As Integer, CveEmpresa As Integer, CveSubProyecto As String, Optional CveUsuarioConsulta As Integer = -1, Optional ConsultaInventario As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepRemisionesDetalleGet") @@ -7594,7 +7601,6 @@ Public Class ClsVentas #End Region - Public Function GetRepVentasBiosistemas(CveEmpresa As Integer, Opcion As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasBiosistemasGetRep") @@ -7614,29 +7620,29 @@ Public Class ClsVentas Return Retorno End Function + + Public Function GetSabanaE189(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, CveProveedor As Integer, CodigoPSInicio As String, CodigoPSFin As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasSabanaDatos") - Public Function GetSabanaE189(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, CveProveedor As Integer, CodigoPSInicio As String, CodigoPSFin As String) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_VentasSabanaDatos") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CodigoProductoI", SqlDbType.VarChar).Value = CodigoPSInicio + .Add("@CodigoProductoF", SqlDbType.VarChar).Value = CodigoPSFin + End With - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio - .Add("@FechaFin", SqlDbType.Date).Value = FechaFin - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@CodigoProductoI", SqlDbType.VarChar).Value = CodigoPSInicio - .Add("@CodigoProductoF", SqlDbType.VarChar).Value = CodigoPSFin - End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los datos de la Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los datos de la Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function + Return Retorno + End Function #Region "IDisposable Support" diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index 86d3ec501..1d6cd4556 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -83,6 +83,7 @@ Public Class LogicNominas Return Retorno End Function Dim hasfiniquito As Boolean + Public Function PreTimbrar(CveNomina As Integer, UsuarioActual As Usuario, TimbreIndemnizacion As Boolean, Optional versionTimbrex As VersionTimbradoEnum = VersionTimbradoEnum.PorDefectoEmpresa) As CFDITimbre Dim versionTimbre As VersionTimbradoEnum = versionTimbrex @@ -525,4 +526,5 @@ Public Class LogicNominas End If End Function + End Class diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 6c42babe3..b71c4f47d 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1718,12 +1718,9 @@ Namespace Modelos Timbre.Comprobante.Folio = Me.Folio.ToString() Timbre.Comprobante.Serie = Me.Serie Timbre.Comprobante.Fecha = Me.FechaCP - - Timbre.Comprobante.MetodoPago = ClsPaginas.GlobalDTVtaMetodoPago().FiltroPrimeroValor("ClaveMetodoPagoSAT", $"CveMetodoPago = {Me.CveMetodoPago}") - Timbre.Comprobante.FormadePago = ClsPaginas.GlobalDTVtaFormaPago().FiltroPrimeroValor("ClaveFormaPagoSAT", $"CveFormaPago = {Me.CveFormaPago}") - Timbre.Receptor.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI().FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {Me.CveUsoCFDI}") - Timbre.Comprobante.CondicionesdePago = ClsPaginas.GlobalDTVtaFormaPago().FiltroPrimeroValor("FormaPago", $"CveFormaPago = {Me.CveFormaPago}") - + Timbre.Comprobante.FormadePago = Me.ClaveFormaPagoSAT + Timbre.Comprobante.CondicionesdePago = Me.FormaPago + Timbre.Comprobante.MetodoPago = Me.ClaveMetodoPagoSAT Timbre.Comprobante.SubTotal = Me.SubTotal Timbre.Comprobante.Descuentos = Me.Descuento Timbre.Comprobante.Moneda = Me.MonedaSAT @@ -1849,6 +1846,7 @@ Namespace Modelos } End If + Me.FemsaFactura = New Modelos.FemsaFactura Me.Timbre = Timbre End Sub @@ -3541,6 +3539,11 @@ Namespace Modelos Pago.AplicaTraslado = False Pago.Referencia = Concepto + If DtVentasNC.Columns.Contains("CveIE") Then + Dim CveIEVenta As Integer = Dr("CveIE").ToString().ToEntero() + Pago.CveIE = CveIEVenta + End If + ErrorPrepoliza = ClsPaginas.AplicaPrePolizaPagoVenta(ventaRef, Pago, ObjFactura.CvePrePoliza, ObjConta) If Not ErrorPrepoliza AndAlso ObjFactura.CveTipoAmortizacionAnticipo = 2 AndAlso ObjFactura.EsNCAmortizacion AndAlso ObjFactura.TipoDocto.Contiene("Egs") AndAlso ObjFactura.DtAnticiposAplicados IsNot Nothing Then