diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index d6693040d..1fa789d2c 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -6081,7 +6081,7 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function GetPrePolizasImpresion(CveEmpresa As Integer, FechaI As String, FechaF As String, Optional CveTipoPoliza As Integer = -1, Optional FolioI As Integer = -1, + Public Function GetPrePolizasImpresion(CveEmpresa As Integer, FechaI As Date, FechaF As Date, Optional CveTipoPoliza As Integer = -1, Optional FolioI 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 CveTipoProveedor As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -6601,6 +6601,34 @@ Public Class ClsContabilidad #End Region + + + Public Function GetPolizas(Ejercicio As Integer, Periodo As Integer, TipoPoliza As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean + Dim Respuesta As Boolean = False + + DataAdapter("PA_Conta_FiltraPolizasGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio + .Add("@Periodo", SqlDbType.Int).Value = Periodo + .Add("@TipoPoliza", SqlDbType.Int).Value = TipoPoliza + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + + End With + Try + SqlAdapter.Fill(Data) + Respuesta = True + Catch ex As Exception + Me.OnError("Ocurrió un error al obtener las Prepolizas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Respuesta + + End Function + + #Region "IDisposable Support" ' IDisposable Protected Overridable Sub Dispose(disposing As Boolean) diff --git a/App_Code/ClsSisEmpresas.vb b/App_Code/ClsSisEmpresas.vb index e96dd9a87..df98ac503 100644 --- a/App_Code/ClsSisEmpresas.vb +++ b/App_Code/ClsSisEmpresas.vb @@ -1,1851 +1,1851 @@ -Option Explicit On -Option Strict On - -Imports System.Data -Imports System.Data.SqlClient -Imports Extensiones -Imports System -Imports System.Configuration - -Public Class ClsSisEmpresas - Implements IDisposable - -#Region "Campos" - - 'SQL - Private SqlConexion As SqlConnection - Private SqlAdapter As SqlDataAdapter - Private SqlTransacc As SqlTransaction - Private SqlCommand As SqlCommand - Private Data As DataTable - - 'Atributos de la clase - Private _Empresa As Empresa - Private _CveEmpresa As Integer - 'Private _Empresa As String - 'Private _Direccion As String - 'Private _NoExt As String - 'Private _NoInt As String - 'Private _Colonia As String - 'Private _Ciudad As String - - 'Private _Estado As String - 'Private _CP As Integer - 'Private _RFC As String - 'Private _Telefono As String - 'Private _Contacto As String - 'Private _Mail As String - 'Private _TipoFacturacion As String - 'Private _ContraseñaKey As String - 'Private _ArchivoKey As String - 'Private _ArchivoCer As String - 'Private _ArchivoPfx As String - 'Private _BIUsuario As String - 'Private _BIContraseña As String - 'Private _Banner As String - 'Private _FacturaProduccion As Boolean - 'Private _FechaIng As Date - 'Private _CveUsuario As Integer - 'Private _SendMail As String - 'Private _SendMailPassword As String - 'Private _Usuario As String - 'Private _MostrarRetIVA As Boolean - ' Private _MostrarRetISR As Boolean - - - Private disposedValue As Boolean = False ' Para detectar llamadas redundantes - 'PARA REGISTRAR CONEXION - Private CveConexion As Integer = 0 - -#End Region - -#Region "Propiedades" - Public ReadOnly Property DtResultados As DataTable - Get - DtResultados = Data - End Get - End Property - Public ReadOnly Property CveEmpresa As Integer - Get - Return _CveEmpresa - End Get - End Property - Public ReadOnly Property Empresa As Empresa - Get - Return _Empresa - End Get - End Property - - 'Public ReadOnly Property Usuario As String - ' Get - ' Return _Usuario - ' End Get - 'End Property - - 'Public ReadOnly Property RFC As String - ' Get - ' Return _RFC - ' End Get - 'End Property - - 'Public ReadOnly Property Telefono As String - ' Get - ' Return _Telefono - ' End Get - 'End Property - - 'Public ReadOnly Property Contacto As String - ' Get - ' Return _Contacto - ' End Get - 'End Property - - 'Public ReadOnly Property Mail As String - ' Get - ' Return _Mail - ' End Get - 'End Property - - 'Public ReadOnly Property TipoFacturacion As String - ' Get - ' Return _TipoFacturacion - ' End Get - 'End Property - - 'Public ReadOnly Property ContraseñaKey As String - ' Get - ' Return _ContraseñaKey - ' End Get - 'End Property - - 'Public ReadOnly Property ArchivoKey As String - ' Get - ' Return _ArchivoKey - ' End Get - 'End Property - - 'Public ReadOnly Property ArchivoCer As String - ' Get - ' Return _ArchivoCer - ' End Get - 'End Property - - 'Public ReadOnly Property ArchivoPfx As String - ' Get - ' Return _ArchivoPfx - ' End Get - 'End Property - - 'Public ReadOnly Property BIUsuario As String - ' Get - ' Return _BIUsuario - ' End Get - 'End Property - - 'Public ReadOnly Property BIContraseña As String - ' Get - ' Return _BIContraseña - ' End Get - 'End Property - - 'Public ReadOnly Property Banner As String - ' Get - ' Return _Banner - ' End Get - 'End Property - - 'Public ReadOnly Property FacturaProduccion As Boolean - ' Get - ' Return _FacturaProduccion - ' End Get - 'End Property - - 'Public ReadOnly Property Fechaing As Date - ' Get - ' Return _FechaIng - ' End Get - 'End Property - - 'Public ReadOnly Property CveUsuario As Integer - ' Get - ' Return _CveUsuario - ' End Get - 'End Property - - 'Public ReadOnly Property SendMail As String - ' Get - ' Return _SendMail - ' End Get - 'End Property - - 'Public ReadOnly Property SendMailPassword As String - ' Get - ' Return _SendMailPassword - ' End Get - 'End Property - - 'Public ReadOnly Property MostrarRetIVA As Boolean - ' Get - ' Return _MostrarRetIVA - ' End Get - 'End Property - - 'Public ReadOnly Property MostrarRetISR As Boolean - ' Get - ' Return _MostrarRetISR - ' End Get - 'End Property - - 'Public Property Regimen As String - 'Public Property EstatusFacturacion As Boolean - 'Public Property Estatus As Boolean - 'Public Property UsaContabilidad As Boolean - 'Public Property BDContPAQi As String - 'Public Property ServerContPAQi As String - 'Public Property UsrContPAQi As String - 'Public Property PwdContPAQi As String -#End Region - - Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) - - If TransaccionCompartida Is Nothing Then - SqlConexion = New SqlConnection - SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString - Try - SqlConexion.Open() - Catch ex As Exception - OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) - End Try - Else - SqlConexion = TransaccionCompartida.Connection - SqlTransacc = TransaccionCompartida - End If - - SqlCommand = New SqlCommand("", SqlConexion) - SqlAdapter = New SqlDataAdapter("", SqlConexion) - ConexionAdd() - - End Sub - Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) - With SqlAdapter.SelectCommand - .Parameters.Clear() - .CommandText = StrSQL - .CommandType = TipoComando - End With - If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc - Data = New DataTable - End Sub -#Region "Conexiones" - - Private Sub ConexionAdd() - If 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 - 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 -#End Region - Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) - With SqlCommand - .Parameters.Clear() - .CommandText = pStrSQL - .CommandType = TipoComando - End With - - If Not SqlTransacc Is Nothing Then SqlCommand.Transaction = SqlTransacc - - End Sub - Public Function IniciaTransacSQL() As SqlTransaction - If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction() - Return SqlTransacc - End Function - Public Sub RollBack() - If SqlTransacc IsNot Nothing Then SqlTransacc.Rollback() - SqlTransacc = Nothing - End Sub - Public Sub Commit() - If SqlTransacc IsNot Nothing Then SqlTransacc.Commit() - SqlTransacc = Nothing - End Sub - -#Region "Empresas" - Public Function UpEmpresaFiel(CveEmpresa As Integer, FielPassword As String, FielPFX As String) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("UPDATE Empresas SET FielPassword=@FielPassword, FielPFX=@FielPFX WHERE CveEmpresa=@CveEmpresa ", CommandType.Text) - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@FielPassword", SqlDbType.VarChar).Value = FielPassword - .Add("@FielPFX", SqlDbType.VarChar).Value = FielPFX - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al actualizar la fiel de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - End Function - Public Function GetEmpresas(CveEmpresa As Integer, Empresa As String, RFC As String, Telefono As String, Contacto As String) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@Empresa", SqlDbType.VarChar).Value = Empresa - .Add("@RFC", SqlDbType.VarChar).Value = RFC - .Add("@Telefono", SqlDbType.VarChar).Value = Telefono - .Add("@Contacto", SqlDbType.VarChar).Value = Contacto - End With - Try - SqlAdapter.Fill(Data) - If CveEmpresa <> -1 And Data.Rows.Count > 0 Then - _Empresa = New Empresa - _Empresa.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero - _Empresa.Empresa = Data.Rows(0)("Empresa").ToString - _Empresa.NombreCorto = Data.Rows(0)("NombreCorto").ToString - _Empresa.Direccion = Data.Rows(0)("Direccion").ToString - _Empresa.NoExt = Data.Rows(0)("NoExt").ToString - _Empresa.NoInt = Data.Rows(0)("NoInt").ToString - _Empresa.Colonia = Data.Rows(0)("Colonia").ToString - _Empresa.Ciudad = Data.Rows(0)("Ciudad").ToString - _Empresa.Estado = Data.Rows(0)("Estado").ToString - _Empresa.CP = Data.Rows(0)("CP").ToString().ToEntero - _Empresa.Regimen = Data.Rows(0)("Regimen").ToString - _Empresa.CodigoRegimenFiscal = Data.Rows(0)("CodigoRegimenFiscal").ToString - _Empresa.RFC = Data.Rows(0)("RFC").ToString - _Empresa.CURP = Data.Rows(0)("CURP").ToString - _Empresa.RegistroPatronal = Data.Rows(0)("RegistroPatronal").ToString.ToString - _Empresa.Telefono = Data.Rows(0)("Telefono").ToString - _Empresa.Contacto = Data.Rows(0)("Contacto").ToString - _Empresa.Mail = Data.Rows(0)("Mail").ToString - _Empresa.MostrarRetIVA = Data.Rows(0)("MostrarRetIVA").ToString <> "No" - _Empresa.MostrarRetISR = Data.Rows(0)("MostrarRetISR").ToString <> "No" - _Empresa.TipoFacturacion = Data.Rows(0)("TipoFacturacion").ToString - _Empresa.BIUsuario = Data.Rows(0)("BIUsuario").ToString - _Empresa.BIContraseña = Data.Rows(0)("BIContraseña").ToString - _Empresa.ArchivoKey = Data.Rows(0)("ArchivoKey").ToString - _Empresa.ArchivoCer = Data.Rows(0)("ArchivoCer").ToString - _Empresa.ArchivoPfx = Data.Rows(0)("ArchivoPfx").ToString - _Empresa.ContraseñaKey = Data.Rows(0)("ContraseñaKey").ToString - _Empresa.SendMail = Data.Rows(0)("SendMail").ToString - _Empresa.SendMailPassword = Data.Rows(0)("SendMailPassword").ToString - _Empresa.SendMailServer = Data.Rows(0)("SendMailServer").ToString - _Empresa.SendMailPuerto = Data.Rows(0)("SendMailPuerto").ToString.ToEntero - _Empresa.SendMailSSL = If(Data.Rows(0)("SendMailSSL").ToString = "", False, CBool(Data.Rows(0)("SendMailSSL").ToString)) - _Empresa.Buzon_Mail = Data.Rows(0)("Buzon_Mail").ToString - _Empresa.Buzon_Server = Data.Rows(0)("Buzon_Server").ToString - _Empresa.Buzon_Puerto = Data.Rows(0)("Buzon_Puerto").ToString.ToEntero - _Empresa.Buzon_SSL = If(Data.Rows(0)("Buzon_SSL").ToString = "", False, CBool(Data.Rows(0)("Buzon_SSL").ToString)) - _Empresa.Buzon_USR = Data.Rows(0)("Buzon_USR").ToString - _Empresa.Buzon_PWD = Data.Rows(0)("Buzon_PWD").ToString - _Empresa.Soporte_Mail = Data.Rows(0)("Soporte_Mail").ToString - _Empresa.Soporte_Server = Data.Rows(0)("Soporte_Server").ToString - _Empresa.Soporte_Puerto = Data.Rows(0)("Soporte_Puerto").ToString.ToEntero - _Empresa.Soporte_SSL = If(Data.Rows(0)("Soporte_SSL").ToString = "", False, CBool(Data.Rows(0)("Soporte_SSL").ToString)) - _Empresa.Soporte_USR = Data.Rows(0)("Soporte_USR").ToString - _Empresa.Soporte_PWD = Data.Rows(0)("Soporte_PWD").ToString - _Empresa.Soporte_Tipo = Data.Rows(0)("Soporte_Tipo").ToString - _Empresa.BDContPAQi = Data.Rows(0)("BDContPAQi").ToString - _Empresa.ServerContPAQi = Data.Rows(0)("ServerContPAQi").ToString - _Empresa.UsrContPAQi = Data.Rows(0)("UsrContPAQi").ToString - _Empresa.PwdContPAQi = Data.Rows(0)("PwdContPAQi").ToString - _Empresa.Estatus = Data.Rows(0)("Estatus").ToString = "Activo" - _Empresa.FechaIng = Data.Rows(0)("Fecha").ToString.ToDate - _Empresa.Usuario = Data.Rows(0)("Usuario").ToString - _Empresa.FacturaProduccion = If(Data.Rows(0)("FacturaProduccion").ToString = "", False, CBool(Data.Rows(0)("FacturaProduccion").ToString)) - _Empresa.EstatusFacturacion = Data.Rows(0)("EstatusFacturacion").ToString <> "No" - _Empresa.UsaContabilidad = Data.Rows(0)("UsaContabilidad").ToString <> "No" - _Empresa.UsaContabilidadSIG = Data.Rows(0)("UsaContabilidadSIG").ToString <> "No" - _Empresa.UsaBancos = Data.Rows(0)("UsaBancos").ToString <> "No" - _Empresa.UsaVentas = Data.Rows(0)("UsaVentas").ToString <> "No" - _Empresa.UsaCxC = Data.Rows(0)("UsaCxC").ToString <> "No" - _Empresa.UsaCompras = Data.Rows(0)("UsaCompras").ToString <> "No" - _Empresa.UsaInventarios = Data.Rows(0)("UsaInventarios").ToString <> "No" - _Empresa.UsaRH = Data.Rows(0)("UsaRH").ToString <> "No" - _Empresa.UsaNomina = Data.Rows(0)("UsaNomina").ToString <> "No" - _Empresa.UsaOS = Data.Rows(0)("UsaOS").ToString <> "No" - _Empresa.UsaAC = Data.Rows(0)("UsaAC").ToString <> "No" - _Empresa.UsaArmonizacion = Data.Rows(0)("UsaArmonizacion").ToString <> "No" - _Empresa.UsaAF = Data.Rows(0)("UsaAF").ToString <> "No" - _Empresa.Banner = Data.Rows(0)("Banner").ToString - _Empresa.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero - _Empresa.CvePAC = Data.Rows(0)("CvePAC").ToString.ToEntero - _Empresa.CveRegimenFiscal = Data.Rows(0)("CveRegimenFiscal").ToString.ToEntero - _Empresa.EmpresaEncabezado = Data.Rows(0)("EmpresaEncabezado").ToString - _Empresa.EsComercializadora = Data.Rows(0)("EsComercializadora").ToString = "True" - - 'Nuevos Datos - _Empresa.AreaGeografica = Data.Rows(0)("AreaGeografica").ToString - _Empresa.IdCuentaIVAxAcreditar = Data.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero - _Empresa.IdCuentaIVAAcreditable = Data.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero - _Empresa.IdCuentaIVAxTrasladar = Data.Rows(0)("IdCuentaIVAxTrasladar").ToString.ToEntero - _Empresa.IdCuentaIVATrasladado = Data.Rows(0)("IdCuentaIVATrasladado").ToString.ToEntero - _Empresa.IdCuentaRetIVACirculacion = Data.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - _Empresa.IdCuentaRetISRCirculacion = Data.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - _Empresa.IdCuentaDSV = Data.Rows(0)("Conta_IdCuentaDescuentoVenta").ToString.ToEntero - _Empresa.IdCuentaImpuestosLocales = Data.Rows(0)("Conta_IdCuentaImpuestosLocales").ToString.ToEntero - _Empresa.IdCuentaIEPSxAcreditar = Data.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero - _Empresa.IdCuentaIEPSAcreditable = Data.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero - _Empresa.IdCuentaIEPSxTrasladar = Data.Rows(0)("IdCuentaIEPSxTrasladar").ToString.ToEntero - _Empresa.IdCuentaIEPSTrasladado = Data.Rows(0)("IdCuentaIEPSTrasladado").ToString.ToEntero - _Empresa.IdCuentaOtrosIngresos = Data.Rows(0)("Conta_IdCuentaOtrosIngresos").ToString.ToEntero - - '_Empresa.IdCtaProveedor = Data.Rows(0)("IdCtaProveedor").ToString.ToEntero - '_Empresa.IdCtaCliente = Data.Rows(0)("IdCtaCliente").ToString.ToEntero - '_Empresa.IdCtaDeudores = Data.Rows(0)("IdCtaDeudores").ToString.ToEntero - '_Empresa.IdCtaCliente = Data.Rows(0)("IdCtaCliente").ToString.ToEntero - '_Empresa.IdCtaAcreedores = Data.Rows(0)("IdCtaAcreedores").ToString.ToEntero - '_Empresa.IdCtaDocXPagar = Data.Rows(0)("IdCtaDocXPagar").ToString.ToEntero - '_Empresa.IdCtaAnticipoCliente = Data.Rows(0)("IdCtaAnticipoCliente").ToString.ToEntero - '_Empresa.IdCtaAnticipoProveedores = Data.Rows(0)("IdCtaAnticipoProveedores").ToString.ToEntero - - _Empresa.Buzon_Tipo = Data.Rows(0)("Buzon_Tipo").ToString - _Empresa.ContaContabilizacionNC = Data.Rows(0)("Conta_ContabilizacionNC").ToString.ToEntero - '_Empresa.Ruta = String.Format("{0}Empresas\{1}\", ModExtensiones.DirectorioBaseEmpresas, _Empresa.CveEmpresa) - _Empresa.PV_TerminalTipo = Data.Rows(0)("PV_TerminalTipo").ToString.ToEntero - _Empresa.EjercicioActual = Data.Rows(0)("EjercicioActual").ToString.ToEntero - _Empresa.PeriodoActual = Data.Rows(0)("PeriodoActual").ToString.ToEntero - '_Empresa.GralSoloProyecto = Data.Rows(0)("Gral_SoloProyecto").ToString <> "No" - _Empresa.MetodoOC = Data.Rows(0)("MetodoOC").ToString.ToEntero - _Empresa.CveMetodoInventario = Data.Rows(0)("Inv_CveMetodoInventario").ToString.ToEntero - _Empresa.RequiereCentroCostos = Data.Rows(0)("RequiereCentroCostos").ToString <> "No" - _Empresa.IdCuentaPerdidaCambiaria = Data.Rows(0)("IdCuentaPerdidaCambiaria").ToString.ToEntero - _Empresa.IdCuentaGananciaCambiaria = Data.Rows(0)("IdCuentaGananciaCambiaria").ToString.ToEntero - _Empresa.Tipo_CentroCosto = Data.Rows(0)("Tipo_CentroCosto").ToString.ToEntero - _Empresa.GrupoEmpresa = Data.Rows(0)("GrupoEmpresa").ToString.ToEntero - _Empresa.PlantillaMailVenta = Data.Rows(0)("PlantillaMailVenta").ToString - _Empresa.AsuntoPlantillaMailVenta = Data.Rows(0)("AsuntoPlantillaMailVenta").ToString - _Empresa.CvePlataforma = Data.Rows(0)("CvePlataforma").ToString.ToEntero - _Empresa.CveDistribuidor = Data.Rows(0)("CveDistribuidor").ToString.ToEntero - _Empresa.DiasPermitidos = Data.Rows(0)("DiasPermitidos").ToString.ToEntero - _Empresa.AsientoContableComprasContado = If(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString = "", False, CBool(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString)) - _Empresa.TipoContabilizacion = Data.Rows(0)("Conta_TipoContabilizacion").ToString.ToEntero - _Empresa.TipoContabilidad = Data.Rows(0)("Conta_TipoContabilidad").ToString.ToEntero '0 - Sin Conta, 1- Contabilidad SIG, 2- Contabilidad Contpaq - _Empresa.DefaultAsistencias = If(Data.Rows(0)("RH_DefaultAsistencias").ToString = "", False, CBool(Data.Rows(0)("RH_DefaultAsistencias").ToString)) - _Empresa.CIEC = Data.Rows(0)("CIEC").ToString - _Empresa.Localidad = Data.Rows(0)("Localidad").ToString - _Empresa.Importe = Data.Rows(0)("Importe").ToString.ToDecimal - _Empresa.CveMetodoPago = Data.Rows(0)("CveMetodoPago").ToString.ToEntero - _Empresa.Extension = Data.Rows(0)("Extension").ToString - _Empresa.PorDepreciacion = Data.Rows(0)("PorDepreciacion").ToString.ToDecimal - _Empresa.EsPersonaFisica = Data.Rows(0)("EsPersonaFisica").ToString.ToEntero - - _Empresa.UsaCRM = Data.Rows(0)("UsaCRM").ToString = "True" - _Empresa.AplicaDatosTecnicosCRM = If(Data.Rows(0)("AplicaDatosTecnicosCRM").ToString = "", False, CBool(Data.Rows(0)("AplicaDatosTecnicosCRM").ToString)) - _Empresa.CveEncuestaCRM = Data.Rows(0)("CveEncuestaCRM").ToString.ToEntero - - _Empresa.FielPassword = Data.Rows(0)("FielPassword").ToString +Option Explicit On +Option Strict On + +Imports System.Data +Imports System.Data.SqlClient +Imports Extensiones +Imports System +Imports System.Configuration + +Public Class ClsSisEmpresas + Implements IDisposable + +#Region "Campos" + + 'SQL + Private SqlConexion As SqlConnection + Private SqlAdapter As SqlDataAdapter + Private SqlTransacc As SqlTransaction + Private SqlCommand As SqlCommand + Private Data As DataTable + + 'Atributos de la clase + Private _Empresa As Empresa + Private _CveEmpresa As Integer + 'Private _Empresa As String + 'Private _Direccion As String + 'Private _NoExt As String + 'Private _NoInt As String + 'Private _Colonia As String + 'Private _Ciudad As String + + 'Private _Estado As String + 'Private _CP As Integer + 'Private _RFC As String + 'Private _Telefono As String + 'Private _Contacto As String + 'Private _Mail As String + 'Private _TipoFacturacion As String + 'Private _ContraseñaKey As String + 'Private _ArchivoKey As String + 'Private _ArchivoCer As String + 'Private _ArchivoPfx As String + 'Private _BIUsuario As String + 'Private _BIContraseña As String + 'Private _Banner As String + 'Private _FacturaProduccion As Boolean + 'Private _FechaIng As Date + 'Private _CveUsuario As Integer + 'Private _SendMail As String + 'Private _SendMailPassword As String + 'Private _Usuario As String + 'Private _MostrarRetIVA As Boolean + ' Private _MostrarRetISR As Boolean + + + Private disposedValue As Boolean = False ' Para detectar llamadas redundantes + 'PARA REGISTRAR CONEXION + Private CveConexion As Integer = 0 + +#End Region + +#Region "Propiedades" + Public ReadOnly Property DtResultados As DataTable + Get + DtResultados = Data + End Get + End Property + Public ReadOnly Property CveEmpresa As Integer + Get + Return _CveEmpresa + End Get + End Property + Public ReadOnly Property Empresa As Empresa + Get + Return _Empresa + End Get + End Property + + 'Public ReadOnly Property Usuario As String + ' Get + ' Return _Usuario + ' End Get + 'End Property + + 'Public ReadOnly Property RFC As String + ' Get + ' Return _RFC + ' End Get + 'End Property + + 'Public ReadOnly Property Telefono As String + ' Get + ' Return _Telefono + ' End Get + 'End Property + + 'Public ReadOnly Property Contacto As String + ' Get + ' Return _Contacto + ' End Get + 'End Property + + 'Public ReadOnly Property Mail As String + ' Get + ' Return _Mail + ' End Get + 'End Property + + 'Public ReadOnly Property TipoFacturacion As String + ' Get + ' Return _TipoFacturacion + ' End Get + 'End Property + + 'Public ReadOnly Property ContraseñaKey As String + ' Get + ' Return _ContraseñaKey + ' End Get + 'End Property + + 'Public ReadOnly Property ArchivoKey As String + ' Get + ' Return _ArchivoKey + ' End Get + 'End Property + + 'Public ReadOnly Property ArchivoCer As String + ' Get + ' Return _ArchivoCer + ' End Get + 'End Property + + 'Public ReadOnly Property ArchivoPfx As String + ' Get + ' Return _ArchivoPfx + ' End Get + 'End Property + + 'Public ReadOnly Property BIUsuario As String + ' Get + ' Return _BIUsuario + ' End Get + 'End Property + + 'Public ReadOnly Property BIContraseña As String + ' Get + ' Return _BIContraseña + ' End Get + 'End Property + + 'Public ReadOnly Property Banner As String + ' Get + ' Return _Banner + ' End Get + 'End Property + + 'Public ReadOnly Property FacturaProduccion As Boolean + ' Get + ' Return _FacturaProduccion + ' End Get + 'End Property + + 'Public ReadOnly Property Fechaing As Date + ' Get + ' Return _FechaIng + ' End Get + 'End Property + + 'Public ReadOnly Property CveUsuario As Integer + ' Get + ' Return _CveUsuario + ' End Get + 'End Property + + 'Public ReadOnly Property SendMail As String + ' Get + ' Return _SendMail + ' End Get + 'End Property + + 'Public ReadOnly Property SendMailPassword As String + ' Get + ' Return _SendMailPassword + ' End Get + 'End Property + + 'Public ReadOnly Property MostrarRetIVA As Boolean + ' Get + ' Return _MostrarRetIVA + ' End Get + 'End Property + + 'Public ReadOnly Property MostrarRetISR As Boolean + ' Get + ' Return _MostrarRetISR + ' End Get + 'End Property + + 'Public Property Regimen As String + 'Public Property EstatusFacturacion As Boolean + 'Public Property Estatus As Boolean + 'Public Property UsaContabilidad As Boolean + 'Public Property BDContPAQi As String + 'Public Property ServerContPAQi As String + 'Public Property UsrContPAQi As String + 'Public Property PwdContPAQi As String +#End Region + + Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) + + If TransaccionCompartida Is Nothing Then + SqlConexion = New SqlConnection + SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString + Try + SqlConexion.Open() + Catch ex As Exception + OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex) + End Try + Else + SqlConexion = TransaccionCompartida.Connection + SqlTransacc = TransaccionCompartida + End If + + SqlCommand = New SqlCommand("", SqlConexion) + SqlAdapter = New SqlDataAdapter("", SqlConexion) + ConexionAdd() + + End Sub + Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) + With SqlAdapter.SelectCommand + .Parameters.Clear() + .CommandText = StrSQL + .CommandType = TipoComando + End With + If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc + Data = New DataTable + End Sub +#Region "Conexiones" + + Private Sub ConexionAdd() + If 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 + 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 +#End Region + Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) + With SqlCommand + .Parameters.Clear() + .CommandText = pStrSQL + .CommandType = TipoComando + End With + + If Not SqlTransacc Is Nothing Then SqlCommand.Transaction = SqlTransacc + + End Sub + Public Function IniciaTransacSQL() As SqlTransaction + If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction() + Return SqlTransacc + End Function + Public Sub RollBack() + If SqlTransacc IsNot Nothing Then SqlTransacc.Rollback() + SqlTransacc = Nothing + End Sub + Public Sub Commit() + If SqlTransacc IsNot Nothing Then SqlTransacc.Commit() + SqlTransacc = Nothing + End Sub + +#Region "Empresas" + Public Function UpEmpresaFiel(CveEmpresa As Integer, FielPassword As String, FielPFX As String) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("UPDATE Empresas SET FielPassword=@FielPassword, FielPFX=@FielPFX WHERE CveEmpresa=@CveEmpresa ", CommandType.Text) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FielPassword", SqlDbType.VarChar).Value = FielPassword + .Add("@FielPFX", SqlDbType.VarChar).Value = FielPFX + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al actualizar la fiel de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function GetEmpresas(CveEmpresa As Integer, Empresa As String, RFC As String, Telefono As String, Contacto As String) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Empresa", SqlDbType.VarChar).Value = Empresa + .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@Telefono", SqlDbType.VarChar).Value = Telefono + .Add("@Contacto", SqlDbType.VarChar).Value = Contacto + End With + Try + SqlAdapter.Fill(Data) + If CveEmpresa <> -1 And Data.Rows.Count > 0 Then + _Empresa = New Empresa + _Empresa.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero + _Empresa.Empresa = Data.Rows(0)("Empresa").ToString + _Empresa.NombreCorto = Data.Rows(0)("NombreCorto").ToString + _Empresa.Direccion = Data.Rows(0)("Direccion").ToString + _Empresa.NoExt = Data.Rows(0)("NoExt").ToString + _Empresa.NoInt = Data.Rows(0)("NoInt").ToString + _Empresa.Colonia = Data.Rows(0)("Colonia").ToString + _Empresa.Ciudad = Data.Rows(0)("Ciudad").ToString + _Empresa.Estado = Data.Rows(0)("Estado").ToString + _Empresa.CP = Data.Rows(0)("CP").ToString().ToEntero + _Empresa.Regimen = Data.Rows(0)("Regimen").ToString + _Empresa.CodigoRegimenFiscal = Data.Rows(0)("CodigoRegimenFiscal").ToString + _Empresa.RFC = Data.Rows(0)("RFC").ToString + _Empresa.CURP = Data.Rows(0)("CURP").ToString + _Empresa.RegistroPatronal = Data.Rows(0)("RegistroPatronal").ToString.ToString + _Empresa.Telefono = Data.Rows(0)("Telefono").ToString + _Empresa.Contacto = Data.Rows(0)("Contacto").ToString + _Empresa.Mail = Data.Rows(0)("Mail").ToString + _Empresa.MostrarRetIVA = Data.Rows(0)("MostrarRetIVA").ToString <> "No" + _Empresa.MostrarRetISR = Data.Rows(0)("MostrarRetISR").ToString <> "No" + _Empresa.TipoFacturacion = Data.Rows(0)("TipoFacturacion").ToString + _Empresa.BIUsuario = Data.Rows(0)("BIUsuario").ToString + _Empresa.BIContraseña = Data.Rows(0)("BIContraseña").ToString + _Empresa.ArchivoKey = Data.Rows(0)("ArchivoKey").ToString + _Empresa.ArchivoCer = Data.Rows(0)("ArchivoCer").ToString + _Empresa.ArchivoPfx = Data.Rows(0)("ArchivoPfx").ToString + _Empresa.ContraseñaKey = Data.Rows(0)("ContraseñaKey").ToString + _Empresa.SendMail = Data.Rows(0)("SendMail").ToString + _Empresa.SendMailPassword = Data.Rows(0)("SendMailPassword").ToString + _Empresa.SendMailServer = Data.Rows(0)("SendMailServer").ToString + _Empresa.SendMailPuerto = Data.Rows(0)("SendMailPuerto").ToString.ToEntero + _Empresa.SendMailSSL = If(Data.Rows(0)("SendMailSSL").ToString = "", False, CBool(Data.Rows(0)("SendMailSSL").ToString)) + _Empresa.Buzon_Mail = Data.Rows(0)("Buzon_Mail").ToString + _Empresa.Buzon_Server = Data.Rows(0)("Buzon_Server").ToString + _Empresa.Buzon_Puerto = Data.Rows(0)("Buzon_Puerto").ToString.ToEntero + _Empresa.Buzon_SSL = If(Data.Rows(0)("Buzon_SSL").ToString = "", False, CBool(Data.Rows(0)("Buzon_SSL").ToString)) + _Empresa.Buzon_USR = Data.Rows(0)("Buzon_USR").ToString + _Empresa.Buzon_PWD = Data.Rows(0)("Buzon_PWD").ToString + _Empresa.Soporte_Mail = Data.Rows(0)("Soporte_Mail").ToString + _Empresa.Soporte_Server = Data.Rows(0)("Soporte_Server").ToString + _Empresa.Soporte_Puerto = Data.Rows(0)("Soporte_Puerto").ToString.ToEntero + _Empresa.Soporte_SSL = If(Data.Rows(0)("Soporte_SSL").ToString = "", False, CBool(Data.Rows(0)("Soporte_SSL").ToString)) + _Empresa.Soporte_USR = Data.Rows(0)("Soporte_USR").ToString + _Empresa.Soporte_PWD = Data.Rows(0)("Soporte_PWD").ToString + _Empresa.Soporte_Tipo = Data.Rows(0)("Soporte_Tipo").ToString + _Empresa.BDContPAQi = Data.Rows(0)("BDContPAQi").ToString + _Empresa.ServerContPAQi = Data.Rows(0)("ServerContPAQi").ToString + _Empresa.UsrContPAQi = Data.Rows(0)("UsrContPAQi").ToString + _Empresa.PwdContPAQi = Data.Rows(0)("PwdContPAQi").ToString + _Empresa.Estatus = Data.Rows(0)("Estatus").ToString = "Activo" + _Empresa.FechaIng = Data.Rows(0)("Fecha").ToString.ToDate + _Empresa.Usuario = Data.Rows(0)("Usuario").ToString + _Empresa.FacturaProduccion = If(Data.Rows(0)("FacturaProduccion").ToString = "", False, CBool(Data.Rows(0)("FacturaProduccion").ToString)) + _Empresa.EstatusFacturacion = Data.Rows(0)("EstatusFacturacion").ToString <> "No" + _Empresa.UsaContabilidad = Data.Rows(0)("UsaContabilidad").ToString <> "No" + _Empresa.UsaContabilidadSIG = Data.Rows(0)("UsaContabilidadSIG").ToString <> "No" + _Empresa.UsaBancos = Data.Rows(0)("UsaBancos").ToString <> "No" + _Empresa.UsaVentas = Data.Rows(0)("UsaVentas").ToString <> "No" + _Empresa.UsaCxC = Data.Rows(0)("UsaCxC").ToString <> "No" + _Empresa.UsaCompras = Data.Rows(0)("UsaCompras").ToString <> "No" + _Empresa.UsaInventarios = Data.Rows(0)("UsaInventarios").ToString <> "No" + _Empresa.UsaRH = Data.Rows(0)("UsaRH").ToString <> "No" + _Empresa.UsaNomina = Data.Rows(0)("UsaNomina").ToString <> "No" + _Empresa.UsaOS = Data.Rows(0)("UsaOS").ToString <> "No" + _Empresa.UsaAC = Data.Rows(0)("UsaAC").ToString <> "No" + _Empresa.UsaArmonizacion = Data.Rows(0)("UsaArmonizacion").ToString <> "No" + _Empresa.UsaAF = Data.Rows(0)("UsaAF").ToString <> "No" + _Empresa.Banner = Data.Rows(0)("Banner").ToString + _Empresa.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero + _Empresa.CvePAC = Data.Rows(0)("CvePAC").ToString.ToEntero + _Empresa.CveRegimenFiscal = Data.Rows(0)("CveRegimenFiscal").ToString.ToEntero + _Empresa.EmpresaEncabezado = Data.Rows(0)("EmpresaEncabezado").ToString + _Empresa.EsComercializadora = Data.Rows(0)("EsComercializadora").ToString = "True" + + 'Nuevos Datos + _Empresa.AreaGeografica = Data.Rows(0)("AreaGeografica").ToString + _Empresa.IdCuentaIVAxAcreditar = Data.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero + _Empresa.IdCuentaIVAAcreditable = Data.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero + _Empresa.IdCuentaIVAxTrasladar = Data.Rows(0)("IdCuentaIVAxTrasladar").ToString.ToEntero + _Empresa.IdCuentaIVATrasladado = Data.Rows(0)("IdCuentaIVATrasladado").ToString.ToEntero + _Empresa.IdCuentaRetIVACirculacion = Data.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero + _Empresa.IdCuentaRetISRCirculacion = Data.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + _Empresa.IdCuentaDSV = Data.Rows(0)("Conta_IdCuentaDescuentoVenta").ToString.ToEntero + _Empresa.IdCuentaImpuestosLocales = Data.Rows(0)("Conta_IdCuentaImpuestosLocales").ToString.ToEntero + _Empresa.IdCuentaIEPSxAcreditar = Data.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero + _Empresa.IdCuentaIEPSAcreditable = Data.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero + _Empresa.IdCuentaIEPSxTrasladar = Data.Rows(0)("IdCuentaIEPSxTrasladar").ToString.ToEntero + _Empresa.IdCuentaIEPSTrasladado = Data.Rows(0)("IdCuentaIEPSTrasladado").ToString.ToEntero + _Empresa.IdCuentaOtrosIngresos = Data.Rows(0)("Conta_IdCuentaOtrosIngresos").ToString.ToEntero + + '_Empresa.IdCtaProveedor = Data.Rows(0)("IdCtaProveedor").ToString.ToEntero + '_Empresa.IdCtaCliente = Data.Rows(0)("IdCtaCliente").ToString.ToEntero + '_Empresa.IdCtaDeudores = Data.Rows(0)("IdCtaDeudores").ToString.ToEntero + '_Empresa.IdCtaCliente = Data.Rows(0)("IdCtaCliente").ToString.ToEntero + '_Empresa.IdCtaAcreedores = Data.Rows(0)("IdCtaAcreedores").ToString.ToEntero + '_Empresa.IdCtaDocXPagar = Data.Rows(0)("IdCtaDocXPagar").ToString.ToEntero + '_Empresa.IdCtaAnticipoCliente = Data.Rows(0)("IdCtaAnticipoCliente").ToString.ToEntero + '_Empresa.IdCtaAnticipoProveedores = Data.Rows(0)("IdCtaAnticipoProveedores").ToString.ToEntero + + _Empresa.Buzon_Tipo = Data.Rows(0)("Buzon_Tipo").ToString + _Empresa.ContaContabilizacionNC = Data.Rows(0)("Conta_ContabilizacionNC").ToString.ToEntero + '_Empresa.Ruta = String.Format("{0}Empresas\{1}\", ModExtensiones.DirectorioBaseEmpresas, _Empresa.CveEmpresa) + _Empresa.PV_TerminalTipo = Data.Rows(0)("PV_TerminalTipo").ToString.ToEntero + _Empresa.EjercicioActual = Data.Rows(0)("EjercicioActual").ToString.ToEntero + _Empresa.PeriodoActual = Data.Rows(0)("PeriodoActual").ToString.ToEntero + '_Empresa.GralSoloProyecto = Data.Rows(0)("Gral_SoloProyecto").ToString <> "No" + _Empresa.MetodoOC = Data.Rows(0)("MetodoOC").ToString.ToEntero + _Empresa.CveMetodoInventario = Data.Rows(0)("Inv_CveMetodoInventario").ToString.ToEntero + _Empresa.RequiereCentroCostos = Data.Rows(0)("RequiereCentroCostos").ToString <> "No" + _Empresa.IdCuentaPerdidaCambiaria = Data.Rows(0)("IdCuentaPerdidaCambiaria").ToString.ToEntero + _Empresa.IdCuentaGananciaCambiaria = Data.Rows(0)("IdCuentaGananciaCambiaria").ToString.ToEntero + _Empresa.Tipo_CentroCosto = Data.Rows(0)("Tipo_CentroCosto").ToString.ToEntero + _Empresa.GrupoEmpresa = Data.Rows(0)("GrupoEmpresa").ToString.ToEntero + _Empresa.PlantillaMailVenta = Data.Rows(0)("PlantillaMailVenta").ToString + _Empresa.AsuntoPlantillaMailVenta = Data.Rows(0)("AsuntoPlantillaMailVenta").ToString + _Empresa.CvePlataforma = Data.Rows(0)("CvePlataforma").ToString.ToEntero + _Empresa.CveDistribuidor = Data.Rows(0)("CveDistribuidor").ToString.ToEntero + _Empresa.DiasPermitidos = Data.Rows(0)("DiasPermitidos").ToString.ToEntero + _Empresa.AsientoContableComprasContado = If(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString = "", False, CBool(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString)) + _Empresa.TipoContabilizacion = Data.Rows(0)("Conta_TipoContabilizacion").ToString.ToEntero + _Empresa.TipoContabilidad = Data.Rows(0)("Conta_TipoContabilidad").ToString.ToEntero '0 - Sin Conta, 1- Contabilidad SIG, 2- Contabilidad Contpaq + _Empresa.DefaultAsistencias = If(Data.Rows(0)("RH_DefaultAsistencias").ToString = "", False, CBool(Data.Rows(0)("RH_DefaultAsistencias").ToString)) + _Empresa.CIEC = Data.Rows(0)("CIEC").ToString + _Empresa.Localidad = Data.Rows(0)("Localidad").ToString + _Empresa.Importe = Data.Rows(0)("Importe").ToString.ToDecimal + _Empresa.CveMetodoPago = Data.Rows(0)("CveMetodoPago").ToString.ToEntero + _Empresa.Extension = Data.Rows(0)("Extension").ToString + _Empresa.PorDepreciacion = Data.Rows(0)("PorDepreciacion").ToString.ToDecimal + _Empresa.EsPersonaFisica = Data.Rows(0)("EsPersonaFisica").ToString.ToEntero + + _Empresa.UsaCRM = Data.Rows(0)("UsaCRM").ToString = "True" + _Empresa.AplicaDatosTecnicosCRM = If(Data.Rows(0)("AplicaDatosTecnicosCRM").ToString = "", False, CBool(Data.Rows(0)("AplicaDatosTecnicosCRM").ToString)) + _Empresa.CveEncuestaCRM = Data.Rows(0)("CveEncuestaCRM").ToString.ToEntero + + _Empresa.FielPassword = Data.Rows(0)("FielPassword").ToString _Empresa.FielPFX = Data.Rows(0)("FielPFX").ToString - _Empresa.RutaArchivos = Data.Rows(0)("RutaArchivos").ToString - - - Else - 'Alert("No se encontró la Empresa solicitada.", TipoMensaje.MsgAdvertencia) - End If - Retorno = True - Catch ex As SqlException - If CveEmpresa <> -1 Then - OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End Try - - Return Retorno - End Function - Public Function AddEmpresa(CveEmpresa As Integer, Empresa As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Ciudad As String, Estado As String, - RFC As String, CP As Integer, Telefono As String, Contacto As String, Mail As String, TipoFacturacion As String, BIUsuario As String, BIContraseña As String, ContraseñaKey As String, ArchivoKey As String, - ArchivoCer As String, ArchivoPfx As String, Banner As String, CveUsuario As Integer, FacturaProduccion As Boolean, MostrarRetIVA As Boolean, MostrarRetISR As Boolean, Regimen As String, EstatusFacturacion As Boolean, - SendMail As String, SendMailPassword As String, SendMailServer As String, SendMailPuerto As Integer, SendMailSSL As Boolean, UsaContabilidad As Boolean, UsaBancos As Boolean, UsaVentas As Boolean, UsaCxC As Boolean, - UsaCompras As Boolean, UsaInventarios As Boolean, UsaRH As Boolean, UsaNomina As Boolean, UsaOS As Boolean, BDContPAQi As String, ServerContPAQi As String, UsrContPAQi As String, PwdContPAQi As String, Buzon_Mail As String, - Buzon_Server As String, Buzon_Puerto As Integer, Buzon_SSL As Boolean, Buzon_USR As String, Buzon_PWD As String, Buzon_Tipo As String, Soporte_Mail As String, - Soporte_Server As String, Soporte_Puerto As Integer, Soporte_SSL As Boolean, Soporte_USR As String, Soporte_PWD As String, Soporte_Tipo As String, IdCuentaIVAxAcreditar As Integer, IdCuentaIVAAcreditable As Integer, - IdCuentaIVAxTrasladar As Integer, IdCuentaIVATrasladado As Integer, IdCuentaRetIVACirculacion As Integer, IdCuentaOtrosIngresos As Integer, IdCuentaDescuentoVentas As Integer, - IdCuentaRetISRCirculacion As Integer, RegistroPatronal As String, AreaGeografica As String, - Conta_IdCuentaPerdidaCambiaria As Integer, Conta_IdCuentaGananciaCambiaria As Integer, NombreCorto As String, CURP As String, CveRegimenFiscal As Integer, Importe As Decimal, - CIEC As String, CvePlataforma As Integer, UsaAC As Boolean, PorDepreciacion As Decimal, Extension As String, Localidad As String, MetodoInventario As Integer, AsientoContableComprasContado As Boolean, - PeriodoActual As Integer, EjercicioActual As Integer, RH_DefaultAsistencias As Boolean, DiasPermitidos As Integer, TipoCentroCosto As Integer, RequiereCentroCosto As Boolean, PV_TerminalTipo As Integer, - Optional CveMetodoPago As Integer = 0, Optional CvePAC As Integer = 0, Optional IdCuentaDSV As Integer = -1, - Optional IdCuentaImpuestosLocales As Integer = -1, Optional RegistroCompleto As Boolean = False, Optional IdCuentaIEPSxAcreditar As Integer = -1, Optional IdCuentaIEPSAcreditable As Integer = -1, Optional IdCuentaIEPSxTrasladar As Integer = -1, - Optional IdCuentaIEPSTrasladado As Integer = -1) As Boolean - - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasAdd") - - With SqlAdapter.SelectCommand.Parameters - - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@Empresa", SqlDbType.VarChar).Value = Empresa - .Add("@Direccion", SqlDbType.VarChar).Value = Direccion - .Add("@NoExt", SqlDbType.VarChar).Value = NoExt - - .Add("@NoInt", SqlDbType.VarChar).Value = NoInt - .Add("@Colonia", SqlDbType.VarChar).Value = Colonia - .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad - .Add("@Estado", SqlDbType.VarChar).Value = Estado - .Add("@RFC", SqlDbType.VarChar).Value = RFC - .Add("@CP", SqlDbType.Int).Value = CP - .Add("@Contacto", SqlDbType.VarChar).Value = Contacto - .Add("@Telefono", SqlDbType.VarChar).Value = Telefono - .Add("@Mail", SqlDbType.VarChar).Value = Mail - .Add("@TipoFacturacion", SqlDbType.VarChar).Value = TipoFacturacion - .Add("@BIUsuario", SqlDbType.VarChar).Value = BIUsuario - .Add("@BIContraseña", SqlDbType.VarChar).Value = BIContraseña - .Add("@ContraseñaKey", SqlDbType.VarChar).Value = ContraseñaKey - .Add("@ArchivoKey", SqlDbType.VarChar).Value = ArchivoKey - .Add("@ArchivoCer", SqlDbType.VarChar).Value = ArchivoCer - .Add("@ArchivoPfx", SqlDbType.VarChar).Value = ArchivoPfx - .Add("@Banner", SqlDbType.VarChar).Value = Banner - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@FacturaProduccion", SqlDbType.Bit).Value = FacturaProduccion - .Add("@MostrarRetIVA", SqlDbType.Bit).Value = MostrarRetIVA - .Add("@MostrarRetISR", SqlDbType.Bit).Value = MostrarRetISR - .Add("@Regimen", SqlDbType.VarChar).Value = Regimen - .Add("@EstatusFacturacion", SqlDbType.Int).Value = EstatusFacturacion - .Add("@SendMail", SqlDbType.VarChar).Value = SendMail - .Add("@SendMailPassword", SqlDbType.VarChar).Value = SendMailPassword - .Add("@SendMailServer", SqlDbType.VarChar).Value = SendMailServer - .Add("@SendMailPuerto", SqlDbType.Int).Value = SendMailPuerto - .Add("@SendMailSSL", SqlDbType.Bit).Value = SendMailSSL - .Add("@UsaContabilidad", SqlDbType.Bit).Value = UsaContabilidad - .Add("@UsaBancos", SqlDbType.Bit).Value = UsaBancos - .Add("@UsaVentas", SqlDbType.Bit).Value = UsaVentas - .Add("@UsaCxC", SqlDbType.Bit).Value = UsaCxC - .Add("@UsaCompras", SqlDbType.Bit).Value = UsaCompras - .Add("@UsaInventarios", SqlDbType.Bit).Value = UsaInventarios - .Add("@UsaRH", SqlDbType.Bit).Value = UsaRH - .Add("@UsaNomina", SqlDbType.Bit).Value = UsaNomina - .Add("@UsaOS", SqlDbType.Bit).Value = UsaOS - .Add("@BDContPAQi", SqlDbType.VarChar).Value = BDContPAQi - .Add("@ServerContPAQi", SqlDbType.VarChar).Value = ServerContPAQi - .Add("@UsrContPAQi", SqlDbType.VarChar).Value = UsrContPAQi - .Add("@PwdContPAQi", SqlDbType.VarChar).Value = PwdContPAQi - .Add("@Buzon_Mail", SqlDbType.VarChar).Value = Buzon_Mail - .Add("@Buzon_Server", SqlDbType.VarChar).Value = Buzon_Server - .Add("@Buzon_Puerto", SqlDbType.Int).Value = Buzon_Puerto - .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago - .Add("@Buzon_SSL", SqlDbType.Bit).Value = Buzon_SSL - .Add("@Buzon_USR", SqlDbType.VarChar).Value = Buzon_USR - .Add("@Buzon_PWD", SqlDbType.VarChar).Value = Buzon_PWD - .Add("@CveRegimenFiscal", SqlDbType.Int).Value = CveRegimenFiscal - .Add("@CURP", SqlDbType.VarChar).Value = CURP - - 'Nuevos Datos - .Add("@Buzon_Tipo", SqlDbType.VarChar).Value = Buzon_Tipo - .Add("@IdCuentaIVAxAcreditar", SqlDbType.VarChar).Value = IdCuentaIVAxAcreditar - .Add("@IdCuentaIVAAcreditable", SqlDbType.VarChar).Value = IdCuentaIVAAcreditable - .Add("@IdCuentaIVAxTrasladar", SqlDbType.VarChar).Value = IdCuentaIVAxTrasladar - .Add("@IdCuentaIVATrasladado", SqlDbType.VarChar).Value = IdCuentaIVATrasladado - .Add("@IdCuentaRetIVACirculacion", SqlDbType.VarChar).Value = IdCuentaRetIVACirculacion - .Add("@IdCuentaRetISRCirculacion", SqlDbType.VarChar).Value = IdCuentaRetISRCirculacion - .Add("@RegistroPatronal", SqlDbType.VarChar).Value = RegistroPatronal - .Add("@AreaGeografica", SqlDbType.VarChar).Value = AreaGeografica - .Add("@Conta_IdCuentaPerdidaCambiaria", SqlDbType.VarChar).Value = Conta_IdCuentaPerdidaCambiaria - .Add("@Conta_IdCuentaGananciaCambiaria", SqlDbType.VarChar).Value = Conta_IdCuentaGananciaCambiaria - .Add("@NombreCorto", SqlDbType.VarChar).Value = NombreCorto - .Add("@CvePAC", SqlDbType.Int).Value = CvePAC - .Add("@IdCuentaDSV", SqlDbType.Int).Value = IdCuentaDSV - .Add("@IdCuentaImpuestosLocales", SqlDbType.Int).Value = IdCuentaImpuestosLocales - .Add("@CveEmpresaNew", SqlDbType.Int).Direction = ParameterDirection.Output - .Add("@RegistroCompleto", SqlDbType.Bit).Value = RegistroCompleto - - .Add("@IdCuentaIEPSxAcreditar", SqlDbType.VarChar).Value = IdCuentaIEPSxAcreditar - .Add("@IdCuentaIEPSAcreditable", SqlDbType.VarChar).Value = IdCuentaIEPSAcreditable - .Add("@IdCuentaIEPSxTrasladar", SqlDbType.VarChar).Value = IdCuentaIEPSxTrasladar - .Add("@IdCuentaIEPSTrasladado", SqlDbType.VarChar).Value = IdCuentaIEPSTrasladado - .Add("@Soporte_Tipo", SqlDbType.VarChar).Value = Soporte_Tipo - .Add("@Soporte_SSL", SqlDbType.Bit).Value = Soporte_SSL - .Add("@Soporte_USR", SqlDbType.VarChar).Value = Soporte_USR - .Add("@Soporte_PWD", SqlDbType.VarChar).Value = Soporte_PWD - .Add("@Soporte_Mail", SqlDbType.VarChar).Value = Soporte_Mail - .Add("@Soporte_Server", SqlDbType.VarChar).Value = Soporte_Server - .Add("@Soporte_Puerto", SqlDbType.Int).Value = Soporte_Puerto - - .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma - .Add("@CIEC", SqlDbType.VarChar).Value = CIEC - .Add("@UsaAC", SqlDbType.Bit).Value = UsaAC - .Add("@PorDepreciacion", SqlDbType.Decimal).Value = PorDepreciacion - .Add("@Extension", SqlDbType.VarChar).Value = Extension - .Add("@Localidad", SqlDbType.VarChar).Value = Localidad - .Add("@MetodoInventario", SqlDbType.Int).Value = MetodoInventario - .Add("@AsientoContableComprasContado", SqlDbType.Bit).Value = AsientoContableComprasContado - .Add("@PeriodoActual", SqlDbType.Int).Value = PeriodoActual - .Add("@EjercicioActual", SqlDbType.Int).Value = EjercicioActual - .Add("@RH_DefaultAsistencias", SqlDbType.Bit).Value = RH_DefaultAsistencias - .Add("@DiasPermitidos", SqlDbType.Int).Value = DiasPermitidos - .Add("@TipoCentroCosto", SqlDbType.Int).Value = TipoCentroCosto - .Add("@RequiereCentroCosto", SqlDbType.Bit).Value = RequiereCentroCosto - .Add("@PV_TerminalTipo", SqlDbType.Int).Value = PV_TerminalTipo - .Add("@IdCuentaDescuentoVentas", SqlDbType.Int).Value = IdCuentaDescuentoVentas - .Add("@IdCuentaOtrosIngresos", SqlDbType.Int).Value = IdCuentaOtrosIngresos - .Add("@Importe", SqlDbType.Decimal).Value = Importe - - - End With - - Try - SqlAdapter.Fill(Data) - _CveEmpresa = SqlAdapter.SelectCommand.Parameters("@CveEmpresaNew").Value.ToString().ToEntero() - Retorno = True - Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Then - Alert("La Empresa no se pudo Guardar debido a que ya se encuentra registrada.", TipoMensaje.MsgAdvertencia) - Else - - Me.OnError("Ocurrió un error al Guardar la Nueva Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - - End If - Catch ex As Exception - OnError("Ocurrió un error al guardar la Nueva Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function UpdateEmpresa(Empresa As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Ciudad As String, Estado As String, - RFC As String, CP As Integer, Telefono As String, Contacto As String, Mail As String, TipoFacturacion As String, BIUsuario As String, BIContraseña As String, ContraseñaKey As String, ArchivoKey As String, - ArchivoCer As String, ArchivoPfx As String, Banner As String, Estatus As Boolean, FacturaProduccion As Boolean, MostrarRetIVA As Boolean, MostrarRetISR As Boolean, Regimen As String, EstatusFacturacion As Boolean, - SendMail As String, SendMailPassword As String, SendMailServer As String, SendMailPuerto As Integer, SendMailSSL As Boolean, UsaContabilidad As Boolean, UsaBancos As Boolean, UsaVentas As Boolean, UsaCxC As Boolean, - UsaCompras As Boolean, UsaInventarios As Boolean, UsaRH As Boolean, UsaNomina As Boolean, UsaOS As Boolean, BDContPAQi As String, ServerContPAQi As String, UsrContPAQi As String, PwdContPAQi As String, Buzon_Mail As String, - Buzon_Server As String, Buzon_Puerto As Integer, Buzon_SSL As Boolean, Buzon_USR As String, Buzon_PWD As String, CveEmpresa As Integer, Buzon_Tipo As String, Soporte_Mail As String, - Soporte_Server As String, Soporte_Puerto As Integer, Soporte_SSL As Boolean, Soporte_USR As String, Soporte_PWD As String, Soporte_Tipo As String, IdCuentaIVAxAcreditar As Integer, IdCuentaIVAAcreditable As Integer, - IdCuentaIVAxTrasladar As Integer, IdCuentaIVATrasladado As Integer, IdCuentaRetIVACirculacion As Integer, IdCuentaRetISRCirculacion As Integer, IdCuentaOtrosIngresos As Integer, IdCuentaDescuentoVentas As Integer, RegistroPatronal As String, AreaGeografica As String, - Conta_IdCuentaPerdidaCambiaria As Integer, Conta_IdCuentaGananciaCambiaria As Integer, NombreCorto As String, CURP As String, CveRegimenFiscal As Integer, CvePAC As Integer, - Importe As Decimal, CIEC As String, CvePlataforma As Integer, UsaAC As Boolean, PorDepreciacion As Decimal, Extension As String, Localidad As String, MetodoInventario As Integer, AsientoContableComprasContado As Boolean, - PeriodoActual As Integer, EjercicioActual As Integer, RH_DefaultAsistencias As Boolean, DiasPermitidos As Integer, TipoCentroCosto As Integer, RequiereCentroCosto As Boolean, PV_TerminalTipo As Integer, Optional IdCuentaDSV As Integer = -1, Optional IdCuentaImpuestosLocales As Integer = -1, - Optional IdCuentaIEPSxAcreditar As Integer = -1, Optional IdCuentaIEPSAcreditable As Integer = -1, Optional IdCuentaIEPSxTrasladar As Integer = -1, Optional IdCuentaIEPSTrasladado As Integer = -1) As Boolean - - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@Empresa", SqlDbType.VarChar).Value = Empresa - .Add("@Direccion", SqlDbType.VarChar).Value = Direccion - .Add("@NoExt", SqlDbType.VarChar).Value = NoExt - .Add("@NoInt", SqlDbType.VarChar).Value = NoInt - .Add("@Colonia", SqlDbType.VarChar).Value = Colonia - .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad - .Add("@Estado", SqlDbType.VarChar).Value = Estado - .Add("@RFC", SqlDbType.VarChar).Value = RFC - .Add("@CP", SqlDbType.Int).Value = CP - .Add("@Telefono", SqlDbType.VarChar).Value = Telefono - .Add("@Contacto", SqlDbType.VarChar).Value = Contacto - .Add("@Mail", SqlDbType.VarChar).Value = Mail - .Add("@TipoFacturacion", SqlDbType.VarChar).Value = TipoFacturacion - .Add("@BIUsuario", SqlDbType.VarChar).Value = BIUsuario - .Add("@BIContraseña", SqlDbType.VarChar).Value = BIContraseña - .Add("@ContraseñaKey", SqlDbType.VarChar).Value = ContraseñaKey - .Add("@ArchivoKey", SqlDbType.VarChar).Value = ArchivoKey - .Add("@ArchivoCer", SqlDbType.VarChar).Value = ArchivoCer - .Add("@ArchivoPfx", SqlDbType.VarChar).Value = ArchivoPfx - .Add("@Banner", SqlDbType.VarChar).Value = Banner - .Add("@Estatus", SqlDbType.Bit).Value = Estatus - .Add("@FacturaProduccion", SqlDbType.Bit).Value = FacturaProduccion - .Add("@MostrarRetIVA", SqlDbType.Bit).Value = MostrarRetIVA - .Add("@MostrarRetISR", SqlDbType.Bit).Value = MostrarRetISR - .Add("@Regimen", SqlDbType.VarChar).Value = Regimen - .Add("@EstatusFacturacion", SqlDbType.Int).Value = EstatusFacturacion - .Add("@SendMail", SqlDbType.VarChar).Value = SendMail - .Add("@SendMailPassword", SqlDbType.VarChar).Value = SendMailPassword - .Add("@SendMailServer", SqlDbType.VarChar).Value = SendMailServer - .Add("@SendMailPuerto", SqlDbType.Int).Value = SendMailPuerto - .Add("@SendMailSSL", SqlDbType.Bit).Value = SendMailSSL - .Add("@UsaContabilidad", SqlDbType.Bit).Value = UsaContabilidad - .Add("@UsaBancos", SqlDbType.Bit).Value = UsaBancos - .Add("@UsaVentas", SqlDbType.Bit).Value = UsaVentas - .Add("@UsaCxC", SqlDbType.Bit).Value = UsaCxC - .Add("@UsaCompras", SqlDbType.Bit).Value = UsaCompras - .Add("@UsaInventarios", SqlDbType.Bit).Value = UsaInventarios - .Add("@UsaRH", SqlDbType.Bit).Value = UsaRH - .Add("@UsaNomina", SqlDbType.Bit).Value = UsaNomina - .Add("@UsaOS", SqlDbType.Bit).Value = UsaOS - .Add("@BDContPAQi", SqlDbType.VarChar).Value = BDContPAQi - .Add("@ServerContPAQi", SqlDbType.VarChar).Value = ServerContPAQi - .Add("@UsrContPAQi", SqlDbType.VarChar).Value = UsrContPAQi - .Add("@PwdContPAQi", SqlDbType.VarChar).Value = PwdContPAQi - .Add("@Buzon_Mail", SqlDbType.VarChar).Value = Buzon_Mail - .Add("@Buzon_Server", SqlDbType.VarChar).Value = Buzon_Server - .Add("@Buzon_Puerto", SqlDbType.Int).Value = Buzon_Puerto - .Add("@Buzon_SSL", SqlDbType.Bit).Value = Buzon_SSL - .Add("@Buzon_USR", SqlDbType.VarChar).Value = Buzon_USR - .Add("@Buzon_PWD", SqlDbType.VarChar).Value = Buzon_PWD - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveRegimenFiscal", SqlDbType.Int).Value = CveRegimenFiscal - .Add("@CURP", SqlDbType.VarChar).Value = CURP - - - 'Nuevos Datos - .Add("@Buzon_Tipo", SqlDbType.VarChar).Value = Buzon_Tipo - .Add("@IdCuentaIVAxAcreditar", SqlDbType.VarChar).Value = IdCuentaIVAxAcreditar - .Add("@IdCuentaIVAAcreditable", SqlDbType.VarChar).Value = IdCuentaIVAAcreditable - .Add("@IdCuentaIVAxTrasladar", SqlDbType.VarChar).Value = IdCuentaIVAxTrasladar - .Add("@IdCuentaIVATrasladado", SqlDbType.VarChar).Value = IdCuentaIVATrasladado - .Add("@IdCuentaRetIVACirculacion", SqlDbType.VarChar).Value = IdCuentaRetIVACirculacion - .Add("@IdCuentaRetISRCirculacion", SqlDbType.VarChar).Value = IdCuentaRetISRCirculacion - .Add("@RegistroPatronal", SqlDbType.VarChar).Value = RegistroPatronal - .Add("@AreaGeografica", SqlDbType.VarChar).Value = AreaGeografica - .Add("@Conta_IdCuentaPerdidaCambiaria", SqlDbType.Int).Value = Conta_IdCuentaPerdidaCambiaria - .Add("@Conta_IdCuentaGananciaCambiaria", SqlDbType.Int).Value = Conta_IdCuentaGananciaCambiaria - .Add("@NombreCorto", SqlDbType.VarChar).Value = NombreCorto - .Add("@CvePAC", SqlDbType.Int).Value = CvePAC - .Add("@IdCuentaDSV", SqlDbType.Int).Value = IdCuentaDSV - .Add("@IdCuentaImpuestosLocales", SqlDbType.Int).Value = IdCuentaImpuestosLocales - - .Add("@IdCuentaIEPSxAcreditar", SqlDbType.VarChar).Value = IdCuentaIEPSxAcreditar - .Add("@IdCuentaIEPSAcreditable", SqlDbType.VarChar).Value = IdCuentaIEPSAcreditable - .Add("@IdCuentaIEPSxTrasladar", SqlDbType.VarChar).Value = IdCuentaIEPSxTrasladar - .Add("@IdCuentaIEPSTrasladado", SqlDbType.VarChar).Value = IdCuentaIEPSTrasladado - .Add("@Soporte_Tipo", SqlDbType.VarChar).Value = Soporte_Tipo - .Add("@Soporte_SSL", SqlDbType.Bit).Value = Soporte_SSL - .Add("@Soporte_USR", SqlDbType.VarChar).Value = Soporte_USR - .Add("@Soporte_PWD", SqlDbType.VarChar).Value = Soporte_PWD - .Add("@Soporte_Mail", SqlDbType.VarChar).Value = Soporte_Mail - .Add("@Soporte_Server", SqlDbType.VarChar).Value = Soporte_Server - .Add("@Soporte_Puerto", SqlDbType.Int).Value = Soporte_Puerto - - .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma - .Add("@CIEC", SqlDbType.VarChar).Value = CIEC - .Add("@UsaAC", SqlDbType.Bit).Value = UsaAC - .Add("@PorDepreciacion", SqlDbType.Decimal).Value = PorDepreciacion - .Add("@Extension", SqlDbType.VarChar).Value = Extension - .Add("@Localidad", SqlDbType.VarChar).Value = Localidad - .Add("@MetodoInventario", SqlDbType.Int).Value = MetodoInventario - .Add("@AsientoContableComprasContado", SqlDbType.Bit).Value = AsientoContableComprasContado - .Add("@PeriodoActual", SqlDbType.Int).Value = PeriodoActual - .Add("@EjercicioActual", SqlDbType.Int).Value = EjercicioActual - .Add("@RH_DefaultAsistencias", SqlDbType.Bit).Value = RH_DefaultAsistencias - .Add("@DiasPermitidos", SqlDbType.Int).Value = DiasPermitidos - .Add("@TipoCentroCosto", SqlDbType.Int).Value = TipoCentroCosto - .Add("@RequiereCentroCosto", SqlDbType.Bit).Value = RequiereCentroCosto - .Add("@PV_TerminalTipo", SqlDbType.Int).Value = PV_TerminalTipo - .Add("@IdCuentaDescuentoVentas", SqlDbType.Int).Value = IdCuentaDescuentoVentas - .Add("@IdCuentaOtrosIngresos", SqlDbType.Int).Value = IdCuentaOtrosIngresos - .Add("@Importe", SqlDbType.Decimal).Value = Importe - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Then - Alert("La Empresa no se pudo Actualizar por que esta siendo usada por un registro", TipoMensaje.MsgAdvertencia) - Else - Me.OnError("Ocurrió un error al Actualizar la Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End If - Catch ex As Exception - OnError("Ocurrió un error al guardar los cambios en la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function UpdateEmpresaXWizard(Empresa As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Ciudad As String, Estado As String, - RFC As String, CP As Integer, Telefono As String, Contacto As String, Mail As String, Regimen As String, SendMail As String, SendMailPassword As String, SendMailServer As String, SendMailPuerto As Integer, SendMailSSL As Boolean, - Buzon_Mail As String, Buzon_Server As String, Buzon_Puerto As Integer, Buzon_SSL As Boolean, Buzon_USR As String, Buzon_PWD As String, CveEmpresa As Integer, - Buzon_Tipo As String, Localidad As String, Extension As String, CIEC As String, ArchivoKey As String, ArchivoCER As String, ContraseñaKey As String, Optional CveMetodoInventario As Integer = -1) As Boolean - - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresaSelfUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@Empresa", SqlDbType.VarChar).Value = Empresa - .Add("@Direccion", SqlDbType.VarChar).Value = Direccion - .Add("@NoExt", SqlDbType.VarChar).Value = NoExt - .Add("@NoInt", SqlDbType.VarChar).Value = NoInt - .Add("@Colonia", SqlDbType.VarChar).Value = Colonia - .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad - .Add("@Estado", SqlDbType.VarChar).Value = Estado - .Add("@RFC", SqlDbType.VarChar).Value = RFC - .Add("@CP", SqlDbType.Int).Value = CP - .Add("@Telefono", SqlDbType.VarChar).Value = Telefono - .Add("@Contacto", SqlDbType.VarChar).Value = Contacto - .Add("@Mail", SqlDbType.VarChar).Value = Mail - - .Add("@Regimen", SqlDbType.VarChar).Value = Regimen - .Add("@SendMail", SqlDbType.VarChar).Value = SendMail - .Add("@SendMailPassword", SqlDbType.VarChar).Value = SendMailPassword - .Add("@SendMailServer", SqlDbType.VarChar).Value = SendMailServer - .Add("@SendMailPuerto", SqlDbType.Int).Value = SendMailPuerto - .Add("@SendMailSSL", SqlDbType.Bit).Value = SendMailSSL - - .Add("@Buzon_Mail", SqlDbType.VarChar).Value = Buzon_Mail - .Add("@CIEC", SqlDbType.VarChar).Value = CIEC - .Add("@Buzon_Server", SqlDbType.VarChar).Value = Buzon_Server - .Add("@Buzon_Puerto", SqlDbType.Int).Value = Buzon_Puerto - .Add("@Buzon_SSL", SqlDbType.Bit).Value = Buzon_SSL - .Add("@Buzon_USR", SqlDbType.VarChar).Value = Buzon_USR - .Add("@Buzon_PWD", SqlDbType.VarChar).Value = Buzon_PWD - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@ArchivoKey", SqlDbType.VarChar).Value = ArchivoKey - .Add("@ArchivoCER", SqlDbType.VarChar).Value = ArchivoCER - .Add("@ContraseñaKey", SqlDbType.VarChar).Value = ContraseñaKey - .Add("@CveMetodoInventario", SqlDbType.Int).Value = CveMetodoInventario - - 'Nuevos Datos - .Add("@Buzon_Tipo", SqlDbType.VarChar).Value = Buzon_Tipo - .Add("@Localidad", SqlDbType.VarChar).Value = Buzon_Tipo - .Add("@Extension", SqlDbType.VarChar).Value = Buzon_Tipo - - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Then - Alert("La Empresa no se pudo Actualizar por que ya existe una empresa con esos datos", TipoMensaje.MsgAdvertencia) - Else - Me.OnError("Ocurrió un error al Actualizar la Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End If - Catch ex As Exception - OnError("Ocurrió un error al guardar los cambios en la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function RemoveEmpresa(CveEmpresa As Integer) As Boolean - Dim OnError As Boolean = False - - DataAdapter("PA_Sis_EmpresasRemove") - - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Data = New DataTable() - - Try - SqlAdapter.Fill(Data) - OnError = True - - Catch Ex1 As SqlException - - If Ex1.Message.Contains("Número: 547;") Then - - Alert("La Empresa no se pudo eliminar por que esta siendo usada por un registro", TipoMensaje.MsgAdvertencia) - - Else - Me.OnError("Ocurrió un error al eliminar la Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - - End If - - Catch ex As Exception - Me.OnError("Ocurrió un error al eliminar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return OnError - End Function -#End Region - -#Region " REGISTRO EMPRESAS - PYME " - Public Function RegistroEmpresasDatosFiscales(NombreEmpresa As String, RFC As String, CorreoElectronico As String, Regimen As String, Contacto As String, Telefono As String, Extension As String, - Calle As String, NoExt As String, NoInt As String, Colonia As String, Ciudad As String, Localidad As String, Estado As String, CP As String, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_RegistroEmpresasDatosFiscales") - - With SqlAdapter.SelectCommand.Parameters - .Add("@NombreEmpresa", SqlDbType.VarChar).Value = NombreEmpresa - .Add("@RFC", SqlDbType.VarChar).Value = RFC - .Add("@CorreoElectronico", SqlDbType.VarChar).Value = CorreoElectronico - .Add("@Regimen", SqlDbType.VarChar).Value = Regimen - .Add("@Contacto", SqlDbType.VarChar).Value = Contacto - .Add("@Telefono", SqlDbType.VarChar).Value = Telefono - .Add("@Extension", SqlDbType.VarChar).Value = Extension - .Add("@Calle", SqlDbType.VarChar).Value = Calle - .Add("@NoExt", SqlDbType.Int).Value = NoExt - .Add("@NoInt", SqlDbType.VarChar).Value = NoInt - .Add("@Colonia", SqlDbType.VarChar).Value = Colonia - .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad - .Add("@Localidad", SqlDbType.VarChar).Value = Localidad - .Add("@Estado", SqlDbType.VarChar).Value = Estado - .Add("@CP", SqlDbType.VarChar).Value = CP - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Then - Alert("La Empresa no se pudo actualizar por que ya existe una empresa con esos datos", TipoMensaje.MsgAdvertencia) - Else - Me.OnError("Ocurrió un error al Actualizar la Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End If - Catch ex As Exception - OnError("Ocurrió un error al guardar los cambios en la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - Public Function RegistroEmpresasCertificadosFIEL(ArchivoFIEL As String, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_RegistroEmpresasCertificadosFIEL") - - With SqlAdapter.SelectCommand.Parameters - .Add("@ArchivoFIEL", SqlDbType.VarChar).Value = ArchivoFIEL - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al guardar el archivo FIEL de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - End Function - Public Function RegistroEmpresasCertificadosCSD(ArchivoCSD As String, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_RegistroEmpresasCertificadosCSD") - - With SqlAdapter.SelectCommand.Parameters - .Add("@ArchivoCSD", SqlDbType.VarChar).Value = ArchivoCSD - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al guardar el archivo CSD de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - End Function - Public Function RegistroEmpresasCertificados(ContraseñaKey As String, CIEC As String, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_RegistroEmpresasCertificados") - - With SqlAdapter.SelectCommand.Parameters - .Add("@ContraseñaKey", SqlDbType.VarChar).Value = ContraseñaKey - .Add("@CIEC", SqlDbType.VarChar).Value = CIEC - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al guardar el archivo CSD de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - End Function - Public Function RegistroEmpresasCorreos(EnvioCorreo As String, EnvioContraseña As String, EnvioServidor As String, EnvioPuerto As Integer, EnvioSSL As Boolean, - RecepCorreo As String, RecepContraseña As String, RecepServidor As String, RecepPuerto As Integer, RecepProtocolo As String, RecepSSL As Boolean, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_RegistroEmpresasCorreos") - - With SqlAdapter.SelectCommand.Parameters - .Add("@EnvioCorreo", SqlDbType.VarChar).Value = EnvioCorreo - .Add("@EnvioContraseña", SqlDbType.VarChar).Value = EnvioContraseña - .Add("@EnvioServidor", SqlDbType.VarChar).Value = EnvioServidor - .Add("@EnvioPuerto", SqlDbType.Int).Value = EnvioPuerto - .Add("@EnvioSSL", SqlDbType.Bit).Value = EnvioSSL - .Add("@RecepCorreo", SqlDbType.VarChar).Value = RecepCorreo - .Add("@RecepContraseña", SqlDbType.VarChar).Value = RecepContraseña - .Add("@RecepServidor", SqlDbType.VarChar).Value = RecepServidor - .Add("@RecepPuerto", SqlDbType.Int).Value = RecepPuerto - .Add("@RecepProtocolo", SqlDbType.VarChar).Value = RecepProtocolo - .Add("@RecepSSL", SqlDbType.Bit).Value = RecepSSL - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al guardar la información de correos de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - - Return Retorno - End Function - - Public Function UpdateTipoCentroCosto(Tipo_CentroCosto As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_Tipo_CentroCostoUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@Tipo_CentroCosto", SqlDbType.Int).Value = Tipo_CentroCosto - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al actualizar el tipo de centro de costo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - End Function - - Public Function UpdateFormatoImpresion(CveEmpresa As Integer, FormatoImpresion As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasFormatoPlantillaUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@FormatoImpresion", SqlDbType.Int).Value = FormatoImpresion - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al guardar el fomato de plantilla.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function -#End Region - -#Region "E M P R E S A S - F U N C I O N A L I D A D" - Public Function GetFuncionalidades() As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_FuncionalidadesGet") - - With SqlAdapter.SelectCommand.Parameters - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener los datos de la página.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetEmpresasFuncionalidades(CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasFuncionalidadesGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al consultar las Empresas Funcionalidades.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function AddUpdateEmpresaFuncionalidades(CveEmpresa As Integer, CveFuncionalidad As Integer, Valor As String) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasFuncionalidadesAddUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@Valor", SqlDbType.VarChar).Value = Valor - .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - If CveEmpresa <> -1 Then - OnError("Ocurrió un error al agregar los datos a la Cuenta Padre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al agregar los datos a la cuenta padre.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End Try - - Return Retorno - End Function - - Public Function AddFuncionalidades(CveFuncionalidad As Integer, Funcionalidad As String, Descripcion As String) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_FuncionalidadesAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad - .Add("@Funcionalidad", SqlDbType.VarChar).Value = Funcionalidad - .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - If CveEmpresa <> -1 Then - OnError("Ocurrió un error al agregar los datos en Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al agregar los datos a Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End Try - - Return Retorno - End Function - - Public Function UpdateFuncionalidades(CveFuncionalidad As Integer, Funcionalidad As String, Descripcion As String) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_FuncionalidadesUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad - .Add("@Funcionalidad", SqlDbType.VarChar).Value = Funcionalidad - .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - If CveEmpresa <> -1 Then - OnError("Ocurrió un error al agregar los datos en Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al agregar los datos a Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End Try - - Return Retorno - End Function - - Public Function UpdateEmpresaFuncionalidad(CveFuncionalidad As Integer, Valor As String, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresaFuncionalidadUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad - .Add("@Valor", SqlDbType.VarChar).Value = Valor - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - If CveEmpresa <> -1 Then - OnError("Ocurrió un error al agregar los datos en Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al agregar los datos a Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End Try - - Return Retorno - End Function - Public Function UpdateEmpresaCierre(CveEmpresa As Integer, Fecha As DateTime) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresaCierreUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@Fecha", SqlDbType.DateTime).Value = Fecha - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al actualizar la fecha de cierre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function RemoveFuncionalidades(CveFuncionalidad As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_FuncionalidadesRemove") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - If CveEmpresa <> -1 Then - OnError("Ocurrió un error al Eliminar los datos en Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al Eliminar los datos a Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End Try - - Return Retorno - End Function - - Public Function RemoveEmpresasFuncionalidades(CveFuncionalidad As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasFuncionalidadesRemove") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - If CveEmpresa <> -1 Then - OnError("Ocurrió un error al Eliminar los datos en Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al Eliminar los datos a Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End Try - - Return Retorno - End Function -#End Region - - -#Region "EmpresasGrupos" - - Public Function GetEmpresasGrupos(CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasGruposGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - If CveEmpresa <> -1 Then - OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End Try - - Return Retorno - End Function - - Public Function GetEmpresasGruposNot(CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasGruposnotGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - If CveEmpresa <> -1 Then - OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End Try - - Return Retorno - End Function - - Public Function AddEmpresasGrupos(CveEmpresaPrincipal As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasGruposAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresaPrincipal", SqlDbType.Int).Value = CveEmpresaPrincipal - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - If CveEmpresa <> -1 Then - OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End Try - - Return Retorno - End Function - - Public Function RemoveEmpresasGrupos(CveEmpresaPrincipal As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasGruposRemove") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresaPrincipal", SqlDbType.Int).Value = CveEmpresaPrincipal - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - If CveEmpresa <> -1 Then - OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End Try - - Return Retorno - End Function - -#End Region - -#Region " EMPRESAS - MODULOS " - Public Function GetEmpresasModulos(CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasModulosGet") - - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al consultar las Empresas Modulos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function AddEmpresasModulos(CveEmpresa As Integer, CveModulo As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasModulosAdd") - - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveModulo", SqlDbType.Int).Value = CveModulo - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar el modulo a la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function RemoveEmpresasModulos(CveEmpresa As Integer, CveModulo As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasModulosRemove") - - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveModulo", SqlDbType.Int).Value = CveModulo - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar el modulo a la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region - -#Region "Empresas temporales" - Public Function AddEmpresaTemp(Empresa As String, - RFC As String, Mail As String, MetodoPago As Integer) As Integer - - Dim Retorno As Integer = -1 - - DataAdapter("PA_Sis_EmpresasTempAdd") - - With SqlAdapter.SelectCommand.Parameters - .Add("@Empresa", SqlDbType.VarChar).Value = Empresa - .Add("@RFC", SqlDbType.VarChar).Value = RFC - .Add("@Mail", SqlDbType.VarChar).Value = Mail - .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago - .Add("@CveEmpresaTemp", SqlDbType.Int).Direction = ParameterDirection.Output - - End With - - Try - SqlAdapter.Fill(Data) - Retorno = CType(SqlAdapter.SelectCommand.Parameters("@CveEmpresaTemp").Value, Integer) - Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Then - Alert("La Empresa no se pudo Guardar debido a que ya se encuentra registrada.", TipoMensaje.MsgAdvertencia) - Else - - Me.OnError("Ocurrió un error al Guardar la Nueva Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - - End If - Catch ex As Exception - OnError("Ocurrió un error al guardar la Nueva Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function GetEmpresaTemp(CveEmpresaTemp As Integer) As Boolean - Dim retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasTempGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresaTemp", SqlDbType.Int).Value = CveEmpresaTemp - End With - - Try - SqlAdapter.Fill(Data) - retorno = True - Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al obtener los datos de la empresa", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - Catch ex As Exception - OnError("Ocurrió un error al obtener los datos de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return retorno - End Function -#End Region - - Public Function UpdatePlantillaMail(NombreCampoBDAsuntoPlantilla As String, AsuntoValor As String, NombreCampoBDPlantilla As String, HTMLValorPlantilla As String, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasPlantillaMailUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@AsuntoPlantilla", SqlDbType.VarChar).Value = NombreCampoBDAsuntoPlantilla - .Add("@ValorAsuntoPlantilla", SqlDbType.NVarChar).Value = AsuntoValor - .Add("@Plantilla", SqlDbType.VarChar).Value = NombreCampoBDPlantilla - .Add("@ValorPlantilla", SqlDbType.NVarChar).Value = HTMLValorPlantilla - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al guardar la plantilla de correo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - -#Region " P A C " - Public Function GetPacs() As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_PacGet") - With SqlAdapter.SelectCommand.Parameters - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al obtener los PAC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - - Public Function AddPacs(PAC As String, Estatus As Boolean, CveUsuario As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_PacAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@PAC", SqlDbType.VarChar).Value = PAC - .Add("@Estatus", SqlDbType.Bit).Value = Estatus - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al agregar el PAC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function UpdatePacs(PAC As String, Estatus As Boolean, CveUsuario As Integer, CvePAC As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_PacUpdate") - With SqlAdapter.SelectCommand.Parameters - - .Add("@CvePAC", SqlDbType.TinyInt).Value = CvePAC - .Add("@PAC", SqlDbType.VarChar).Value = PAC - .Add("@Estatus", SqlDbType.Bit).Value = Estatus - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al agregar el PAC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - Public Function RemovePacs(CvePAC As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_PacRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePAC", SqlDbType.VarChar).Value = CvePAC - - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al eliminar el PAC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - -#End Region - -#Region "D I S T R I B U I D O R E S , P L A T A F O R M A" - Public Function AddPlataforma(Plataforma As String) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_PlataformaAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@Plataforma", SqlDbType.VarChar).Value = Plataforma - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar la plataforma.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function GetPlataforma(CvePlataforma As Integer, Plataforma As String) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_PlataformaGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma - .Add("@Plataforma", SqlDbType.VarChar).Value = Plataforma - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Catálogo de Plataformas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function UpdatePlataforma(CvePlataforma As Integer, Plataforma As String) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_PlataformaUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma - .Add("@Plataforma", SqlDbType.VarChar).Value = Plataforma - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar la Plataforma.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - - Public Function DeletePlataforma(CvePlataforma As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_PlataformaDelete") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar la Plataforma.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - - Public Function AddDistribuidor(Distribuidor As String, CvePlataforma As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_DistribuidorAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@Distribuidor", SqlDbType.VarChar).Value = Distribuidor - .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function GetDistribuidor(CveDistribuidor As Integer, Distribuidor As String, Plataforma As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_DistribuidorGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveDistribuidor", SqlDbType.Int).Value = CveDistribuidor - .Add("@Distribuidor", SqlDbType.VarChar).Value = Distribuidor - .Add("@CvePlataforma", SqlDbType.Int).Value = Plataforma - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Catálogo de Distribuidores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function UpdateDistribuidor(CveDistribuidor As Integer, CvePlataforma As Integer, Distribuidor As String) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_DistribuidorUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveDistribuidor", SqlDbType.Int).Value = CveDistribuidor - .Add("@Distribuidor", SqlDbType.VarChar).Value = Distribuidor - .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - - Public Function DeleteDistribuidor(CveDistribuidor As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_DistribuidorDelete") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveDistribuidor", SqlDbType.Int).Value = CveDistribuidor - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function GetDistribuidorMaster(CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_DistribuidoresMasterGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el catálogo de distribuidores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function AddDistribuidorMaster(RFC As String, Empresa As String, Telefono As String, Contacto As String, Mail As String, Usuario As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_DistribuidoresMasterAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@RFC", SqlDbType.VarChar).Value = RFC - .Add("@Empresa", SqlDbType.VarChar).Value = Empresa - .Add("@Telefono", SqlDbType.VarChar).Value = Telefono - .Add("@Contacto", SqlDbType.VarChar).Value = Contacto - .Add("@Mail", SqlDbType.VarChar).Value = Mail - .Add("@Usuario", SqlDbType.Int).Value = Usuario - .Add("@CveEmpresaNew", SqlDbType.Int).Direction = ParameterDirection.Output - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - _CveEmpresa = SqlAdapter.SelectCommand.Parameters("@CveEmpresaNew").Value.ToString().ToEntero() - Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Then - Alert("La Empresa no se pudo Guardar debido a que ya se encuentra registrada.", TipoMensaje.MsgAdvertencia) - Else - - Me.OnError("Ocurrió un error al Guardar la Nueva Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - - End If - Catch ex As Exception - OnError("Ocurrió un error al agregar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function UpdateDistribuidorMaster(RFC As String, Empresa As String, Telefono As String, Contacto As String, Mail As String, Usuario As Integer, Estatus As Boolean, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_DistribuidoresMasterUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@RFC", SqlDbType.VarChar).Value = RFC - .Add("@Empresa", SqlDbType.VarChar).Value = Empresa - .Add("@Telefono", SqlDbType.VarChar).Value = Telefono - .Add("@Contacto", SqlDbType.VarChar).Value = Contacto - .Add("@Mail", SqlDbType.VarChar).Value = Mail - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@Estatus", SqlDbType.Bit).Value = Estatus - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Then - Alert("La Empresa no se pudo Guardar ya que ya existe una empresa con el mismo nombre.", TipoMensaje.MsgAdvertencia) - Else - - Me.OnError("Ocurrió un error al Guardar la Nueva Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - - End If - Catch ex As Exception - OnError("Ocurrió un error al actualizar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function - - Public Function DeleteDistribuidorMaster(CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Sis_DistribuidoresMasterDelete") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region - -#Region "R E G I M E N F I S C A L" - Public Function GetRegimenFiscal(CveRegimenFIscal As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_GetRegimenFiscal") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveRegimenFiscal", SqlDbType.Int).Value = CveRegimenFIscal - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al obtener Regimen Fiscal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function -#End Region - -#Region "C O M U N I C A D O" - Public Function UpdateComunicado(CveEmpresa As Integer, Comunicado As String) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasComunicadoUpdate") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@Comunicado", SqlDbType.VarChar).Value = Comunicado - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al Actualizar el Comunicado de la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - End Function - - Public Function GetComunicado(CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Sis_EmpresasComunicadoGet") - - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As SqlException - OnError("Ocurrió un error al Obtener el Comunicado de la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - End Function -#End Region - -#Region " IDisposable Support " - ' IDisposable - Protected Overridable Sub Dispose(disposing As Boolean) - If Not Me.disposedValue Then + _Empresa.RutaArchivos = Data.Rows(0)("RutaArchivos").ToString + + + Else + 'Alert("No se encontró la Empresa solicitada.", TipoMensaje.MsgAdvertencia) + End If + Retorno = True + Catch ex As SqlException + If CveEmpresa <> -1 Then + OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try + + Return Retorno + End Function + Public Function AddEmpresa(CveEmpresa As Integer, Empresa As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Ciudad As String, Estado As String, + RFC As String, CP As Integer, Telefono As String, Contacto As String, Mail As String, TipoFacturacion As String, BIUsuario As String, BIContraseña As String, ContraseñaKey As String, ArchivoKey As String, + ArchivoCer As String, ArchivoPfx As String, Banner As String, CveUsuario As Integer, FacturaProduccion As Boolean, MostrarRetIVA As Boolean, MostrarRetISR As Boolean, Regimen As String, EstatusFacturacion As Boolean, + SendMail As String, SendMailPassword As String, SendMailServer As String, SendMailPuerto As Integer, SendMailSSL As Boolean, UsaContabilidad As Boolean, UsaBancos As Boolean, UsaVentas As Boolean, UsaCxC As Boolean, + UsaCompras As Boolean, UsaInventarios As Boolean, UsaRH As Boolean, UsaNomina As Boolean, UsaOS As Boolean, BDContPAQi As String, ServerContPAQi As String, UsrContPAQi As String, PwdContPAQi As String, Buzon_Mail As String, + Buzon_Server As String, Buzon_Puerto As Integer, Buzon_SSL As Boolean, Buzon_USR As String, Buzon_PWD As String, Buzon_Tipo As String, Soporte_Mail As String, + Soporte_Server As String, Soporte_Puerto As Integer, Soporte_SSL As Boolean, Soporte_USR As String, Soporte_PWD As String, Soporte_Tipo As String, IdCuentaIVAxAcreditar As Integer, IdCuentaIVAAcreditable As Integer, + IdCuentaIVAxTrasladar As Integer, IdCuentaIVATrasladado As Integer, IdCuentaRetIVACirculacion As Integer, IdCuentaOtrosIngresos As Integer, IdCuentaDescuentoVentas As Integer, + IdCuentaRetISRCirculacion As Integer, RegistroPatronal As String, AreaGeografica As String, + Conta_IdCuentaPerdidaCambiaria As Integer, Conta_IdCuentaGananciaCambiaria As Integer, NombreCorto As String, CURP As String, CveRegimenFiscal As Integer, Importe As Decimal, + CIEC As String, CvePlataforma As Integer, UsaAC As Boolean, PorDepreciacion As Decimal, Extension As String, Localidad As String, MetodoInventario As Integer, AsientoContableComprasContado As Boolean, + PeriodoActual As Integer, EjercicioActual As Integer, RH_DefaultAsistencias As Boolean, DiasPermitidos As Integer, TipoCentroCosto As Integer, RequiereCentroCosto As Boolean, PV_TerminalTipo As Integer, + Optional CveMetodoPago As Integer = 0, Optional CvePAC As Integer = 0, Optional IdCuentaDSV As Integer = -1, + Optional IdCuentaImpuestosLocales As Integer = -1, Optional RegistroCompleto As Boolean = False, Optional IdCuentaIEPSxAcreditar As Integer = -1, Optional IdCuentaIEPSAcreditable As Integer = -1, Optional IdCuentaIEPSxTrasladar As Integer = -1, + Optional IdCuentaIEPSTrasladado As Integer = -1) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasAdd") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Empresa", SqlDbType.VarChar).Value = Empresa + .Add("@Direccion", SqlDbType.VarChar).Value = Direccion + .Add("@NoExt", SqlDbType.VarChar).Value = NoExt + + .Add("@NoInt", SqlDbType.VarChar).Value = NoInt + .Add("@Colonia", SqlDbType.VarChar).Value = Colonia + .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad + .Add("@Estado", SqlDbType.VarChar).Value = Estado + .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@CP", SqlDbType.Int).Value = CP + .Add("@Contacto", SqlDbType.VarChar).Value = Contacto + .Add("@Telefono", SqlDbType.VarChar).Value = Telefono + .Add("@Mail", SqlDbType.VarChar).Value = Mail + .Add("@TipoFacturacion", SqlDbType.VarChar).Value = TipoFacturacion + .Add("@BIUsuario", SqlDbType.VarChar).Value = BIUsuario + .Add("@BIContraseña", SqlDbType.VarChar).Value = BIContraseña + .Add("@ContraseñaKey", SqlDbType.VarChar).Value = ContraseñaKey + .Add("@ArchivoKey", SqlDbType.VarChar).Value = ArchivoKey + .Add("@ArchivoCer", SqlDbType.VarChar).Value = ArchivoCer + .Add("@ArchivoPfx", SqlDbType.VarChar).Value = ArchivoPfx + .Add("@Banner", SqlDbType.VarChar).Value = Banner + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@FacturaProduccion", SqlDbType.Bit).Value = FacturaProduccion + .Add("@MostrarRetIVA", SqlDbType.Bit).Value = MostrarRetIVA + .Add("@MostrarRetISR", SqlDbType.Bit).Value = MostrarRetISR + .Add("@Regimen", SqlDbType.VarChar).Value = Regimen + .Add("@EstatusFacturacion", SqlDbType.Int).Value = EstatusFacturacion + .Add("@SendMail", SqlDbType.VarChar).Value = SendMail + .Add("@SendMailPassword", SqlDbType.VarChar).Value = SendMailPassword + .Add("@SendMailServer", SqlDbType.VarChar).Value = SendMailServer + .Add("@SendMailPuerto", SqlDbType.Int).Value = SendMailPuerto + .Add("@SendMailSSL", SqlDbType.Bit).Value = SendMailSSL + .Add("@UsaContabilidad", SqlDbType.Bit).Value = UsaContabilidad + .Add("@UsaBancos", SqlDbType.Bit).Value = UsaBancos + .Add("@UsaVentas", SqlDbType.Bit).Value = UsaVentas + .Add("@UsaCxC", SqlDbType.Bit).Value = UsaCxC + .Add("@UsaCompras", SqlDbType.Bit).Value = UsaCompras + .Add("@UsaInventarios", SqlDbType.Bit).Value = UsaInventarios + .Add("@UsaRH", SqlDbType.Bit).Value = UsaRH + .Add("@UsaNomina", SqlDbType.Bit).Value = UsaNomina + .Add("@UsaOS", SqlDbType.Bit).Value = UsaOS + .Add("@BDContPAQi", SqlDbType.VarChar).Value = BDContPAQi + .Add("@ServerContPAQi", SqlDbType.VarChar).Value = ServerContPAQi + .Add("@UsrContPAQi", SqlDbType.VarChar).Value = UsrContPAQi + .Add("@PwdContPAQi", SqlDbType.VarChar).Value = PwdContPAQi + .Add("@Buzon_Mail", SqlDbType.VarChar).Value = Buzon_Mail + .Add("@Buzon_Server", SqlDbType.VarChar).Value = Buzon_Server + .Add("@Buzon_Puerto", SqlDbType.Int).Value = Buzon_Puerto + .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago + .Add("@Buzon_SSL", SqlDbType.Bit).Value = Buzon_SSL + .Add("@Buzon_USR", SqlDbType.VarChar).Value = Buzon_USR + .Add("@Buzon_PWD", SqlDbType.VarChar).Value = Buzon_PWD + .Add("@CveRegimenFiscal", SqlDbType.Int).Value = CveRegimenFiscal + .Add("@CURP", SqlDbType.VarChar).Value = CURP + + 'Nuevos Datos + .Add("@Buzon_Tipo", SqlDbType.VarChar).Value = Buzon_Tipo + .Add("@IdCuentaIVAxAcreditar", SqlDbType.VarChar).Value = IdCuentaIVAxAcreditar + .Add("@IdCuentaIVAAcreditable", SqlDbType.VarChar).Value = IdCuentaIVAAcreditable + .Add("@IdCuentaIVAxTrasladar", SqlDbType.VarChar).Value = IdCuentaIVAxTrasladar + .Add("@IdCuentaIVATrasladado", SqlDbType.VarChar).Value = IdCuentaIVATrasladado + .Add("@IdCuentaRetIVACirculacion", SqlDbType.VarChar).Value = IdCuentaRetIVACirculacion + .Add("@IdCuentaRetISRCirculacion", SqlDbType.VarChar).Value = IdCuentaRetISRCirculacion + .Add("@RegistroPatronal", SqlDbType.VarChar).Value = RegistroPatronal + .Add("@AreaGeografica", SqlDbType.VarChar).Value = AreaGeografica + .Add("@Conta_IdCuentaPerdidaCambiaria", SqlDbType.VarChar).Value = Conta_IdCuentaPerdidaCambiaria + .Add("@Conta_IdCuentaGananciaCambiaria", SqlDbType.VarChar).Value = Conta_IdCuentaGananciaCambiaria + .Add("@NombreCorto", SqlDbType.VarChar).Value = NombreCorto + .Add("@CvePAC", SqlDbType.Int).Value = CvePAC + .Add("@IdCuentaDSV", SqlDbType.Int).Value = IdCuentaDSV + .Add("@IdCuentaImpuestosLocales", SqlDbType.Int).Value = IdCuentaImpuestosLocales + .Add("@CveEmpresaNew", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@RegistroCompleto", SqlDbType.Bit).Value = RegistroCompleto + + .Add("@IdCuentaIEPSxAcreditar", SqlDbType.VarChar).Value = IdCuentaIEPSxAcreditar + .Add("@IdCuentaIEPSAcreditable", SqlDbType.VarChar).Value = IdCuentaIEPSAcreditable + .Add("@IdCuentaIEPSxTrasladar", SqlDbType.VarChar).Value = IdCuentaIEPSxTrasladar + .Add("@IdCuentaIEPSTrasladado", SqlDbType.VarChar).Value = IdCuentaIEPSTrasladado + .Add("@Soporte_Tipo", SqlDbType.VarChar).Value = Soporte_Tipo + .Add("@Soporte_SSL", SqlDbType.Bit).Value = Soporte_SSL + .Add("@Soporte_USR", SqlDbType.VarChar).Value = Soporte_USR + .Add("@Soporte_PWD", SqlDbType.VarChar).Value = Soporte_PWD + .Add("@Soporte_Mail", SqlDbType.VarChar).Value = Soporte_Mail + .Add("@Soporte_Server", SqlDbType.VarChar).Value = Soporte_Server + .Add("@Soporte_Puerto", SqlDbType.Int).Value = Soporte_Puerto + + .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma + .Add("@CIEC", SqlDbType.VarChar).Value = CIEC + .Add("@UsaAC", SqlDbType.Bit).Value = UsaAC + .Add("@PorDepreciacion", SqlDbType.Decimal).Value = PorDepreciacion + .Add("@Extension", SqlDbType.VarChar).Value = Extension + .Add("@Localidad", SqlDbType.VarChar).Value = Localidad + .Add("@MetodoInventario", SqlDbType.Int).Value = MetodoInventario + .Add("@AsientoContableComprasContado", SqlDbType.Bit).Value = AsientoContableComprasContado + .Add("@PeriodoActual", SqlDbType.Int).Value = PeriodoActual + .Add("@EjercicioActual", SqlDbType.Int).Value = EjercicioActual + .Add("@RH_DefaultAsistencias", SqlDbType.Bit).Value = RH_DefaultAsistencias + .Add("@DiasPermitidos", SqlDbType.Int).Value = DiasPermitidos + .Add("@TipoCentroCosto", SqlDbType.Int).Value = TipoCentroCosto + .Add("@RequiereCentroCosto", SqlDbType.Bit).Value = RequiereCentroCosto + .Add("@PV_TerminalTipo", SqlDbType.Int).Value = PV_TerminalTipo + .Add("@IdCuentaDescuentoVentas", SqlDbType.Int).Value = IdCuentaDescuentoVentas + .Add("@IdCuentaOtrosIngresos", SqlDbType.Int).Value = IdCuentaOtrosIngresos + .Add("@Importe", SqlDbType.Decimal).Value = Importe + + + End With + + Try + SqlAdapter.Fill(Data) + _CveEmpresa = SqlAdapter.SelectCommand.Parameters("@CveEmpresaNew").Value.ToString().ToEntero() + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("La Empresa no se pudo Guardar debido a que ya se encuentra registrada.", TipoMensaje.MsgAdvertencia) + Else + + Me.OnError("Ocurrió un error al Guardar la Nueva Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar la Nueva Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function UpdateEmpresa(Empresa As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Ciudad As String, Estado As String, + RFC As String, CP As Integer, Telefono As String, Contacto As String, Mail As String, TipoFacturacion As String, BIUsuario As String, BIContraseña As String, ContraseñaKey As String, ArchivoKey As String, + ArchivoCer As String, ArchivoPfx As String, Banner As String, Estatus As Boolean, FacturaProduccion As Boolean, MostrarRetIVA As Boolean, MostrarRetISR As Boolean, Regimen As String, EstatusFacturacion As Boolean, + SendMail As String, SendMailPassword As String, SendMailServer As String, SendMailPuerto As Integer, SendMailSSL As Boolean, UsaContabilidad As Boolean, UsaBancos As Boolean, UsaVentas As Boolean, UsaCxC As Boolean, + UsaCompras As Boolean, UsaInventarios As Boolean, UsaRH As Boolean, UsaNomina As Boolean, UsaOS As Boolean, BDContPAQi As String, ServerContPAQi As String, UsrContPAQi As String, PwdContPAQi As String, Buzon_Mail As String, + Buzon_Server As String, Buzon_Puerto As Integer, Buzon_SSL As Boolean, Buzon_USR As String, Buzon_PWD As String, CveEmpresa As Integer, Buzon_Tipo As String, Soporte_Mail As String, + Soporte_Server As String, Soporte_Puerto As Integer, Soporte_SSL As Boolean, Soporte_USR As String, Soporte_PWD As String, Soporte_Tipo As String, IdCuentaIVAxAcreditar As Integer, IdCuentaIVAAcreditable As Integer, + IdCuentaIVAxTrasladar As Integer, IdCuentaIVATrasladado As Integer, IdCuentaRetIVACirculacion As Integer, IdCuentaRetISRCirculacion As Integer, IdCuentaOtrosIngresos As Integer, IdCuentaDescuentoVentas As Integer, RegistroPatronal As String, AreaGeografica As String, + Conta_IdCuentaPerdidaCambiaria As Integer, Conta_IdCuentaGananciaCambiaria As Integer, NombreCorto As String, CURP As String, CveRegimenFiscal As Integer, CvePAC As Integer, + Importe As Decimal, CIEC As String, CvePlataforma As Integer, UsaAC As Boolean, PorDepreciacion As Decimal, Extension As String, Localidad As String, MetodoInventario As Integer, AsientoContableComprasContado As Boolean, + PeriodoActual As Integer, EjercicioActual As Integer, RH_DefaultAsistencias As Boolean, DiasPermitidos As Integer, TipoCentroCosto As Integer, RequiereCentroCosto As Boolean, PV_TerminalTipo As Integer, Optional IdCuentaDSV As Integer = -1, Optional IdCuentaImpuestosLocales As Integer = -1, + Optional IdCuentaIEPSxAcreditar As Integer = -1, Optional IdCuentaIEPSAcreditable As Integer = -1, Optional IdCuentaIEPSxTrasladar As Integer = -1, Optional IdCuentaIEPSTrasladado As Integer = -1) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Empresa", SqlDbType.VarChar).Value = Empresa + .Add("@Direccion", SqlDbType.VarChar).Value = Direccion + .Add("@NoExt", SqlDbType.VarChar).Value = NoExt + .Add("@NoInt", SqlDbType.VarChar).Value = NoInt + .Add("@Colonia", SqlDbType.VarChar).Value = Colonia + .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad + .Add("@Estado", SqlDbType.VarChar).Value = Estado + .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@CP", SqlDbType.Int).Value = CP + .Add("@Telefono", SqlDbType.VarChar).Value = Telefono + .Add("@Contacto", SqlDbType.VarChar).Value = Contacto + .Add("@Mail", SqlDbType.VarChar).Value = Mail + .Add("@TipoFacturacion", SqlDbType.VarChar).Value = TipoFacturacion + .Add("@BIUsuario", SqlDbType.VarChar).Value = BIUsuario + .Add("@BIContraseña", SqlDbType.VarChar).Value = BIContraseña + .Add("@ContraseñaKey", SqlDbType.VarChar).Value = ContraseñaKey + .Add("@ArchivoKey", SqlDbType.VarChar).Value = ArchivoKey + .Add("@ArchivoCer", SqlDbType.VarChar).Value = ArchivoCer + .Add("@ArchivoPfx", SqlDbType.VarChar).Value = ArchivoPfx + .Add("@Banner", SqlDbType.VarChar).Value = Banner + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@FacturaProduccion", SqlDbType.Bit).Value = FacturaProduccion + .Add("@MostrarRetIVA", SqlDbType.Bit).Value = MostrarRetIVA + .Add("@MostrarRetISR", SqlDbType.Bit).Value = MostrarRetISR + .Add("@Regimen", SqlDbType.VarChar).Value = Regimen + .Add("@EstatusFacturacion", SqlDbType.Int).Value = EstatusFacturacion + .Add("@SendMail", SqlDbType.VarChar).Value = SendMail + .Add("@SendMailPassword", SqlDbType.VarChar).Value = SendMailPassword + .Add("@SendMailServer", SqlDbType.VarChar).Value = SendMailServer + .Add("@SendMailPuerto", SqlDbType.Int).Value = SendMailPuerto + .Add("@SendMailSSL", SqlDbType.Bit).Value = SendMailSSL + .Add("@UsaContabilidad", SqlDbType.Bit).Value = UsaContabilidad + .Add("@UsaBancos", SqlDbType.Bit).Value = UsaBancos + .Add("@UsaVentas", SqlDbType.Bit).Value = UsaVentas + .Add("@UsaCxC", SqlDbType.Bit).Value = UsaCxC + .Add("@UsaCompras", SqlDbType.Bit).Value = UsaCompras + .Add("@UsaInventarios", SqlDbType.Bit).Value = UsaInventarios + .Add("@UsaRH", SqlDbType.Bit).Value = UsaRH + .Add("@UsaNomina", SqlDbType.Bit).Value = UsaNomina + .Add("@UsaOS", SqlDbType.Bit).Value = UsaOS + .Add("@BDContPAQi", SqlDbType.VarChar).Value = BDContPAQi + .Add("@ServerContPAQi", SqlDbType.VarChar).Value = ServerContPAQi + .Add("@UsrContPAQi", SqlDbType.VarChar).Value = UsrContPAQi + .Add("@PwdContPAQi", SqlDbType.VarChar).Value = PwdContPAQi + .Add("@Buzon_Mail", SqlDbType.VarChar).Value = Buzon_Mail + .Add("@Buzon_Server", SqlDbType.VarChar).Value = Buzon_Server + .Add("@Buzon_Puerto", SqlDbType.Int).Value = Buzon_Puerto + .Add("@Buzon_SSL", SqlDbType.Bit).Value = Buzon_SSL + .Add("@Buzon_USR", SqlDbType.VarChar).Value = Buzon_USR + .Add("@Buzon_PWD", SqlDbType.VarChar).Value = Buzon_PWD + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveRegimenFiscal", SqlDbType.Int).Value = CveRegimenFiscal + .Add("@CURP", SqlDbType.VarChar).Value = CURP + + + 'Nuevos Datos + .Add("@Buzon_Tipo", SqlDbType.VarChar).Value = Buzon_Tipo + .Add("@IdCuentaIVAxAcreditar", SqlDbType.VarChar).Value = IdCuentaIVAxAcreditar + .Add("@IdCuentaIVAAcreditable", SqlDbType.VarChar).Value = IdCuentaIVAAcreditable + .Add("@IdCuentaIVAxTrasladar", SqlDbType.VarChar).Value = IdCuentaIVAxTrasladar + .Add("@IdCuentaIVATrasladado", SqlDbType.VarChar).Value = IdCuentaIVATrasladado + .Add("@IdCuentaRetIVACirculacion", SqlDbType.VarChar).Value = IdCuentaRetIVACirculacion + .Add("@IdCuentaRetISRCirculacion", SqlDbType.VarChar).Value = IdCuentaRetISRCirculacion + .Add("@RegistroPatronal", SqlDbType.VarChar).Value = RegistroPatronal + .Add("@AreaGeografica", SqlDbType.VarChar).Value = AreaGeografica + .Add("@Conta_IdCuentaPerdidaCambiaria", SqlDbType.Int).Value = Conta_IdCuentaPerdidaCambiaria + .Add("@Conta_IdCuentaGananciaCambiaria", SqlDbType.Int).Value = Conta_IdCuentaGananciaCambiaria + .Add("@NombreCorto", SqlDbType.VarChar).Value = NombreCorto + .Add("@CvePAC", SqlDbType.Int).Value = CvePAC + .Add("@IdCuentaDSV", SqlDbType.Int).Value = IdCuentaDSV + .Add("@IdCuentaImpuestosLocales", SqlDbType.Int).Value = IdCuentaImpuestosLocales + + .Add("@IdCuentaIEPSxAcreditar", SqlDbType.VarChar).Value = IdCuentaIEPSxAcreditar + .Add("@IdCuentaIEPSAcreditable", SqlDbType.VarChar).Value = IdCuentaIEPSAcreditable + .Add("@IdCuentaIEPSxTrasladar", SqlDbType.VarChar).Value = IdCuentaIEPSxTrasladar + .Add("@IdCuentaIEPSTrasladado", SqlDbType.VarChar).Value = IdCuentaIEPSTrasladado + .Add("@Soporte_Tipo", SqlDbType.VarChar).Value = Soporte_Tipo + .Add("@Soporte_SSL", SqlDbType.Bit).Value = Soporte_SSL + .Add("@Soporte_USR", SqlDbType.VarChar).Value = Soporte_USR + .Add("@Soporte_PWD", SqlDbType.VarChar).Value = Soporte_PWD + .Add("@Soporte_Mail", SqlDbType.VarChar).Value = Soporte_Mail + .Add("@Soporte_Server", SqlDbType.VarChar).Value = Soporte_Server + .Add("@Soporte_Puerto", SqlDbType.Int).Value = Soporte_Puerto + + .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma + .Add("@CIEC", SqlDbType.VarChar).Value = CIEC + .Add("@UsaAC", SqlDbType.Bit).Value = UsaAC + .Add("@PorDepreciacion", SqlDbType.Decimal).Value = PorDepreciacion + .Add("@Extension", SqlDbType.VarChar).Value = Extension + .Add("@Localidad", SqlDbType.VarChar).Value = Localidad + .Add("@MetodoInventario", SqlDbType.Int).Value = MetodoInventario + .Add("@AsientoContableComprasContado", SqlDbType.Bit).Value = AsientoContableComprasContado + .Add("@PeriodoActual", SqlDbType.Int).Value = PeriodoActual + .Add("@EjercicioActual", SqlDbType.Int).Value = EjercicioActual + .Add("@RH_DefaultAsistencias", SqlDbType.Bit).Value = RH_DefaultAsistencias + .Add("@DiasPermitidos", SqlDbType.Int).Value = DiasPermitidos + .Add("@TipoCentroCosto", SqlDbType.Int).Value = TipoCentroCosto + .Add("@RequiereCentroCosto", SqlDbType.Bit).Value = RequiereCentroCosto + .Add("@PV_TerminalTipo", SqlDbType.Int).Value = PV_TerminalTipo + .Add("@IdCuentaDescuentoVentas", SqlDbType.Int).Value = IdCuentaDescuentoVentas + .Add("@IdCuentaOtrosIngresos", SqlDbType.Int).Value = IdCuentaOtrosIngresos + .Add("@Importe", SqlDbType.Decimal).Value = Importe + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("La Empresa no se pudo Actualizar por que esta siendo usada por un registro", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al Actualizar la Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar los cambios en la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function UpdateEmpresaXWizard(Empresa As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Ciudad As String, Estado As String, + RFC As String, CP As Integer, Telefono As String, Contacto As String, Mail As String, Regimen As String, SendMail As String, SendMailPassword As String, SendMailServer As String, SendMailPuerto As Integer, SendMailSSL As Boolean, + Buzon_Mail As String, Buzon_Server As String, Buzon_Puerto As Integer, Buzon_SSL As Boolean, Buzon_USR As String, Buzon_PWD As String, CveEmpresa As Integer, + Buzon_Tipo As String, Localidad As String, Extension As String, CIEC As String, ArchivoKey As String, ArchivoCER As String, ContraseñaKey As String, Optional CveMetodoInventario As Integer = -1) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresaSelfUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Empresa", SqlDbType.VarChar).Value = Empresa + .Add("@Direccion", SqlDbType.VarChar).Value = Direccion + .Add("@NoExt", SqlDbType.VarChar).Value = NoExt + .Add("@NoInt", SqlDbType.VarChar).Value = NoInt + .Add("@Colonia", SqlDbType.VarChar).Value = Colonia + .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad + .Add("@Estado", SqlDbType.VarChar).Value = Estado + .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@CP", SqlDbType.Int).Value = CP + .Add("@Telefono", SqlDbType.VarChar).Value = Telefono + .Add("@Contacto", SqlDbType.VarChar).Value = Contacto + .Add("@Mail", SqlDbType.VarChar).Value = Mail + + .Add("@Regimen", SqlDbType.VarChar).Value = Regimen + .Add("@SendMail", SqlDbType.VarChar).Value = SendMail + .Add("@SendMailPassword", SqlDbType.VarChar).Value = SendMailPassword + .Add("@SendMailServer", SqlDbType.VarChar).Value = SendMailServer + .Add("@SendMailPuerto", SqlDbType.Int).Value = SendMailPuerto + .Add("@SendMailSSL", SqlDbType.Bit).Value = SendMailSSL + + .Add("@Buzon_Mail", SqlDbType.VarChar).Value = Buzon_Mail + .Add("@CIEC", SqlDbType.VarChar).Value = CIEC + .Add("@Buzon_Server", SqlDbType.VarChar).Value = Buzon_Server + .Add("@Buzon_Puerto", SqlDbType.Int).Value = Buzon_Puerto + .Add("@Buzon_SSL", SqlDbType.Bit).Value = Buzon_SSL + .Add("@Buzon_USR", SqlDbType.VarChar).Value = Buzon_USR + .Add("@Buzon_PWD", SqlDbType.VarChar).Value = Buzon_PWD + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@ArchivoKey", SqlDbType.VarChar).Value = ArchivoKey + .Add("@ArchivoCER", SqlDbType.VarChar).Value = ArchivoCER + .Add("@ContraseñaKey", SqlDbType.VarChar).Value = ContraseñaKey + .Add("@CveMetodoInventario", SqlDbType.Int).Value = CveMetodoInventario + + 'Nuevos Datos + .Add("@Buzon_Tipo", SqlDbType.VarChar).Value = Buzon_Tipo + .Add("@Localidad", SqlDbType.VarChar).Value = Buzon_Tipo + .Add("@Extension", SqlDbType.VarChar).Value = Buzon_Tipo + + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("La Empresa no se pudo Actualizar por que ya existe una empresa con esos datos", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al Actualizar la Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar los cambios en la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveEmpresa(CveEmpresa As Integer) As Boolean + Dim OnError As Boolean = False + + DataAdapter("PA_Sis_EmpresasRemove") + + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Data = New DataTable() + + Try + SqlAdapter.Fill(Data) + OnError = True + + Catch Ex1 As SqlException + + If Ex1.Message.Contains("Número: 547;") Then + + Alert("La Empresa no se pudo eliminar por que esta siendo usada por un registro", TipoMensaje.MsgAdvertencia) + + Else + Me.OnError("Ocurrió un error al eliminar la Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + End If + + Catch ex As Exception + Me.OnError("Ocurrió un error al eliminar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return OnError + End Function +#End Region + +#Region " REGISTRO EMPRESAS - PYME " + Public Function RegistroEmpresasDatosFiscales(NombreEmpresa As String, RFC As String, CorreoElectronico As String, Regimen As String, Contacto As String, Telefono As String, Extension As String, + Calle As String, NoExt As String, NoInt As String, Colonia As String, Ciudad As String, Localidad As String, Estado As String, CP As String, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_RegistroEmpresasDatosFiscales") + + With SqlAdapter.SelectCommand.Parameters + .Add("@NombreEmpresa", SqlDbType.VarChar).Value = NombreEmpresa + .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@CorreoElectronico", SqlDbType.VarChar).Value = CorreoElectronico + .Add("@Regimen", SqlDbType.VarChar).Value = Regimen + .Add("@Contacto", SqlDbType.VarChar).Value = Contacto + .Add("@Telefono", SqlDbType.VarChar).Value = Telefono + .Add("@Extension", SqlDbType.VarChar).Value = Extension + .Add("@Calle", SqlDbType.VarChar).Value = Calle + .Add("@NoExt", SqlDbType.Int).Value = NoExt + .Add("@NoInt", SqlDbType.VarChar).Value = NoInt + .Add("@Colonia", SqlDbType.VarChar).Value = Colonia + .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad + .Add("@Localidad", SqlDbType.VarChar).Value = Localidad + .Add("@Estado", SqlDbType.VarChar).Value = Estado + .Add("@CP", SqlDbType.VarChar).Value = CP + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("La Empresa no se pudo actualizar por que ya existe una empresa con esos datos", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al Actualizar la Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar los cambios en la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function RegistroEmpresasCertificadosFIEL(ArchivoFIEL As String, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_RegistroEmpresasCertificadosFIEL") + + With SqlAdapter.SelectCommand.Parameters + .Add("@ArchivoFIEL", SqlDbType.VarChar).Value = ArchivoFIEL + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al guardar el archivo FIEL de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function RegistroEmpresasCertificadosCSD(ArchivoCSD As String, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_RegistroEmpresasCertificadosCSD") + + With SqlAdapter.SelectCommand.Parameters + .Add("@ArchivoCSD", SqlDbType.VarChar).Value = ArchivoCSD + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al guardar el archivo CSD de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function RegistroEmpresasCertificados(ContraseñaKey As String, CIEC As String, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_RegistroEmpresasCertificados") + + With SqlAdapter.SelectCommand.Parameters + .Add("@ContraseñaKey", SqlDbType.VarChar).Value = ContraseñaKey + .Add("@CIEC", SqlDbType.VarChar).Value = CIEC + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al guardar el archivo CSD de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function RegistroEmpresasCorreos(EnvioCorreo As String, EnvioContraseña As String, EnvioServidor As String, EnvioPuerto As Integer, EnvioSSL As Boolean, + RecepCorreo As String, RecepContraseña As String, RecepServidor As String, RecepPuerto As Integer, RecepProtocolo As String, RecepSSL As Boolean, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_RegistroEmpresasCorreos") + + With SqlAdapter.SelectCommand.Parameters + .Add("@EnvioCorreo", SqlDbType.VarChar).Value = EnvioCorreo + .Add("@EnvioContraseña", SqlDbType.VarChar).Value = EnvioContraseña + .Add("@EnvioServidor", SqlDbType.VarChar).Value = EnvioServidor + .Add("@EnvioPuerto", SqlDbType.Int).Value = EnvioPuerto + .Add("@EnvioSSL", SqlDbType.Bit).Value = EnvioSSL + .Add("@RecepCorreo", SqlDbType.VarChar).Value = RecepCorreo + .Add("@RecepContraseña", SqlDbType.VarChar).Value = RecepContraseña + .Add("@RecepServidor", SqlDbType.VarChar).Value = RecepServidor + .Add("@RecepPuerto", SqlDbType.Int).Value = RecepPuerto + .Add("@RecepProtocolo", SqlDbType.VarChar).Value = RecepProtocolo + .Add("@RecepSSL", SqlDbType.Bit).Value = RecepSSL + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al guardar la información de correos de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + + Return Retorno + End Function + + Public Function UpdateTipoCentroCosto(Tipo_CentroCosto As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_Tipo_CentroCostoUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Tipo_CentroCosto", SqlDbType.Int).Value = Tipo_CentroCosto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al actualizar el tipo de centro de costo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + Public Function UpdateFormatoImpresion(CveEmpresa As Integer, FormatoImpresion As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasFormatoPlantillaUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FormatoImpresion", SqlDbType.Int).Value = FormatoImpresion + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al guardar el fomato de plantilla.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region + +#Region "E M P R E S A S - F U N C I O N A L I D A D" + Public Function GetFuncionalidades() As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_FuncionalidadesGet") + + With SqlAdapter.SelectCommand.Parameters + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los datos de la página.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetEmpresasFuncionalidades(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasFuncionalidadesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar las Empresas Funcionalidades.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function AddUpdateEmpresaFuncionalidades(CveEmpresa As Integer, CveFuncionalidad As Integer, Valor As String) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasFuncionalidadesAddUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Valor", SqlDbType.VarChar).Value = Valor + .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + If CveEmpresa <> -1 Then + OnError("Ocurrió un error al agregar los datos a la Cuenta Padre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al agregar los datos a la cuenta padre.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try + + Return Retorno + End Function + + Public Function AddFuncionalidades(CveFuncionalidad As Integer, Funcionalidad As String, Descripcion As String) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_FuncionalidadesAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad + .Add("@Funcionalidad", SqlDbType.VarChar).Value = Funcionalidad + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + If CveEmpresa <> -1 Then + OnError("Ocurrió un error al agregar los datos en Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al agregar los datos a Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try + + Return Retorno + End Function + + Public Function UpdateFuncionalidades(CveFuncionalidad As Integer, Funcionalidad As String, Descripcion As String) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_FuncionalidadesUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad + .Add("@Funcionalidad", SqlDbType.VarChar).Value = Funcionalidad + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + If CveEmpresa <> -1 Then + OnError("Ocurrió un error al agregar los datos en Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al agregar los datos a Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try + + Return Retorno + End Function + + Public Function UpdateEmpresaFuncionalidad(CveFuncionalidad As Integer, Valor As String, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresaFuncionalidadUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad + .Add("@Valor", SqlDbType.VarChar).Value = Valor + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + If CveEmpresa <> -1 Then + OnError("Ocurrió un error al agregar los datos en Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al agregar los datos a Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try + + Return Retorno + End Function + Public Function UpdateEmpresaCierre(CveEmpresa As Integer, Fecha As DateTime) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresaCierreUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Fecha", SqlDbType.DateTime).Value = Fecha + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al actualizar la fecha de cierre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveFuncionalidades(CveFuncionalidad As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_FuncionalidadesRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + If CveEmpresa <> -1 Then + OnError("Ocurrió un error al Eliminar los datos en Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al Eliminar los datos a Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try + + Return Retorno + End Function + + Public Function RemoveEmpresasFuncionalidades(CveFuncionalidad As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasFuncionalidadesRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFuncionalidad", SqlDbType.Int).Value = CveFuncionalidad + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + If CveEmpresa <> -1 Then + OnError("Ocurrió un error al Eliminar los datos en Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al Eliminar los datos a Funcionalidades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try + + Return Retorno + End Function +#End Region + + +#Region "EmpresasGrupos" + + Public Function GetEmpresasGrupos(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasGruposGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + If CveEmpresa <> -1 Then + OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try + + Return Retorno + End Function + + Public Function GetEmpresasGruposNot(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasGruposnotGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + If CveEmpresa <> -1 Then + OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try + + Return Retorno + End Function + + Public Function AddEmpresasGrupos(CveEmpresaPrincipal As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasGruposAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresaPrincipal", SqlDbType.Int).Value = CveEmpresaPrincipal + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + If CveEmpresa <> -1 Then + OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try + + Return Retorno + End Function + + Public Function RemoveEmpresasGrupos(CveEmpresaPrincipal As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasGruposRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresaPrincipal", SqlDbType.Int).Value = CveEmpresaPrincipal + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + If CveEmpresa <> -1 Then + OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al consultar la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try + + Return Retorno + End Function + +#End Region + +#Region " EMPRESAS - MODULOS " + Public Function GetEmpresasModulos(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasModulosGet") + + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar las Empresas Modulos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function AddEmpresasModulos(CveEmpresa As Integer, CveModulo As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasModulosAdd") + + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveModulo", SqlDbType.Int).Value = CveModulo + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el modulo a la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function RemoveEmpresasModulos(CveEmpresa As Integer, CveModulo As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasModulosRemove") + + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveModulo", SqlDbType.Int).Value = CveModulo + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el modulo a la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#Region "Empresas temporales" + Public Function AddEmpresaTemp(Empresa As String, + RFC As String, Mail As String, MetodoPago As Integer) As Integer + + Dim Retorno As Integer = -1 + + DataAdapter("PA_Sis_EmpresasTempAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Empresa", SqlDbType.VarChar).Value = Empresa + .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@Mail", SqlDbType.VarChar).Value = Mail + .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago + .Add("@CveEmpresaTemp", SqlDbType.Int).Direction = ParameterDirection.Output + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = CType(SqlAdapter.SelectCommand.Parameters("@CveEmpresaTemp").Value, Integer) + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("La Empresa no se pudo Guardar debido a que ya se encuentra registrada.", TipoMensaje.MsgAdvertencia) + Else + + Me.OnError("Ocurrió un error al Guardar la Nueva Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar la Nueva Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetEmpresaTemp(CveEmpresaTemp As Integer) As Boolean + Dim retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasTempGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresaTemp", SqlDbType.Int).Value = CveEmpresaTemp + End With + + Try + SqlAdapter.Fill(Data) + retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener los datos de la empresa", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener los datos de la empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function +#End Region + + Public Function UpdatePlantillaMail(NombreCampoBDAsuntoPlantilla As String, AsuntoValor As String, NombreCampoBDPlantilla As String, HTMLValorPlantilla As String, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasPlantillaMailUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@AsuntoPlantilla", SqlDbType.VarChar).Value = NombreCampoBDAsuntoPlantilla + .Add("@ValorAsuntoPlantilla", SqlDbType.NVarChar).Value = AsuntoValor + .Add("@Plantilla", SqlDbType.VarChar).Value = NombreCampoBDPlantilla + .Add("@ValorPlantilla", SqlDbType.NVarChar).Value = HTMLValorPlantilla + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al guardar la plantilla de correo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + +#Region " P A C " + Public Function GetPacs() As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_PacGet") + With SqlAdapter.SelectCommand.Parameters + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al obtener los PAC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + Public Function AddPacs(PAC As String, Estatus As Boolean, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_PacAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@PAC", SqlDbType.VarChar).Value = PAC + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al agregar el PAC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdatePacs(PAC As String, Estatus As Boolean, CveUsuario As Integer, CvePAC As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_PacUpdate") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CvePAC", SqlDbType.TinyInt).Value = CvePAC + .Add("@PAC", SqlDbType.VarChar).Value = PAC + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al agregar el PAC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemovePacs(CvePAC As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_PacRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePAC", SqlDbType.VarChar).Value = CvePAC + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al eliminar el PAC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + +#End Region + +#Region "D I S T R I B U I D O R E S , P L A T A F O R M A" + Public Function AddPlataforma(Plataforma As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_PlataformaAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@Plataforma", SqlDbType.VarChar).Value = Plataforma + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar la plataforma.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function GetPlataforma(CvePlataforma As Integer, Plataforma As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_PlataformaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma + .Add("@Plataforma", SqlDbType.VarChar).Value = Plataforma + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de Plataformas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdatePlataforma(CvePlataforma As Integer, Plataforma As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_PlataformaUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma + .Add("@Plataforma", SqlDbType.VarChar).Value = Plataforma + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la Plataforma.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function DeletePlataforma(CvePlataforma As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_PlataformaDelete") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar la Plataforma.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function AddDistribuidor(Distribuidor As String, CvePlataforma As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_DistribuidorAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@Distribuidor", SqlDbType.VarChar).Value = Distribuidor + .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function GetDistribuidor(CveDistribuidor As Integer, Distribuidor As String, Plataforma As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_DistribuidorGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDistribuidor", SqlDbType.Int).Value = CveDistribuidor + .Add("@Distribuidor", SqlDbType.VarChar).Value = Distribuidor + .Add("@CvePlataforma", SqlDbType.Int).Value = Plataforma + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de Distribuidores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateDistribuidor(CveDistribuidor As Integer, CvePlataforma As Integer, Distribuidor As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_DistribuidorUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDistribuidor", SqlDbType.Int).Value = CveDistribuidor + .Add("@Distribuidor", SqlDbType.VarChar).Value = Distribuidor + .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function DeleteDistribuidor(CveDistribuidor As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_DistribuidorDelete") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDistribuidor", SqlDbType.Int).Value = CveDistribuidor + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function GetDistribuidorMaster(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_DistribuidoresMasterGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el catálogo de distribuidores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function AddDistribuidorMaster(RFC As String, Empresa As String, Telefono As String, Contacto As String, Mail As String, Usuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_DistribuidoresMasterAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@Empresa", SqlDbType.VarChar).Value = Empresa + .Add("@Telefono", SqlDbType.VarChar).Value = Telefono + .Add("@Contacto", SqlDbType.VarChar).Value = Contacto + .Add("@Mail", SqlDbType.VarChar).Value = Mail + .Add("@Usuario", SqlDbType.Int).Value = Usuario + .Add("@CveEmpresaNew", SqlDbType.Int).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + _CveEmpresa = SqlAdapter.SelectCommand.Parameters("@CveEmpresaNew").Value.ToString().ToEntero() + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("La Empresa no se pudo Guardar debido a que ya se encuentra registrada.", TipoMensaje.MsgAdvertencia) + Else + + Me.OnError("Ocurrió un error al Guardar la Nueva Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + End If + Catch ex As Exception + OnError("Ocurrió un error al agregar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateDistribuidorMaster(RFC As String, Empresa As String, Telefono As String, Contacto As String, Mail As String, Usuario As Integer, Estatus As Boolean, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_DistribuidoresMasterUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@Empresa", SqlDbType.VarChar).Value = Empresa + .Add("@Telefono", SqlDbType.VarChar).Value = Telefono + .Add("@Contacto", SqlDbType.VarChar).Value = Contacto + .Add("@Mail", SqlDbType.VarChar).Value = Mail + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("La Empresa no se pudo Guardar ya que ya existe una empresa con el mismo nombre.", TipoMensaje.MsgAdvertencia) + Else + + Me.OnError("Ocurrió un error al Guardar la Nueva Empresa.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + End If + Catch ex As Exception + OnError("Ocurrió un error al actualizar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function DeleteDistribuidorMaster(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_DistribuidoresMasterDelete") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el distribuidor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function +#End Region + +#Region "R E G I M E N F I S C A L" + Public Function GetRegimenFiscal(CveRegimenFIscal As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_GetRegimenFiscal") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveRegimenFiscal", SqlDbType.Int).Value = CveRegimenFIscal + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al obtener Regimen Fiscal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region + +#Region "C O M U N I C A D O" + Public Function UpdateComunicado(CveEmpresa As Integer, Comunicado As String) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasComunicadoUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Comunicado", SqlDbType.VarChar).Value = Comunicado + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al Actualizar el Comunicado de la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + Public Function GetComunicado(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasComunicadoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al Obtener el Comunicado de la Empresa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function +#End Region + +#Region " IDisposable Support " + ' IDisposable + Protected Overridable Sub Dispose(disposing As Boolean) + If Not Me.disposedValue Then If disposing Then ' TODO: Liberar otro estado (objetos administrados). If Not Data Is Nothing Then Data.Dispose() : Data = Nothing @@ -1853,22 +1853,22 @@ Public Class ClsSisEmpresas If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close() - If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing - - End If - - ' TODO: Liberar su propio estado (objetos no administrados). - ' TODO: Establecer campos grandes como Null. - End If - Me.disposedValue = True - End Sub - - ' Visual Basic agregó este código para implementar correctamente el modelo descartable. - Public Sub Dispose() Implements IDisposable.Dispose - ' No cambie este código. Coloque el código de limpieza en Dispose ( que se dispone como Boolean). - ConexionClose() - Dispose(True) - GC.SuppressFinalize(Me) - End Sub -#End Region -End Class + If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing + + End If + + ' TODO: Liberar su propio estado (objetos no administrados). + ' TODO: Establecer campos grandes como Null. + End If + Me.disposedValue = True + End Sub + + ' Visual Basic agregó este código para implementar correctamente el modelo descartable. + Public Sub Dispose() Implements IDisposable.Dispose + ' No cambie este código. Coloque el código de limpieza en Dispose ( que se dispone como Boolean). + ConexionClose() + Dispose(True) + GC.SuppressFinalize(Me) + End Sub +#End Region +End Class diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 3f722b885..569ba4d2f 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -431,10 +431,10 @@ Partial Class PopUpVerFactura Dim bcode As New BarcodeLib.Barcode() - Dim img = bcode.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", noPallet), 500, 100) + ' Dim img = bcode.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", noPallet), 500, 100) Dim barcodebyte As Byte() Using ms = New MemoryStream() - img.Save(ms, System.Drawing.Imaging.ImageFormat.Png) + ' img.Save(ms, System.Drawing.Imaging.ImageFormat.Png) barcodebyte = ms.ToArray() End Using rowqr("ImagenByte") = barcodebyte diff --git a/Contabilidad/FiltraPolizas.aspx b/Contabilidad/FiltraPolizas.aspx index 98d6eb33c..9718d46b2 100644 --- a/Contabilidad/FiltraPolizas.aspx +++ b/Contabilidad/FiltraPolizas.aspx @@ -157,7 +157,9 @@ - + + + diff --git a/Contabilidad/FiltraPolizas.aspx.vb b/Contabilidad/FiltraPolizas.aspx.vb index f31632150..08d83a34f 100644 --- a/Contabilidad/FiltraPolizas.aspx.vb +++ b/Contabilidad/FiltraPolizas.aspx.vb @@ -15,6 +15,7 @@ Partial Class Contabilidad_FiltraPolizas ViewState("DtDatos") = value End Set End Property + Public Property Tick As String Get Return CType(ViewState("Tick"), String) @@ -23,20 +24,47 @@ Partial Class Contabilidad_FiltraPolizas ViewState("Tick") = value End Set End Property + + + Public Property ContabilidadSIG As Boolean + Get + If ViewState("ContabilidadSIG") Is Nothing Then + ViewState("ContabilidadSIG") = False + End If + + Return Boolean.Parse(ViewState("ContabilidadSIG").ToString) + + End Get + Set(value As Boolean) + ViewState("ContabilidadSIG") = value + End Set + End Property + #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + + + If Not Page.IsPostBack Then + + + ContabilidadSIG = UsuarioActual.Empresa.UsaContabilidadSIG + + ViewState("Orden") = "" DdlPeriodo.SelectedValue = Now.Month.ToString TxtFechaICredito.Text = Now.FirstDayOfMonth.ToShortDateString TxtFechaFCredito.Text = Now.LastDayOfMonth.ToShortDateString - If UsuarioActual.Empresa.UsaContabilidad Then + + If UsuarioActual.Empresa.UsaContabilidad Or ContabilidadSIG Then + CargaSegmentoNeg() CargaEjercicios() - CargaDatos() + 'CargaDatos() CargaGvBitacora() + Else Alert("Este módulo requiere el uso de Contabilidad.", TipoMensaje.MsgAdvertencia) BtnConsultar.Enabled = False @@ -55,50 +83,110 @@ Partial Class Contabilidad_FiltraPolizas End If End Sub Public Sub CargaDatos() + Dim Ejercicio As Integer = DdlEjercicio.SelectedValue.ToString().ToEntero() Dim Periodo As Integer = DdlPeriodo.SelectedValue.ToString().ToEntero() - Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) - If ObjConta.GetPolizas(Ejercicio, Periodo, DdlTipoPoliza.SelectedValue.ToEntero(), DdlSegmentoNeg.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then - DtDatos = ObjConta.DtResultados - Gv.DataSource = ObjConta.DtResultados - 'If DdlTipoPoliza.SelectedValue.ToEntero > 0 Then - ' ViewState("DTPolizas") = ObjConta.DtResultados.FiltraParametros($"TipoPol = '{DdlTipoPoliza.SelectedItem}'") - ' DtDatos = ObjConta.DtResultados.FiltraParametros($"TipoPol = '{DdlTipoPoliza.SelectedItem}'") - 'Else - ' ViewState("DTPolizas") = ObjConta.DtResultados - ' DtDatos = ObjConta.DtResultados - 'End If + + + + If ContabilidadSIG Then + + Dim ObjConta As New ClsContabilidad + + If ObjConta.GetPolizas(Ejercicio, Periodo, DdlTipoPoliza.SelectedValue.ToEntero(), DdlSegmentoNeg.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then + DtDatos = ObjConta.DtResultados + Gv.DataSource = ObjConta.DtResultados + Else + Gv.DataSource = Nothing + End If + + ObjConta.Dispose() + + + Else + + Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) + If ObjConta.GetPolizas(Ejercicio, Periodo, DdlTipoPoliza.SelectedValue.ToEntero(), DdlSegmentoNeg.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then + DtDatos = ObjConta.DtResultados + Gv.DataSource = ObjConta.DtResultados + 'If DdlTipoPoliza.SelectedValue.ToEntero > 0 Then + ' ViewState("DTPolizas") = ObjConta.DtResultados.FiltraParametros($"TipoPol = '{DdlTipoPoliza.SelectedItem}'") + ' DtDatos = ObjConta.DtResultados.FiltraParametros($"TipoPol = '{DdlTipoPoliza.SelectedItem}'") + 'Else + ' ViewState("DTPolizas") = ObjConta.DtResultados + ' DtDatos = ObjConta.DtResultados + 'End If + Else + Gv.DataSource = Nothing + End If + + ObjConta.Dispose() End If - Gv.DataBind() - ObjConta.Dispose() + + Gv.DataBind() UpDatos.Update() End Sub Private Sub CargaSegmentoNeg() - Dim ObjContPAQ As New ClsContPAQi(UsuarioActual.Empresa) - If ObjContPAQ.GetSegmentosNegocio(-1, "-1") Then - DdlSegmentoNeg.DataSource = ObjContPAQ.DtResultados - DdlSegmentoNeg.DataBind() + + DdlSegmentoNeg.Items.Clear() + + If ContabilidadSIG Then + DdlSegmentoNeg.DataValueField = "CveSubProyecto" + DdlSegmentoNeg.DataTextField = "SubProyecto" + DdlSegmentoNeg.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + Else + DdlSegmentoNeg.DataValueField = "Id" + DdlSegmentoNeg.DataTextField = "Nombre" + + Dim ObjContPAQ As New ClsContPAQi(UsuarioActual.Empresa) + If ObjContPAQ.GetSegmentosNegocio(-1, "-1") Then + DdlSegmentoNeg.DataSource = ObjContPAQ.DtResultados + End If + ObjContPAQ.Dispose() + End If - ObjContPAQ.Dispose() + + + DdlSegmentoNeg.DataBind() DdlSegmentoNeg.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub Private Sub CargaEjercicios() - Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa) - If ClsConta.GetEjercicios() Then - DdlEjercicio.DataSource = ClsConta.DtResultados - Else - DdlEjercicio.DataSource = Nothing - End If - ClsConta.Dispose() - DdlEjercicio.DataBind() + DdlEjercicio.Items.Clear() + + If ContabilidadSIG Then + + Dim ObjConta As New ClsContabilidad + + If ObjConta.GetEjercicios(UsuarioActual.CveEmpresa) Then + DdlEjercicio.DataSource = ObjConta.DtResultados + Else + DdlEjercicio.DataSource = Nothing + End If + ObjConta.Dispose() + + Else + Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa) + If ClsConta.GetEjercicios() Then + DdlEjercicio.DataSource = ClsConta.DtResultados + Else + DdlEjercicio.DataSource = Nothing + End If + ClsConta.Dispose() + + End If + + + DdlEjercicio.DataBind() DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString) + End Sub Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click @@ -526,12 +614,18 @@ Partial Class Contabilidad_FiltraPolizas End Function Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles Gv.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then - 'If e.Row.DataKey("Comprobante").ToString <> "" AndAlso e.Row.DataKey("Comprobante").ToString IsNot Nothing Then - ' e.Row.FCCheckBox("ChkPoliza").Enabled = True - 'Else - ' e.Row.FCCheckBox("ChkPoliza").ToolTip = "No se tiene cargado comprobante de pago" - 'End If + + If ContabilidadSIG Then + + e.Row.Cells(2).Text = $"{e.Row.DataKey("Folio")}" + e.Row.Cells(6).Text = $"" + + End If + + + End If End Sub diff --git a/Contabilidad/PolizasImpresion.aspx b/Contabilidad/PolizasImpresion.aspx index 7eed8c897..f692083ca 100644 --- a/Contabilidad/PolizasImpresion.aspx +++ b/Contabilidad/PolizasImpresion.aspx @@ -73,7 +73,9 @@
- + + Segmento de Neg.: +
diff --git a/Contabilidad/PolizasImpresion.aspx.vb b/Contabilidad/PolizasImpresion.aspx.vb index 567c14f2b..900c7af9d 100644 --- a/Contabilidad/PolizasImpresion.aspx.vb +++ b/Contabilidad/PolizasImpresion.aspx.vb @@ -10,19 +10,173 @@ Partial Class Contabilidad_PolizasImpresion Inherits ClsPaginas + + Public Property ContabilidadSIG As Boolean + Get + If ViewState("ContabilidadSIG") Is Nothing Then + ViewState("ContabilidadSIG") = False + End If + + Return Boolean.Parse(ViewState("ContabilidadSIG").ToString) + + End Get + Set(value As Boolean) + ViewState("ContabilidadSIG") = value + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.LoadComplete + If Not IsPostBack Then + + ContabilidadSIG = UsuarioActual.Empresa.UsaContabilidadSIG + TxtFechaInicio.Text = Now.AddDays(-1).ToShortDateString TxtFechaFin.Text = Now.ToShortDateString DdlUsuarioRegistro.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa) DdlUsuarioRegistro.DataBind() - cargaddlpolizas() - CargaSegmentoNeg() - cargaCuentas() + + + If ContabilidadSIG Then + cargaddlpolizasSIG() + CargaSubProyectosSIG() + CargaCuentasSIG() + + CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSegmentoNegocio) + LblSegmentoNegocio.Attributes.Add("title", LblSegmentoNegocio.Text) + + Else + cargaddlpolizas() + CargaSegmentoNeg() + CargaCuentas() + End If + + + End If + End Sub Private Sub BtnConsultar_click(sender As Object, args As EventArgs) Handles BtnConsultar.Click + + If ContabilidadSIG Then + ConsultaSIIG() + Else + ConsultaCONTPAQi() + End If + + End Sub + + + +#Region "SIIG" + + Private Sub ConsultaSIIG() + + Dim foli As Integer = -1 + Dim folf As Integer = -1 + If Not FolioInicio.Text = "" Then + foli = FolioInicio.Text.ToEntero() + End If + If Not FolioFin.Text = "" Then + folf = FolioFin.Text.ToEntero() + End If + + 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 + + Dim ObjConta As New ClsContabilidad + If ObjConta.GetPrePolizasImpresion(UsuarioActual.CveEmpresa, TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, CveTipoPoliza:=ddlTipoPoliza.SelectedValue.ToEntero, FolioI:=foli, + FolioF:=folf, CveUsuario:=DdlUsuarioRegistro.SelectedValue.ToEntero, CveSubProyecto:=DdlSegmentoNeg.SelectedValue.ToEntero, + CveCuenta:=DdlCuenta.SelectedValue.ToEntero, CvePlantillaPoliza:=DdlGrupoPlantilla.SelectedValue.ToEntero, + CveTipoProveedor:=DdlTipoProveedor.SelectedValue.ToEntero) Then + If ObjConta.DtResultados.Rows.Count < 10000 Then + + If ObjConta.DtResultados.Rows.Count > 0 Then + Dim dr As DataRow + dr = ObjConta.DtResultados.Rows(0) + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString)) + params.Add(New ReportParameter("Finicio", TxtFechaInicio.Text)) + params.Add(New ReportParameter("FFin", TxtFechaFin.Text)) + params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString)) + 'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString)) + 'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString)) + params.Add(New ReportParameter("Numero", dr("Folio").ToString)) + params.Add(New ReportParameter("Moneda", "")) + params.Add(New ReportParameter("CodigoPostal", "")) + + If UsuarioActual.CveEmpresa = 119 Then + params.Add(New ReportParameter("UsuarioRegistro", dr("NombreUsuario").ToString)) + End If + + ImprimirPDF(ArchivoReporte, ObjConta.DtResultados, params) + + Else + Alert("Los Filtros Actuales no contienen datos") + End If + + Else + Alert("Los Filtros Actuales contienen muchos datos") + End If + End If + ObjConta.Dispose() + + End Sub + + + + Private Sub cargaddlpolizasSIG() + Dim objcont As New ClsContabilidad + If objcont.GetTiposPoliza(-1, "-1", UsuarioActual.CveEmpresa) Then + ddlTipoPoliza.DataSource = objcont.DtResultados + ddlTipoPoliza.DataBind() + ddlTipoPoliza.Items.Insert(0, New ListItem("Todos", "-1")) + + End If + objcont.Dispose() + DdlUsuarioRegistro.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub + + Private Sub CargaSubProyectosSIG() + + DdlSegmentoNeg.DataValueField = "CveSubProyecto" + DdlSegmentoNeg.DataTextField = "SubProyecto" + + DdlSegmentoNeg.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa) + DdlSegmentoNeg.DataBind() + DdlSegmentoNeg.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSegmentoNeg.Items.Insert(1, New ListItem("Sin Asignar", "-2")) + End Sub + + Private Sub CargaCuentasSIG() + + DdlCuenta.DataValueField = "CveCuenta" + DdlCuenta.DataTextField = "CtaCodigo" + + + + Dim objconta As New ClsContabilidad + If objconta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then + DdlCuenta.DataSource = objconta.DtResultados + End If + objconta.Dispose() + DdlCuenta.DataBind() + + DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub + + + +#End Region + +#Region "CONTPAQi" + Private Sub ConsultaCONTPAQi() Dim foli As Integer = -1 Dim folf As Integer = -1 If Not FolioInicio.Text = "" Then @@ -73,8 +227,8 @@ Partial Class Contabilidad_PolizasImpresion End If End If objcont.Dispose() - End Sub + Private Sub cargaddlpolizas() Dim objcont As New ClsContPAQi(UsuarioActual.Empresa) If objcont.GetTiposPoliza(-1, "-1") Then @@ -119,5 +273,10 @@ Partial Class Contabilidad_PolizasImpresion DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1")) End If End Sub +#End Region + + + + End Class diff --git a/Contabilidad/RegPoliza.aspx b/Contabilidad/RegPoliza.aspx index 7ca0aef36..eaee667a9 100644 --- a/Contabilidad/RegPoliza.aspx +++ b/Contabilidad/RegPoliza.aspx @@ -56,24 +56,29 @@ Pólizas -
  • - <%-- Imprimir--%> - Imprimir -
  • -
  • - Agregar movtos de IVA -
  • -
  • - Causaciones IVA -
  • -
  • - Cargar Movimientos -
  • + + +
  • + Imprimir +
  • +
  • + Agregar movtos de IVA +
  • +
  • + Causaciones IVA +
  • + +
  • + Cargar Movimientos +
  • +
    + +
    + + + -
  • - -
  • diff --git a/Contabilidad/RegPoliza.aspx.vb b/Contabilidad/RegPoliza.aspx.vb index 48ac946b3..9750b1cd3 100644 --- a/Contabilidad/RegPoliza.aspx.vb +++ b/Contabilidad/RegPoliza.aspx.vb @@ -937,7 +937,7 @@ Partial Class RegPoliza Dim dr As DataRow = DT.Rows(0) - HLImprimir.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta($"OP=POL&CvePoliza={dr("IdPoliza").ToString.ToEntero}")) + HLImprimir.PostBackUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta($"OP=POL&CvePoliza={dr("IdPoliza").ToString.ToEntero}")) HLImprimir.Visible = True TxtFechaPoliza.Text = dr("FechaPol").ToString.ToDate.ToShortDateString @@ -1012,6 +1012,7 @@ Partial Class RegPoliza CargaGrid() upTitulos.Update() upDatos.Update() + UpAcciones.Update() If DT IsNot Nothing Then DT.Dispose() End Sub diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 6fd890e1f..e99d9468d 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -2390,6 +2390,7 @@ Partial Class ContabilidadC_RegPrePolizaS ObjConta.IniciaTransacSQL() Try + Dim ContadorRegistros As Integer = 2 For Each Row As DataRow In dt.FiltraParametros("ConceptoAdministrativo <> ''").Rows @@ -2406,6 +2407,7 @@ Partial Class ContabilidadC_RegPrePolizaS Dim ObjConta2 As New ClsContabilidad Dim FolioExcel As Long = -1 Dim TipoMov As Integer = -1 + Dim TipoNaturalesa As String = "" Dim CveBancoCuenta As Integer = -1 If ObjConta2.GetCuentas(-1, Row("Cuenta").ToString.Replace("-", "").Trim, 1, UsuarioActual.CveEmpresa) Then CveCuentaExcel = ObjConta2.DtResultados.FiltroPrimeroValor("CveCuenta", "").ToEntero @@ -2438,6 +2440,8 @@ Partial Class ContabilidadC_RegPrePolizaS End If TipoMov = GlobalDTTipoTransacciones.FiltroPrimeroValor("CveTipoTransaccion", String.Format("TipoTransaccion = '{0}' ", Row("TipoTransferencia"))).ToEntero + TipoNaturalesa = GlobalDTTipoTransacciones.FiltroPrimeroValor("Tipo", String.Format("TipoTransaccion = '{0}' ", Row("TipoTransferencia"))).ToEntero + FolioExcel = Row("Folio").ToString.ToEntero CveTipoTransaccion = TipoMov CveCuenta = CveBancoCuenta @@ -2451,13 +2455,29 @@ Partial Class ContabilidadC_RegPrePolizaS ImporteDocumento = IIf(Row("Abono").ToString.ToDecimal > 0, Row("Abono").ToString.ToDecimal, Row("Cargo").ToString.ToDecimal) Observaciones = Row("Referencia").ToString Beneficiario = Row("Concepto").ToString + If Not TipoMov > 0 Then Alert(String.Format("El Tipo de Transferencia no fue encontrado:
    Tipo Transferencia: {0}
    Folio: {1}
    Importe: {2} ", Row("TipoTransferencia").ToString(), FolioExcel, ImporteDocumento), TipoMensaje.MsgAdvertencia) Exit Sub End If + + If Row("Abono").ToString.ToDecimal > 0 And TipoNaturalesa = "Ing" Then + Alert($"El movimiento con cuenta: {NombreCuenta} , importe: {ImporteDocumento.ToString("###,###,###.00")} (registro {ContadorRegistros}), no tiene la naturaleza correcta", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + + End If + + If CveConceptoContable = 30 AndAlso Row("TipoTransferencia").ToString = "" Then + Alert($" El registro {ContadorRegistros} es movimiento bancario y no se especifica el tipo de transferencia , importe: {ImporteDocumento.ToString("###,###,###.00")}", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + 'sino viene el cveconcepto, busca por le nombre del concepto If CveConceptoContable = 0 Then Alert(String.Format("El concepto {0} no se reconoció, favor de verificar el archivo.", Row("ConceptoAdministrativo"))) @@ -2515,6 +2535,9 @@ Partial Class ContabilidadC_RegPrePolizaS DtMovimientos.Rows.Add(dr) DtMovimientos.AcceptChanges() End If + + ContadorRegistros = ContadorRegistros + 1 + Next TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero diff --git a/Contabilidad2/PolizasImpresion.aspx.vb b/Contabilidad2/PolizasImpresion.aspx.vb index 6b89745ae..1260c2550 100644 --- a/Contabilidad2/PolizasImpresion.aspx.vb +++ b/Contabilidad2/PolizasImpresion.aspx.vb @@ -39,7 +39,7 @@ Partial Class Contabilidad2_PolizasImpresion End If Dim ObjConta As New ClsContabilidad - If ObjConta.GetPrePolizasImpresion(UsuarioActual.CveEmpresa, TxtFechaInicio.Text, TxtFechaFin.Text, CveTipoPoliza:=ddlTipoPoliza.SelectedValue.ToEntero, FolioI:=foli, + If ObjConta.GetPrePolizasImpresion(UsuarioActual.CveEmpresa, TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, CveTipoPoliza:=ddlTipoPoliza.SelectedValue.ToEntero, FolioI:=foli, FolioF:=folf, CveUsuario:=DdlUsuarioRegistro.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveCuenta:=DdlCuenta.SelectedValue.ToEntero, CvePlantillaPoliza:=DdlGrupoPlantilla.SelectedValue.ToEntero, CveTipoProveedor:=DdlTipoProveedor.SelectedValue.ToEntero) Then diff --git a/Contratos/ContratoObraAutorizacion.aspx.vb b/Contratos/ContratoObraAutorizacion.aspx.vb index 0edb1200f..3c2a32cd5 100644 --- a/Contratos/ContratoObraAutorizacion.aspx.vb +++ b/Contratos/ContratoObraAutorizacion.aspx.vb @@ -221,7 +221,7 @@ Partial Class Contratos_ContratoObraAutorizacion If DTEstimaciones.Rows.Count > 0 Then GvEstimaciones.DataSource = DTEstimaciones - ' BtnGuardarEstimacion.Visible = True + 'BtnGuardarEstimacion.Visible = True BtnAutoriza.Visible = True Else GvEstimaciones.DataSource = Nothing diff --git a/Empresas/1/Formatos/Factura.rdlc b/Empresas/1/Formatos/Factura.rdlc index 624677082..b8efed7e9 100644 --- a/Empresas/1/Formatos/Factura.rdlc +++ b/Empresas/1/Formatos/Factura.rdlc @@ -2,887 +2,44 @@ - - - - true - true - - - - - Serie: - - - - - - - - =Parameters!Serie.Value - - - - - - - - Folio: - - - - =Parameters!Folio.Value - - - - - - - Textbox81 - 0.36804in - 5.50529in - 0.18682in - 2.05349in - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - Cliente: - - - - =Parameters!ClienteCodigo.Value - - - - - - - - - =Parameters!ClienteNombre.Value - - - - - - - - - Domicilio: - - - - =Parameters!ClienteDireccion.Value - - - - , - - - - =Parameters!ClienteCiudad.Value - - - - , - - - - =Parameters!ClienteEstado.Value - - - - - - - Textbox36 - 1.83775cm - 4.42805cm - 0.96667cm - 11.33709cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - 3.08165cm - 0.635cm - 0cm - 18.56429cm - 2 - - - - - - true - true - - - - - - - - - POR ESTE PAGARE ME(NO) OBLIGO(AMOS) INCONDICIONALMENTE A PAGAR A LA ORDEN DE - - - - PROYECTOS LA RUINA, S.A. DE C.V. - - - - AL VENCIMIENTO ABAJO INDICADO. EN LA CIUDAD DE HERMOSILLO, SONORA O EN CUALQUIER OTRO LUGAR QUE SE ME REQUIERA DE PAGO, RENUNCIANDO EXPRESAMENTE AL FUERO DE MI DOMICILIO. LA CANTIDAD DE - - - - $ - - - - =Parameters!Total.Value - - - - - - - =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) - - - - - - - LA SUMA ANTERIOR SI NO FUERA CUBIERTA A SU VENCIMIENTO, CAUSARA INTERES MORATORIO A RAZON DEL - - - - 3.00% MENSUAL - - - - Y EN CASO DEL COBRO JUDICIAL SE CARGARAN LOS GASTOS QUE ESTOS GENEREN. - - - - - - - true - true - - - - - a - - - - =cdate(Parameters!Fecha.Value) - - - - - - - - - Vencimiento el - - - - =Parameters!Vencimiento.Value - - - - - - - Textbox38 - 8.17569cm - 3.93558cm - 1.07625cm - 5.19875cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - 10.25697cm - 3.93558cm - 0cm - 5.19875cm - 5 - - - - - - true - true - - - - - S U S C R I P T O R - - - - - - - Textbox39 - 10.43336cm - 3.93558cm - 0.6cm - 5.19875cm - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - 10.25697cm - 11.9387cm - 0cm - 5.19875cm - 7 - - - - - - true - true - - - - - NOMBRE Y FIRMA DEL AVAL - - - - - - - Textbox39 - 10.43336cm - 11.9387cm - 0.6cm - 5.19875cm - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - - Start - - true - 6.7507in - 0.07741in - 4.422in - 7.87128in - - =iif(Parameters!AplicaPagare.Value="0",True,False) - - - - - - - - - true - true - - - - - "Este documento es una representación impresa de un CFDI" - - - - - - - - - Folio fiscal: - - - - =Parameters!FolioFiscal.Value - - - - - - - =Parameters!FechaCertificacion.Value - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!QR.Value - FitProportional - 0.02757in - 6.97243in - 1.17046in - 1.17in - 1 - - - - - - true - true - - - - - Número de serie del Certificado de Sello Digital: - - - - =Parameters!CertificadoContribuyente.Value - - - - - - - =Parameters!SerieCertificadoSAT.Value - - - - - - 2pt - 2pt - - - - true - 3.27046in - 1.21192in - 8.15659in - 1 - - - - - + - 0.58in + 1.36705cm - 0.58in + 4.79747cm - 0.8in + 3.1493cm - 3in + 3.31899cm - 0.57354in + 3.20023cm - 0.59047in - - - 0.61967in - - - 0.64182in - - - 0.79194in + 3.2129cm - 0.19645in + 0.42802cm - + true true - CANT. + FG: @@ -891,12 +48,24 @@ - Textbox22 + Textbox4 + LightGrey + - #6e4b43 + + + + + Black + + + + + + Black + 2pt 2pt 2pt @@ -907,19 +76,16 @@ - + true true - UM + Folio Fiscal: @@ -928,12 +94,24 @@ - Textbox15 + Textbox10 + LightGrey + - #6e4b43 + + Black + + + + + + + + + Black + 2pt 2pt 2pt @@ -944,19 +122,16 @@ - + true true - CLAVE SAT + Certificado SAT: @@ -965,12 +140,24 @@ - Textbox29 + Textbox37 + LightGrey + - #6e4b43 + + + + + + + + + + + Black + 2pt 2pt 2pt @@ -981,19 +168,16 @@ - + true true - DESCRIPCIÓN + Certificado del Emisor @@ -1002,12 +186,14 @@ - Textbox17 + Textbox21 - #6e4b43 + + + 2pt 2pt 2pt @@ -1018,19 +204,16 @@ - + true true - PU + Fecha de Expedición: @@ -1039,12 +222,96 @@ - Textbox3 + Textbox14 - #6e4b43 + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha de Certificación: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.3751cm + + + + + true + true + + + + + =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) + + + + + + + Black + 1pt + + + + + + + + + Black + 2pt 2pt 2pt @@ -1062,268 +329,10 @@ - DESC. + =Parameters!FolioFiscal.Value - - - - - - Textbox8 - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - IVA - - - - - - - Textbox2 - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - IEPS - - - - - - - Textbox4 - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - TOTAL - - - - - - - Textbox1 - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.14436in - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!UM.Value - - - - - - - UM - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SATClaveProdServ.Value - - - - - - - SATClaveProdServ - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PS.Value & " " & Fields!Obs.Value - @@ -1331,11 +340,24 @@ + LightGrey + + + Black + + + + + + + + + Black + 2pt 2pt 2pt @@ -1346,69 +368,42 @@ - + true true - =Fields!PU.Value + =Parameters!SerieCertificadoSAT.Value - + + LightGrey + - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - true - true - - - - - =Fields!Descuento.Value - - - - - - - Descuento - - + + + + + + Black + 2pt 2pt 2pt @@ -1419,32 +414,42 @@ - + true true - =Fields!ImporteIVA.Value & iif(Fields!PorcentajeIVA.Value = "0.16", " (16%)"," (0%)") + =Parameters!CertificadoContribuyente.Value - + + LightGrey + + + Black + + + + + + + + + Black + 2pt 2pt 2pt @@ -1455,32 +460,43 @@ - + true true - =iif(Fields!PorcentajeIEPS.Value = "0.03",Fields!ImporteIEPS.Value & " (3%)",iif(Fields!PorcentajeIEPS.Value = "0.06",Fields!ImporteIEPS.Value & " (6%)",iif(Fields!PorcentajeIEPS.Value = "0.07",Fields!ImporteIEPS.Value & " (7%)",iif(Fields!PorcentajeIEPS.Value = "0.09",Fields!ImporteIEPS.Value & " (9%)","")))) + =Parameters!FechaExpedicion.Value - + + LightGrey + + + Black + + + + + + + + + Black + 2pt 2pt 2pt @@ -1491,38 +507,47 @@ - + true true - =Fields!Cantidad.Value * Fields!PU.Value + = Parameters!FechaCertificacion.Value - + + LightGrey + + + Black + + + + + + + + + + 2pt 2pt 2pt 2pt - es-MX @@ -1539,212 +564,68 @@ - - - - - After - - - - + + DsOC - 1.40306in - 0.34081in - 8.17744in - 2 + 2.44301cm + 0.08633cm + 0.80312cm + 19.04594cm + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + - + true true - - - - #bce0c8 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - #613f35 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =UCase(Parameters!ImporteLetra.Value) + CLIENTE: - - - - ImporteLetra - 2.22226in - 2.12359in - 0.18861in - 5.97921in - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - #bce0c8 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - #bce0c8 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - @@ -1755,278 +636,45 @@ 2pt - - - - - 2.99824cm - - - - - 0.48004cm - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - - - - - - - - - - - - =Fields!ImpuestoLocal.Value - - - - 2.93858cm - - - true - true - - - - - =IIF(Fields!ImpuestoLocal.Value = "Total",UCase(Fields!ImpuestoLocal.Value),Fields!ImpuestoLocal.Value) - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - DataSet1 - 4.82801cm - 14.6443cm - 0.48004cm - 5.93682cm - 9 - - - - - - true - true - - - - - CFDI Relacionados - - - - - - - Textbox5 - 0.14926cm - 0.07193cm - 0.54004cm - 20.64582cm - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Tipo Relación: - - - - - - - Textbox29 - 0.83025cm - 4.78817cm - 0.41981cm - 5.31841cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!TipoRelacionTexto.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - + - 2.42456cm + 2.5cm - 2.05585cm - - - 3.03631cm - - - 7.7847cm + 9.28803cm - 0.44125cm + 0.33494cm - + true true - Folio + NOMBRE: - + - #6e4b43 2pt 2pt 2pt @@ -2037,107 +685,27 @@ - + true true - Fecha + =Parameters!ClienteNombre.Value - + - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Importe - - - - - - - Textbox21 - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Folio Fiscal - - - - - - - Textbox11 - - - #6e4b43 2pt 2pt 2pt @@ -2149,28 +717,27 @@ - 0.41479cm + 0.39173cm - + true true - =Fields!SerieFolio.Value + RFC: @@ -2185,94 +752,224 @@ - + true true - =Fields!Fecha.Value + =Parameters!ClienteRFC.Value - - - - - - Fecha - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!FolioFiscal.Value - + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.3375cm + + + + + true + true + + + + + DIRECCIÓN: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!ClienteDireccion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.31327cm + + + + + true + true + + + + + COLONIA: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!ClienteColonia.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.33327cm + + + + + true + true + + + + + CIUDAD: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!ClienteCiudad.Value + + + + @@ -2293,6 +990,3020 @@ + + + + + + + + + + + + DsOC + 0.11258cm + 0.30542cm + 1.71071cm + 11.78803cm + + + + + + + + + 1.57986cm + + + 4.98513cm + + + + + 0.33568cm + + + + + true + true + + + + + PAIS: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!ClientePais.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41432cm + + + + + true + true + + + + + LOCALIDAD + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!ClienteLocalidad.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.28271cm + + + + + true + true + + + + + C.P: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!ClienteCP.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.44125cm + + + + + true + true + + + + + ESTADO: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!ClienteEstado.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + DsOC + 0.17235cm + 12.24977cm + 1.47396cm + 6.56499cm + 1 + + + + + + true + 3.77178cm + 0.08633cm + 1.94426cm + 19.03097cm + 2 + + + + + + + + + + + 0.74524cm + + + 0.9873cm + + + 1.39591cm + + + 1.32145cm + + + 1.02823cm + + + 1.57771cm + + + 1.11702cm + + + 1.29714cm + + + 2.19941cm + + + 1.91907cm + + + 1.76677cm + + + 1.64277cm + + + 1.94602cm + + + + + 0.46393cm + + + + + true + true + + + + + CANT + + + + + + + Textbox11 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + UNIDAD + + + + + + + Textbox104 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + PROD/SERV + + + + + + + Textbox30 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESCRIPCIÓN + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 6 + + + + + + + + + + + true + true + + + + + PRECIO UNITARIO + + + + + + + Black + + 1pt + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IMPORTE + + + + + + + Black + + 1pt + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESCUENTO + + + + + + + Black + + 1pt + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + TOTAL + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46393cm + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveUM.Value + + + + + + + UM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveProdServ.Value + + + + + + + SATClaveProdServ + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Obs.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 6 + + + + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + true + true + + + + + =Fields!Cantidad.Value * Fields!PU.Value + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Descuento.Value + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + true + true + + + + + =(Fields!Cantidad.Value * Fields!PU.Value) - Fields!Descuento.Value + + + + + + + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + 0.61917cm + + + + + true + true + + + + + + + + + + + + Textbox58 + + =IIF( Fields!ImporteIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox59 + + =IIF( Fields!ImporteIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox61 + + =IIF( Fields!ImporteIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Impuesto + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Tipo + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Base + + + + + + + + + + Textbox87 + + =IIF( Fields!ImporteIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Tipo Factor + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Tasa o cuota + + + + + + + + + + Textbox79 + + =IIF( Fields!ImporteIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + + + + Textbox73 + + =IIF( Fields!ImporteIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.39956cm + + + + + true + true + + + + + + + + + + + + Textbox94 + + =IIF(Fields!ImporteIEPS.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox95 + + =IIF(Fields!ImporteIEPS.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox96 + + =IIF(Fields!ImporteIEPS.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IEPS + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Traslado + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =(Fields!Cantidad.Value * Fields!PU.Value) - Fields!Descuento.Value + + + + + + + Textbox99 + + =IIF(Fields!ImporteIEPS.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Tasa + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorcentajeIEPS.Value + + + + + + + Textbox101 + + =IIF(Fields!ImporteIEPS.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + $ + + + + =Fields!ImporteIEPS.Value + + + + + + + Textbox102 + + =IIF(Fields!ImporteIEPS.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.39956cm + + + + + true + true + + + + + + + + + + + + Textbox112 + + =IIF(Fields!ImporteRetIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox113 + + =IIF(Fields!ImporteRetIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox115 + + =IIF(Fields!ImporteRetIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Ret. IVA + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Retención + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =(Fields!Cantidad.Value * Fields!PU.Value) - Fields!Descuento.Value + + + + + + + Textbox118 + + =IIF(Fields!ImporteRetIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Tasa + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorcentajeRetIVA.Value + + + + + + + Textbox120 + + =IIF(Fields!ImporteRetIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + $ + + + + =Fields!ImporteRetIVA.Value + + + + + + + Textbox122 + + =IIF(Fields!ImporteRetIVA.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.42628cm + + + + + true + true + + + + + + + + + + + + Textbox127 + + =IIF(Fields!ImporteRetISR.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox128 + + =IIF(Fields!ImporteRetISR.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox129 + + =IIF(Fields!ImporteRetISR.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Ret. ISR + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Retención + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =(Fields!Cantidad.Value * Fields!PU.Value) - Fields!Descuento.Value + + + + + + + Textbox132 + + =IIF(Fields!ImporteRetISR.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Tasa + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorcentajeRetISR.Value + + + + + + + Textbox134 + + =IIF(Fields!ImporteRetISR.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + $ + + + + =Fields!ImporteRetISR.Value + + + + + + + Textbox135 + + =IIF(Fields!ImporteRetISR.Value = 0, True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + = IIF( Parameters!AplicaPU.Value.ToString()="True", "Default", "White") + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + @@ -2303,33 +4014,423 @@ After - + + + + + + =IIF( Fields!ImporteIVA.Value = 0, True,False) + + + + + + + =IIF(Fields!ImporteIEPS.Value = 0, True,False) + + Before + + + + =IIF(Fields!ImporteRetIVA.Value = 0, True,False) + + Before + + + + =IIF(Fields!ImporteRetISR.Value = 0, True,False) + + Before - DataSet4 - 1.39643cm - 3.28643cm - 0.85604cm - 15.30142cm - 3 + DsOC + 0.02909cm + 0.08693cm + 2.77243cm + 18.94404cm - + + true + 5.76456cm + 0.08633cm + 2.81143cm + 19.06506cm + 3 + + + + + + + + + 1.97751cm + + + + + 0.45183cm + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + + + + + + + + + + + + =Fields!ImpuestoLocal.Value + + + + 2.99338cm + + + true + true + + + + + =Fields!ImpuestoLocal.Value + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + DataSet1 + 8.58452cm + 14.1887cm + 0.45183cm + 4.97089cm + 4 + + + White + + + + true + true + + + + + IMPORTE CON LETRA + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + 4.68791cm + 6.69955cm + 0cm + + + + + true true - VERSION 3.3 + Sello digital del CFDI: + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloCFDI.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 1.21513cm + 4.68791cm + 0cm + 14.05756cm + 3 + + + + + + true + true + + + + + Sello del SAT: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloSAT.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 2.28637cm + 4.68791cm + 0cm + 14.05756cm + 6 + + + + + + true + true + + + + + Cadena original del complemento de certificación del SAT + @@ -2339,12 +4440,826 @@ - Textbox5 - 2.32303cm - 17.39754cm - 0.6cm - 3.32021cm - 4 + Textbox153 + 2.33846cm + 6.53135cm + 0.30014cm + 11.18751cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + 2.70915cm + 4.68791cm + 0cm + 14.05756cm + 8 + + + + + + true + true + + + + + =Parameters!CadenaOriginal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 3.66722cm + 4.68791cm + 0cm + 14.05756cm + 10 + + + + + + true + true + + + + + Este documento es una representación impresa de un CFDI + + + + + + + Textbox155 + 3.69544cm + 6.53135cm + 0.32075cm + 11.18751cm + 11 + + + 2pt + 2pt + 2pt + 2pt + + + + 4.07969cm + 4.68791cm + 0cm + 14.05756cm + 12 + + + + + + true + true + + + + + Efectos fiscales al pago + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 4.54563cm + 4.68791cm + 0cm + 14.08618cm + 14 + + + + + + true + true + + + + + Régimen Fiscal: 601 RÉGIMEN GENERAL DE LEY PERSONAS MORALES + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 5.2938cm + 4.68791cm + 0cm + 14.05756cm + 16 + + + + + + true + true + + + + + Método de pago: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 5.2938cm + 12.55109cm + 0.94175cm + 0cm + 19 + + + + + + true + true + + + + + Número de cuenta de pago: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!NumCta.Value="0" Orelse Parameters!NumCta.Value="","NA",Parameters!NumCta.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!QR.Value + FitProportional + 2.59219cm + 0.04173in + 1.27324in + 1.56618in + 22 + + + + + + Embedded + SAT + FitProportional + 0.12384cm + 0.106cm + 3.23403cm + 3.9781cm + 23 + + + + + + 4.93921cm + 4.68743cm + 0cm + 14.05756cm + 24 + + + + + + true + true + + + + + Uso CFDI: + + + + =Parameters!UsoCFDI.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 5.75269cm + 4.68743cm + 0cm + 14.05756cm + 26 + + + + + + true + true + + + + + =Parameters!FormaPago.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Forma de pago: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + CFDI Relacionados + + + + + + + Textbox5 + 0.46243cm + 19.11806cm + + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Tipo Relación: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF( Parameters!TipoRelacionTexto.Value.ToString() = "Refacturación de Ingreso" ,"04 - Sustitución de los CFDI previos" ,Parameters!TipoRelacionTexto.Value.ToString()) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Folio Fiscal: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FolioFiscalRelacionado.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Número relacionado a la factura del Anticipo Inicial. + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + 6.21158cm + 1.197cm + 19.11806cm + 29 + + =Microsoft.VisualBasic.Interaction.iif(Parameters!TipoRelacionTexto.Value <> "" Or Parameters!FolioFiscalRelacionado.Value <> "", False, True) + + + + + + + true + true + + + + + Moneda: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Moneda.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + TC: $ + + + + =Parameters!TipoCambio.Value + + + + @@ -2357,30 +5272,429 @@ true - 12.21724cm - 2.97096cm - 20.72355cm - 10 - - =iif(Parameters!TipoRelacionTexto.Value <> "", False, True) - + 13.35624cm + 0.127cm + 7.40858cm + 19.11806cm + 7 + + + + + + + + + + + 5.10989cm + + + + + 0.91584cm + + + + + true + true + + + + + =Fields!Titulo.Value + + + + + + + + + =Fields!Titulo2.Value + + + + + + + + + + + + + + + + + + __________________________________ + + + + + + + + + =Fields!Nombre.Value + + + + + + + + + =Fields!Puesto.Value + + + + + + + + + =Fields!RFC.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + true + DataSet2 + 0.07525cm + 0.8073cm + 0.91584cm + 5.10989cm + + + + + + + + + 4.81544cm + + + + + 0.90381cm + + + + + true + true + + + + + =Fields!Titulo.Value + + + + + + + + + =Fields!Titulo2.Value + + + + + + + + + + + + + + + + + + __________________________________ + + + + + + + + + =Fields!Nombre.Value + + + + + + + + + =Fields!Puesto.Value + + + + + + + + + =Fields!RFC.Value + + + + + + + Textbox114 + + =(Fields!Lado.Value <> 0) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + DataSet2 + 0.07525cm + 13.13459cm + 0.90381cm + 4.81544cm + 1 + + + + + + true + 12.30653cm + 0.127cm + 0.99109cm + 18.86448cm + 8 - + + true + true + + + + + Documento Válido + + + + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + - 0.78719in + 1.06641in - 0.58129in + 0.8881in - 0.71694in + 0.87012in @@ -2389,19 +5703,18 @@ - + true true - IMPUESTO + Impuesto @@ -2411,11 +5724,14 @@ Textbox22 + + true + + - #6e4b43 + White 2pt 2pt 2pt @@ -2426,19 +5742,18 @@ - + true true - TASA + Tasa @@ -2450,9 +5765,9 @@ Textbox15 + - #6e4b43 + White 2pt 2pt 2pt @@ -2463,19 +5778,18 @@ - + true true - IMPORTE + Importe @@ -2487,9 +5801,9 @@ Textbox29 + - #6e4b43 + White 2pt 2pt 2pt @@ -2514,8 +5828,8 @@ =Fields!Impuesto.Value @@ -2528,7 +5842,7 @@ Cantidad1 + 2pt 2pt @@ -2549,8 +5863,8 @@ =Fields!tasa.Value @@ -2563,7 +5877,7 @@ UM + 2pt 2pt @@ -2584,10 +5898,10 @@ =Fields!Importe.Value @@ -2599,13 +5913,12 @@ Codigo + 2pt 2pt 2pt 2pt - es-MX @@ -2627,485 +5940,18 @@ After - + DataSet3 - 1.90507in + 3.38942in + 2.51985in 0.34081in - 2.08542in - 11 - - - - - - - - - 1.99527cm - - - 1.4677cm - - - 2.20762cm - - - 2.04008cm - - - 1.71184cm - - - - - 0.52062cm - - - - - true - true - - - - - Ventas Aplicadas - - - - - - - Textbox22 - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - 5 - - - - - - - - - - 0.52063cm - - - - - true - true - - - - - Factura - - - - - - - Textbox16 - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fecha - - - - - - - Textbox24 - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Total - - - - - - - Textbox27 - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - NC - - - - - - - Textbox30 - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Moneda - - - - - - - Textbox37 - - - #6e4b43 - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.49417cm - - - - - true - true - - - - - =Fields!SerieFolio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Fecha.Value - - - - - - - Fecha1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SubTotal.Value - - - - - - - SubTotal - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe2 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Moneda.Value - - - - - - - Moneda - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - - - After - - - - - - - DataSet5 - 6.19416cm - 1.53542cm - 9.42251cm - 12 + 2.82463in + 10 - =IIF(Parameters!Tipo.Value = "EGRESO" OR Parameters!Tipo.Value = "Anticipo" OR Parameters!Tipo.Value = "DEVOLUCION", False,True) + true - - true + + + + true + true + + + + + DEPOSITAR EN: + + + + + + + Textbox1 + 0.02461cm + 1.25cm + 0.33197cm + 2.5cm + + + 2pt + 2pt + 2pt + 2pt + + + + 0.39539cm + 0cm + 5.89514cm + 1 + + + + + + + + + 1.92142cm + + + 3.97372cm + + + + + 0.36611cm + + + + + true + true + + + + + BENEFICIARIO + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + GLUYAS CONSTRUCCIONES S.A. DE C.V. + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.35463cm + + + + + true + true + + + + + BANCO: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + BANCOMER + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.34697cm + + + + + true + true + + + + + No.CUENTA: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + 0133357023 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.35257cm + + + + + true + true + + + + + CLABE: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + 012760001333570233 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.34803cm + + + + + true + true + + + + + SUCURSAL: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + 1830 HERMOSILLO + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.33935cm + + + + + true + true + + + + + LUGAR: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + SONORA + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + DsOC + 0.45889cm + 2.10766cm + 5.89514cm + 2 + + + + + true - - - - - "REVISAR SU FACTURA AL MOMENTO DE RECEPCIÓN YA QUE NO SE REALIZARA CAMBIO DE LA MISMA DESPUÉS DE 5 DÍAS POSTERIORES A SU FECHA DE ELABORACIÓN" - - - - - - - Textbox1 - 7.80013cm - 0.34219cm - 20.64582cm - 13 + 8.64802cm + 0.09525cm + 2.61093cm + 5.92603cm + 11 + - 2pt - 2pt - 2pt - 2pt - - - true + + + + + 3.18142cm + 2.36466cm + 0cm + + + + + + true + true + + + + + GLUYAS CONSTRUCCIONES, S.A DE C.V. + + + + + + + + + Calle Tarasca #16 Sur, Col. Nueva Estación, Hermosillo, Sonora. , CP 83160 + + + + + + + + + Tels/Fax(662) 210 4721 Email: info@gluyasconstrucciones.com + + + + + + + + + RFC: GCO-890418-M56 + + + + + + + + + + + + Lugar Expedición: 83160 + + + + + + + Textbox2 + 0.13879cm + 3.39309cm + 2.04489cm + 11.97743cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo3 + FitProportional + 0.13879cm + 0.2113cm + 2.04489cm + 2.79373cm + 2 + + + + + + true + true + + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + CFDI 4.0 Tipo: + + + + =Microsoft.VisualBasic.Interaction.IIF(Parameters!Tipo.Value.ToString() = "INGRESO" Or Parameters!Tipo.Value.ToString() = "REMISION", "I-Ingreso", Microsoft.VisualBasic.Interaction.IIF(Parameters!Tipo.Value.ToString() = "EGRESO", "E-Egreso", "")) + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + true - - - - - - - - - TIPO DE DOCUMENTO: - - - - =Parameters!Tipo.Value - - - - - - - - - - - - - Serie: - - - - =Parameters!Serie.Value - - - - Folio: - - - - =Parameters!Folio.Value - - - - - - - - - Fecha: - - - - - - - - = Parameters!Fecha.Value - - - - - - - - - - - - - =IIF(Parameters!CondicionPago.Value = "crédito","<b>Fecha Vencimiento:</b> " & (Parameters!Vencimiento.Value),"") - HTML - - - - - - - - - Moneda: - - - - =Parameters!MonedaAbreviatura.Value - - - - - - - - - Forma de pago: - - - - =Parameters!FormaPago.Value - - - - - - - - - Método de pago: - - - - =Parameters!MetodoPago.Value - - - - - - - - - Uso CFDI: - - - - =Parameters!UsoCFDI.Value - - - - - - - - - Régimen fiscal: - - - - Regimen General de Ley Personas Morale - - - - s - - - - - - - Textbox4 - 0.03543in - 5.16854in - 1.34269in - 3.02863in - 14 + 0.08815cm + 2.36466cm + 19.04412cm + 12 - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Facturado a: - - - - - - - - - Cliente: - - - - =Parameters!ClienteNombre.Value - - - - - - - - - RFC: - - - - =Parameters!ClienteRFC.Value - - - - - - - - - Calle: - - - - - - - - =Parameters!ClienteCalle.Value & IIF(Parameters!ClienteNoExt.Value <> "", " No.Ext: " & Parameters!ClienteNoExt.Value & iif(Parameters!ClienteNoInt.Value <> ""," No.Int: " & Parameters!ClienteNoInt.Value,""),iif(Parameters!ClienteNoInt.Value <> ""," No.Int: " & Parameters!ClienteNoInt.Value,"")) - - - - - - - - - Colonia: - - - - - - - - =Parameters!ClienteColonia.Value - - - - - - - - - Ciudad: - - - - =Parameters!ClienteCiudad.Value - - - - - - - - - - - - - Estado: - - - - - - - - =Parameters!ClienteEstado.Value - - - - - - - - - Municipio y/o Delegación: - - - - =Parameters!ClienteMunicipio.Value - - - - - - - - - - - - - Pais: - - - - =Parameters!ClientePais.Value - - - - - - - - CP: - - - - - - - - =Parameters!ClienteCP.Value - - - - - - - Textbox2 - 0.03543in - 4.14584cm - 1.34269in - 3.53631in - 15 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Domicilio fiscal: - - - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - Embedded - LogoRuinaNuevo1 - FitProportional - 0.05674cm - 1.59082cm - 4.08074cm - 17 - + - + - 30.54266cm - - - + 20.76482cm + - - - =Parameters!FechaImpresion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - + true true @@ -3884,8 +6727,8 @@ ="Página " & Globals.PageNumber & " de " & Globals.TotalPages @@ -3894,12 +6737,10 @@ - Textbox35 - 0.11289cm - 18.37755cm - 0.41981cm - 2.5cm - 1 + Textbox3 + 15.03252cm + 0.41479cm + 3.95896cm @@ -3919,10 +6760,10 @@ 27.94cm 21.59cm - 0.25cm - 0.25cm + 0.5cm + 0cm 0.5cm - 0.5cm + 0cm 1.27cm