diff --git a/Acumuladores/CatGarantiasMeses.aspx.vb b/Acumuladores/CatGarantiasMeses.aspx.vb index 0f204a538..190f4dd6c 100644 --- a/Acumuladores/CatGarantiasMeses.aspx.vb +++ b/Acumuladores/CatGarantiasMeses.aspx.vb @@ -72,22 +72,12 @@ Partial Class Acumuladores_CatFoliosGarantia Private Sub CargaCombos() - 'Dim ObjPS As New ClsProductosServicios - - 'If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then - ' DdlMarca.DataSource = ObjPS.DtResultados - ' DdlMarca.DataBind() - ' DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) - ' DdlMarca.SelectedValue = "-1" - 'End If - 'ObjPS.Dispose() - DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa) DdlMarca.DataBind() DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) DdlMarca.SelectedValue = "-1" - DdlTipoUso.DataSource = GlobalDTAcumTiposUso() + DdlTipoUso.DataSource = GlobalDTAcumTiposUso(UsuarioActual.CveEmpresa) DdlTipoUso.DataBind() DdlTipoUso.Items.Insert(0, New ListItem("Todos", "-1")) DdlTipoUso.SelectedValue = "-1" @@ -124,7 +114,7 @@ Partial Class Acumuladores_CatFoliosGarantia DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa) DdlMarcaM.DataBind() - DdlTipoUsoM.DataSource = GlobalDTAcumTiposUso() + DdlTipoUsoM.DataSource = GlobalDTAcumTiposUso(UsuarioActual.CveEmpresa) DdlTipoUsoM.DataBind() End Sub diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 8b60b8ae6..81a6e7ee9 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -1466,7 +1466,7 @@ Public Class ClsBancos Public Function AddBancos_IE(CveCuenta As Integer, CveTipoTransaccion As Integer, FechaDocumento As Date, Folio As String, PagueseA As String, Importe As Double, CveMoneda As Integer, TipoCambio As Double, Observaciones As String, NotificarA As String, EsAbonoEnCuenta As Boolean, AplicaImpuestos As Boolean, IDPoliza As Integer, CvePrePoliza As Integer, Comprobante As String, CveUsuario As Integer, CveEmpresa As Integer, Optional CveCuentaDeposito As Integer = -1, Optional PagoElectronico As String = "-1", Optional CveEstatusIE As Integer = 1, Optional CveCuentaTarjeta As Integer = -1, - Optional Referencia As String = "-1", Optional CveIESustitucion As Integer = -1, Optional CveCorte As Integer = -1, Optional CveProveedorIntermediario As Integer = -1, Optional FueConciliado As Boolean = False, + Optional Referencia As String = "-1", Optional CveCorte As Integer = -1, Optional CveProveedorIntermediario As Integer = -1, Optional FueConciliado As Boolean = False, Optional MesesSinIntereses As Integer = -1, Optional Modulo As String = "", Optional ConceptoCIE As String = "", Optional CveOCAnticipo As Integer = -1) As Integer Dim Retorno As Integer = -1 @@ -1497,7 +1497,6 @@ Public Class ClsBancos .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveCuentaTarjeta", SqlDbType.Int).Value = CveCuentaTarjeta .Add("@Referencia", SqlDbType.VarChar).Value = Referencia - .Add("@CveIESustitucion", SqlDbType.Int).Value = CveIESustitucion .Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@CveProveedorIntermediario", SqlDbType.Int).Value = CveProveedorIntermediario .Add("@FueConciliado", SqlDbType.Bit).Value = FueConciliado diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index e7a7280d6..4e1c5e4f6 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -391,8 +391,8 @@ Public Class ClsClientes _CveUsoCFDI = Data(0)("CveUsoCFDI").ToString.ToEntero - _CveFormaPago33 = Data(0)("CveFormaPago33").ToString.ToEntero - _CveMetodoPago33 = Data(0)("CveMetodoPago33").ToString.ToEntero + _CveFormaPago33 = Data(0)("CveFormaPago").ToString.ToEntero + _CveMetodoPago33 = Data(0)("CveMetodoPago").ToString.ToEntero _CveRegimenFiscal = Data(0)("CveRegimenFiscal").ToString.ToEntero @@ -576,6 +576,8 @@ Public Class ClsClientes Return Retorno End Function + + Public Function AddCliente(Nombre As String, NombreComercial As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, Estado As String, Pais As String, RFC As String, CP As String, Telefono As String, Contacto As String, Mail As String, MailCotizacion As String, Notificar As String, Pagina As String, Giro As String, CvePrecioLista As Integer, EnviarFactura As Boolean, RetIVA As Double, RetISR As Double, RetieneIVAFletes As Boolean, CveUsuario As Integer, CveEmpresa As Integer, NombreCorto As String, CveVendedor As Integer, PlazoCobranza As Integer, PlazoCobranzaRemision As Integer, RecepcionPagos As String, TipoPago As String, @@ -587,7 +589,7 @@ Public Class ClsClientes Optional CveClienteClasificacion As Integer = -1, Optional CveUsuarioResponsable As Integer = -1, Optional CveCondicionEntrega As Integer = -1, Optional ImprimeNombreSucursal As Boolean = True, Optional CveZonaHoraria As Integer = -1, Optional CobranzaContacto As String = "-1", Optional CobranzaTelefono As String = "-1", Optional CobranzaExt As String = "-1", Optional CobranzaCorreo As String = "-1", Optional Horario As String = "-1", Optional PortalFacturacion As String = "-1", Optional Documentacion As String = "-1", Optional DiasEspecifico As String = "-1", Optional UsuarioPortal As String = "-1", Optional ContraseñaPortal As String = "-1", Optional DiasRevision As String = "-1", - Optional ObservacionRevsion As String = "-1", Optional ReferenciaFiscal As String = "-1", Optional Celular As String = "-1", Optional ExtOtros As String = "-1", Optional CveUsoCFDI As Integer = -1, Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional DesglosaIEPS As Boolean = True, + Optional ObservacionRevsion As String = "-1", Optional ReferenciaFiscal As String = "-1", Optional Celular As String = "-1", Optional ExtOtros As String = "-1", Optional CveUsoCFDI As Integer = -1, Optional CveFormaPago As Integer = -1, Optional CveMetodoPago As Integer = -1, Optional DesglosaIEPS As Boolean = True, Optional AplicaComercioExterior As Boolean = False, Optional CveTipoOperacion As Integer = -1, Optional CvePedimento As Integer = -1, Optional CveIncoterm As Integer = -1, Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveColonia As Integer = -1, Optional CveMotivoTraslado As Integer = 0, Optional NumRegIdTrib As String = "", Optional ComExtEstado As String = "-1", Optional ComExtMunicipio As String = "-1", Optional ComExtColonia As String = "-1", Optional RequiereOC As Boolean = False, Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, @@ -694,8 +696,8 @@ Public Class ClsClientes .Add("@ExtOtros", SqlDbType.VarChar).Value = ExtOtros .Add("@CveUsoCFDI", SqlDbType.Int).Value = CveUsoCFDI - .Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33 - .Add("@CveMetodoPago33", SqlDbType.Int).Value = CveMetodoPago33 + .Add("@CveFormaPago", SqlDbType.Int).Value = CveFormaPago + .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago .Add("@CveClienteCorporativo", SqlDbType.Int).Value = CveClienteCorporativo @@ -785,7 +787,7 @@ Public Class ClsClientes Optional CveClienteClasificacion As Integer = -1, Optional CveUsuarioResponsable As Integer = -1, Optional CveCondicionEntrega As Integer = -1, Optional ImprimeNombreSucursal As Boolean = True, Optional CveZonaHoraria As Integer = -1, Optional CobranzaContacto As String = "-1", Optional CobranzaTelefono As String = "-1", Optional CobranzaExt As String = "-1", Optional CobranzaCorreo As String = "-1", Optional Horario As String = "-1", Optional PortalFacturacion As String = "-1", Optional Documentacion As String = "-1", Optional DiasEspecifico As String = "-1", Optional UsuarioPortal As String = "-1", Optional ContraseñaPortal As String = "-1", Optional DiasRevision As String = "-1", - Optional ObservacionRevsion As String = "-1", Optional ReferenciaFiscal As String = "-1", Optional Celular As String = "-1", Optional ExtOtros As String = "-1", Optional CveUsoCFDI As Integer = -1, Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional DesglosaIEPS As Boolean = True, + Optional ObservacionRevsion As String = "-1", Optional ReferenciaFiscal As String = "-1", Optional Celular As String = "-1", Optional ExtOtros As String = "-1", Optional CveUsoCFDI As Integer = -1, Optional CveFormaPago As Integer = -1, Optional CveMetodoPago As Integer = -1, Optional DesglosaIEPS As Boolean = True, Optional AplicaComercioExterior As Boolean = False, Optional CveTipoOperacion As Integer = -1, Optional CvePedimento As Integer = -1, Optional CveIncoterm As Integer = -1, Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveColonia As Integer = -1, Optional CveMotivoTraslado As Integer = 0, Optional NumRegIdTrib As String = "-1", Optional ComExtEstado As String = "-1", Optional ComExtMunicipio As String = "-1", Optional ComExtColonia As String = "-1", Optional ApellidoPaternoPF As String = "-1", Optional ApellidoMaternoPF As String = "-1", Optional NombresPF As String = "-1", Optional RequiereOC As Boolean = False, @@ -906,8 +908,8 @@ Public Class ClsClientes .Add("@CveUsoCFDI", SqlDbType.Int).Value = CveUsoCFDI - .Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33 - .Add("@CveMetodoPago33", SqlDbType.Int).Value = CveMetodoPago33 + .Add("@CveFormaPago", SqlDbType.Int).Value = CveFormaPago + .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago .Add("@CveClienteCorporativo", SqlDbType.Int).Value = CveClienteCorporativo diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index fc35b6ae2..d61a22728 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -1016,22 +1016,24 @@ Public Class ClsContabilidad If ex1.Message.Contains("50015;") Then OnError("No se puede registrar una póliza en un ejercicio Cerrado", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ElseIf ex1.Message.Contains("50024; La Cuenta no fue detectada") Then - Dim Strr As String = "" - If HttpContext.Current.Application("GlobalDTContaConceptosContables") IsNot Nothing Then - Dim dr As Data.DataRow = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimero(String.Format("CveConceptoContable = {0}", CveConceptoContable)) - Strr = dr("ConceptoContable").ToString - 'If dr("AplicaClasificacion").ToString <> "No" Then - ' Strr = Strr + " - Clasificación: " + DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("", "") - 'End If + Dim dtt As DataTable = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable) + Dim StrMsg As String = "" + If dtt IsNot Nothing Then + Dim dr As Data.DataRow = dtt.FiltroPrimero("") + If dr IsNot Nothing Then + StrMsg = dr("ConceptoContable").ToString + If dr("AplicaClasificacion").ToString = "True" Then + StrMsg = StrMsg + " - Clasificación: " + ClsPaginas.GlobalDTClasificaciones(CType(HttpContext.Current.Session("UsuarioSIG"), Usuario).CveEmpresa, CveClasificacion:=CveClasificacion).FiltroPrimeroValor("Clasificacion", "") + End If + End If End If - - OnError(String.Format("El concepto '{0}' no tiene especificada la cuenta. Favor de especificarla en la asignación de cuentas.", Strr), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError(String.Format("El concepto '{0}' no tiene especificada la cuenta. Favor de especificarla en la asignación de cuentas.", StrMsg), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ElseIf ex1.Message.Contains("Vw_Val_Conta_CuentasResultados_SubProyectos") Then - Dim Concepto2 As String = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("ConceptoContable", String.Format("CveConceptoContable = {0}", CveConceptoContable)) - OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto2), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Dim Concepto2 As String = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimeroValor("ConceptoContable") + OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto2), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ElseIf ex1.Message.Contains("UK_Vw_Val_Conta_CuentasResultados_SubProyectos") Then - Dim Concepto3 As String = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("ConceptoContable", String.Format("CveConceptoContable = {0}", CveConceptoContable)) - OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto3), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Dim Concepto3 As String = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimeroValor("ConceptoContable") + OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto3), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ElseIf ex1.Message.Contains("50025;") Then OnError("La empresa no tiene un formato de cuenta asignado.", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ElseIf ex1.Message.Contains("50026;") Then @@ -2048,13 +2050,14 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function GetPrePolizasDetalleResumen(CvePrePoliza As Integer, CveEmpresa As Integer) As Boolean 'Editado por charlie + Public Function GetPrePolizasDetalleResumen(CvePrePoliza As Integer, CveEmpresa As Integer, Optional Opcion As Integer = 1) As Boolean 'Editado por charlie Dim Retorno As Boolean = False DataAdapter("PA_Conta_PrePolizasDetalleResumenGet") With SqlAdapter.SelectCommand.Parameters .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Opcion", SqlDbType.Int).Value = Opcion End With Try diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 77f4301c1..10c90cc59 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3910,7 +3910,7 @@ Public Class ClsGenerales Public Function AddInvEntregaAlmacenRuta(CveSubProyecto As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveMovimientoAlmacen As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, FechaLlegada As DateTime, Tipo As String, FolioReferencia As String, Referencia As String, FechaLimite As Date, Orden As Integer, Estatus As Integer, Distancia As Integer, Optional CveConfigAutoTransporte As Integer = -1, - Optional CveCamionRemolque1 As Integer = -1, Optional CveCamionRemolque2 As Integer = -1) As Integer + Optional CveCamionRemolque1 As Integer = -1, Optional CveCamionRemolque2 As Integer = -1, Optional CveCliente As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Inv_EntregaAlmacenRutaAdd") @@ -3936,6 +3936,7 @@ Public Class ClsGenerales .Add("@CveCamionRemolque1", SqlDbType.Int).Value = CveCamionRemolque1 .Add("@CveCamionRemolque2", SqlDbType.Int).Value = CveCamionRemolque2 .Add("@CveConfigAutoTransporte", SqlDbType.Int).Value = CveConfigAutoTransporte + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output End With diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index cf9c2e04c..36e99b747 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -2,16 +2,17 @@ Option Explicit On Option Strict On +Imports System Imports System.Data Imports System.Data.SqlClient Imports Extensiones Public Class ClsMovimientos - Implements IDisposable - + Implements IDisposable + #Region "Campos" - - 'SQL + + 'SQL Private SqlConexion As SqlConnection Private SqlAdapter As SqlDataAdapter Private SqlTransacc As SqlTransaction @@ -20,12 +21,12 @@ Public Class ClsMovimientos Private DS As DataSet 'Atributos de la clase - Private disposedValue As Boolean = False ' Para detectar llamadas redundantes - 'REGISTRAR CONEXIONES ABIERTAS - Private CveConexion As Integer = 0 - + Private disposedValue As Boolean = False ' Para detectar llamadas redundantes + 'REGISTRAR CONEXIONES ABIERTAS + Private CveConexion As Integer = 0 + + #End Region - #Region "Propiedades" Public ReadOnly Property DtResultados() As DataTable Get @@ -36,12 +37,13 @@ Public Class ClsMovimientos Public ReadOnly Property DSResultados() As DataSet Get DSResultados = DS - End Get + End Get End Property - Public Property AlertaMensaje As New StringBuilder + Public Property AlertaMensaje As New StringBuilder + #End Region - + Sub New() SqlConexion = New SqlConnection SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString @@ -62,9 +64,10 @@ Public Class ClsMovimientos End With If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc Data = New DataTable - End Sub + End Sub + #Region "Conexiones" - + Private Sub ConexionAdd() If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try @@ -97,9 +100,9 @@ Public Class ClsMovimientos CveConexion = 0 End If - End Sub + End Sub #End Region - + Public Sub IniciaTransacSQL() SqlTransacc = SqlConexion.BeginTransaction() End Sub @@ -488,13 +491,13 @@ Public Class ClsMovimientos Retorno = True Catch ex As SqlException OnError("Ocurrió un error al descargar los segmentos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try + End Try Return Retorno - End Function - - + End Function + + + #End Region - #Region "Anticipos de Clientes" Public Function GetAnticiposCliente(CveCliente As Integer, Optional SelectTop As Integer = -1, Optional CveMoneda As Integer = 1) As Boolean Dim Retorno As Boolean = False @@ -572,12 +575,14 @@ Public Class ClsMovimientos End Try Return Retorno - End Function - + End Function + + + + #End Region - #Region "CxP" - + Public Function GetCxPEmpresa(CveProveedor As Integer, FechaVencimientoInicio As String, FechaVencimientoFin As String, CveSubProyecto As Integer, DiasVencidos As Integer, CveUsuarioRegistro As Integer, CveUsuarioProgramo As Integer, CveUsuarioResponsable As Integer, CveClasificacion As Integer, CveMoneda As Integer, CveTipoPagoProgramo As Integer, CveEstatusFactura As Integer, CveAplicaNC As Integer, CveEmpresa As Integer, Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional CodigoProgramacion As String = "-1", Optional CveTipoProveedor As Integer = 0, @@ -1204,6 +1209,29 @@ Public Class ClsMovimientos Return Retorno End Function + Public Function GetDocumentosxPagarDetalle(CveCliente As Integer, CveMoneda As Integer, Opcion As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_Banc_DocumentosxPagarSaldosDetalle") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda + .Add("@Opcion", SqlDbType.Int).Value = Opcion + .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 Reporte de documentos por pagar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function GetCajaChicaDetalle(CveCajaChica As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -1465,9 +1493,9 @@ Public Class ClsMovimientos End Try Return Retorno - End Function + End Function #End Region - + #Region "Anticipos de Proveedores" Public Function GetAnticiposProveedor(CveProveedor As Integer, CveProveedorSucursal As Integer, Optional CveMoneda As Integer = -1, Optional SelectTop As Integer = -1, Optional FechaI As String = "-1", Optional FechaF As String = "-1", Optional TipoDocto As String = "-1") As Boolean Dim Retorno As Boolean = False @@ -1489,33 +1517,32 @@ Public Class ClsMovimientos Retorno = True Catch ex As SqlException OnError("Ocurrió un error al consultar los Anticipos del proveedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function - - 'Public Function GetAnticiposClienteAuxiliar(CveCliente As Integer, CveVenta As Integer) As Boolean - ' Dim Retorno As Boolean = False - ' 'Data = New DataTable - ' 'SqlAdapter = New SqlDataAdapter("PA_ClienteAnticiposAuxiliar", SqlConexion) - ' 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure - ' DataAdapter("PA_ClienteAnticiposAuxiliar") - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - ' .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - ' End With - ' Try - ' SqlAdapter.Fill(Data) - ' Retorno = True - ' Catch ex As SqlException - ' OnError("Ocurrió un error al consultar el Auxiliar Contable de Anticipos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ' End Try - - ' Return Retorno - 'End Function - + End Try + Return Retorno + End Function + + + 'Public Function GetAnticiposClienteAuxiliar(CveCliente As Integer, CveVenta As Integer) As Boolean + ' Dim Retorno As Boolean = False + ' 'Data = New DataTable + ' 'SqlAdapter = New SqlDataAdapter("PA_ClienteAnticiposAuxiliar", SqlConexion) + ' 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure + ' DataAdapter("PA_ClienteAnticiposAuxiliar") + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + ' .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + ' End With + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As SqlException + ' OnError("Ocurrió un error al consultar el Auxiliar Contable de Anticipos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try + + ' Return Retorno + 'End Function + #End Region - #Region "REP RECUPERACION" Public Function GetRepRecuperacion(FechaI As Date, FechaF As Date, CveCliente As Integer, CveSubProyecto As Integer, CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String, @@ -1661,9 +1688,9 @@ Public Class ClsMovimientos End Try Return Retorno - End Function + End Function + #End Region - #Region "REP COBRADO" Public Function GetRepCobrado(FechaI As Date, FechaF As Date, CveProveedor As Integer, CveSubProyecto As Integer, CveUsuario As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, CveResponsable As Integer, @@ -1733,11 +1760,13 @@ Public Class ClsMovimientos End Try Return Retorno - End Function + End Function + + + #End Region - #Region "EDITAR FECHA DE MOVIMIENTO" - + Public Function UpdateMovimientoFecha(Fecha As DateTime, CveMovimiento As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Mov_MovimientoFechaUpdate") @@ -1752,12 +1781,16 @@ Public Class ClsMovimientos OnError("Ocurrió un error al actualizar la fecha del movimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno - End Function + End Function + + + + + #End Region - #Region "Registros Contables" - - + + Public Function AddMovimiento(CveConcepto As Integer, Tipo As String, Referencia1 As String, Referencia2 As String, CveMoneda As Integer, Cargo As Double, Abono As Double, Fecha As Date, FechaVencimiento As Date, Folio As String, IdCtaContable As Integer, CveUsuario As Integer, CveEmprea As Integer) As Boolean Dim Retorno As Boolean = False @@ -1831,14 +1864,14 @@ Public Class ClsMovimientos End Try Return Retorno - End Function - + End Function + + #End Region - #Region "IDisposable Support" - - - ' IDisposable + + + ' IDisposable Protected Overridable Sub Dispose(disposing As Boolean) If Not Me.disposedValue Then If disposing Then @@ -1871,9 +1904,10 @@ Public Class ClsMovimientos ConexionClose() Dispose(True) GC.SuppressFinalize(Me) - End Sub + End Sub + #End Region - + Public Function GetPersonalCajaChica(CveEmpresa As Integer, CveCompra As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_PersonalCajaChica") diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index f86784260..c812a6f51 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -1554,7 +1554,7 @@ Public Class ClsOIEventos CveOS As Integer, CveOC As Integer, CvePersonal As Integer, CveProveedor As Integer, CveCompra As Integer, CveVenta As Integer, CveUsuario As Integer, CveUsuarioIng As Integer, CveUsuarioConsulta As Integer, CveEmpresa As Integer, Optional FechaInicio As Nullable(Of DateTime) = Nothing, Optional FechaFin As Nullable(Of DateTime) = Nothing, Optional FechaRealTermino As Nullable(Of DateTime) = Nothing, Optional CveContrato As Integer = -1, Optional CveMovimientoAlmacen As Integer = -1, Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, - Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean + Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional EsCoordinador As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OI_EventosGet") @@ -1605,7 +1605,10 @@ Public Class ClsOIEventos .Add("@CveEtapaProcesoCRM", SqlDbType.Int).Value = CveEtapaProcesoCRM .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - + .Add("@EsCoordinador", SqlDbType.Bit).Value = EsCoordinador + + + End With Try @@ -2203,6 +2206,43 @@ Public Class ClsOIEventos Return Retorno End Function + + + Public Function GetCircularCorreos(EnvioTipo As Integer, CveEmpresa As Integer, CveRol As Integer, CveSubProyectoUsuario As Integer, CveProveedorClasificacion As Integer, CveSubProyectoPersonal As Integer, CveClienteClasificacion As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_CircularCorreosGet") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@EnvioTipo", SqlDbType.Int).Value = EnvioTipo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + .Add("@CveRol", SqlDbType.Int).Value = CveRol + .Add("@CveSubProyectoUsuario", SqlDbType.Int).Value = CveSubProyectoUsuario + .Add("@CveProveedorClasificacion", SqlDbType.Int).Value = CveProveedorClasificacion + .Add("@CveSubProyectoPersonal", SqlDbType.Int).Value = CveSubProyectoPersonal + .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + 'Catch Ex1 As SqlException + ' If Ex1.Message.Contains("Número: 2627;") Then + ' Alert("Ya existe un Evento con el mismo nombre: " & Asunto & ".", TipoMensaje.MsgAdvertencia) + ' Else + ' Me.OnError("Ocurrió un error al guardar los cambios en el Evento", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End If + Catch ex As Exception + OnError("Ocurrió un error al obtener los correos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + #End Region @@ -3205,4 +3245,4 @@ Public Class ClsOIEventos End Sub #End Region -End Class \ No newline at end of file +End Class diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 38b6db274..30f81f474 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -227,23 +227,24 @@ Public Class ClsPaginas End Property Property GlobalDTNomConceptos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTNomConceptos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTNomConceptos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTNomConceptos = DirectCast(Application("GlobalDTNomConceptos"), DataTable) + Dim AppNombre As String = String.Format("GlobalDTNomConceptos-{0}", CveEmpresa) + If Application("GlobalDTNomConceptos") Is Nothing Then + Dim ObjNom As New ClsNominas + If ObjNom.GetConceptos(CveEmpresa) Then Application(AppNombre) = ObjNom.DtResultados + ObjNom.Dispose() End If + GlobalDTNomConceptos = DirectCast(Application(AppNombre), DataTable) + End Get Set(value As DataTable) - Application("GlobalDTNomConceptos") = value + Dim AppNombre As String = String.Format("GlobalDTNomConceptos-{0}", CveEmpresa) + Application(AppNombre) = value End Set End Property Property GlobalDTTiposGastos(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTTiposGastos-{0}", CveEmpresa) - 'sino existe, recarga los datos If Application(AppNombre) Is Nothing Then Dim ObjCompra As New ClsCompras() If ObjCompra.GetTipoGasto(-1, -1) Then Application(AppNombre) = ObjCompra.DtResultados Else Application(AppNombre) = Nothing @@ -363,45 +364,51 @@ Public Class ClsPaginas End Property #Region "GLOBALES DE SAT COMERCIO EXTERIOR" - - Property GlobalDTClavePedimento() As DataTable + Public Shared Property GlobalDTClavePedimento() As DataTable Get - GlobalDTClavePedimento = DirectCast(Application("GlobalDTClavePedimento"), DataTable) + Dim AppNombre As String = "GlobalDTClavePedimento" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATClavePedimento() Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados + ObjGrales.Dispose() + End If + GlobalDTClavePedimento = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTClavePedimento") = value + Dim AppNombre As String = "GlobalDTClavePedimento" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTFraccionArancelaria() As DataTable + Public Shared Property GlobalDTFraccionArancelaria() As EnumerableRowCollection(Of DataRow) Get Dim AppNombre As String = "GlobalDTFraccionArancelaria" - If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATFraccionArancelaria() Then Application(AppNombre) = ObjGrales.DtResultados.AsEnumerable() + If ObjGrales.GetSATFraccionArancelaria() Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados.AsEnumerable() ObjGrales.Dispose() End If - GlobalDTFraccionArancelaria = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable + GlobalDTFraccionArancelaria = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow)) End Get - Set(value As DataTable) + Set(value As EnumerableRowCollection(Of DataRow)) Dim AppNombre As String = "GlobalDTFraccionArancelaria" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTIncoterm() As DataTable + Public Shared Property GlobalDTIncoterm() As DataTable Get Dim AppNombre As String = "GlobalDTIncoterm" - If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATIncoterm() Then Application(AppNombre) = ObjGrales.DtResultados + If ObjGrales.GetSATIncoterm() Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados ObjGrales.Dispose() End If - GlobalDTIncoterm = DirectCast(Application(AppNombre), DataTable) + GlobalDTIncoterm = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) Dim AppNombre As String = "GlobalDTIncoterm" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property @@ -591,27 +598,28 @@ Public Class ClsPaginas #End Region - Property GlobalDTPSATUM() As DataTable + Public Shared Property GlobalDTPSATUM() As EnumerableRowCollection(Of DataRow) Get - If Application("GlobalDTPSATUM") Is Nothing Then + If HttpContext.Current.Application("GlobalDTPSATUM") Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATUnidadMedida Then Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() + If ObjGrales.GetSATUnidadMedida Then HttpContext.Current.Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() ObjGrales.Dispose() End If + Return DirectCast(HttpContext.Current.Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow)) - 'System.Data.EnumerableRowCollection - If Not IsNothing(Application("GlobalDTPSATUM")) Then - If Application("GlobalDTPSATUM").GetType().IsSubclassOf(GetType(EnumerableRowCollection)) Then - Return DirectCast(Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow)).CopyToDataTable() - Else - Return DirectCast(Application("GlobalDTPSATUM"), DataTable) - End If - Else - Return Nothing - End If + ''System.Data.EnumerableRowCollection + 'If Not IsNothing(HttpContext.Current.Application("GlobalDTPSATUM")) Then + ' If HttpContext.Current.Application("GlobalDTPSATUM").GetType().IsSubclassOf(GetType(EnumerableRowCollection)) Then + ' Return DirectCast(HttpContext.Current.Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow)) + ' Else + ' Return DirectCast(HttpContext.Current.Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow)) + ' End If + 'Else + ' Return Nothing + 'End If End Get - Set(value As DataTable) - Application("GlobalDTPSATUM") = value + Set(value As EnumerableRowCollection(Of DataRow)) + HttpContext.Current.Application("GlobalDTPSATUM") = value End Set End Property Property GlobalDTNomConceptosFunciones() As DataTable @@ -816,70 +824,67 @@ Public Class ClsPaginas End Property #Region "C A R T A P O R T E " - Property GlobalDTMaterialPeligroso(Optional CveMaterialPeligroso As Integer = -1) As DataTable + Public Shared Property GlobalDTMaterialPeligroso(Optional CveMaterialPeligroso As Integer = -1) As DataTable Get Dim AppNombre As String = "GlobalDTMaterialPeligroso" - 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim Obj As New ClsGenerales - If Obj.GetMaterialPeligroso() Then Application(AppNombre) = Obj.DtResultados + If Obj.GetMaterialPeligroso() Then HttpContext.Current.Application(AppNombre) = Obj.DtResultados Obj.Dispose() End If If CveMaterialPeligroso > 0 Then Dim Str As New StringBuilder Str.AppendFormat("CveMaterialPeligroso = {0}", CveMaterialPeligroso) - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) GlobalDTMaterialPeligroso = Dv.ToTable Dv.Dispose() Else - GlobalDTMaterialPeligroso = DirectCast(Application(AppNombre), DataTable) + GlobalDTMaterialPeligroso = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) Dim AppNombre As String = "GlobalDTMaterialPeligroso" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTEmbalajes(Optional CveEmbalaje As Integer = -1) As DataTable + Public Shared Property GlobalDTEmbalajes(Optional CveEmbalaje As Integer = -1) As DataTable Get Dim AppNombre As String = "GlobalDTEmbalajes" - 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim Obj As New ClsGenerales - If Obj.GetEmbalajes() Then Application(AppNombre) = Obj.DtResultados + If Obj.GetEmbalajes() Then HttpContext.Current.Application(AppNombre) = Obj.DtResultados Obj.Dispose() End If If CveEmbalaje > 0 Then Dim Str As New StringBuilder Str.AppendFormat("CveEmbalaje = {0}", CveEmbalaje) - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) GlobalDTEmbalajes = Dv.ToTable Dv.Dispose() Else - GlobalDTEmbalajes = DirectCast(Application(AppNombre), DataTable) + GlobalDTEmbalajes = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) Dim AppNombre As String = "GlobalDTEmbalajes" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property #End Region - - Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable + Public Shared Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa) 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then Application(AppNombre) = ObjClasificaciones.DtResultados + If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados ObjClasificaciones.Dispose() End If If CveEmpresa <> -1 Then @@ -888,25 +893,20 @@ Public Class ClsPaginas If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion) If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion) - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) GlobalDTClasificaciones = Dv.ToTable Dv.Dispose() Else - GlobalDTClasificaciones = DirectCast(Application(AppNombre), DataTable) + GlobalDTClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If - - End Get Set(value As DataTable) Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa) - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property - - - Property GlobalDTRHActividades(CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTRHActividades-{0}", CveEmpresa) @@ -1129,43 +1129,45 @@ Public Class ClsPaginas Application("GlobalDTModulos") = value End Set End Property - Property GlobalDTMonedas() As DataTable + Public Shared Property GlobalDTMonedas() As DataTable Get - GlobalDTMonedas = DirectCast(Application("GlobalDTMonedas"), DataTable) + Dim AppNombre As String = "GlobalDTMonedas" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjMonedas As New ClsMonedas + If ObjMonedas.GetMonedas() Then HttpContext.Current.Application(AppNombre) = ObjMonedas.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing + ObjMonedas.Dispose() + End If + GlobalDTMonedas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTMonedas") = value + Dim AppNombre As String = "GlobalDTMonedas" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTMonedasAlias() As DataTable Get - GlobalDTMonedasAlias = DirectCast(Application("GlobalDTMonedasAlias"), DataTable) + Dim AppNombre As String = "GlobalDTMonedasAlias" + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then + Dim ObjMonedas As New ClsMonedas + If ObjMonedas.GetMonedasAlias() Then HttpContext.Current.Application(AppNombre) = ObjMonedas.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing + ObjMonedas.Dispose() + End If + GlobalDTMonedasAlias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTMonedasAlias") = value + Dim AppNombre As String = "GlobalDTMonedasAlias" + HttpContext.Current.Application(AppNombre) = value End Set + End Property - 'Property GlobalDTSucursales(Optional CveEmpresa As Integer = -1) As DataTable - ' Get - ' If CveEmpresa <> -1 Then - ' Dim Dv As New DataView(DirectCast(Application("GlobalDTSucursales"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " Sucursal", DataViewRowState.CurrentRows) - ' GlobalDTSucursales = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTSucursales = DirectCast(Application("GlobalDTSucursales"), DataTable) - ' End If - ' End Get - ' Set(value As DataTable) - ' Application("GlobalDTSucursales") = value - ' End Set - 'End Property - Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1, Optional RegimenFiscalReceptor As String = "-1") As DataTable + + + Public Shared Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1, Optional RegimenFiscalReceptor As String = "-1") As DataTable Get Dim AppNombre As String = "GlobalDTSATUsosCFDI" - 'sino existe, recarga los datos - If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATUsosCFDI() Then Application(AppNombre) = ObjGrales.DtResultados + If ObjGrales.GetSATUsosCFDI() Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados ObjGrales.Dispose() End If @@ -1177,40 +1179,40 @@ Public Class ClsPaginas Tipo.AppendFormat("AND RegimenFiscalReceptor LIKE '%{0}%'", RegimenFiscalReceptor) End If - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Tipo.ToString(), " UsoCFDIDescripcion", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Tipo.ToString(), " UsoCFDIDescripcion", DataViewRowState.CurrentRows) GlobalDTSATUsosCFDI = Dv.ToTable Dv.Dispose() Else - GlobalDTSATUsosCFDI = DirectCast(Application(AppNombre), DataTable) + GlobalDTSATUsosCFDI = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) Dim AppNombre As String = "GlobalDTSATUsosCFDI" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property - Public Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable + Public Shared Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida-{0}", CveEmpresa) 'sino existe, recarga los datos - If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then + If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then Dim ObjUnidadesMedida As New ClsUnidadesMedida() - If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados + If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUnidadesMedida.DtResultados ObjUnidadesMedida.Dispose() End If If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows) GlobalDTUnidadesMedida = Dv.ToTable Dv.Dispose() Else - GlobalDTUnidadesMedida = DirectCast(Application(AppNombre), DataTable) + GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida-{0}", CveEmpresa) - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable @@ -1475,7 +1477,6 @@ Public Class ClsPaginas Dim ObjSubProyectos As New ClsSubProyectos() If ObjSubProyectos.GetSubProyectosUsuarios(CveEmpresa:=CveEmpresa) Then Application(AppNombre) = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"}) Else Alert("Ocurrió un error al cargar los Proyectos. Por favor comuniquese con sistemas.", TipoMensaje.MsgError) ObjSubProyectos.Dispose() - GuardaLog("Se Cargo GlobalDTProyectosUsuarios") End If If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveEmpresa <> -1 OrElse CveEstatus <> -1 Then @@ -2054,7 +2055,6 @@ Public Class ClsPaginas ObjClientes.Dispose() End If - If CveEmpresa <> -1 Then Dim StrSQL As New StringBuilder @@ -3543,28 +3543,26 @@ Public Class ClsPaginas - Property GlobalDTContaConceptosContables(CveConceptoContable As Integer) As DataTable + Public Shared Property GlobalDTContaConceptosContables(CveConceptoContable As Integer) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables") 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Using ObjContabilidad As New ClsContabilidad - If ObjContabilidad.GetConta_ConceptosContables() Then Application(AppNombre) = ObjContabilidad.DtResultados Else Application(AppNombre) = Nothing + If ObjContabilidad.GetConta_ConceptosContables() Then HttpContext.Current.Application(AppNombre) = ObjContabilidad.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing End Using - End If If CveConceptoContable <> -1 Then - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveConceptoContable = {0}", CveConceptoContable), "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveConceptoContable = {0}", CveConceptoContable), "", DataViewRowState.CurrentRows) GlobalDTContaConceptosContables = Dv.ToTable Dv.Dispose() Else - GlobalDTContaConceptosContables = DirectCast(Application(AppNombre), DataTable) + GlobalDTContaConceptosContables = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If - End Get Set(value As DataTable) Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables") - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property #End Region @@ -4138,30 +4136,45 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTAcumTiposDefecto() As DataTable + Public Shared Property GlobalDTAcumTiposDefecto(CveEmpresa As Integer) As DataTable Get - GlobalDTAcumTiposDefecto = DirectCast(Application("GlobalDTAcumTiposDefecto"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTAcumTiposDefecto") = value - End Set - End Property - Property GlobalDTAcumTiposUso() As DataTable - Get - GlobalDTAcumTiposUso = DirectCast(Application("GlobalDTAcumTiposUso"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTAcumTiposUso") = value - End Set - End Property + Dim AppNombre As String = String.Format("GlobalDTAcumTiposDefecto-{0}", CveEmpresa) + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjAcumuladores As New ClsAcumuladores() + If ObjAcumuladores.TiposDefectoGet(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAcumuladores.DtResultados + ObjAcumuladores.Dispose() + End If + GlobalDTAcumTiposDefecto = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTAcumTiposDefecto-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value + End Set + End Property + Public Shared Property GlobalDTAcumTiposUso(CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTAcumTiposUso-{0}", CveEmpresa) + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjAcumuladores As New ClsAcumuladores() + If ObjAcumuladores.TiposUsoGet(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAcumuladores.DtResultados + ObjAcumuladores.Dispose() + End If + GlobalDTAcumTiposUso = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTAcumTiposUso-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value + End Set + End Property Property GlobalDTAcumGarantiasMesesTipoUso(CveEmpresa As Integer, CveMarca As Integer) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTAcumGarantiasMesesTipoUso-{0}", CveEmpresa) If Application(AppNombre) Is Nothing Then Dim ObjAcumuladores As New ClsAcumuladores() - If ObjAcumuladores.GarantiasMesesGet(-1, -1) Then Application(AppNombre) = ObjAcumuladores.DtResultados.FiltraParametros("", DistinctColumns:={"CveMarca", "CveTipoUso", "TipoUso"}) + If ObjAcumuladores.GarantiasMesesGet(-1, CveEmpresa) Then Application(AppNombre) = ObjAcumuladores.DtResultados.FiltraParametros("", DistinctColumns:={"CveMarca", "CveTipoUso", "TipoUso"}) ObjAcumuladores.Dispose() End If @@ -4196,17 +4209,6 @@ Public Class ClsPaginas End If - 'If CveMarca <> -1 Then - ' Dim Str As StringBuilder = New StringBuilder() - ' If CveMarca <> -1 Then Str.AppendFormat("CveMarca = {0}", CveMarca) - - ' Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - ' GlobalDTCultivosCuadro = Dv.ToTable - ' Dv.Dispose() - 'Else - - 'End If - GlobalDTCultivosCuadro = DirectCast(Application(AppNombre), DataTable) End Get @@ -4216,79 +4218,23 @@ Public Class ClsPaginas End Set End Property - - - - Property GlobalDTAcumTamaños() As DataTable + Public Shared Property GlobalDTAcumTamaños(CveEmpresa As Integer) As DataTable Get - GlobalDTAcumTamaños = DirectCast(Application("GlobalDTAcumTamaños"), DataTable) + Dim AppNombre As String = String.Format("GlobalDTAcumTamaños-{0}", CveEmpresa) + + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAcumuladores As New ClsAcumuladores() + If ObjAcumuladores.TamañoGet(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAcumuladores.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing + End Using + End If + GlobalDTAcumTamaños = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAcumTamaños") = value + Dim AppNombre As String = String.Format("GlobalDTAcumTamaños-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value End Set End Property -#Region "GDT'S RASTREO" - Property GlobalDTDispositivos(CveCliente As Integer) As DataTable - Get - Dim Str As StringBuilder = New StringBuilder() - - If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente) - - - If CveCliente <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTDispositivos"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTDispositivos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTDispositivos = DirectCast(Application("GlobalDTDispositivos"), DataTable) - End If - - End Get - Set(value As DataTable) - Application("GlobalDTDispositivos") = value - End Set - End Property - - Public Sub RecargaGlobalDTDispositivos(GPS As ClsGPS) - If GPS.DispositivosGet(-1, -1, -1, -1) Then - GlobalDTDispositivos(-1) = GPS.DtResultados - End If - End Sub - - Property GlobalDTDispositivosUsuarios(CveCliente As Integer, Optional CveUsuario As Integer = -1) As DataTable - Get - If Application("GlobalDTDispositivosUsuarios") Is Nothing Then - Dim ObjGPS As New ClsGPS - If ObjGPS.DispositivosUsuariosGet(-1, -1, -1, -1, -1) Then - Application("GlobalDTDispositivosUsuarios") = ObjGPS.DtResultados - End If - ObjGPS.Dispose() - End If - - Dim Str As StringBuilder = New StringBuilder() - - If CveUsuario <> -1 Then Str.AppendFormat("CveUsuario = {0}", CveUsuario) - If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente) - - - If CveUsuario <> -1 OrElse CveCliente <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTDispositivosUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTDispositivosUsuarios = Dv.ToTable - Dv.Dispose() - Else - GlobalDTDispositivosUsuarios = DirectCast(Application("GlobalDTDispositivosUsuarios"), DataTable) - End If - - End Get - Set(value As DataTable) - Application("GlobalDTDispositivosUsuarios") = value - End Set - End Property - -#End Region - - Property GlobalDTClientesVendedoresSubProyectos(CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional CveSubProyecto As Integer = -1) As DataTable Get @@ -4350,6 +4296,66 @@ Public Class ClsPaginas #End Region +#Region "GDT'S RASTREO" + Property GlobalDTDispositivos(CveCliente As Integer) As DataTable + Get + Dim Str As StringBuilder = New StringBuilder() + + If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente) + + + If CveCliente <> -1 Then + Dim Dv As New DataView(DirectCast(Application("GlobalDTDispositivos"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + GlobalDTDispositivos = Dv.ToTable + Dv.Dispose() + Else + GlobalDTDispositivos = DirectCast(Application("GlobalDTDispositivos"), DataTable) + End If + + End Get + Set(value As DataTable) + Application("GlobalDTDispositivos") = value + End Set + End Property + + Public Sub RecargaGlobalDTDispositivos(GPS As ClsGPS) + If GPS.DispositivosGet(-1, -1, -1, -1) Then + GlobalDTDispositivos(-1) = GPS.DtResultados + End If + End Sub + + Property GlobalDTDispositivosUsuarios(CveCliente As Integer, Optional CveUsuario As Integer = -1) As DataTable + Get + If Application("GlobalDTDispositivosUsuarios") Is Nothing Then + Dim ObjGPS As New ClsGPS + If ObjGPS.DispositivosUsuariosGet(-1, -1, -1, -1, -1) Then + Application("GlobalDTDispositivosUsuarios") = ObjGPS.DtResultados + End If + ObjGPS.Dispose() + End If + + Dim Str As StringBuilder = New StringBuilder() + + If CveUsuario <> -1 Then Str.AppendFormat("CveUsuario = {0}", CveUsuario) + If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente) + + + If CveUsuario <> -1 OrElse CveCliente <> -1 Then + Dim Dv As New DataView(DirectCast(Application("GlobalDTDispositivosUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + GlobalDTDispositivosUsuarios = Dv.ToTable + Dv.Dispose() + Else + GlobalDTDispositivosUsuarios = DirectCast(Application("GlobalDTDispositivosUsuarios"), DataTable) + End If + + End Get + Set(value As DataTable) + Application("GlobalDTDispositivosUsuarios") = value + End Set + End Property + +#End Region + Public Enum SisParametros As Integer URL = 1 DirectorioSitio = 2 @@ -4806,6 +4812,7 @@ Public Class ClsPaginas PaginaDict.Add("/Bancos/PopUpBuscaPersonal.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarColectiva.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarProveedor.aspx".ToUpper(), 281) + 'PaginaDict.Add("/Bancos/PopUpBuscarCuentasProveedor.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarFolioC.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarClientes.aspx".ToUpper(), 281) 'PaginaDict.Add("/Bancos/CatTiposCuenta.aspx".ToUpper(), -1) @@ -4857,6 +4864,7 @@ Public Class ClsPaginas PaginaDict.Add("/Bancos/ProveedoresCreditos.aspx".ToUpper(), 528) PaginaDict.Add("/Bancos/RepSaldosPeriodo.aspx".ToUpper(), 884) PaginaDict.Add("/Bancos/PrestamoPersonal.aspx".ToUpper(), 890) + PaginaDict.Add("/Bancos/PopUpBuscarCuentasProveedor.aspx".ToUpper(), 679) #End Region #Region "CGame" @@ -4993,9 +5001,6 @@ Public Class ClsPaginas PaginaDict.Add("/Compras/CatTipoGasto.aspx".ToUpper(), 759) - - - #End Region 'CONTABILIDAD @@ -10390,7 +10395,8 @@ Public Class ClsPaginas End If If VentaActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares - tImportePago = ((Pago.ImportePago * TCValuacionVenta / Pago.TCPago).RoundSQL * Pago.TCPago).RoundSQL + tImportePago = ((Pago.ImportePago * TCValuacionVenta / Pago.TCPago) * Pago.TCPago).RoundSQL + tImporteVenta = (Pago.ImportePago * TCValuacionVenta).RoundSQL ElseIf VentaActual.CveMoneda <> 1 And Pago.CveMonedaPago <> 1 Then 'factura dolares, pago en dolares tImporteVenta = (Pago.ImportePago * TCValuacionVenta).RoundSQL tImportePago = (Pago.ImportePago * TCValuacionPago).RoundSQL @@ -10435,12 +10441,12 @@ Public Class ClsPaginas ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 62, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 62, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True End If @@ -10450,12 +10456,12 @@ Public Class ClsPaginas ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 63, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 63, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True End If @@ -10473,12 +10479,12 @@ Public Class ClsPaginas End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 39, VentaActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 39, VentaActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True End If 'concepto pago @@ -10519,8 +10525,8 @@ Public Class ClsPaginas If Pago.TipoPago = "I" AndAlso Not ErrorMovtos Then ' I N G R E S O S X C O M P R O B A R Dim Ret As New ConceptosRetenciones If UsuarioActual.Empresa.TipoContabilidad = 2 Then - If ObjConta.GetRetCuenta(66, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero - If Pago.CveMonedaPago > 1 AndAlso ObjConta.GetRetCuenta(207, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero + 'If ObjConta.GetRetCuenta(66, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero + 'If Pago.CveMonedaPago > 1 AndAlso ObjConta.GetRetCuenta(207, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero If UsuarioActual.CveEmpresa.Contiene(119) Then If Pago.FechaDocumentoRelacionado.Year <= 2017 Then @@ -10566,6 +10572,7 @@ Public Class ClsPaginas Dim ConceptoContable, IdCtaContable As Integer Dim TipoMovimiento As Boolean Dim Diferencia As Decimal = 0 + tImportePago +=Pago.ImporteFluctuacionAdicional 'para los casos de aplicación de If tImporteVenta <> tImportePago Then If tImporteVenta < tImportePago Then @@ -10617,6 +10624,7 @@ Public Class ClsPaginas Public Property CveCreditoDetalle As Integer = -1 Public Property AplicaTraslado As Boolean = True Public Property Referencia As String + Public Property ImporteFluctuacionAdicional As Decimal = 0 End Class diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index e6eeb845a..d1a3e66b5 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -498,8 +498,8 @@ Namespace Modelos Me.TipoCambio = 0 Me.ConvertirPesos = False Me.CveMoneda = 1 - Me.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda} ") - Me.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda} ") + Me.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda} ") + Me.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda} ") Me.RefDocto = "" ' Me.CveMesa = -1 Me.Fecha = Now @@ -2146,7 +2146,7 @@ Namespace Modelos For Each drow As DataRow In factura.DtDetalle.Rows If drow("CveTamaño").ToString.ToEntero > 0 Then - Dim DrTamanio As DataRow = GlobalDTAcumTamaños().FiltroPrimero($"CveTamaño={drow("CveTamaño").ToString.ToEntero}") + Dim DrTamanio As DataRow = ClsPaginas.GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($"CveTamaño={drow("CveTamaño").ToString.ToEntero}") If DrTamanio IsNot Nothing Then Dim Cargo As Decimal = DrTamanio("Cargo").ToString().ToDecimal() * drow("Cantidad").ToString.ToDecimal() Dim Bonificacion As Decimal = DrTamanio("Bonificacion").ToString().ToDecimal() * drow("Cantidad").ToString.ToDecimal() @@ -2216,7 +2216,7 @@ Namespace Modelos If factura.Cliente.EsDistribuidor AndAlso factura.CveConceptoMovimiento = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then - Dim DrTamanio As DataRow = GlobalDTAcumTamaños().FiltroPrimero($"CveTamaño={Dr("CveTamaño").ToString.ToEntero}") + Dim DrTamanio As DataRow = ClsPaginas.GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($"CveTamaño={Dr("CveTamaño").ToString.ToEntero}") If DrTamanio IsNot Nothing Then Dim Cargo As Decimal = DrTamanio("Cargo").ToString().ToDecimal() * Dr("Cantidad").ToString.ToDecimal() Dim Bonificacion As Decimal = DrTamanio("Bonificacion").ToString().ToDecimal() * Dr("Cantidad").ToString.ToDecimal() @@ -2468,7 +2468,7 @@ Namespace Modelos If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsaComplementariaClientes) Then importeMX = importeMovimiento - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=Math.Round(importeMovimiento * TCCliente - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=If(TCCliente = 1, 0, importeMovimiento), TipoCambio:=TCCliente, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=(importeMovimiento * TCCliente - importeMovimiento).RoundSQL, ImporteME:=If(TCCliente = 1, 0, importeMovimiento), TipoCambio:=TCCliente, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If @@ -2676,7 +2676,7 @@ Namespace Modelos If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsaComplementariaClientes) Then importeMX = importeMovimiento - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=Math.Round(importeMovimiento * tipoCambio - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveSubProyecto:=CveSubProyectoContabilizar) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=(importeMovimiento * tipoCambio - importeMovimiento).RoundSQL, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveSubProyecto:=CveSubProyectoContabilizar) Then ErrorPrepoliza = True End If End If @@ -3492,16 +3492,6 @@ Namespace Modelos End If importeMovimiento = 0 - 'Case 103 'Descuento - ' 'si se amortiza anticipo por concepto de descuento, no debe de registrar esta partida. - ' If ObjFactura.CveTipoAmortizacionAnticipo <> 1 Then - ' importeMovimiento = (ObjFactura.Descuento * ValorMultiplicador) - ' importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador - ' FechaMovimiento = ObjFactura.FechaPago - ' If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" - ' IdCtaContable = 0 - ' End If - Case 8 'Ret IVA por Trasladar If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso ObjFactura.CveTipoRetencion <> 4 Then 'SI NO ES RETENCION DE IVA DE SERVICIOS importeMovimiento = (ObjFactura.RetIVA * ValorMultiplicador) @@ -3530,31 +3520,6 @@ Namespace Modelos End If - Case 313 'Ret Iva Servicios - If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso ObjFactura.CveTipoRetencion = 4 Then 'SI TIENE RETENCION DE IVA DE SERVICIOS - importeMovimiento = ObjFactura.RetIVA * ValorMultiplicador - importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador - FechaMovimiento = ObjFactura.FechaPago - CveSubProyectoContabilizar = CveSubProyectoVenta - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" - - If ValorMultiplicador = -1 AndAlso ObjFactura.Alfa3 = "DEV" AndAlso ObjFactura.TipoDocto = "Dev" Then - TipoMovimiento = Not TipoMovimiento - ConceptoContable = 314 - importeMovimiento = importeMovimiento * -1 - importeMX = importeMX * -1 - End If - - 'OBTENER CUENTAS - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - 'Conta ContPAQ - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - End If - End If - - End If - Case 9 'Ret ISR por Trasladar If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then importeMovimiento = (ObjFactura.RetISR * ValorMultiplicador) @@ -3585,7 +3550,7 @@ Namespace Modelos Case 13 'Iva por Trasladar If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then importeMovimiento = (ObjFactura.IVA * ValorMultiplicador) - importeMX = Math.Round(importeMovimiento * tipoCambio * Multiplicador, 2) + importeMX = (importeMovimiento * tipoCambio * Multiplicador).RoundSQL FechaMovimiento = ObjFactura.FechaPago PorcentajeImpuesto = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal @@ -3604,43 +3569,11 @@ Namespace Modelos If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" End If - 'If ObjFactura.TipoDocto = "Egs" Then - - ' importeMovimiento = ObjFactura.IVA * ValorMultiplicador - ' importeMX = Math.Round(importeMovimiento * tipoCambio * Multiplicador, 2) - ' FechaMovimiento = ObjFactura.FechaPago - ' PorcentajeImpuesto = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal - - ' If importeMovimiento <> 0 Then - ' 'IVA X TRASLADAR - ' IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) - ' Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString()) - - ' If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=-1, ImporteMX:=importeMX * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto) Then - ' ErrorPrepoliza = True - ' Exit For - ' End If - - ' 'IVA PAGADO - ' IdCtaIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) - ' Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString()) - - ' If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=-1, ImporteMX:=importeMX * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto) Then - ' ErrorPrepoliza = True - ' Exit For - ' End If - ' End If - - - ' importeMovimiento = 0 - ' importeMX = 0 - 'End If - Case 38 'IEPS por Trasladar If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then importeMovimiento = (ObjFactura.IEPS * ValorMultiplicador) - importeMX = Math.Round(importeMovimiento * tipoCambio * Multiplicador, 2) + importeMX = (importeMovimiento * tipoCambio * Multiplicador).RoundSQL FechaMovimiento = ObjFactura.Fecha CveSubProyectoContabilizar = CveSubProyectoVenta @@ -4330,7 +4263,7 @@ Namespace Modelos If Not OcurrioError Then IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero - ValorInventario = Math.Round(DtCostos.SUM("Total", "").ToDecimal, 2, MidpointRounding.AwayFromZero) + ValorInventario = (DtCostos.SUM("Total", "").ToDecimal).RoundSQL If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, True, ValorInventario, Me.SerieFolio, 68, Me.SerieFolio, Me.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveSubProyecto:=Me.CveSubProyecto) Then OcurrioError = True End If @@ -7303,7 +7236,7 @@ Namespace Modelos End Sub Public Sub SetMoneda() If CveMoneda > 0 Then - Dim dr As DataRow = GlobalDTMonedas.FiltroPrimero(String.Format("CveMoneda ={0}", CveMoneda)) + Dim dr As DataRow = ClsPaginas.GlobalDTMonedas.FiltroPrimero(String.Format("CveMoneda ={0}", CveMoneda)) If Not IsNothing(dr) Then Moneda = dr("Moneda").ToString() MonedaSAT = dr("AbreviaturaSAT").ToString() @@ -7319,7 +7252,7 @@ Namespace Modelos End Sub Public Sub SetMoneda(ObjClsPaginas As ClsPaginas) If Not IsNothing(ObjClsPaginas) Then - Dim dr As DataRow = ObjClsPaginas.GlobalDTMonedas.FiltroPrimero(String.Format("CveMoneda ={0}", CveMoneda)) + Dim dr As DataRow = ClsPaginas.GlobalDTMonedas.FiltroPrimero(String.Format("CveMoneda ={0}", CveMoneda)) If Not IsNothing(dr) Then Moneda = dr("Moneda").ToString() MonedaSAT = dr("AbreviaturaSAT").ToString() @@ -7458,14 +7391,7 @@ Namespace Modelos #End Region #Region "G L O B A L - D T" - Property GlobalDTAcumTamaños() As DataTable - Get - GlobalDTAcumTamaños = DirectCast(HttpContext.Current.Application("GlobalDTAcumTamaños"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAcumTamaños") = value - End Set - End Property + Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double Get If GlobalTipoCambio <= 0 Then @@ -7514,14 +7440,7 @@ Namespace Modelos End Set End Property - 'Property GlobalValidarCFDI As Boolean - ' Get - ' GlobalValidarCFDI = CBool(HttpContext.Current.Application("GlobalValidarCFDI")) - ' End Get - ' Set(value As Boolean) - ' HttpContext.Current.Application("GlobalValidarCFDI") = value - ' End Set - 'End Property + Property GlobalDTUsuarios(Optional CveUsuario As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1) As DataTable Get Dim Str As New StringBuilder @@ -7542,90 +7461,6 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTUsuarios") = value End Set End Property - Property GlobalDTNomConceptos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTNomConceptos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTNomConceptos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTNomConceptos = DirectCast(HttpContext.Current.Application("GlobalDTNomConceptos"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTNomConceptos") = value - End Set - End Property - Property GlobalDTTiposGastos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTiposGastos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTiposGastos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTiposGastos = DirectCast(HttpContext.Current.Application("GlobalDTTiposGastos"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTiposGastos") = value - End Set - End Property - Property GlobalDTMFActividad(CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional CveActividad As Integer = -1) As DataTable - Get - - Dim dt As DataTable = Nothing - Dim ObjMF As New ClsMF - - If ObjMF.GetActividad(CveActividad, CveEmpresa, Estatus) Then - dt = ObjMF.DtResultados - End If - - ObjMF.Dispose() - GlobalDTMFActividad = dt - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTActividad") = value - End Set - End Property - Property GlobalDTMFOperador(CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional CveOperador As Integer = -1) As DataTable - Get - - Dim dt As DataTable = Nothing - Dim ObjMF As New ClsMF - - If ObjMF.GetOperador(CveOperador, CveEmpresa, Estatus) Then - dt = ObjMF.DtResultados - End If - - ObjMF.Dispose() - GlobalDTMFOperador = dt - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTOperador") = value - End Set - End Property - Property GlobalDTMFEstatus(CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable - Get - - Dim dt As DataTable = Nothing - Dim ObjMF As New ClsMF - - If ObjMF.GetEstatus(CveEstatus, Estatus, CveEmpresa) Then - dt = ObjMF.DtResultados - End If - - ObjMF.Dispose() - GlobalDTMFEstatus = dt - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTEstatus") = value - End Set - End Property Property DtFacturaDefault() As DataTable Get DtFacturaDefault = DirectCast(HttpContext.Current.Application("DtFacturaDefault"), DataTable) @@ -7642,162 +7477,6 @@ Namespace Modelos HttpContext.Current.Application("Directorio") = value End Set End Property - Property GlobalDTPSATPS() As DataTable - Get - GlobalDTPSATPS = DirectCast(HttpContext.Current.Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTPSATPS") = value - End Set - End Property - -#Region "GLOBALES DE SAT COMERCIO EXTERIOR" - - Property GlobalDTClavePedimento() As DataTable - Get - GlobalDTClavePedimento = DirectCast(HttpContext.Current.Application("GlobalDTClavePedimento"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTClavePedimento") = value - End Set - End Property - - Property GlobalDTFraccionArancelaria() As DataTable - Get - GlobalDTFraccionArancelaria = DirectCast(HttpContext.Current.Application("GlobalDTFraccionArancelaria"), EnumerableRowCollection(Of DataRow)).CopyToDataTable - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTFraccionArancelaria") = value - End Set - End Property - - Property GlobalDTIncoterm() As DataTable - Get - GlobalDTIncoterm = DirectCast(HttpContext.Current.Application("GlobalDTIncoterm"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTIncoterm") = value - End Set - End Property - - Property GlobalDTTipoOperacion() As DataTable - Get - GlobalDTTipoOperacion = DirectCast(HttpContext.Current.Application("GlobalDTTipoOperacion"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTipoOperacion") = value - End Set - End Property - - Property GlobalDTSATMotivoTraslado() As DataTable - Get - GlobalDTSATMotivoTraslado = DirectCast(HttpContext.Current.Application("GlobalDTSATMotivoTraslado"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTSATMotivoTraslado") = value - End Set - End Property - - Property GlobalDTUnidadAduana() As DataTable - Get - GlobalDTUnidadAduana = DirectCast(HttpContext.Current.Application("GlobalDTUnidadAduana"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTUnidadAduana") = value - End Set - End Property - - Property GlobalDTPais() As DataTable - Get - GlobalDTPais = DirectCast(HttpContext.Current.Application("GlobalDTPais"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTPais") = value - End Set - End Property - - Property GlobalDTEstado(ClaveSATPais As String) As DataTable - Get - If ClaveSATPais <> "-1" Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTEstado"), DataTable), String.Format("ClaveSATPais = '{0}'", ClaveSATPais), "", DataViewRowState.CurrentRows) - GlobalDTEstado = Dv.ToTable - Dv.Dispose() - Else - GlobalDTEstado = DirectCast(HttpContext.Current.Application("GlobalDTEstado"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTEstado") = value - End Set - End Property - - Property GlobalDTMunicipio(ClaveSATEstado As String) As DataTable - Get - If ClaveSATEstado <> "-1" Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTMunicipio"), DataTable), String.Format("ClaveSATEstado = '{0}'", ClaveSATEstado), "", DataViewRowState.CurrentRows) - GlobalDTMunicipio = Dv.ToTable - Dv.Dispose() - Else - GlobalDTMunicipio = DirectCast(HttpContext.Current.Application("GlobalDTMunicipio"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTMunicipio") = value - End Set - End Property - - Property GlobalDTColonia(ClaveSATMunicipio As String) As DataTable - Get - If ClaveSATMunicipio <> "-1" Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTColonia"), DataTable), String.Format("ClaveSATMunicipio = '{0}'", ClaveSATMunicipio), "", DataViewRowState.CurrentRows) - GlobalDTColonia = Dv.ToTable - Dv.Dispose() - Else - GlobalDTColonia = DirectCast(HttpContext.Current.Application("GlobalDTColonia"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTColonia") = value - End Set - End Property - -#End Region - - Property GlobalDTPSATUM() As DataTable - Get - GlobalDTPSATUM = DirectCast(HttpContext.Current.Application("GlobalDTPSATUM"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTPSATUM") = value - End Set - End Property - Property GlobalDTNomConceptosFunciones() As DataTable - Get - GlobalDTNomConceptosFunciones = DirectCast(HttpContext.Current.Application("GlobalDTNomConceptosFunciones"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTNomConceptosFunciones") = value - End Set - End Property - Property GlobalDTUsuarioResponsable() As DataTable - Get - GlobalDTUsuarioResponsable = DirectCast(HttpContext.Current.Application("GlobalDTUsuarioResponsable"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTUsuarioResponsable") = value - End Set - End Property - Property GlobalDTProveedoresCuentas(CveProveedor As Integer, Estatus As Boolean) As DataTable - Get - GlobalDTProveedoresCuentas = DirectCast(HttpContext.Current.Application("GlobalDTProveedoresCuentas"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProveedoresCuentas") = value - End Set - End Property Public ReadOnly Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable Get @@ -8088,82 +7767,7 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTModulos") = value End Set End Property - Property GlobalDTMonedas() As DataTable - Get - GlobalDTMonedas = DirectCast(HttpContext.Current.Application("GlobalDTMonedas"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTMonedas") = value - End Set - End Property - Property GlobalDTMonedasAlias() As DataTable - Get - GlobalDTMonedasAlias = DirectCast(HttpContext.Current.Application("GlobalDTMonedasAlias"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTMonedasAlias") = value - End Set - End Property - Property GlobalDTSucursales(Optional CveEmpresa As Integer = -1) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSucursales"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " Sucursal", DataViewRowState.CurrentRows) - GlobalDTSucursales = Dv.ToTable - Dv.Dispose() - Else - GlobalDTSucursales = DirectCast(HttpContext.Current.Application("GlobalDTSucursales"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTSucursales") = value - End Set - End Property - Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable - Get - If EsPersonaFisica <> -1 Then - Dim Tipo As String = "" - If EsPersonaFisica = 1 Then Tipo = "AplicaPersonaFisica = 1" Else Tipo = "AplicaPersonaMoral = 1" - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable), Tipo, " UsoCFDIDescripcion", DataViewRowState.CurrentRows) - GlobalDTSATUsosCFDI = Dv.ToTable - Dv.Dispose() - Else - GlobalDTSATUsosCFDI = DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable) - End If - - End Get - Set(ByVal value As DataTable) - HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value - End Set - End Property - 'Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable - ' Get - ' If CveEmpresa <> -1 Then - ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows) - ' GlobalDTUnidadesMedida = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable) - ' End If - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTUnidadesMedida") = value - ' End Set - 'End Property - 'Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable - ' Get - ' If CveEmpresa <> -1 Then - ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - ' GlobalDTUnidadesMedidaAlias = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTUnidadesMedidaAlias = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable) - ' End If - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias") = value - ' End Set - 'End Property Property GlobalDTEstatusOrdenCompra() As DataTable Get GlobalDTEstatusOrdenCompra = DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenCompra"), DataTable) @@ -8346,99 +7950,99 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTPrecioListas") = value End Set End Property - Property GlobalDTMesas() As DataTable - Get - GlobalDTMesas = DirectCast(HttpContext.Current.Application("GlobalDTMesas"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTMesas") = value - End Set - End Property - Property GlobalDTTipoOrdenServicios(CveEmpresa As Integer) As DataTable - Get - GlobalDTTipoOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTTipoOrdenServicios"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa)) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTipoOrdenServicios") = value - End Set - End Property - Property GlobalDTSubTipoOrdenServicios() As DataTable - Get - GlobalDTSubTipoOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTSubTipoOrdenServicios"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTSubTipoOrdenServicios") = value - End Set - End Property - Property GlobalDTCaracteristicasOrdenServicios() As DataTable - Get - GlobalDTCaracteristicasOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTCaracteristicasOrdenServicios"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTCaracteristicasOrdenServicios") = value - End Set - End Property - Property GlobalDTOrdenesServiciosCaracteristicas() As DataTable - Get - GlobalDTOrdenesServiciosCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTOrdenesServiciosCaracteristicas"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTOrdenesServiciosCaracteristicas") = value - End Set - End Property - Property GlobalDTCaracteristicasOpciones() As DataTable - Get - GlobalDTCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTCaracteristicasOpciones"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTCaracteristicasOpciones") = value - End Set - End Property - Property GlobalDTTipoCuentasEquipos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then + 'Property GlobalDTMesas() As DataTable + ' Get + ' GlobalDTMesas = DirectCast(HttpContext.Current.Application("GlobalDTMesas"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTMesas") = value + ' End Set + 'End Property + 'Property GlobalDTTipoOrdenServicios(CveEmpresa As Integer) As DataTable + ' Get + ' GlobalDTTipoOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTTipoOrdenServicios"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa)) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTTipoOrdenServicios") = value + ' End Set + 'End Property + 'Property GlobalDTSubTipoOrdenServicios() As DataTable + ' Get + ' GlobalDTSubTipoOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTSubTipoOrdenServicios"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTSubTipoOrdenServicios") = value + ' End Set + 'End Property + 'Property GlobalDTCaracteristicasOrdenServicios() As DataTable + ' Get + ' GlobalDTCaracteristicasOrdenServicios = DirectCast(HttpContext.Current.Application("GlobalDTCaracteristicasOrdenServicios"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTCaracteristicasOrdenServicios") = value + ' End Set + 'End Property + 'Property GlobalDTOrdenesServiciosCaracteristicas() As DataTable + ' Get + ' GlobalDTOrdenesServiciosCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTOrdenesServiciosCaracteristicas"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTOrdenesServiciosCaracteristicas") = value + ' End Set + 'End Property + 'Property GlobalDTCaracteristicasOpciones() As DataTable + ' Get + ' GlobalDTCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTCaracteristicasOpciones"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTCaracteristicasOpciones") = value + ' End Set + 'End Property + 'Property GlobalDTTipoCuentasEquipos(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquipos = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquipos"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTipoCuentasEquipos") = value - End Set - End Property - Property GlobalDTTipoCuentasEquiposCaracteristicas(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquipos = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquipos = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquipos"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTTipoCuentasEquipos") = value + ' End Set + 'End Property + 'Property GlobalDTTipoCuentasEquiposCaracteristicas(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquiposCaracteristicas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquiposCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas") = value - End Set - End Property - Property GlobalDTTipoCuentasEquiposOpciones(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquiposCaracteristicas = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquiposCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTTipoCuentasEquiposCaracteristicas") = value + ' End Set + 'End Property + 'Property GlobalDTTipoCuentasEquiposOpciones(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquiposOpciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquiposOpciones = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones") = value - End Set - End Property + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquiposOpciones = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquiposOpciones = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTTipoCuentasEquiposOpciones") = value + ' End Set + 'End Property ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1) As DataTable Get Dim ObjPS As New ClsProductosServicios @@ -8463,48 +8067,48 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTInvMetodosInventario") = value End Set End Property - Property GlobalDTAFCaracteristicasOpciones() As DataTable - Get - GlobalDTAFCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicasOpciones"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAFCaracteristicasOpciones") = value - End Set - End Property - Property GlobalDTAFCaracteristicas() As DataTable - Get - GlobalDTAFCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicas"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAFCaracteristicas") = value - End Set - End Property - Property GlobalDTAFCaracteristicasClasificaciones() As DataTable - Get - GlobalDTAFCaracteristicasClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicasClasificaciones"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAFCaracteristicasClasificaciones") = value - End Set - End Property - Property GlobalDTImpuestosLocales(CvePS As Integer, CveEmpresa As Integer) As DataTable - Get - Dim Str As New StringBuilder - If CvePS > 0 Then Str.AppendFormat("CvePS = {0}", CvePS) - If CveEmpresa > 0 Then Str.AppendFormat("{0} CveEmpresa = {1}", If(CvePS > 0, " AND ", ""), CveEmpresa) + 'Property GlobalDTAFCaracteristicasOpciones() As DataTable + ' Get + ' GlobalDTAFCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicasOpciones"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTAFCaracteristicasOpciones") = value + ' End Set + 'End Property + 'Property GlobalDTAFCaracteristicas() As DataTable + ' Get + ' GlobalDTAFCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicas"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTAFCaracteristicas") = value + ' End Set + 'End Property + 'Property GlobalDTAFCaracteristicasClasificaciones() As DataTable + ' Get + ' GlobalDTAFCaracteristicasClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTAFCaracteristicasClasificaciones"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTAFCaracteristicasClasificaciones") = value + ' End Set + 'End Property + 'Property GlobalDTImpuestosLocales(CvePS As Integer, CveEmpresa As Integer) As DataTable + ' Get + ' Dim Str As New StringBuilder + ' If CvePS > 0 Then Str.AppendFormat("CvePS = {0}", CvePS) + ' If CveEmpresa > 0 Then Str.AppendFormat("{0} CveEmpresa = {1}", If(CvePS > 0, " AND ", ""), CveEmpresa) - If CvePS > 0 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTImpuestosLocales"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTImpuestosLocales = Dv.ToTable - Dv.Dispose() - Else - GlobalDTImpuestosLocales = DirectCast(HttpContext.Current.Application("GlobalDTImpuestosLocales"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTImpuestosLocales") = value - End Set - End Property + ' If CvePS > 0 Then + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTImpuestosLocales"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTImpuestosLocales = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTImpuestosLocales = DirectCast(HttpContext.Current.Application("GlobalDTImpuestosLocales"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTImpuestosLocales") = value + ' End Set + 'End Property 'Bancos Property GlobalDTBancos() As DataTable Get @@ -8560,65 +8164,65 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTTipoTransacciones") = value End Set End Property - Property GlobalDTEstatusIE() As DataTable - Get - GlobalDTEstatusIE = DirectCast(HttpContext.Current.Application("GlobalDTEstatusIE"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTEstatusIE") = value - End Set - End Property - Property GlobalDTBancosIE() As DataTable - Get - GlobalDTBancosIE = DirectCast(HttpContext.Current.Application("GlobalDTBancosIE"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTBancosIE") = value - End Set - End Property - Property GlobalDTTipoCuenta() As DataTable - Get - GlobalDTTipoCuenta = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuenta"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTipoCuenta") = value - End Set - End Property - 'Fin Bancos + 'Property GlobalDTEstatusIE() As DataTable + ' Get + ' GlobalDTEstatusIE = DirectCast(HttpContext.Current.Application("GlobalDTEstatusIE"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTEstatusIE") = value + ' End Set + 'End Property + 'Property GlobalDTBancosIE() As DataTable + ' Get + ' GlobalDTBancosIE = DirectCast(HttpContext.Current.Application("GlobalDTBancosIE"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTBancosIE") = value + ' End Set + 'End Property + 'Property GlobalDTTipoCuenta() As DataTable + ' Get + ' GlobalDTTipoCuenta = DirectCast(HttpContext.Current.Application("GlobalDTTipoCuenta"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTTipoCuenta") = value + ' End Set + 'End Property + ''Fin Bancos - 'Fin EstadoCIvil - 'TipoPerioso - Property GlobalDTTipoPeriodo() As DataTable - Get - GlobalDTTipoPeriodo = DirectCast(HttpContext.Current.Application("GlobalDTTipoPeriodo"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTipoPeriodo") = value - End Set - End Property - 'Fin TipoPeriodo + ''Fin EstadoCIvil + ''TipoPerioso + 'Property GlobalDTTipoPeriodo() As DataTable + ' Get + ' GlobalDTTipoPeriodo = DirectCast(HttpContext.Current.Application("GlobalDTTipoPeriodo"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTTipoPeriodo") = value + ' End Set + 'End Property + ''Fin TipoPeriodo 'Periodos - Property GlobalDTNominasPeriodos(CveTipoPeriodo As Integer, CvePeriodo As Integer, CveEmpresa As Integer) As DataTable - Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveTipoPeriodo <> -1 Then Str.AppendFormat(" {0} CveTipoPeriodo = {1}", If(Str.Length > 0, "AND", ""), CveTipoPeriodo) - If CvePeriodo <> -1 Then Str.AppendFormat(" {0} CvePeriodo = {1}", If(Str.Length > 0, "AND", ""), CvePeriodo) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTNominasPeriodos"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTNominasPeriodos = Dv.ToTable - Dv.Dispose() + 'Property GlobalDTNominasPeriodos(CveTipoPeriodo As Integer, CvePeriodo As Integer, CveEmpresa As Integer) As DataTable + ' Get + ' Dim Str As New StringBuilder + ' If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) + ' If CveTipoPeriodo <> -1 Then Str.AppendFormat(" {0} CveTipoPeriodo = {1}", If(Str.Length > 0, "AND", ""), CveTipoPeriodo) + ' If CvePeriodo <> -1 Then Str.AppendFormat(" {0} CvePeriodo = {1}", If(Str.Length > 0, "AND", ""), CvePeriodo) + ' If Str.Length > 0 Then + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTNominasPeriodos"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTNominasPeriodos = Dv.ToTable + ' Dv.Dispose() - Else - GlobalDTNominasPeriodos = DirectCast(HttpContext.Current.Application("GlobalDTNominasPeriodos"), DataTable) - End If + ' Else + ' GlobalDTNominasPeriodos = DirectCast(HttpContext.Current.Application("GlobalDTNominasPeriodos"), DataTable) + ' End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTNominasPeriodos") = value - End Set - End Property + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTNominasPeriodos") = value + ' End Set + 'End Property 'Fin Periodos 'Fin Ruta @@ -8741,78 +8345,78 @@ Namespace Modelos End Set End Property 'EstatusFactura - Property GlobalDTCompEstatusFactura() As DataTable - Get - GlobalDTCompEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTCompEstatusFactura"), DataTable).FiltraParametros("Estatus = 'Activo'") - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTCompEstatusFactura") = value - End Set - End Property - Property GlobalDTContratosSecciones() As DataTable - Get - GlobalDTContratosSecciones = DirectCast(HttpContext.Current.Application("GlobalDTContratosSecciones"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTContratosSecciones") = value - End Set - End Property - Property GlobalDTContratos() As DataTable - Get - GlobalDTContratos = DirectCast(HttpContext.Current.Application("GlobalDTContratos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTContratos") = value - End Set - End Property - Property GlobalDTContratosTipos() As DataTable - Get - GlobalDTContratosTipos = DirectCast(HttpContext.Current.Application("GlobalDTContratosTipos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTContratosTipos") = value - End Set - End Property - Property GlobalDTTipoAlmacen(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoAlmacen = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTTipoAlmacen"), DataTable) - End If + 'Property GlobalDTCompEstatusFactura() As DataTable + ' Get + ' GlobalDTCompEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTCompEstatusFactura"), DataTable).FiltraParametros("Estatus = 'Activo'") + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTCompEstatusFactura") = value + ' End Set + 'End Property + 'Property GlobalDTContratosSecciones() As DataTable + ' Get + ' GlobalDTContratosSecciones = DirectCast(HttpContext.Current.Application("GlobalDTContratosSecciones"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTContratosSecciones") = value + ' End Set + 'End Property + 'Property GlobalDTContratos() As DataTable + ' Get + ' GlobalDTContratos = DirectCast(HttpContext.Current.Application("GlobalDTContratos"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTContratos") = value + ' End Set + 'End Property + 'Property GlobalDTContratosTipos() As DataTable + ' Get + ' GlobalDTContratosTipos = DirectCast(HttpContext.Current.Application("GlobalDTContratosTipos"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTContratosTipos") = value + ' End Set + 'End Property + 'Property GlobalDTTipoAlmacen(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoAlmacen = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTTipoAlmacen"), DataTable) + ' End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTipoAlmacen") = value - End Set - End Property - Property GlobalDTInvConceptos() As DataTable - Get + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTTipoAlmacen") = value + ' End Set + 'End Property + 'Property GlobalDTInvConceptos() As DataTable + ' Get - Return DirectCast(HttpContext.Current.Application("GlobalDTInvConceptos"), DataTable) + ' Return DirectCast(HttpContext.Current.Application("GlobalDTInvConceptos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTInvConceptos") = value - End Set - End Property - Property GlobalDTSeccionAlmacen(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSeccionAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTSeccionAlmacen = Dv.ToTable - Dv.Dispose() - Else - GlobalDTSeccionAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTSeccionAlmacen"), DataTable) - End If + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTInvConceptos") = value + ' End Set + 'End Property + 'Property GlobalDTSeccionAlmacen(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSeccionAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTSeccionAlmacen = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTSeccionAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTSeccionAlmacen"), DataTable) + ' End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTSeccionAlmacen") = value - End Set - End Property + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTSeccionAlmacen") = value + ' End Set + 'End Property Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa) @@ -8878,46 +8482,46 @@ Namespace Modelos HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTNom_Periodos() As DataTable - Get - GlobalDTNom_Periodos = DirectCast(HttpContext.Current.Application("GlobalDTNom_Periodos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTNom_Periodos") = value - End Set - End Property - Property GlobalDTVtaFormaPago() As DataTable - Get - GlobalDTVtaFormaPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaFormaPago"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTVtaFormaPago") = value - End Set - End Property - Property GlobalDTVtaMetodoPago() As DataTable - Get - GlobalDTVtaMetodoPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaMetodoPago"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTVtaMetodoPago") = value - End Set - End Property - Property GlobalDTVtaTiposRelacion() As DataTable - Get - GlobalDTVtaTiposRelacion = DirectCast(HttpContext.Current.Application("GlobalDTVtaTiposRelacion"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTVtaTiposRelacion") = value - End Set - End Property - Property GlobalDTTiposDocumentos() As DataTable - Get - GlobalDTTiposDocumentos = DirectCast(HttpContext.Current.Application("GlobalDTTiposDocumentos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTiposDocumentos") = value - End Set - End Property + 'Property GlobalDTNom_Periodos() As DataTable + ' Get + ' GlobalDTNom_Periodos = DirectCast(HttpContext.Current.Application("GlobalDTNom_Periodos"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTNom_Periodos") = value + ' End Set + 'End Property + 'Property GlobalDTVtaFormaPago() As DataTable + ' Get + ' GlobalDTVtaFormaPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaFormaPago"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTVtaFormaPago") = value + ' End Set + 'End Property + 'Property GlobalDTVtaMetodoPago() As DataTable + ' Get + ' GlobalDTVtaMetodoPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaMetodoPago"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTVtaMetodoPago") = value + ' End Set + 'End Property + 'Property GlobalDTVtaTiposRelacion() As DataTable + ' Get + ' GlobalDTVtaTiposRelacion = DirectCast(HttpContext.Current.Application("GlobalDTVtaTiposRelacion"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTVtaTiposRelacion") = value + ' End Set + 'End Property + 'Property GlobalDTTiposDocumentos() As DataTable + ' Get + ' GlobalDTTiposDocumentos = DirectCast(HttpContext.Current.Application("GlobalDTTiposDocumentos"), DataTable) + ' End Get + ' Set(value As DataTable) + ' HttpContext.Current.Application("GlobalDTTiposDocumentos") = value + ' End Set + 'End Property Public ReadOnly Property GlobalTipoCambioUltimaFluctuacion(Optional Fecha As Date = MinFecha) As ClsPaginas.MTipoCambioFluctuacion Get @@ -8954,1008 +8558,6 @@ Namespace Modelos End Get End Property - Property GlobalDTCobranzaEstatus(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTVtaCobranzaEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTCobranzaEstatus = Dv.ToTable - Dv.Dispose() - Else - GlobalDTCobranzaEstatus = DirectCast(HttpContext.Current.Application("GlobalDTVtaCobranzaEstatus"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTVtaCobranzaEstatus") = value - End Set - End Property - - -#Region "***********************************************************************DT EVENTOS****************************************************************************************" - Property GlobalDTTiposEventos() As DataTable - Get - GlobalDTTiposEventos = DirectCast(HttpContext.Current.Application("GlobalDTTiposEventos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTiposEventos") = value - End Set - End Property - - Property GlobalDTEventos() As DataTable - Get - GlobalDTEventos = DirectCast(HttpContext.Current.Application("GlobalDTEventos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTEventos") = value - End Set - End Property - - Property GlobalDTOIEventoTarea() As DataTable - Get - GlobalDTOIEventoTarea = DirectCast(HttpContext.Current.Application("GlobalDTOIEventoTarea"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTOIEventoTarea") = value - End Set - End Property - - Property GlobalDTOIEstatusEventos() As DataTable - Get - GlobalDTOIEstatusEventos = DirectCast(HttpContext.Current.Application("GlobalDTOIEstatusEventos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTOIEstatusEventos") = value - End Set - End Property -#End Region - -#Region " **********************************************************************DT PROSPECTOS*************************************************************************************" - Property GlobalDTProspectosCaracteristicasClasificaciones() As DataTable - Get - GlobalDTProspectosCaracteristicasClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTProspectosCaracteristicasClasificaciones"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosCaracteristicasClasificaciones") = value - End Set - End Property - Property GlobalDTProspectosTiposCaracteristicas() As DataTable - Get - GlobalDTProspectosTiposCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTProspectosTiposCaracteristicas"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosTiposCaracteristicas") = value - End Set - End Property - Property GlobalDTProspectosCaracteristicas(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosCaracteristicas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTProspectosCaracteristicas"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosCaracteristicas") = value - End Set - End Property - - Property GlobalDTProspectosCaracteristicasOpciones() As DataTable - Get - GlobalDTProspectosCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTProspectosCaracteristicasOpciones"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosCaracteristicasOpciones") = value - End Set - End Property -#End Region - -#Region "***********************************************************************DT ACTIVOS FIJOS**********************************************************************************" - Property GlobalDTActivoFijos(CveEmpresa As Integer, Optional CveSubTipoActivoFijo As Integer = -1, Optional CveActivoFijo As Integer = -1) As DataTable - Get - Dim dt As DataTable = Nothing - 'Dim Str As New StringBuilder - 'Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - 'If CveSubTipoActivoFijo <> -1 Then Str.AppendFormat(" AND CveSubTipoActivoFijo = {0}", CveSubTipoActivoFijo) - - Dim ObjAF As New ClsAF - 'If ObjAF.GetActivosFijos(CveActivoFijo, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, -1, "-1", -1, -1, -1, -1, -1) Then - If ObjAF.GetActivosFijos(CveActivoFijo, CveEmpresa, "-1", "-1", -1, CveSubTipoActivoFijo, "-1", -1, -1, -1, -1, -1, "", -1) Then - dt = ObjAF.DtResultados - End If - - ObjAF.Dispose() - GlobalDTActivoFijos = dt - - End Get - Set(ByVal value As DataTable) - HttpContext.Current.Application("GlobalDTActivoFijos") = value - End Set - End Property - Property GlobalDTEstadoActivoFijo() As DataTable - Get - GlobalDTEstadoActivoFijo = DirectCast(HttpContext.Current.Application("GlobalDTEstadoActivoFijo"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTEstadoActivoFijo") = value - End Set - End Property - Property GlobalDTMarcaActivoFijo(CveEmpresa As Integer) As DataTable - Get - Dim dt As DataTable = Nothing - - Dim ObjAF As New ClsAF - - If ObjAF.GetMarcasActivosFijos(CveEmpresa) Then - dt = ObjAF.DtResultados - End If - - ObjAF.Dispose() - GlobalDTMarcaActivoFijo = dt - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTMarcaActivoFijo") = value - End Set - End Property - Property GlobalDTModeloActivoFijo(CveEmpresa As Integer, CveMarca As Integer) As DataTable - Get - Dim dt As DataTable = Nothing - - Dim ObjAF As New ClsAF - - If ObjAF.GetModelosActivosFijos(CveEmpresa, CveMarca) Then - dt = ObjAF.DtResultados - End If - - ObjAF.Dispose() - GlobalDTModeloActivoFijo = dt - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTModeloActivoFijo") = value - End Set - End Property - - Property GlobalDTSubTipoActivoFijo(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSubTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTSubTipoActivoFijo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTSubTipoActivoFijo = DirectCast(HttpContext.Current.Application("GlobalDTSubTipoActivoFijo"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTSubTipoActivoFijo") = value - End Set - End Property - Property GlobalDTTipoActivoFijo(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoActivoFijo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoActivoFijo = DirectCast(HttpContext.Current.Application("GlobalDTTipoActivoFijo"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTipoActivoFijo") = value - End Set - End Property - -#End Region - -#Region "***********************************************************************DT GENERALES**************************************************************************************" - Property GlobalDTGralPaises() As DataTable - Get - GlobalDTGralPaises = DirectCast(HttpContext.Current.Application("GlobalDTGralPaises"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTGralPaises") = value - End Set - End Property - Property GlobalDTGralEstados(CvePais As Integer) As DataTable - Get - GlobalDTGralEstados = DirectCast(HttpContext.Current.Application("GlobalDTGralEstados"), DataTable).FiltraParametros(String.Format("CvePais ={0}", CvePais)) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTGralEstados") = value - End Set - End Property - Property GlobalDTGralMunicipios(CveEstado As Integer) As DataTable - Get - GlobalDTGralMunicipios = DirectCast(HttpContext.Current.Application("GlobalDTGralMunicipios"), DataTable).FiltraParametros(String.Format("CveEstado ={0}", CveEstado)) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTGralMunicipios") = value - End Set - End Property - - Property GlobalDTGralPoblaciones() As DataTable - Get - GlobalDTGralPoblaciones = DirectCast(HttpContext.Current.Application("GlobalDTGralPoblaciones"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTGralPoblaciones") = value - End Set - End Property - Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable - - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTGralCategorias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTGralCategorias = Dv.ToTable - Dv.Dispose() - Else - GlobalDTGralCategorias = DirectCast(HttpContext.Current.Application("GlobalDTGralCategorias"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTGralCategorias") = value - End Set - End Property - Property GlobalDTGralCategorias2(CveEmpresa As Integer) As DataTable - - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCategorias2"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTGralCategorias2 = Dv.ToTable - Dv.Dispose() - Else - GlobalDTGralCategorias2 = DirectCast(HttpContext.Current.Application("GlobalDTCategorias2"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTCategorias2") = value - End Set - End Property - - Property GlobalDTGralEscolaridades() As DataTable - Get - GlobalDTGralEscolaridades = DirectCast(HttpContext.Current.Application("GlobalDTGralEscolaridades"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTGralEscolaridades") = value - End Set - End Property - - Property GlobalDTGralColectivas(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTGralColectivas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTGralColectivas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTGralColectivas = DirectCast(HttpContext.Current.Application("GlobalDTGralColectivas"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTGralColectivas") = value - End Set - End Property - -#End Region - -#Region "***********************************************************************DT PROSPECTOS*************************************************************************************" - Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosSupervisores"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSupervisores = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSupervisores = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSupervisores"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosSupervisores") = value - End Set - End Property - Property GlobalDTProspectosCoordinadores(CveSupervisor As Integer, CveEmpresa As Integer) As DataTable - Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveSupervisor <> -1 Then Str.AppendFormat(" {0} CveSupervisor = {1}", If(Str.Length > 0, "AND", ""), CveSupervisor) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosCoordinadores"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosCoordinadores = Dv.ToTable - Dv.Dispose() - - Else - GlobalDTProspectosCoordinadores = DirectCast(HttpContext.Current.Application("GlobalDTProspectosCoordinadores"), DataTable) - End If - End Get - - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosCoordinadores") = value - End Set - End Property - Property GlobalDTProspectosApoyos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosApoyos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosApoyos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosApoyos"), DataTable) - End If - End Get - - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosApoyos") = value - End Set - End Property - Property GlobalDTProspectosClasificaciones(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosClasificaciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosClasificaciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTProspectosClasificaciones"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosClasificaciones") = value - End Set - End Property - Property GlobalDTProspectosEventosTipo(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEventosTipo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosEventosTipo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEventosTipo = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEventosTipo"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosEventosTipo") = value - End Set - End Property - Property GlobalDTProspectosEvento(CveEventoTipo As Integer, CveEmpresa As Integer) As DataTable - Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveEventoTipo <> -1 Then Str.AppendFormat(" {0} CveEventoTipo = {1}", If(Str.Length > 0, "AND", ""), CveEventoTipo) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEvento"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosEvento = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEvento = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEvento"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosEvento") = value - End Set - End Property - Property GlobalDTProspectosEstatus(CveEmpresa As Integer) As DataTable - Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEstatus"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosEstatus = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEstatus = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEstatus"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosEstatus") = value - End Set - End Property - Property GlobalDTProspectosApoyosTipos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosApoyosTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosApoyosTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosApoyosTipos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosApoyosTipos"), DataTable) - End If - End Get - - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosApoyosTipos") = value - End Set - End Property - Property GlobalDTProspectosApoyosTipos() As DataTable - Get - GlobalDTProspectosApoyosTipos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosApoyosTipos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosApoyosTipos") = value - End Set - End Property - Property GlobalDTProspectosEncuestas(CveEmpresa As Integer) As DataTable - Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosEncuestas = Dv.ToTable - Dv.Dispose() - - Else - GlobalDTProspectosEncuestas = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestas"), DataTable) - End If - End Get - - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosEncuestas") = value - End Set - End Property - Property GlobalDTProspectosEncuestasPreguntas(CveEncuesta As Integer, CveEmpresa As Integer) As DataTable - Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveEncuesta <> -1 Then Str.AppendFormat(" {0} CveEncuesta = {1}", If(Str.Length > 0, "AND", ""), CveEncuesta) - - - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestasPreguntas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosEncuestasPreguntas = Dv.ToTable - Dv.Dispose() - - Else - GlobalDTProspectosEncuestasPreguntas = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestasPreguntas"), DataTable) - End If - End Get - - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosEncuestasPreguntas") = value - End Set - End Property - Property GlobalDTProspectosEncuestasRespuestas(CvePregunta As Integer, CveEncuesta As Integer, CveEmpresa As Integer) As DataTable - Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveEncuesta <> -1 Then Str.AppendFormat(" {0} CveEncuesta = {1}", If(Str.Length > 0, "AND", ""), CveEncuesta) - If CvePregunta <> -1 Then Str.AppendFormat(" {0} CvePregunta = {1}", If(Str.Length > 0, "AND", ""), CvePregunta) - - - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestasRespuestas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosEncuestasRespuestas = Dv.ToTable - Dv.Dispose() - - Else - GlobalDTProspectosEncuestasRespuestas = DirectCast(HttpContext.Current.Application("GlobalDTProspectosEncuestasRespuestas"), DataTable) - End If - End Get - - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosEncuestasRespuestas") = value - End Set - End Property - Property GlobalDTProspectosTipos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosTipos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosTipos"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosTipos") = value - End Set - End Property - -#Region " DT PROSPECTOS SOLICITUDES" - Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudes"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudes = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudes = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudes"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosSolicitudes") = value - End Set - End Property - Property GlobalDTProspectosSolicitudesEstatus(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesEstatus = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesEstatus = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesEstatus"), DataTable) - End If - End Get - - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosSolicitudesEstatus") = value - End Set - End Property - Property GlobalDTProspectosSolicitudesTipos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesTipos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesTipos"), DataTable) - End If - End Get - - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosSolicitudesTipos") = value - End Set - End Property - 'Property GlobalDTProspectosSolicitudesTipos() As DataTable - ' Get - ' GlobalDTProspectosSolicitudesTipos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesTipos"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTProspectosSolicitudesTipos") = value - ' End Set - 'End Property - Property GlobalDTProspectosSolicitudesApoyos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesApoyos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesApoyos = DirectCast(HttpContext.Current.Application("GlobalDTProspectosSolicitudesApoyos"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTProspectosSolicitudesApoyos") = value - End Set - End Property - -#End Region -#End Region - -#Region "**********************************************DT AMORTIZACIÓN CONTABLE PLAN DE DESARROLLO********************************************************************************" - -#Region "***********************************************************************DT AMORTIZACIÓN CONTABLE*********************************************************************************************" - - Property GlobalDTAC_RubrosIngreso() As DataTable - Get - GlobalDTAC_RubrosIngreso = DirectCast(HttpContext.Current.Application("GlobalDTAC_RubrosIngreso"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_RubrosIngreso") = value - End Set - End Property - Property GlobalDTAC_FuentesRecaudacion(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesRecaudacion"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_FuentesRecaudacion = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_FuentesRecaudacion = DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesRecaudacion"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_FuentesRecaudacion") = value - End Set - End Property - - Property GlobalDTAC_FuentesFinanciamiento() As DataTable - Get - GlobalDTAC_FuentesFinanciamiento = DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamiento"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamiento") = value - End Set - End Property - Property GlobalDTAC_OG() As DataTable - Get - GlobalDTAC_OG = DirectCast(HttpContext.Current.Application("GlobalDTAC_OG"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_OG") = value - End Set - End Property - 'Property GlobalDTAC_ClasificadorOG(CveEmpresa As Integer) As DataTable - ' Get - ' If CveEmpresa <> -1 Then - ' Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificadorOG"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - ' GlobalDTAC_ClasificadorOG = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTAC_ClasificadorOG = DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificadorOG"), DataTable) - ' End If - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTAC_ClasificadorOG") = value - ' End Set - 'End Property - Property GlobalDTAC_Ubicaciones() As DataTable - Get - GlobalDTAC_Ubicaciones = DirectCast(HttpContext.Current.Application("GlobalDTAC_Ubicaciones"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_Ubicaciones") = value - End Set - End Property - Property GlobalDTAC_UnidadesAdministrativas(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_UnidadesAdministrativas"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_UnidadesAdministrativas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_UnidadesAdministrativas = DirectCast(HttpContext.Current.Application("GlobalDTAC_UnidadesAdministrativas"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_UnidadesAdministrativas") = value - End Set - End Property - Property GlobalDTAC_ClasificacionFuncional(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionFuncional"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionFuncional = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionFuncional = DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionFuncional"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_ClasificacionFuncional") = value - End Set - End Property - Property GlobalDTAC_ClasificacionGeografica(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionGeografica"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionGeografica = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionGeografica = DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionGeografica"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_ClasificacionGeografica") = value - End Set - End Property - Property GlobalDTAC_Cuentas() As DataTable - Get - GlobalDTAC_Cuentas = DirectCast(HttpContext.Current.Application("GlobalDTAC_Cuentas"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_Cuentas") = value - End Set - End Property - Property GlobalDTAC_Finalidad() As DataTable - Get - GlobalDTAC_Finalidad = DirectCast(HttpContext.Current.Application("GlobalDTAC_Finalidad"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_Finalidad") = value - End Set - End Property - 'Property GlobalDTAC_FuenteFinanciamiento() As DataTable - ' Get - ' GlobalDTAC_FuenteFinanciamiento = DirectCast(HttpContext.Current.Application("GlobalDTAC_FuenteFinanciamiento"), DataTable) - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTAC_FuenteFinanciamiento") = value - ' End Set - 'End Property - Property GlobalDTAC_FuentesFinanciamiento(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamiento"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_FuentesFinanciamiento = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_FuentesFinanciamiento = DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamiento"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamiento") = value - End Set - End Property - Property GlobalDTAC_FuentesFinanciamientoCONAC() As DataTable - Get - GlobalDTAC_FuentesFinanciamientoCONAC = DirectCast(HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamientoCONAC"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_FuentesFinanciamientoCONAC") = value - End Set - End Property - Property GlobalDTAC_Funcion() As DataTable - Get - GlobalDTAC_Funcion = DirectCast(HttpContext.Current.Application("GlobalDTAC_Funcion"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_Funcion") = value - End Set - End Property - Property GlobalDTAC_Programas() As DataTable - Get - GlobalDTAC_Programas = DirectCast(HttpContext.Current.Application("GlobalDTAC_Programas"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_Programas") = value - End Set - End Property - Property GlobalDTAC_ProgramasCONAC() As DataTable - Get - GlobalDTAC_ProgramasCONAC = DirectCast(HttpContext.Current.Application("GlobalDTAC_ProgramasCONAC"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_ProgramasCONAC") = value - End Set - End Property - Property GlobalDTAC_ProyectosProceso() As DataTable - Get - GlobalDTAC_ProyectosProceso = DirectCast(HttpContext.Current.Application("GlobalDTAC_ProyectosProceso"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_ProyectosProceso") = value - End Set - End Property - Property GlobalDTAC_SubFuncion() As DataTable - Get - GlobalDTAC_SubFuncion = DirectCast(HttpContext.Current.Application("GlobalDTAC_SubFuncion"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_SubFuncion") = value - End Set - End Property - Property GlobalDTAC_SubProgramas() As DataTable - Get - GlobalDTAC_SubProgramas = DirectCast(HttpContext.Current.Application("GlobalDTAC_SubProgramas"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_SubProgramas") = value - End Set - End Property - Property GlobalDTAC_ClasificacionAdministrativa(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionAdministrativa"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionAdministrativa = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionAdministrativa = DirectCast(HttpContext.Current.Application("GlobalDTAC_ClasificacionAdministrativa"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_ClasificacionAdministrativa") = value - End Set - End Property - Property GlobalDTAC_TipoGasto() As DataTable - Get - GlobalDTAC_TipoGasto = DirectCast(HttpContext.Current.Application("GlobalDTAC_TipoGasto"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_TipoGasto") = value - End Set - End Property - - Property GlobalDTAC_ProgramaOperativo(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_ProgramaOperativo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ProgramaOperativo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ProgramaOperativo = DirectCast(HttpContext.Current.Application("GlobalDTAC_ProgramaOperativo"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_ProgramaOperativo") = value - End Set - End Property - - Property GlobalDTAC_MatrizIngresos() As DataTable - Get - GlobalDTAC_MatrizIngresos = DirectCast(HttpContext.Current.Application("GlobalDTAC_MatrizIngresos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_MatrizIngresos") = value - End Set - End Property - - Property GlobalDTAC_MatrizEgresos() As DataTable - Get - GlobalDTAC_MatrizEgresos = DirectCast(HttpContext.Current.Application("GlobalDTAC_MatrizEgresos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_MatrizEgresos") = value - End Set - End Property - - -#End Region - - Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_EjeRector"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_PD_EjeRector = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_PD_EjeRector = DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_EjeRector"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_PD_EjeRector") = value - End Set - End Property - - Property GlobalDTAC_PD_Programas(CveEjeRector As Integer) As DataTable - Get - If CveEjeRector <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Programas"), DataTable), String.Format("CveEjeRector = {0}", CveEjeRector), "", DataViewRowState.CurrentRows) - GlobalDTAC_PD_Programas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_PD_Programas = DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Programas"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_PD_Programas") = value - End Set - End Property - - Property GlobalDTAC_PD_Estrategias(CveProgramas As Integer) As DataTable - Get - If CveProgramas <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Estrategias"), DataTable), String.Format("CvePrograma = {0}", CveProgramas), "", DataViewRowState.CurrentRows) - GlobalDTAC_PD_Estrategias = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_PD_Estrategias = DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Estrategias"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_PD_Estrategias") = value - End Set - End Property - - Property GlobalDTAC_PD_LineasAccion(CveEstrategias As Integer) As DataTable - Get - If CveEstrategias <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_LineasAccion"), DataTable), String.Format("CveEstrategia = {0}", CveEstrategias), "", DataViewRowState.CurrentRows) - GlobalDTAC_PD_LineasAccion = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_PD_LineasAccion = DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_LineasAccion"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_PD_LineasAccion") = value - End Set - End Property - - Property GlobalDTAC_PD_Metas(CveLineasAccion As Integer) As DataTable - Get - If CveLineasAccion <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Metas"), DataTable), String.Format("CveLineaAccion = {0}", CveLineasAccion), "", DataViewRowState.CurrentRows) - GlobalDTAC_PD_Metas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_PD_Metas = DirectCast(HttpContext.Current.Application("GlobalDTAC_PD_Metas"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAC_PD_Metas") = value - End Set - End Property -#End Region - -#Region "***********************************************************************GLOBAL DT ORDENES DE COMPRA***********************************************************************" - - Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable - Get - - Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) - 'sino existe, recarga los datos - If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then - - Dim ObjOC As New ClsOC - If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then - HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados - Else - HttpContext.Current.Application(AppNombre) = Nothing - End If - - ObjOC.Dispose() - - End If - - Dim filtro As New StringBuilder - filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) - If CveUsuario > 0 Then - filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) - End If - If Tipo <> "" Then - filtro.AppendFormat(" AND Tipo='{0}'", Tipo) - End If - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) - GlobalDTOCEstatusUsuarios = Dv.ToTable - Dv.Dispose() - - End Get - Set(value As DataTable) - Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa) - HttpContext.Current.Application(AppNombre) = value - End Set - End Property - - - Property GlobalDTOCEstatus(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTOCEstatus = Dv.ToTable - Dv.Dispose() - Else - GlobalDTOCEstatus = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatus"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTOCEstatus") = value - End Set - End Property - - - 'Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable - ' Get - ' If CveEmpresa <> -1 Then - ' Dim filtro As New StringBuilder - ' filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) - ' If CveUsuario > 0 Then - ' filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) - ' End If - ' If Tipo <> "" Then - ' filtro.AppendFormat(" AND Tipo='{0}'", Tipo) - ' End If - ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) - ' GlobalDTOCEstatusUsuarios = Dv.ToTable - ' Dv.Dispose() - ' Else - ' GlobalDTOCEstatusUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTOCEstatusUsuarios"), DataTable) - ' End If - ' End Get - ' Set(value As DataTable) - ' HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value - ' End Set - 'End Property - - -#End Region - -#Region "F I N A N Z A S " - Property GlobalDTFinan_RazonesFinancieras() As DataTable - Get - GlobalDTFinan_RazonesFinancieras = DirectCast(HttpContext.Current.Application("GlobalDTFinan_RazonesFinancieras"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTFinan_RazonesFinancieras") = value - End Set - End Property -#End Region #Region "***********************************************************************GLOBAL DT CONTABILIDAD****************************************************************************" @@ -10021,357 +8623,7 @@ Namespace Modelos End Property #End Region -#Region "**********************************************************************GLOBAL DT RH (RECURSOS HUMANOS)********************************************************************" - Property GlobalDTAsistenciaDetalle() As DataTable - Get - GlobalDTAsistenciaDetalle = DirectCast(HttpContext.Current.Application("GlobalDTAsistenciaDetalle"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAsistenciaDetalle") = value - End Set - End Property - Property GlobalDTAsistenciasInasistencias() As DataTable - Get - GlobalDTAsistenciasInasistencias = DirectCast(HttpContext.Current.Application("GlobalDTAsistenciasInasistencias"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTAsistenciasInasistencias") = value - End Set - End Property - Property GlobalDTEstatusPersonal() As DataTable - Get - GlobalDTEstatusPersonal = DirectCast(HttpContext.Current.Application("GlobalDTEstatusPersonal"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTEstatusPersonal") = value - End Set - End Property - Property GlobalDTRHPersonal(CveEmpresa As Integer) As DataTable - Get - Dim ObjPersonal As New ClsRH - ObjPersonal.GetPersonal(-1, CveEmpresa) - GlobalDTRHPersonal = ObjPersonal.DtResultados - ObjPersonal.Dispose() - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTRHPersonal") = value - End Set - End Property - - - Property GlobalDTDepartamentos() As DataTable - Get - GlobalDTDepartamentos = DirectCast(HttpContext.Current.Application("GlobalDTDepartamentos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTDepartamentos") = value - End Set - End Property - Property GlobalDTRHPuestos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTRHPuestos"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTRHPuestos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTRHPuestos = DirectCast(HttpContext.Current.Application("GlobalDTRHPuestos"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTRHPuestos") = value - End Set - End Property - Property GlobalDTEscolaridad() As DataTable - Get - GlobalDTEscolaridad = DirectCast(HttpContext.Current.Application("GlobalDTEscolaridad"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTEscolaridad") = value - End Set - End Property - Property GlobalDTEstadoCivil() As DataTable - Get - GlobalDTEstadoCivil = DirectCast(HttpContext.Current.Application("GlobalDTEstadoCivil"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTEstadoCivil") = value - End Set - End Property - Property GlobalDTDocumentos() As DataTable - Get - GlobalDTDocumentos = DirectCast(HttpContext.Current.Application("GlobalDTDocumentos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTDocumentos") = value - End Set - End Property - Property GlobalDTGenero() As DataTable - Get - GlobalDTGenero = DirectCast(HttpContext.Current.Application("GlobalDTGenero"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTGenero") = value - End Set - End Property - Property GlobalDTMotivoBaja() As DataTable - Get - GlobalDTMotivoBaja = DirectCast(HttpContext.Current.Application("GlobalDTMotivoBaja"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTMotivoBaja") = value - End Set - End Property - Property GlobalDTTiposContrato() As DataTable - Get - GlobalDTTiposContrato = DirectCast(HttpContext.Current.Application("GlobalDTTiposContrato"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTiposContrato") = value - End Set - End Property - Property GlobalDTRutas() As DataTable - Get - GlobalDTRutas = DirectCast(HttpContext.Current.Application("GlobalDTRutas"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTRutas") = value - End Set - End Property - Property GlobalDTTurno() As DataTable - Get - GlobalDTTurno = DirectCast(HttpContext.Current.Application("GlobalDTTurno"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTurno") = value - End Set - End Property - Property GlobalDTJornadas() As DataTable - Get - GlobalDTJornadas = DirectCast(HttpContext.Current.Application("GlobalDTJornadas"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTJornadas") = value - End Set - End Property - Property GlobalDTMotivosHorasExtras() As DataTable - Get - GlobalDTMotivosHorasExtras = DirectCast(HttpContext.Current.Application("GlobalDTMotivosHorasExtras"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTMotivosHorasExtras") = value - End Set - End Property - Property GlobalDTTipoBuzon() As DataTable - Get - GlobalDTTipoBuzon = DirectCast(HttpContext.Current.Application("GlobalDTTipoBuzon"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTipoBuzon") = value - End Set - End Property -#End Region - -#Region "*********** D T - C O M B U S T I B L E S ***********" - - - - Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim StrSQL As New StringBuilder - StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCombustibles"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) - GlobalDTCombustibles = Dv.ToTable - Dv.Dispose() - - Else - GlobalDTCombustibles = DirectCast(HttpContext.Current.Application("GlobalDTCombustibles"), DataTable) - End If - - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTCombustibles") = value - End Set - End Property - - Property GlobalDTCombustiblesTipos(Optional CveCombustibleTipo As Integer = -1) As DataTable - Get - - If CveCombustibleTipo <> -1 Then - - Dim StrSQL As New StringBuilder - If CveCombustibleTipo <> -1 Then StrSQL.AppendFormat("CveCombustibleTipo = {0}", CveCombustibleTipo) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCombustiblesTipos"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) - GlobalDTCombustiblesTipos = Dv.ToTable - Dv.Dispose() - - Else - GlobalDTCombustiblesTipos = DirectCast(HttpContext.Current.Application("GlobalDTCombustiblesTipos"), DataTable) - End If - End Get - Set(ByVal value As DataTable) - HttpContext.Current.Application("GlobalDTCombustiblesTipos") = value - End Set - End Property -#End Region - -#Region "*********** D T - M A N T E N I M I E N T O S ***********" - - Property GlobalDTMantenimientosTipos() As DataTable - Get - GlobalDTMantenimientosTipos = DirectCast(HttpContext.Current.Application("GlobalDTMantenimientosTipos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTMantenimientosTipos") = value - End Set - End Property - - Property GlobalDTMantenimientos() As DataTable - Get - GlobalDTMantenimientos = DirectCast(HttpContext.Current.Application("GlobalDTMantenimientos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTMantenimientos") = value - End Set - End Property - - Property GlobalDTMantenimientosTipos(Optional CveMantenimientoTipo As Integer = -1) As DataTable - Get - - If CveMantenimientoTipo <> -1 Then - - Dim StrSQL As New StringBuilder - If CveMantenimientoTipo <> -1 Then StrSQL.AppendFormat("CveMantenimientoTipo = {0}", CveMantenimientoTipo) - - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTMantenimientosTipos"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) - GlobalDTMantenimientosTipos = Dv.ToTable - Dv.Dispose() - - Else - GlobalDTMantenimientosTipos = DirectCast(HttpContext.Current.Application("GlobalDTMantenimientosTipos"), DataTable) - End If - End Get - Set(ByVal value As DataTable) - - HttpContext.Current.Application("GlobalDTMantenimientosTipos") = value - End Set - End Property - -#End Region - - -#Region "*********** D T - T A L L E R E S ***********" - - Property GlobalDTTalleresTipos() As DataTable - Get - GlobalDTTalleresTipos = DirectCast(HttpContext.Current.Application("GlobalDTTalleresTipos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTalleresTipos") = value - End Set - End Property - - Property GlobalDTTalleres() As DataTable - Get - GlobalDTTalleres = DirectCast(HttpContext.Current.Application("GlobalDTTalleres"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTTalleres") = value - End Set - End Property - -#End Region - -#Region "*********** D T - D I S T R I B U I D O R E S ***********" - - Property GlobalDTDistribuidoresTipos() As DataTable - Get - GlobalDTDistribuidoresTipos = DirectCast(HttpContext.Current.Application("GlobalDTDistribuidoresTipos"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTDistribuidoresTipos") = value - End Set - End Property - - Property GlobalDTDistribuidores() As DataTable - Get - GlobalDTDistribuidores = DirectCast(HttpContext.Current.Application("GlobalDTDistribuidores"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTDistribuidores") = value - End Set - End Property - -#End Region - - - Property GlobalDTOIRevision(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTOIRevision"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTOIRevision = Dv.ToTable - Dv.Dispose() - Else - GlobalDTOIRevision = DirectCast(HttpContext.Current.Application("GlobalDTOIRevision"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTOIRevision") = value - End Set - End Property - Property GlobalDTOIAgendaTipo() As DataTable - Get - GlobalDTOIAgendaTipo = DirectCast(HttpContext.Current.Application("GlobalDTOIAgendaTipo"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTOIAgendaTipo") = value - End Set - End Property - Property GlobalDTOIAgenda() As DataTable - Get - GlobalDTOIAgenda = DirectCast(HttpContext.Current.Application("GlobalDTOIAgenda"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTOIAgenda") = value - End Set - End Property - Property GlobalDTVtaCondicionesEntrega(Optional CveEmpresa As Integer = -1) As DataTable - Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTVtaCondicionesEntrega"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTVtaCondicionesEntrega = Dv.ToTable - Dv.Dispose() - Else - GlobalDTVtaCondicionesEntrega = DirectCast(HttpContext.Current.Application("GlobalDTVtaCondicionesEntrega"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTVtaCondicionesEntrega") = value - End Set - End Property - Property GlobalDTPaqueteriaGuiaTipos(CveEmpresa As Integer) As DataTable - - Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTPaqueteriaGuiaTipos"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTPaqueteriaGuiaTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTPaqueteriaGuiaTipos = DirectCast(HttpContext.Current.Application("GlobalDTPaqueteriaGuiaTipos"), DataTable) - End If - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTPaqueteriaGuiaTipos") = value - End Set - End Property Property GlobalDTClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1, Optional PorcentajeIVA As Double = -1) As DataTable @@ -10393,14 +8645,7 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTClasificacionPorcentaje") = value End Set End Property - Property GlobalDTPaqueterias() As DataTable - Get - GlobalDTPaqueterias = DirectCast(HttpContext.Current.Application("GlobalDTPaqueterias"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTPaqueterias") = value - End Set - End Property + Public Property CveContratoSecciones As String Public Property CveEstatus As Integer diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 9685028a6..b57e902d4 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -145,6 +145,26 @@ Namespace Extensiones End If End Function + Public Function Truncate(value As String, length As Integer) As String + ' If argument is too big, return the original string. + ' ... Otherwise take a substring from the string's start index. + If length > value.Length Then + Return value + Else + Return value.Substring(0, length) + End If + End Function + + Public Function ValidFileName(name As String, Optional maxChars As Integer = -1) As String + For Each c As Char In System.IO.Path.GetInvalidFileNameChars() + name = name.Replace(c.ToString(), "_") + Next + If maxChars > 0 AndAlso maxChars < 256 Then + Return Truncate(name, maxChars) + End If + Return Truncate(name, 255) + End Function + Public Class RespuestaCancelacionSAT Public Property Verificado As Boolean = False Public Property CveEstatus As Integer = 0 @@ -1630,25 +1650,22 @@ Namespace Extensiones End Function - Public Function GetColumn(ByVal gv As GridView, ByVal name As String) As Integer - Dim index As Integer = 0 - Dim found As Boolean = False - - For Each c As DataControlField In gv.Columns - - If TypeOf c Is BoundField Then - Dim field As BoundField = CType(c, BoundField) - - If name = field.DataField OrElse name = field.SortExpression OrElse name = field.HeaderText Then - found = True - Exit For + Public Function FBColumn(gv As GridView, name As String) As DataControlField + name = name.ToLower + For Each col As DataControlField In gv.Columns + If TypeOf col Is BoundField Then + Dim field As BoundField = CType(col, BoundField) + If field.DataField.ToLower = name OrElse field.SortExpression.ToLower = name OrElse field.HeaderText.Trim.ToLower = name Then + Return col + End If + ElseIf TypeOf col Is HyperLinkField Then + Dim field As HyperLinkField = CType(col, HyperLinkField) + If field.DataTextField.ToLower = name OrElse field.SortExpression.ToLower = name OrElse field.HeaderText.Trim.ToLower = name Then + Return col End If End If - - index += 1 Next - - Return If(found, index, -1) + Return Nothing End Function @@ -2445,11 +2462,12 @@ Namespace Extensiones End If End Sub + 'Usa la librería ClosedXML - Public Sub ExportToExcelx(GridView As GridView, NombreArchivoXLSX As String) + Public Sub ExportToExcelX(GridView As GridView, NombreArchivoXLSX As String) If GridView IsNot Nothing AndAlso GridView.Rows.Count > 0 Then - NombreArchivoXLSX = Regex.Replace(NombreArchivoXLSX.Replace("["c, "").Replace("]"c, ""), "[:\/?*]", String.Empty) + NombreArchivoXLSX = ValidFileName(NombreArchivoXLSX, 31) Dim dt As New DataTable(NombreArchivoXLSX) Dim i As Integer = 0 Dim ArrColumnasVisibles As New List(Of Integer) 'solo recorro las columnas visibles @@ -2492,8 +2510,17 @@ Namespace Extensiones 'Next Next Using wb As New XLWorkbook() - wb.Worksheets.Add(dt) + Dim WS As IXLWorksheet = wb.Worksheets.Add(NombreArchivoXLSX) + Dim RangoColTitulos As IXLCells = WS.FirstRow().CellsUsed() + WS.FirstCell().InsertTable(dt, False) + + 'Estilo + RangoColTitulos.Style.Fill.SetBackgroundColor(XLColor.FromArgb(75, 119, 190)) + RangoColTitulos.Style.Font.SetBold(True) + RangoColTitulos.Style.Font.FontColor = XLColor.White + + WS.Columns().AdjustToContents() HttpContext.Current.Response.Clear() HttpContext.Current.Response.Buffer = True @@ -2510,13 +2537,13 @@ Namespace Extensiones End If End Sub - 'usa la librería de gembox + 'Usa la librería GemBox Public Sub ExportToExcelG(Gv As GridView, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing, Optional Filtros As String = "", Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100) Dim sw As New StringWriter() Dim htw As New HtmlTextWriter(sw) Gv.RenderControl(htw) - GemBox.Spreadsheet.SpreadsheetInfo.SetLicense("ESWN-4QFD-26JF-1SZ8") + GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet) Dim excel As GemBox.Spreadsheet.ExcelFile Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault @@ -2527,9 +2554,11 @@ Namespace Extensiones Dim TotalRowFooter As Integer = 2 Dim worksheet = excel.Worksheets(0) + worksheet.Name = ValidFileName(NombreArchivoXLSx, 31) worksheet.Rows.InsertEmpty(0, TotalRowHeader) Dim celdasConTexto = worksheet.GetUsedCellRange(True) celdasConTexto.Style.Font.Name = "Calibri Light" + celdasConTexto.Style.Borders = Nothing Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex) RangoNombreEmpresa.Merged = True @@ -2539,7 +2568,6 @@ Namespace Extensiones RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - Dim RangoFiltros = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex) RangoFiltros.Merged = True RangoFiltros.Value = Filtros @@ -2548,27 +2576,28 @@ Namespace Extensiones RangoFiltros.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left RangoFiltros.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex) RangoTitulo.Merged = True RangoTitulo.Value = Titulo RangoTitulo.Style.Font.Size = 20 * 20 RangoTitulo.Style.Font.Name = "Calibri Light" RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + Dim RangoColTitulos = worksheet.Cells.GetSubrangeAbsolute(8, celdasConTexto.FirstColumnIndex, 8, celdasConTexto.LastColumnIndex) + RangoColTitulos.Style.Font.Size = 12 * 20 + RangoColTitulos.Style.Font.Name = "Calibri" + RangoColTitulos.Style.Font.Weight = GemBox.Spreadsheet.ExcelFont.BoldWeight + RangoColTitulos.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoColTitulos.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + RangoColTitulos.Style.FillPattern.SetSolid(GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190)) + RangoColTitulos.Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex - worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20 - worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)) - worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) - If i > 0 Then - Try - worksheet.Columns(i).AutoFit(1) - Catch ex As Exception - End Try - End If + Try + worksheet.Columns(i).AutoFit(0.95) + Catch ex As Exception + End Try Next Dim IndexEndTable As Integer = Gv.Rows.Count + TotalRowHeader + TotalRowFooter @@ -2579,10 +2608,10 @@ Namespace Extensiones worksheet.Rows(IndexEndTable).Cells(6).Value = "Fecha Impresión" worksheet.Rows(IndexEndTable + 1).Cells(6).Value = DateTime.Now.ToString("dd/MM/yyyy") - Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)) + Dim Imagen As New System.IO.FileInfo($"{Usuario.Empresa.Ruta}/Logo.png") If Imagen.Exists Then - Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta) + Dim Ruta As String = $"{Usuario.Empresa.Ruta}/Logo.png" Using sr As New StreamReader(Ruta) Dim ms As New MemoryStream() sr.BaseStream.CopyTo(ms) @@ -2597,6 +2626,96 @@ Namespace Extensiones excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx") End Sub + + + Public Sub ExportToExcelG(Dt As DataTable, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing, Optional Filtros As String = "", Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100) + GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet) + If Dt.TableName Is Nothing Then Dt.TableName = NombreArchivoXLSx + + Dim excel As New GemBox.Spreadsheet.ExcelFile + Dim item = excel.Worksheets.Add(ValidFileName(Dt.TableName, 31)) + + item.InsertDataTable(Dt, New InsertDataTableOptions() With + { + .ColumnHeaders = True, + .StartRow = 0, + .StartColumn = 0 + }) + + If Usuario IsNot Nothing Then + Dim TotalRowHeader As Integer = 8 + Dim TotalRowFooter As Integer = 2 + + Dim worksheet = excel.Worksheets(0) + 'worksheet.Name = ValidFileName(NombreArchivoXLSx, 31) + worksheet.Rows.InsertEmpty(0, TotalRowHeader) + Dim celdasConTexto = worksheet.GetUsedCellRange(True) + celdasConTexto.Style.Font.Name = "Calibri Light" + celdasConTexto.Style.Borders = Nothing + + Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex) + RangoNombreEmpresa.Merged = True + RangoNombreEmpresa.Value = Usuario.Empresa.Empresa + RangoNombreEmpresa.Style.Font.Size = 18 * 20 + RangoNombreEmpresa.Style.Font.Name = "Calibri Light" + RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + Dim RangoFiltros = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex) + RangoFiltros.Merged = True + RangoFiltros.Value = Filtros + RangoFiltros.Style.Font.Size = 15 * 20 + RangoFiltros.Style.Font.Name = "Calibri Light" + RangoFiltros.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left + RangoFiltros.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex) + RangoTitulo.Merged = True + RangoTitulo.Value = Titulo + RangoTitulo.Style.Font.Size = 20 * 20 + RangoTitulo.Style.Font.Name = "Calibri Light" + RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + Dim RangoColTitulos = worksheet.Cells.GetSubrangeAbsolute(8, celdasConTexto.FirstColumnIndex, 8, celdasConTexto.LastColumnIndex) + RangoColTitulos.Style.Font.Size = 12 * 20 + RangoColTitulos.Style.Font.Name = "Calibri" + RangoColTitulos.Style.Font.Weight = GemBox.Spreadsheet.ExcelFont.BoldWeight + RangoColTitulos.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoColTitulos.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + RangoColTitulos.Style.FillPattern.SetSolid(GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190)) + RangoColTitulos.Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) + + For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex + Try + worksheet.Columns(i).AutoFit(0.95) + Catch ex As Exception + End Try + Next + + Dim IndexEndTable As Integer = Dt.Rows.Count + TotalRowHeader + TotalRowFooter + + worksheet.Rows(IndexEndTable).Cells(2).Value = "Usuario Imprimió" + worksheet.Rows(IndexEndTable + 1).Cells(2).Value = Usuario.Nombre + + worksheet.Rows(IndexEndTable).Cells(6).Value = "Fecha Impresión" + worksheet.Rows(IndexEndTable + 1).Cells(6).Value = DateTime.Now.ToString("dd/MM/yyyy") + + Dim Imagen As New System.IO.FileInfo($"{Usuario.Empresa.Ruta}/Logo.png") + + If Imagen.Exists Then + Dim Ruta As String = $"{Usuario.Empresa.Ruta}/Logo.png" + Using sr As New StreamReader(Ruta) + Dim ms As New MemoryStream() + sr.BaseStream.CopyTo(ms) + worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel) + End Using + End If + End If + + excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx") + + End Sub Private Sub RecursivoLimpiaControlesExcel(Controls As ControlCollection) For Each c As Control In Controls diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index 44ad73a30..5be0ee8b2 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -39,7 +39,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState FI = context.Request("start").ToDate FF = context.Request("end").ToDate - If Not GetEventos(CveUsuario, CveEmpresa, FI, FF, CveOS:=-2, CveUsuarioPara:=CveUsuarioPara, CveSubProyecto:=CveSubProyecto) Then + If Not GetEventos(CveUsuario, CveEmpresa, FI, FF, CveOS:=-2, CveUsuarioPara:=CveUsuarioPara, CveSubProyecto:=CveSubProyecto, context:=context) Then 'Convierte el objeto de Eventos en JSON 'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events) @@ -90,7 +90,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState End Property - Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date, Optional CveOS As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean + Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date, Optional CveOS As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional context As HttpContext = Nothing) As Boolean Dim ObjEventos As New ClsOIEventos Dim ErrorEventos = False Dim CveEmpresaCRM As Integer = 0 @@ -137,7 +137,20 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState End If - If ObjEventos.GetEventos(-1, -1, -1, "-1", "-1", -1, CveUsuario, CveUsuarioPara, -1, -1, -1, "-1", -1, -1, -1, -1, CveOS, -1, -1, -1, -1, -1, CveUsuario, CveUsuario, CveUsuario, CveEmpresa, pFI, pFF, CveSubProyecto:=CveSubProyecto) Then + + Dim EsCoordinador As Boolean = False + + If context IsNot Nothing AndAlso CveOS = -2 Then + Dim usuario As Usuario = UsuarioActual(context) + If usuario.TienePermisoProceso(348) Then + EsCoordinador = True + End If + End If + + + + + If ObjEventos.GetEventos(-1, -1, -1, "-1", "-1", -1, CveUsuario, CveUsuarioPara, -1, -1, -1, "-1", -1, -1, -1, -1, CveOS, -1, -1, -1, -1, -1, CveUsuario, CveUsuario, CveUsuario, CveEmpresa, pFI, pFF, CveSubProyecto:=CveSubProyecto, EsCoordinador:=EsCoordinador) Then If ObjEventos.DtResultados.Rows.Count > 0 Then events = New List(Of CalendarEvent) @@ -372,5 +385,11 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState Return ErrorEventos End Function + ReadOnly Property UsuarioActual(ByVal context As HttpContext) As Usuario + Get + UsuarioActual = DirectCast(context.Session("UsuarioSIG"), Usuario) + End Get + End Property + End Class \ No newline at end of file diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index b78140971..3dd1135b5 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -1232,14 +1232,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Private Function GETUMSAT(ByVal context As HttpContext) As String Dim retorno As String = "" - - If context.Application("GlobalDTPSATUM") Is Nothing Then - Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATUnidadMedida Then context.Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() Else context.Application("GlobalDTPSATUM") = Nothing - ObjGrales.Dispose() - End If - - Dim DTUM = DirectCast(context.Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow)) + Dim DTUM = ClsPaginas.GlobalDTPSATUM 'DirectCast(context.Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow)) Dim DtPSRetorno As DataTable Dim Name = IfNull(context.Request("Name"), "-1").ToString @@ -1271,14 +1264,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Private Function GETSATMaterialPeligroso(ByVal context As HttpContext) As String Dim retorno As String = "" - - If context.Application("GlobalDTMaterialPeligroso") Is Nothing Then - Dim ObjGrales As New ClsGenerales - If ObjGrales.GetMaterialPeligroso Then context.Application("GlobalDTMaterialPeligroso") = ObjGrales.DtResultados Else context.Application("GlobalDTMaterialPeligroso") = Nothing - ObjGrales.Dispose() - End If - - Dim DTUM = DirectCast(context.Application("GlobalDTMaterialPeligroso"), DataTable).AsEnumerable + Dim DTUM = DirectCast(ClsPaginas.GlobalDTMaterialPeligroso, DataTable).AsEnumerable Dim DtPSRetorno As DataTable Dim Name = IfNull(context.Request("Name"), "-1").ToString @@ -1308,14 +1294,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Private Function GETSATEmbalajes(ByVal context As HttpContext) As String Dim retorno As String = "" - - If context.Application("GlobalDTEmbalajes") Is Nothing Then - Dim ObjGrales As New ClsGenerales - If ObjGrales.GetEmbalajes Then context.Application("GlobalDTEmbalajes") = ObjGrales.DtResultados Else context.Application("GlobalDTEmbalajes") = Nothing - ObjGrales.Dispose() - End If - - Dim DTUM = DirectCast(context.Application("GlobalDTEmbalajes"), DataTable).AsEnumerable + Dim DTUM = DirectCast(ClsPaginas.GlobalDTEmbalajes, DataTable).AsEnumerable Dim DtPSRetorno As DataTable Dim Name = IfNull(context.Request("Name"), "-1").ToString @@ -1349,7 +1328,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Private Function GetFraccionArancelaria(ByVal context As HttpContext) As String Dim retorno As String = "" - Dim DT = DirectCast(context.Application("GlobalDTFraccionArancelaria"), EnumerableRowCollection(Of DataRow)) + Dim DT = ClsPaginas.GlobalDTFraccionArancelaria Dim DtRetorno As DataTable Dim Name = IfNull(context.Request("Name"), "-1").ToString diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 08241247b..d332bef65 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -1059,7 +1059,7 @@
-
+
<%----%> @@ -1071,8 +1071,10 @@ Agregar
--%> -
- + + +
+
diff --git a/Bancos/PopUpBuscarCuentasProveedor.aspx b/Bancos/PopUpBuscarCuentasProveedor.aspx new file mode 100644 index 000000000..5100e2023 --- /dev/null +++ b/Bancos/PopUpBuscarCuentasProveedor.aspx @@ -0,0 +1,164 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarCuentasProveedor.aspx.vb" Inherits="Bancos_PopUpBuscarCuentasProveedor" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + + + + + + + + +<%----%> + + + + + + + + + + + + + + + + + + +
Filtros para búsqueda
Proveedor: + + + + + +
+ +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+<%-- --%> +
+ + + + + diff --git a/Bancos/PopUpBuscarCuentasProveedor.aspx.vb b/Bancos/PopUpBuscarCuentasProveedor.aspx.vb new file mode 100644 index 000000000..48c16f351 --- /dev/null +++ b/Bancos/PopUpBuscarCuentasProveedor.aspx.vb @@ -0,0 +1,124 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Partial Class Bancos_PopUpBuscarCuentasProveedor + Inherits ClsPaginas + +#Region "Propiedades" + Private ReadOnly Property CveProveedor As Integer + Get + Return ViewState("CveProveedor").ToString.ToEntero + End Get + End Property + Private Property DTCuentasBancos As DataTable + Get + Return CType(ViewState("DTCuentasBancos"), DataTable) + End Get + Set(value As DataTable) + ViewState("DTCuentasBancos") = 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 + CType(Me.Master, BaseMasterPage).EsPopup = True + CType(Me.Master, BaseMasterPage).PopupWidth = 780 + RegistraScript("if($get('tdContenido')){$get('tdContenido').style.height='465px'}") + + If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then + ViewState("CveProveedor") = Request("CveProveedor") + CargaDatos(CveProveedor) + DdlProveedores.SelectedValue = CveProveedor.ToString + Else + ViewState("CveProveedor") = -1 + End If + + InicializaValores() + + Me.Form.DefaultButton = BtnBuscar.UniqueID + End If + End Sub + Private Sub InicializaValores() + Dim Txt As String = IfNull(Request("Txt"), "").ToString + If Txt <> "" Then LblTitulo.Text = String.Format("Búsqueda de {0}", Txt) + + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.SelectedText = "Seleccione" + DdlProveedores.SelectedValue = "-1" + DdlProveedores.DataBind() + End Sub + Private Sub CargaDatos(CveProveedor As Integer) + + If ValidarFiltrosSeleccionados() OrElse CveProveedor > 0 Then + CargaCuentasBancarias() + UPDatos.Update() + Else + Alert("Seleccione un proveedor", TipoMensaje.MsgAdvertencia) + End If + End Sub + + Private Sub CargaCuentasBancarias() + 'If CveProveedor <= 0 Then Exit Sub + Dim ObjCuentasBancos As New ClsGenerales + DTCuentasBancos = New DataTable + + If ObjCuentasBancos.GetCuentasDepositos(CveProveedor) Then + DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados) + Else + Alert("No se pudieron cargar las cuentas bancarias. Por favor intente nuevamente.", TipoMensaje.MsgAdvertencia) + ObjCuentasBancos.Dispose() + Exit Sub + End If + + If CveProveedor < 0 Then + 'Alert("No hay proveedor", TipoMensaje.MsgInformacion) + 'TempDTCuentasBancos = DTCuentasBancos + End If + + ObjCuentasBancos.Dispose() + CargaPSGridCuentasBancos() + RecargaGlobalCuentasBancarias() + End Sub + + Private Sub RecargaGlobalCuentasBancarias(Optional ByVal CveCuenta As Integer = -1) + If CveProveedor > 0 Then + Dim ObjCuentasBancos As New ClsGenerales + + If ObjCuentasBancos.GetCuentasDepositos() Then + GlobalDTProveedoresCuentas(-1, True) = ObjCuentasBancos.DtResultados + End If + ObjCuentasBancos.Dispose() + End If + End Sub + + Private Sub CargaPSGridCuentasBancos() + GvBancosCuentas.DataSource = DTCuentasBancos.FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue}") + GvBancosCuentas.DataBind() + TblBusqueda.Visible = True + UPDatos.Update() + End Sub + + Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click + CargaDatos(DdlProveedores.SelectedValue.ToEntero) + End Sub + + Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvBancosCuentas.RowDataBound + 'If e.Row.RowType = DataControlRowType.DataRow Then + ' If e.Row.DBCampo("CveAlmacen") = "" Then + ' e.Row.CssClass = "Totales" + ' End If + 'End If + End Sub + + Private Function ValidarFiltrosSeleccionados() As Boolean + If DdlProveedores.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function + +End Class diff --git a/Bin/GoCfdi.dll b/Bin/GoCfdi.dll index e25ec6628..7dbd0787b 100644 Binary files a/Bin/GoCfdi.dll and b/Bin/GoCfdi.dll differ diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index 5d694eff3..5b7fb8098 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -292,10 +292,16 @@ public partial class CRM_EmpresaCRM : ClsPaginas CargarTiposEventos(); LimitaFechasAcercamiento(); CargaDatos(); - if (CveEncuestaCRM > 0) - { - CargaDatosTecnicos(); - } + + //if( Request["CveEmpresaCRM"] != null) + //{ + if (CveEncuestaCRM > 0) + { + CargaDatosTecnicos(); + } + // } + + VerificaPermisos(); CargaClasificaciones(); DdlPS.setEsWebService(true); @@ -1476,8 +1482,11 @@ public partial class CRM_EmpresaCRM : ClsPaginas var responseGenericGetDatosTecnicosEmpresaCRM = encuestaService.GetDatosTecnicosEmpresaCRM(new RequestDatosTecnicosEmpresaCRMGet() { CveEmpresa = UsuarioActual.Empresa.CveEmpresa, CveEncuesta = CveEncuestaCRM, CveEncuestaAplicada = CveEncuestaAplicada, CvePregunta = -1 }); if (responseGenericGetDatosTecnicosEmpresaCRM.IsSuccess) { - GvDatosTecnicos.DataSource = responseGenericGetDatosTecnicosEmpresaCRM.Result; - if (responseGenericGetDatosTecnicosEmpresaCRM.Result.Count > 0) + + + var DTTemp = responseGenericGetDatosTecnicosEmpresaCRM.Result.ToDataTable(); + GvDatosTecnicos.DataSource = DTTemp; + if (DTTemp.Rows.Count > 0) { GvDatosTecnicos.Visible = true; } diff --git a/Compras/CatProveedores.aspx.vb b/Compras/CatProveedores.aspx.vb index 1c159186d..a46ae19af 100644 --- a/Compras/CatProveedores.aspx.vb +++ b/Compras/CatProveedores.aspx.vb @@ -280,114 +280,21 @@ Partial Class Compras_CatProveedores Protected Sub LnkCtasBancSinProveedor_Click(sender As Object, e As EventArgs) Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - Dim DtDatos As DataTable = Nothing + 'Dim GvDatosSC As New GridView With { .AutoGenerateColumns = True } Dim ObjComp As New ClsCompProveedores If ObjComp.GetProveedoresSinCuentas(UsuarioActual.CveEmpresa) Then - DtDatos = ObjComp.DtResultados.Copy() + DtDatos = ObjComp.DtResultados + 'GvDatosSC.DataBind() End If ObjComp.Dispose() If DtDatos IsNot Nothing Then DtDatos.TableName = "Proveedores" - GenerarReporteProveedoresSinCuentaExcel("Proveedores sin Cuentas Bancarias", DtDatos) + DtDatos.ExportToExcelG("Proveedores Sin Cuentas", "Proveedores sin Cuentas Bancarias", UsuarioActual) End If End Sub - Private Sub GenerarReporteProveedoresSinCuentaExcel(Titulo As String, DtDatos As DataTable) - Dim Retorno As New MemoryStream() - SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) - - Dim excel As ExcelFile = New ExcelFile - - Dim item = excel.Worksheets.Add(DtDatos.TableName) - item.InsertDataTable(DtDatos, New InsertDataTableOptions() With - { - .ColumnHeaders = True, - .StartRow = 0, - .StartColumn = 0 - }) - item.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255)) - item.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255) - - Dim columnCount = item.CalculateMaxUsedColumns() - For i = 0 To columnCount - item.Columns(i).AutoFit(1, item.Rows(i), item.Rows(item.Rows.Count - 1)) - Next - - Dim TotalRowHeader As Integer = 8 - Dim TotalRowFooter As Integer = 2 - - Dim worksheet = excel.Worksheets(0) - worksheet.Rows.InsertEmpty(0, TotalRowHeader) - Dim celdasConTexto = worksheet.GetUsedCellRange(True) - celdasConTexto.Style.Font.Name = "Calibri Light" - - Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex) - RangoNombreEmpresa.Merged = True - RangoNombreEmpresa.Value = UsuarioActual.Empresa.Empresa - RangoNombreEmpresa.Style.Font.Size = 18 * 20 - RangoNombreEmpresa.Style.Font.Name = "Calibri Light" - RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - - 'Dim RangoFiltros = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex) - 'RangoFiltros.Merged = True - 'RangoFiltros.Value = Filtros - 'RangoFiltros.Style.Font.Size = 15 * 20 - 'RangoFiltros.Style.Font.Name = "Calibri Light" - 'RangoFiltros.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left - 'RangoFiltros.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - - Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex) - RangoTitulo.Merged = True - RangoTitulo.Value = Titulo - RangoTitulo.Style.Font.Size = 20 * 20 - RangoTitulo.Style.Font.Name = "Calibri Light" - RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex - worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20 - worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)) - worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) - If i > 0 Then - Try - worksheet.Columns(i).AutoFit(1) - Catch ex As Exception - End Try - End If - Next - - Dim IndexEndTable As Integer = DtDatos.Rows.Count + TotalRowHeader + TotalRowFooter - - worksheet.Rows(IndexEndTable).Cells(2).Value = "Usuario Imprimió" - worksheet.Rows(IndexEndTable + 1).Cells(2).Value = UsuarioActual.Nombre - - worksheet.Rows(IndexEndTable).Cells(6).Value = "Fecha Impresión" - worksheet.Rows(IndexEndTable + 1).Cells(6).Value = DateTime.Now.ToString("dd/MM/yyyy") - - Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") - - If Imagen.Exists Then - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, UsuarioActual.CveEmpresa) - Using webClient As New Net.WebClient() - Dim imageBytes = webClient.DownloadData(logouri) - Dim stream As New MemoryStream(imageBytes) - worksheet.Pictures.Add(stream, ExcelPictureFormat.Png, "A1", 100, 100, LengthUnit.Pixel) - 'worksheet.Pictures.Add(stream, GemBox.Spreadsheet.ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, GemBox.Document.LengthUnit.Pixel) - End Using - End If - - - excel.Save(Response, "Proveedores Sin Cuentas.xlsx", SaveOptions.XlsxDefault) - - End Sub End Class diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index b68c99bc0..004593a48 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6481,6 +6481,7 @@ Partial Class Compras_Compras ' si agrego en almacen, ya no se ocupa algun concepto puente AgregaMercanciaInventario = False End If + Next End If End If @@ -8195,7 +8196,7 @@ Partial Class Compras_Compras End If 'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA - If UsuarioActual.CveEmpresa.Contiene(1, 119, 141) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then If ObjCompras.GetComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, UsuarioActual.CveEmpresa) Then Dim CvePreComprobacion As Integer If ObjCompras.DtResultados.Rows.Count = 0 Then @@ -9654,7 +9655,7 @@ Partial Class Compras_Compras 'COSTO ALMACEN Dim DtAlmacenes = GlobalDTAlmacen(UsuarioActual.CveEmpresa) - If UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen = 0 Then + If UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen = 0 Or DdlTipoCompra.SelectedValue.ToEntero = 10 Then DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"}) 'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 26a459684..d6440f523 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -3834,6 +3834,8 @@ Partial Class Compras_Proveedores Private Sub ImprimirReporteCxPCrystal(Optional Formato As String = "PDF") Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepProveedorCxP.rpt", UsuarioActual.Empresa.Ruta)) + Dim RutaReporteGrales As New System.IO.FileInfo($"{DirectorioEmpresas}Grales\Formatos\RepProveedorCxP.rpt") + Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") Dim DTCxPTempral As DataTable = Nothing @@ -3881,7 +3883,7 @@ Partial Class Compras_Proveedores If Archivo.Exists Then ImprimirbytesPDF(ImprimirSubRepPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepProveedorCxP.rpt", DTCxPTempral, lista, DTCxPTempral, dtnc, "Ing", "Ant", "Estado de cuenta", Formato), "Estado de cuenta", Formato) Else - ImprimirbytesPDF(ImprimirSubRepPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/RepProveedorCxP.rpt"), DTCxPTempral, lista, DTCxPTempral, dtnc, "Ing", "Ant", "Estado de cuenta", Formato), "Estado de cuenta", Formato) + ImprimirbytesPDF(ImprimirSubRepPDFCrystal(RutaReporteGrales.FullName, DTCxPTempral, lista, DTCxPTempral, dtnc, "Ing", "Ant", "Estado de cuenta", Formato), "Estado de cuenta", Formato) End If End If diff --git a/Compras/RepComprasAFDetalle.aspx b/Compras/RepComprasAFDetalle.aspx index bb5fbd9fa..98c3f24f4 100644 --- a/Compras/RepComprasAFDetalle.aspx +++ b/Compras/RepComprasAFDetalle.aspx @@ -8,6 +8,9 @@ max-width:600px; width:600px; } + .margenbound { + text-align: right; + } @@ -16,12 +19,20 @@ -
  • - Generar PDF -
  • -
  • - Generar Excel -
  • + + +
  • + Generar PDF +
  • +
  • + Generar Excel +
  • +
  • + Personalizar +
  • +
  • + Excel Personalizado +
  • Ver Dlls en pesos
  • @@ -29,6 +40,13 @@ <%-- --%>   +
    + + + + + +
    @@ -150,13 +168,9 @@
    - - -
    Proyecto:
    -
    @@ -164,7 +178,6 @@ SubProyecto:
    -
    @@ -212,153 +225,31 @@
    - - - - - Factura - - - - - - - - - - SubProyecto - - - - - - - - - ActivoFijo - - - <%----%> - - - - - - - No. Serie - - - - - - - - - Producto - - - - - - - - - - Responsable - - - - - - - - - Horometro/Odometro - - - - - - - - - - Tipo Mantenimiento - - - - - - - - - Clasificación 2 - - - - - - - - - - - - - Unidad de Medida - - - - - - - - - Cantidad - - - - - - - - - PU - - - - - - - - - Total - - - - - - - - - Cuenta - - - - - - + + + + + + + + + + + + + + + + + + + - <%-- - --%>
    - - - + + + + + diff --git a/Compras/RepComprasAFDetalle.aspx.vb b/Compras/RepComprasAFDetalle.aspx.vb index 5b19beed7..9077f17ce 100644 --- a/Compras/RepComprasAFDetalle.aspx.vb +++ b/Compras/RepComprasAFDetalle.aspx.vb @@ -82,12 +82,13 @@ Partial Class Compras_RepComprasAFDetalle #End Region + Private Personalizado As Boolean = False + Private Sub Compras_RepComprasAFDetalle_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then CargaCombos() 'ImgPersonalizar.Attributes.Add("onclick", "javascript:$('#DivPersonalizar').show(1000); PosicionaObjeto(this.id,'DivPersonalizar');") - - + GvDatos.DataBind(True) Try Dim Fecha, FechaI, FechaF As String @@ -163,9 +164,11 @@ Partial Class Compras_RepComprasAFDetalle End If If UsuarioActual.CveEmpresa = 72 Then - GvDatos.Columns(3).Visible = True + GvDatos.FBColumn("NoSerie").Visible = True End If + UPDatos.Update() + End If End Sub @@ -226,31 +229,7 @@ Partial Class Compras_RepComprasAFDetalle DdlPS.ddl.Items.Add(New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2")) End If - If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then - DdlProyecto.Visible = False - LblSubProyecto.Text = "Sucursal" - LblProyecto.Visible = False - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - DdlProyecto.Visible = False - LblSubProyecto.Text = "Proyecto" - LblProyecto.Visible = False - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Or UsuarioActual.Empresa.Tipo_CentroCosto = 0 Then - LblProyecto.Text = "Proyecto" - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then - LblProyecto.Text = "Sucursal" - LblSubProyecto.Text = "Proyecto" - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then - LblProyecto.Text = "Proyecto" - LblSubProyecto.Text = "Sucursal" - End If - + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) End Sub @@ -264,15 +243,19 @@ Partial Class Compras_RepComprasAFDetalle End Sub Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged - CargaSubProyecto() + If DdlProyecto.SelectedValue = "-1" Then + DdlProyecto.Items.Clear() + DdlSubProyecto.Items.Clear() + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) + Else + CargaSubProyecto() + End If End Sub Private Sub CargaSubProyecto() - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros(String.Format("CveProyecto = {0}", DdlProyecto.SelectedValue), "SubProyecto") DdlSubProyecto.DataBind() DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - End Sub Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click CargaDatos() @@ -304,18 +287,12 @@ Partial Class Compras_RepComprasAFDetalle CvePS, Anio.ToEntero, Mes.ToEntero, AnioMes, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClasificacion2:=DdlClasificacion2.SelectedValue.ToEntero) Then DTDatos = ObjCompras.DtResultados - GvDatos.DataSource = ObjCompras.DtResultados - Else - GvDatos.DataSource = Nothing - DTDatos = Nothing + GvDatos.DataSource = DTDatos End If - ObjCompras.Dispose() - GvDatos.DataBind() - - - + GvDatos.DataBind(True) + UPDatos.Update() End Sub Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound @@ -360,6 +337,9 @@ Partial Class Compras_RepComprasAFDetalle Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click GenerarPDF() End Sub + Private Sub LnkExcelPersonalizado_Click(sender As Object, e As EventArgs) Handles LnkExcelPersonalizado.Click + GvDatos.ExportToExcel("ComprasDetalle_" + DdlPS.txtValue.Value + Now.ToShortDateString) + End Sub Private Sub GenerarPDF(Optional Formato As String = "PDF") Dim ObjTareas As New ClsOIEventos @@ -372,12 +352,8 @@ Partial Class Compras_RepComprasAFDetalle End If Dim params As New List(Of ReportParameter) - - - Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") - Dim FechaI, FechaF As String FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) @@ -390,7 +366,6 @@ Partial Class Compras_RepComprasAFDetalle params.Add(New ReportParameter("FechaFin", FechaF)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) - params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) ImprimirPDF(RutaPDF, DTDatos, params, "ReporteComprasAFDetalle_" & Now.ToString("yyyyMMddmmss"), Formato:=Formato) @@ -502,4 +477,38 @@ Partial Class Compras_RepComprasAFDetalle End If End Sub + + Protected Sub PersonalizarColumnas() + GvDatos.FBColumn("SerieFolio").Visible = ChkFactura.Checked + GvDatos.FBColumn("SubProyecto").Visible = ChkSubProyecto.Checked + GvDatos.FBColumn("CodigoAF").Visible = ChkAF.Checked + GvDatos.FBColumn("NoSerie").Visible = ChkNS.Checked + GvDatos.FBColumn("CodigoPS").Visible = ChkPS.Checked + GvDatos.FBColumn("NombreCompleto").Visible = ChkResp.Checked + GvDatos.FBColumn("AFMedida").Visible = ChkMedidaAF.Checked + GvDatos.FBColumn("AFTipoMantenimientoStr").Visible = ChkTipoMant.Checked + GvDatos.FBColumn("TipoActivoFijo").Visible = ChkTipoAF.Checked + GvDatos.FBColumn("SubTipoActivoFijo").Visible = ChkSubTipoAF.Checked + GvDatos.FBColumn("Clasificacion").Visible = ChkClasif.Checked + GvDatos.FBColumn("Clasificacion2").Visible = ChkClasif2.Checked + GvDatos.FBColumn("UnidadMedida").Visible = ChkUM.Checked + GvDatos.FBColumn("Cantidad").Visible = ChkCant.Checked + GvDatos.FBColumn("PU").Visible = ChkPU.Checked + GvDatos.FBColumn("Total").Visible = ChkTotal.Checked + GvDatos.FBColumn("Cuenta").Visible = ChkCuenta.Checked + UPDatos.Update() + + If Personalizado Then + LnkExcelPersonalizado.Visible = True + Else + LnkExcelPersonalizado.Visible = False + End If + UPAcciones.Update() + End Sub + + Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click + Personalizado = True + PersonalizarColumnas() + End Sub + End Class \ No newline at end of file diff --git a/Compras/RepComprasDetalle.aspx b/Compras/RepComprasDetalle.aspx index 050c2e50b..7810abe27 100644 --- a/Compras/RepComprasDetalle.aspx +++ b/Compras/RepComprasDetalle.aspx @@ -310,6 +310,17 @@ + + + + Folio Fiscal + + + + + + + Cant. @@ -477,30 +488,32 @@ - + - + + - + + - + - + diff --git a/Compras/RepComprasDetalle.aspx.vb b/Compras/RepComprasDetalle.aspx.vb index cdd24ed20..69b15621a 100644 --- a/Compras/RepComprasDetalle.aspx.vb +++ b/Compras/RepComprasDetalle.aspx.vb @@ -165,8 +165,7 @@ Partial Class Compras_RepComprasDetalle ChkDesc.Checked = True ChkTotal.Checked = True ChkAbre.Checked = True - ChkRazon.Checked = True - ChkFolio.Checked = True + ChkRazon.Checked = True ChkFecha.Checked = True ChkObs.Checked = True @@ -596,18 +595,19 @@ Partial Class Compras_RepComprasDetalle #End Region Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click - GvDatos.Columns(4).Visible = ChkIVA.Checked - GvDatos.Columns(5).Visible = ChkIEPS.Checked - GvDatos.Columns(6).Visible = ChkDesc.Checked - GvDatos.Columns(7).Visible = Chkretiva.Checked - GvDatos.Columns(8).Visible = Chkretisr.Checked - GvDatos.Columns(9).Visible = ChkTotal.Checked - GvDatos.Columns(10).Visible = ChkAbre.Checked - GvDatos.Columns(11).Visible = ChkRazon.Checked - GvDatos.Columns(12).Visible = ChkFolio.Checked - GvDatos.Columns(13).Visible = ChkFecha.Checked - GvDatos.Columns(14).Visible = ChkObs.Checked - GvDatos.Columns(15).Visible = ChkDescripcion.Checked + GvDatos.Columns(2).Visible = ChkFolio.Checked + GvDatos.Columns(5).Visible = ChkIVA.Checked + GvDatos.Columns(6).Visible = ChkIEPS.Checked + GvDatos.Columns(7).Visible = ChkDesc.Checked + GvDatos.Columns(8).Visible = ChkRetIVA.Checked + GvDatos.Columns(9).Visible = ChkRetISR.Checked + GvDatos.Columns(10).Visible = ChkTotal.Checked + GvDatos.Columns(11).Visible = ChkAbre.Checked + GvDatos.Columns(12).Visible = ChkRazon.Checked + GvDatos.Columns(13).Visible = ChkFolioInv.Checked + GvDatos.Columns(14).Visible = ChkFecha.Checked + GvDatos.Columns(15).Visible = ChkObs.Checked + GvDatos.Columns(16).Visible = ChkDescripcion.Checked UPDatos.Update() End Sub diff --git a/Compras/RepProductosServiciosDetalle.aspx - copia.vb b/Compras/RepProductosServiciosDetalle.aspx - copia.vb deleted file mode 100644 index 9e308e6f7..000000000 --- a/Compras/RepProductosServiciosDetalle.aspx - copia.vb +++ /dev/null @@ -1,437 +0,0 @@ -Option Explicit On -Option Strict On - -Imports Microsoft.Reporting.WebForms -Imports Extensiones -Imports System.Data -Partial Class Compras_RepProductosServiciosDetalle - Inherits ClsPaginas - -#Region "PROPIEDADES" - Private Property DtDatos As DataTable - Get - Return CType(ViewState("DtDatos"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtDatos") = value - End Set - End Property - Private Property CveMoneda As Integer - Get - Return ViewState("CveMoneda").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("CveMoneda") = value - End Set - End Property -#End Region - - Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not IsPostBack Then - If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx") - CargaCombos() - CargaTipoCentroCosto() - Dim Grupo, Proyecto, SubProyecto, Categoria, Clasificacion, PS, Proveedor, Estatus, Usuario, Familia, SubFamilia, TipoActivoFijo, SubTipoActivoFijo, ActivoFijo, TipoGasto As String - Dim Anio, Mes, AnioMes, Fecha, FechaI, FechaF As String - - Grupo = If(Request("GPO") IsNot Nothing AndAlso Request("GPO").ToEntero() > 0, Request("GPO").ToEntero(), -1).ToString - Proyecto = If(Request("CveProyecto") IsNot Nothing AndAlso Request("CveProyecto").ToEntero() > 0, Request("CveProyecto").ToEntero(), -1).ToString - SubProyecto = If(Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto").ToEntero() > 0, Request("CveSubProyecto").ToEntero(), -1).ToString - SubProyecto = If(Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto").ToEntero() = -2, "-2", SubProyecto) - Categoria = If(Request("CveCategoria") IsNot Nothing AndAlso Request("CveCategoria").ToEntero() > 0, Request("CveCategoria").ToEntero(), -1).ToString - Clasificacion = If(Request("CveClasificacion") IsNot Nothing AndAlso Request("CveClasificacion").ToEntero() > 0, Request("CveClasificacion").ToEntero(), -1).ToString - PS = If(Request("CvePS") IsNot Nothing AndAlso Request("CvePS").ToEntero() > 0, Request("CvePS").ToEntero(), -1).ToString - Proveedor = If(Request("CveProveedor") IsNot Nothing AndAlso Request("CveProveedor").ToEntero() > 0, Request("CveProveedor").ToEntero(), -1).ToString - Estatus = If(Request("CveEstatusFactura") IsNot Nothing AndAlso Request("CveEstatusFactura").ToEntero() > 0, Request("CveEstatusFactura").ToEntero(), -1).ToString - Usuario = If(Request("CveUsuario") IsNot Nothing AndAlso Request("CveUsuario").ToEntero() > 0, Request("CveUsuario").ToEntero(), -1).ToString - Familia = If(Request("CveFamilia") IsNot Nothing AndAlso Request("CveFamilia").ToEntero() > -3, Request("CveFamilia").ToEntero(), -1).ToString - SubFamilia = If(Request("CveSubFamilia") IsNot Nothing AndAlso Request("CveSubFamilia").ToEntero() > -3, Request("CveSubFamilia").ToEntero(), -1).ToString - TipoActivoFijo = If(Request("CveTipoAF") IsNot Nothing AndAlso Request("CveTipoAF").ToEntero() > 0, Request("CveTipoAF").ToEntero(), -1).ToString - SubTipoActivoFijo = If(Request("CveSubTipoAF") IsNot Nothing AndAlso Request("CveSubTipoAF").ToEntero() > 0, Request("CveSubTipoAF").ToEntero(), -1).ToString - ActivoFijo = If(Request("CveAF") IsNot Nothing AndAlso Request("CveAF").ToEntero() > 0, Request("CveAF").ToEntero(), -1).ToString - CveMoneda = If(Request("CveMoneda") IsNot Nothing AndAlso Request("CveMoneda").ToEntero() > 0, Request("CveMoneda").ToEntero(), -1).ToString.ToEntero - TipoGasto = If(Request("CveTipoGasto") IsNot Nothing AndAlso Request("CveTipoGasto").ToEntero > 0, Request("CveTipoGasto").ToEntero(), -1).ToString - Anio = If(Request("Anio") IsNot Nothing, Request("Anio").ToString, "-1").ToString - Mes = If(Request("Mes") IsNot Nothing, Request("Mes").ToString, "-1").ToString - AnioMes = If(Request("AnioMes") IsNot Nothing, Request("AnioMes").ToString, "-1").ToString - Fecha = If(Request("Fecha") IsNot Nothing, Request("Fecha").ToString, "-1").ToString - FechaI = If(Request("FechaI") IsNot Nothing, Request("FechaI").ToString, "-1").ToString - FechaF = If(Request("FechaF") IsNot Nothing, Request("FechaF").ToString, "-1").ToString - - txtFechaI.Text = If(Anio <> "-1", String.Format("01/01/{0}", Anio), txtFechaI.Text) - txtFechaI.Text = If(Mes <> "-1", String.Format("01/{0}/0001", Mes), txtFechaI.Text) - txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text) - - If Fecha <> "-1" Then - txtFechaI.Text = Fecha - txtFechaF.Text = Fecha - Else - If FechaI <> "-1" Then - txtFechaI.Text = FechaI - End If - If FechaF <> "-1" Then - txtFechaF.Text = FechaF - End If - End If - - DdlCategoria.SelectedValue = Categoria - - If Clasificacion.ToEntero > 0 Then - CargaClasificaciones(DdlCategoria.SelectedValue.ToEntero) - DdlClasificacion.SelectedValueExist(Clasificacion) - End If - - DdlPS.SelectedValue = PS - DdlProyecto.SelectedValue = Proyecto - DdlSubProyecto.SelectedValue = SubProyecto - DdlFamilia.SelectedValue = Familia - DdlSubFamilia.SelectedValue = SubFamilia - DdlProveedor.SelectedValue = Proveedor - DdlEstatus.SelectedValue = Estatus - DdlUsuario.SelectedValue = Usuario - DdlTipoAF.SelectedValue = TipoActivoFijo - DdlTipoGasto.SelectedValueExist(TipoGasto) - DdlSubTipoAF.SelectedValue = SubTipoActivoFijo - DdlAF.SelectedValue = ActivoFijo - - CargaDatos(Proyecto.ToEntero, SubProyecto.ToEntero, Categoria.ToEntero, Clasificacion.ToEntero, PS.ToEntero, Proveedor.ToEntero, Usuario.ToEntero, Estatus.ToEntero, Grupo.ToEntero, Familia.ToEntero, SubFamilia.ToEntero, TipoActivoFijo.ToEntero, SubTipoActivoFijo.ToEntero, ActivoFijo.ToEntero, TipoGasto.ToEntero) - End If - End Sub - - Private Sub CargaTipoCentroCosto() - If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then - DdlSubProyecto.Items.Clear() - TdProyecto.Visible = False - TdProyecto2.Visible = False - LtSubProyecto.Text = "Sucursal:" - - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyecto.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - DdlSubProyecto.Items.Clear() - TdProyecto.Visible = False - TdProyecto2.Visible = False - LtSubProyecto.Text = "Proyecto:" - - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubProyecto.DataBind() - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then - TdProyecto.InnerText = "Sucursal:" - LtSubProyecto.Text = "Proyecto:" - - - ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then - TdProyecto.InnerText = "Proyecto:" - LtSubProyecto.Text = "Sucursal:" - - End If - End Sub - Private Sub CargaCombos() - 'Cargo Proyectos - DdlProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) - DdlProyecto.DataBind() - - 'Cargo Categorias - DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa) - DdlCategoria.DataBind() - - DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) - DdlTipoGasto.DataBind() - - 'CargaProveedor - DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - DdlProveedor.DataBind() - - 'CargaUsuarios - DdlUsuario.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DdlUsuario.DataBind() - - 'CargaEstatus - DdlEstatus.DataSource = GlobalDTCompEstatusFactura - DdlEstatus.DataBind() - - - 'CARGA COSTOS - If UsuarioActual.CveEmpresa = 66 Then - - 'COSTOS PROYECTO - RowCostos.Visible = True - - 'Carga Familias - DdlFamilia.DataSource = GlobalDTFamilias(66) - DdlFamilia.DataBind() - - 'Carga SubFamilias - DdlSubFamilia.DataSource = GlobalDTSubFamilias(66) - DdlSubFamilia.DataBind() - - 'COSTOS AF - RowActivoFijo.Visible = True - - 'Carga Tipos AF - DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(66) - DdlTipoAF.DataBind() - - 'Carga SubTipos AF - DdlSubTipoAF.DataSource = GlobalDTSubTipoActivoFijo(66) - DdlSubTipoAF.DataBind() - - 'Carga AF - 'DdlAF.DataSource = GlobalDTActivoFijos().FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa)) - 'DdlAF.DataBind() - - End If - - If UsuarioActual.Empresa.GralSoloProyecto Then - TdProyecto.Visible = False - TdProyecto2.Visible = False - LtSubProyecto.Text = "Proyecto" - - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) - DdlSubProyecto.DataBind() - End If - - End Sub - - Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click - CargaDatos() - End Sub - - Private Sub CargaDatos() - Dim ObjCompras As New ClsCompras() - - Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) - Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha) - Dim TCEspecifico = If(TxtEspecifico.Text.Trim = "", -1, TxtEspecifico.Text.ToEntero) - If ObjCompras.GetRepProductosServiciosDetalle(DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, - DdlPS.SelectedValue.ToEntero, FechaI, FechaF, DdlProveedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, - UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlFamilia.SelectedValue.ToEntero, DdlSubFamilia.SelectedValue.ToEntero, DdlTipoAF.SelectedValue.ToEntero, DdlSubTipoAF.SelectedValue.ToEntero, DdlAF.SelectedValue.ToEntero, CveMoneda, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, TipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - DtDatos = ObjCompras.DtResultados - Else - DtDatos = Nothing - End If - ObjCompras.Dispose() - CargaGrid("") - End Sub - - Private Sub CargaDatos(Proyecto As Integer, SubProyecto As Integer, Categoria As Integer, Clasificacion As Integer, PS As Integer, Proveedor As Integer, Usuario As Integer, Estatus As Integer, Grupo As Integer, Familia As Integer, SubFamilia As Integer, TipoActivoFijo As Integer, SubTipoActivoFijo As Integer, ActivoFijo As Integer, TipoGasto As Integer) - Dim ObjCompras As New ClsCompras() - - Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) - Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha) - Dim TCEspecifico = If(TxtEspecifico.Text.Trim = "", -1, TxtEspecifico.Text.ToEntero) - - If ObjCompras.GetRepProductosServiciosDetalle(Proyecto, SubProyecto, Categoria, Clasificacion, PS, FechaI, FechaF, Proveedor, Usuario, Estatus, UsuarioActual.CveEmpresa, Grupo, Familia, SubFamilia, TipoActivoFijo, SubTipoActivoFijo, ActivoFijo, CveMoneda, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, TipoGasto:=TipoGasto, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - DtDatos = ObjCompras.DtResultados - Else - DtDatos = Nothing - End If - ObjCompras.Dispose() - CargaGrid("") - End Sub - - -#Region " D R O P - D O W N S | SELECT INDEX CHANGED" - Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged - DdlSubProyecto.Items.Clear() - If DdlProyecto.SelectedValue <> "-1" Then - DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero) - DdlSubProyecto.DataBind() - End If - DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub - - Protected Sub DdlCategoria_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCategoria.SelectedIndexChanged - CargaClasificaciones(DdlCategoria.SelectedValue.ToEntero) - End Sub - - Private Sub CargaClasificaciones(CveCategoria As Integer) - DdlClasificacion.Items.Clear() - If DdlCategoria.SelectedValue <> "-1" Then - DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveCategoria:=CveCategoria) - DdlClasificacion.DataBind() - End If - DdlClasificacion.Items.Insert(0, New ListItem("Todas", "-1")) - End Sub - - Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacion.SelectedIndexChanged - DdlPS.Items.Clear() - If DdlClasificacion.SelectedValue <> "-1" Then - DdlPS.DataSource = GlobalDTProductosServicios(UsuarioActual.CveEmpresa) - DdlPS.DataBind() - End If - DdlSubFamilia.Items.Insert(0, New ListItem("Sin Asignar", "-2")) - DdlPS.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub - Protected Sub DdlFamilia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFamilia.SelectedIndexChanged - DdlSubFamilia.Items.Clear() - - If DdlFamilia.SelectedValue <> "-1" Then - DdlSubFamilia.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa, DdlFamilia.SelectedValue.ToEntero) - DdlSubFamilia.DataBind() - Else - DdlSubFamilia.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa) - DdlSubFamilia.DataBind() - End If - - DdlSubFamilia.Items.Insert(0, New ListItem("Todas", "-1")) - End Sub - Protected Sub DdlTipoAF_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoAF.SelectedIndexChanged - DdlSubTipoAF.Items.Clear() - - If DdlTipoAF.SelectedValue <> "-1" Then - DdlSubTipoAF.DataSource = GlobalDTSubTipoActivoFijo(66).FiltraParametros(String.Format("CveTipoActivoFijo = {0}", DdlTipoAF.SelectedValue.ToEntero)) - DdlSubTipoAF.DataBind() - Else - DdlSubTipoAF.DataSource = GlobalDTSubTipoActivoFijo(66) - DdlSubTipoAF.DataBind() - End If - - DdlSubTipoAF.Items.Insert(0, New ListItem("Todas", "-1")) - End Sub - Protected Sub DdlSubTipoAF_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubTipoAF.SelectedIndexChanged - DdlAF.Items.Clear() - - If DdlSubTipoAF.SelectedValue <> "-1" Then - DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, DdlSubTipoAF.SelectedValue.ToEntero) - DdlAF.DataBind() - 'Else - ' DdlAF.DataSource = GlobalDTSubTipoActivoFijo(66) - ' DdlAF.DataBind() - End If - - DdlAF.Items.Insert(0, New ListItem("Todas", "-1")) - End Sub -#End Region - - Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("Orden") = "" AndAlso e.Row.DBCampo("RazonSocial") = "" Then - e.Row.CssClass = "Totales" - End If - e.Row.Cells(6).Width = Unit.Pixel(100) - e.Row.Cells(3).Width = Unit.Pixel(80) - End If - End Sub - -#Region "tipo Cambio" - Private Sub RblTipoCambio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipoCambio.SelectedIndexChanged - If RblTipoCambio.SelectedValue.ToEntero = 3 Then - Dim TipoCambio As Double - LiEspecifico.Visible = True - TipoCambio = GlobalTipoCambio(Now) - TxtEspecifico.Text = TipoCambio.ToString - Else - LiEspecifico.Visible = False - End If - UpBodyTipoCambio.Update() - End Sub - - Private Sub BtnTipoCambio_Click(sender As Object, e As EventArgs) Handles BtnTipoCambio.Click - CargaDatos() - RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio")) - UPDatos.Update() - End Sub -#End Region - - -#Region "O R D E N A M I E N T O" - Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs) - Dim Orden As String = "" - Dim Campo As String = "" - Dim Literal As Literal = Nothing - Const OrdenInicial As String = "" - Dim Arg(2) As String - - Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c) - Campo = Arg(0) - Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal) - - If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then - ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo) - Literal.Text = String.Format("") - Else - ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) - Literal.Text = String.Format("") - End If - Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString - ViewState("Orden") = Orden - CargaGrid(Orden) - End Sub - - Protected Sub CargaGrid(Orden As String) - Dim DV As DataView = Nothing - DV = New DataView(DtDatos, "", Orden, DataViewRowState.CurrentRows) - If Orden <> String.Empty Then - GvDatos.DataSource = DV.ToTable() - Else - GvDatos.DataSource = DtDatos - End If - - GvDatos.DataBind() - UPDatos.Update() - DV.Dispose() - End Sub -#End Region - - -#Region " IMPRESION - NUEVO " - Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click - GenerarPDF("EXCEL") - End Sub - - Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click - GenerarPDF() - End Sub - - Private Sub GenerarPDF(Optional Formato As String = "PDF") - - Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) - Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha) - If txtFechaI.Text = "" Then FechaI = "-1".ToDate - If txtFechaF.Text = "" Then FechaF = "-1".ToDate - Dim Grupo = If(DdlGrupo.SelectedValue = "-1", "", $" Grupo: {DdlGrupo.SelectedItem.Text}") - Dim Proyecto = If(DdlProyecto.SelectedValue = "-1", "", $" Proyecto: {DdlProyecto.SelectedItem.Text}") - Dim SubProyecto = If(DdlSubProyecto.SelectedValue = "-1", "", $" SubProyecto: {DdlSubProyecto.SelectedItem.Text}") - Dim Categoria = If(DdlCategoria.SelectedValue = "-1", "", $" Categoria: {DdlCategoria.SelectedItem.Text}") - Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $" Clasificación: {DdlClasificacion.SelectedItem.Text}") - Dim PS = If(DdlPS.SelectedValue = "-1", "", $" P.S: {DdlPS.SelectedItem.Text}") - Dim Proveedor = If(DdlProveedor.SelectedValue = "-1", "", $" Proveedor: {DdlProveedor.SelectedItem.Text}") - Dim Estatus = If(DdlEstatus.SelectedValue = "-1", "", $" Estatus: {DdlEstatus.SelectedItem.Text}") - Dim TipoAF = If(DdlTipoAF.SelectedValue = "-1", "", $" Tipo AF: {DdlTipoAF.SelectedItem.Text}") - Dim FechaIn As String = $" Fecha Inicio: {txtFechaI.Text}" - Dim FechaFn As String = $" Fecha Fin: {txtFechaF.Text}" - If txtFechaI.Text = "" Then FechaIn = "" - If txtFechaF.Text = "" Then FechaFn = "" - - Dim TCEspecifico = If(TxtEspecifico.Text.Trim = "", -1, TxtEspecifico.Text.ToEntero) - - If DtDatos.Rows.Count > 0 Then - Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - - Dim params As New List(Of ReportParameter) - params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) - 'params.Add(New ReportParameter("FechaInicio", FechaI)) - 'params.Add(New ReportParameter("FechaFin", FechaF)) - params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) - params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) - params.Add(New ReportParameter("AgrupoPor", $"{Grupo}{Proyecto}{SubProyecto}{Categoria}{Clasificacion}{PS}{Proveedor}{Estatus}{TipoAF}{FechaIn}{FechaFn}")) - - If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) - Else - params.Add(New ReportParameter("LogoPath", "")) - End If - ImprimirPDF("Empresas/Grales/Formatos/RepProductosServiciosDetalleCompra.rdlc", DtDatos, params, "ReportePSDetalle", Formato) - Else - Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) - End If - - End Sub -#End Region - -End Class diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index e6c8b6d2f..36eeebc3f 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -81,18 +81,25 @@ Imprimir Poliza + <%--
  • + Imprimir PDF Resumen +
  • --%> + <%--
  • + Imprimir Excel Resumen +
  • --%> - - -
  • - Agregar Concepto -
  • -
  • - Crear a partir de -
  • -
    -
    + + +
  • + + Agregar Concepto +
  • +
  • + Crear a partir de +
  • +
    +
    diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index c17a2cb31..9c536f0ec 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1,5 +1,7 @@  Imports System.Data +Imports System.Net.NetworkInformation +'Imports DocumentFormat.OpenXml Imports Extensiones Imports GemBox.Spreadsheet Imports Microsoft.Reporting.WebForms @@ -249,6 +251,12 @@ Partial Class ContabilidadC_RegPrePolizaS Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then + + 'If UsuarioActual.Empresa.Funcionalidad(282).ToEntero > 0 Then + ' LnkImprimePDFResumen.Visible = True + ' LnkImprimeExcelResumen.Visible = True + 'End If + Tick = DateTime.Now.Ticks.ToString CveMoneda = 1 @@ -360,6 +368,8 @@ Partial Class ContabilidadC_RegPrePolizaS GvMov.Columns(5).Visible = False End If + + End If End Sub @@ -2714,10 +2724,20 @@ Partial Class ContabilidadC_RegPrePolizaS #Region "Paquete Egresos" Protected Sub LnkImprimirPDF_Click(sender As Object, e As EventArgs) - ImprimirPolizaPDF(IdPoliza) + + + If UsuarioActual.Empresa.Funcionalidad(282).ToEntero = 1 Then + + ImprimePrePolizasDetalleResumen("PDF") + Else + ImprimirPolizaPDF(IdPoliza) + + End If + + End Sub - Private Function ImprimirPolizaPDF(IdPoliza As Integer) As String - Dim ObjConta As New ClsContabilidad + Private Sub ImprimirPolizaPDF(IdPoliza As Integer) + 'Dim ObjPoliza As New ClsContPAQi(UsuarioActual.Empresa) Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) @@ -2725,6 +2745,7 @@ Partial Class ContabilidadC_RegPrePolizaS Dim Bytes As Byte() = Nothing + Dim ObjConta As New ClsContabilidad 'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then If ObjConta.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Dim dtVC As DataTable @@ -2744,8 +2765,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If - 'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString)) - 'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString)) + params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString)) params.Add(New ReportParameter("Moneda", "")) params.Add(New ReportParameter("CodigoPostal", "")) @@ -2765,10 +2785,21 @@ Partial Class ContabilidadC_RegPrePolizaS ImprimirbytesPDF(StreamPDF(ruta, dtVC, params, "ppoliza"), String.Format("{0}-{1}", TipoPoliza, dr("FolioPoliza").ToString), "PDF", True) End If - Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString) + + + + + + + + + 'Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString) ObjConta.Dispose() - End Function + End Sub + + + #End Region @@ -3199,5 +3230,85 @@ Partial Class ContabilidadC_RegPrePolizaS Private Sub TxtAbonoE_TextChanged(sender As Object, e As EventArgs) Handles TxtAbonoE.TextChanged If TxtAbonoE.Text.ToDecimal <> 0 Then CargaModalConceptoTipoTransaccion("Egs") End Sub + + + Private Sub ImprimePrePolizasDetalleResumen(Optional Tipo As String = "PDF") + + Dim Archivo As System.IO.FileInfo + Dim params As New List(Of ReportParameter) + Dim Bytes As Byte() = Nothing + + Dim ImpresionPersonalizada As Integer = UsuarioActual.Empresa.Funcionalidad(282).ToEntero + Dim ConceptoPoliza As String = TxtConcepto.Text + + + Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/PolizasResumen.rdlc", UsuarioActual.Empresa.Ruta)) + Dim Logo As New System.IO.FileInfo(String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta)) + + + + + Dim ObjConta As New ClsContabilidad + 'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then + If ObjConta.GetPrePolizasDetalleResumen(CvePrePoliza, UsuarioActual.CveEmpresa, ImpresionPersonalizada) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then + Dim dtVC As DataTable + Dim dr As DataRow + + dtVC = ObjConta.DtResultados '.FiltraParametros("Contabilizable = 1", "Orden") + dr = dtVC.Rows(0) + + params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("TipoPoliza", DdlTipoPoliza.SelectedItem.Text)) + params.Add(New ReportParameter("Finicio", TxtFechaDocumento.Text)) + params.Add(New ReportParameter("FFin", TxtFechaDocumento.Text)) + + params.Add(New ReportParameter("Fecha", TxtFechaDocumento.Text)) + + params.Add(New ReportParameter("Numero", TxtFolio.Text)) + params.Add(New ReportParameter("Moneda", If(CveMoneda = 2, "Dolar", "Peso Mexicano"))) + params.Add(New ReportParameter("CodigoPostal", "")) + + params.Add(New ReportParameter("UsuarioRegistro", TxtUsuarioElaboro.Text)) + params.Add(New ReportParameter("ConceptoPoliza", ConceptoPoliza)) + + params.Add(New ReportParameter("Folio", TxtFolio.Text)) + + + + + + If Logo.Exists Then + params.Add(New ReportParameter("pImg", $"file://{Logo.FullName}")) + Else + params.Add(New ReportParameter("pImg", "")) + End If + + + + + Dim RutaReprote As String + If Archivo.Exists Then + RutaReprote = Archivo.FullName + Else + RutaReprote = $"{DirectorioEmpresas}Grales\Formatos\PolizasResumen.rdlc" + End If + + ImprimirbytesPDF(StreamPDF(RutaReprote, dtVC, params, "PrePoliza", Formato:=Tipo), "PrePoliza", Formato:=Tipo, Descarga:=True) + + End If + ObjConta.Dispose() + + End Sub + + + Protected Sub LnkImprimePDFResumen_Click(sender As Object, e As EventArgs) + ImprimePrePolizasDetalleResumen("PDF") + End Sub + + 'Protected Sub LnkImprimeExcelResumen_Click(sender As Object, e As EventArgs) + ' ImprimePrePolizasDetalleResumen("Excel") + 'End Sub + + End Class diff --git a/Contratos/Presupuestos.aspx b/Contratos/Presupuestos.aspx index 605b68381..bfb6aca06 100644 --- a/Contratos/Presupuestos.aspx +++ b/Contratos/Presupuestos.aspx @@ -20,6 +20,9 @@
  • Autorizar
  • +
  • + Cargar Presupuesto +
  • Modificar Presupuesto
  • @@ -282,6 +285,61 @@
    +
    diff --git a/OI/CircularDetalleB.aspx.cs b/OI/CircularDetalleB.aspx.cs index 84886f3f2..cb9eb243b 100644 --- a/OI/CircularDetalleB.aspx.cs +++ b/OI/CircularDetalleB.aspx.cs @@ -1,4 +1,5 @@ using System; +using System.Activities.Expressions; using System.Collections.Generic; using System.Data; using System.IO; @@ -8,10 +9,31 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Extensiones; +using Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution; +using MoreLinq; public partial class OI_CircularDetalleB : ClsPaginas { public const string iddivAgregarPara = "iddivAgregarPara"; + enum EnuEnvioTipo { Usuarios,Proveedores,Personal,Clientes } + + + private EnuEnvioTipo EnvioTipo + { + get + { + if (ViewState["EnvioTipo"] == null) + { + ViewState["EnvioTipo"] = EnuEnvioTipo.Usuarios; + } + return (EnuEnvioTipo)ViewState["EnvioTipo"]; + } + set + { + ViewState["EnvioTipo"] =(EnuEnvioTipo) value; + } + } + private DataTable DtUsuarios { get @@ -39,7 +61,11 @@ public partial class OI_CircularDetalleB : ClsPaginas { if (!IsPostBack) { - if(Request["CveCircular"] != null) + + CargaCombos(); + ConsultaCorreos(); + + if (Request["CveCircular"] != null) { CveCircular = Request["CveCircular"].ToString().ToEntero(); } @@ -54,10 +80,14 @@ public partial class OI_CircularDetalleB : ClsPaginas { BtnGuardar.Text = "Guardar"; } - cargarFiltroUsuarios(); + + } } + + + private void CargaDatos() { if (CveCircular > 0) @@ -84,38 +114,162 @@ public partial class OI_CircularDetalleB : ClsPaginas ObjOI.Dispose(); } } - private void cargarFiltroUsuarios() + + + + private void CargaCombos() { DdlRoles.DataSource = get_GlobalDTRoles(UsuarioActual.CveEmpresa); DdlRoles.DataBind(); DdlRoles.Items.Insert(0, new ListItem("Todos", "-1")); - DdlSucursales.DataSource = get_GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa); - DdlSucursales.DataBind(); - DdlSucursales.Items.Insert(0, new ListItem("Todos", "-1")); + CargarCentrosDeCosto(null, DdlSubProyecto, null,LblSubProyecto); + CargarCentrosDeCosto(null, DdlSubProyectoPersonal, null, LblSubProyectoPersonal); + + DdlCveClasificacionProveedor.DataSource = get_GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa); + DdlCveClasificacionProveedor.DataBind(); + DdlCveClasificacionProveedor.Items.Insert(0, new ListItem("Todas", "-1")); + + DdlClasificacion.DataSource = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa); + DdlClasificacion.DataBind(); + DdlClasificacion.Items.Insert(0, new ListItem("Todos", "-1")); + + } + private void ResetCombos() + { + + DdlRoles.SelectedValueExist(-1); + DdlSubProyecto.SelectedValueExist(-1); + DdlCveClasificacionProveedor.SelectedValueExist(-1); + DdlSubProyectoPersonal.SelectedValueExist(-1); + DdlClasificacion.SelectedValueExist(-1); + + RLBTipoEnvioTipo.SelectedValue ="1"; + } - GVUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("Estatus =1 ", "Rol ASC"); - GVUsuarios.DataBind(); - UpUsuarios.Update(); + private void ConsultaCorreos() + { + + int intTipoConsulta = 1; + + DVModalFiltrosUsuarios.Visible = false; + DVModalFiltrosProveedores.Visible = false; + DVModalFiltrosPersonal.Visible = false; + DVModalFiltrosCliente.Visible = false; + + switch (RLBTipoEnvioTipo.SelectedValue.ToEntero()) + { + case 1: + DVModalFiltrosUsuarios.Visible = true; + GVUsuarios.Columns[2].Visible = true; + intTipoConsulta = 1; + break; + case 2: + DVModalFiltrosProveedores.Visible = true; + GVUsuarios.Columns[2].Visible = false; + intTipoConsulta = 2; + break; + case 3: + DVModalFiltrosPersonal.Visible = true; + GVUsuarios.Columns[2].Visible = false; + intTipoConsulta = 3; + break; + case 4: + DVModalFiltrosCliente.Visible = true; + GVUsuarios.Columns[2].Visible = false; + intTipoConsulta = 4; + break; + default: + DVModalFiltrosUsuarios.Visible = true; + GVUsuarios.Columns[2].Visible = true; + intTipoConsulta = 1; + break; + } + + ClsOIEventos ObjOI = new ClsOIEventos(); + + if (ObjOI.GetCircularCorreos(intTipoConsulta, UsuarioActual.CveEmpresa,DdlRoles.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero(), DdlCveClasificacionProveedor.SelectedValue.ToEntero(), DdlSubProyectoPersonal.SelectedValue.ToEntero(),DdlClasificacion.SelectedValue.ToEntero())) + { + + if (ObjOI.DtResultados.Rows.Count >= 1000) + { + DataTable dt = ObjOI.DtResultados.Clone(); + + foreach (DataRow row in ObjOI.DtResultados.AsEnumerable().Take(2000)) + { + dt.ImportRow(row); + } + + GVUsuarios.DataSource = dt; + + Alert($"{ObjOI.DtResultados.Rows.Count } registros se limito a 2000 registros, se recomienda usar los filtros.", ModExtensiones.TipoMensaje.ToastAdventencia); + } + else + { + GVUsuarios.DataSource = ObjOI.DtResultados; + } + + } + else + { + GVUsuarios.DataSource = null; + } + + + RegistraScript("CveRol = -1; CveSucursal = -1;usuariotext = \"\";"); + + + ObjOI.Dispose(); + GVUsuarios.DataBind(); + UpModalSeleccionCorreos.Update(); + } protected void GVUsuarios_RowDataBound(object sender, GridViewRowEventArgs e) { - if (e.Row.RowType == DataControlRowType.DataRow) + //if (e.Row.RowType == DataControlRowType.DataRow) + //{ + // string CveRol = e.Row.DBCampo("CveRol"); + // string CveSubProyecto = e.Row.DBCampo("CveSubProyecto"); + // e.Row.CssClass = "items"; + // e.Row.Attributes.Add("data-rol", CveRol); + // e.Row.Attributes.Add("data-sucursal", CveRol); + //} + + if(e.Row.RowType == DataControlRowType.Header) { - string CveRol = e.Row.DBCampo("CveRol"); - string CveSubProyecto = e.Row.DBCampo("CveSubProyecto"); - e.Row.CssClass = "items"; - e.Row.Attributes.Add("data-rol", CveRol); - e.Row.Attributes.Add("data-sucursal", CveRol); + switch (RLBTipoEnvioTipo.SelectedValue.ToEntero()) + { + case 1: + e.Row.Cells[1].Text = "Usuario"; + break; + case 2: + e.Row.Cells[1].Text = "Proveedor"; + break; + case 3: + e.Row.Cells[1].Text = "Personal"; + break; + case 4: + e.Row.Cells[1].Text = "Cliente"; + break; + default: + e.Row.Cells[1].Text = "Usuario"; + break; + } } + + + } protected void LnkAgregar_Click(object sender, EventArgs e) { this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarPara)); + ResetCombos(); + ConsultaCorreos(); + UpModalSeleccionCorreos.Update(); } @@ -336,5 +490,63 @@ public partial class OI_CircularDetalleB : ClsPaginas return new byte[] { }; } - -} \ No newline at end of file + + + protected void RLBTipoEnvioTipo_SelectedIndexChanged(object sender, EventArgs e) + { + + //switch (RLBTipoEnvioTipo.SelectedValue.ToEntero()) + //{ + // case 1: + // EnvioTipo = EnuEnvioTipo.Usuarios; + // break; + // case 2: + // EnvioTipo = EnuEnvioTipo.Proveedores; + // break; + // case 3: + // EnvioTipo = EnuEnvioTipo.Personal; + // break; + // case 4: + // EnvioTipo = EnuEnvioTipo.Clientes; + // break; + // default: + // EnvioTipo = EnuEnvioTipo.Usuarios; + // break; + //} + + + ConsultaCorreos(); + + + } + + protected void DdlRoles_SelectedIndexChanged(object sender, EventArgs e) + { + ConsultaCorreos(); + } + + protected void DdlSubProyecto_SelectedIndexChanged(object sender, EventArgs e) + { + ConsultaCorreos(); + } + + protected void DdlCveClasificacionProveedor_SelectedIndexChanged(object sender, EventArgs e) + { + ConsultaCorreos(); + } + + protected void DdlSubProyectoPersonal_SelectedIndexChanged(object sender, EventArgs e) + { + ConsultaCorreos(); + } + + protected void DdlClasificacion_SelectedIndexChanged(object sender, EventArgs e) + { + // ConsultaCorreos(); + } + + protected void LnlActualizarCorreos_Click(object sender, EventArgs e) + { + ConsultaCorreos(); + } +} diff --git a/OS/RepServicioDomicilio.aspx.vb b/OS/RepServicioDomicilio.aspx.vb index 33a77efd2..42c9ac8da 100644 --- a/OS/RepServicioDomicilio.aspx.vb +++ b/OS/RepServicioDomicilio.aspx.vb @@ -805,7 +805,7 @@ Partial Class OS_RepServicioDomicilio Dim CveOsDetalle As Integer = HFCveOsDetalle.Value.ToEntero - Dim CveSubProyectoTecnico As Integer = If(DdlTecnicoAsignar.SelectedValue.ToEntero > 0, GlobalDTUsuarios(DdlTecnicoAsignar.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero, -1) + Dim CveSubProyectoTecnico As Integer = If(DdlTecnicoAsignar.SelectedValue.ToEntero > 0, GlobalDTUsuarios(DdlTecnicoAsignar.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0 ").ToEntero, -1) If TipoAccion = OSModalTipoAccion.Asignacion AndAlso Not CveSubProyectoTecnico > 0 Then diff --git a/PortalProveedor/PortalProveedor.aspx b/PortalProveedor/PortalProveedor.aspx index 4bcd4e740..39c129a0a 100644 --- a/PortalProveedor/PortalProveedor.aspx +++ b/PortalProveedor/PortalProveedor.aspx @@ -325,7 +325,8 @@
    - + diff --git a/PortalProveedor/PortalProveedor.aspx.vb b/PortalProveedor/PortalProveedor.aspx.vb index 6329d75bf..dc4fec606 100644 --- a/PortalProveedor/PortalProveedor.aspx.vb +++ b/PortalProveedor/PortalProveedor.aspx.vb @@ -592,16 +592,17 @@ Partial Class Portal_PortalProveedor Protected Sub GvBancos_comprobante(sender As Object, e As EventArgs) - Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - - Dim Path As String = String.Format("{0}{1}{2}{3}", UsuarioActual.Empresa.Ruta, "IE\", Gvr.FCHiddenField("CveIe").Value, ".png") + Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim Path As String = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, Gvr.DataKey("Comprobante")) + Dim Archivo As New System.IO.FileInfo(Path) If Archivo.Exists Then HttpContext.Current.Response.Clear() HttpContext.Current.Response.ClearContent() - HttpContext.Current.Response.ContentType = "application/png" - HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=comprobante.png") + HttpContext.Current.Response.ContentType = "application/png" + HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name)) HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) HttpContext.Current.Response.TransmitFile(Path) 'HttpContext.Current.Response.Flush() diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index b1480f84f..90f27ff1e 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -6834,7 +6834,7 @@ Partial Class RH_Personal TxtFactordeIntegracion.Text = "" TxtFISalarioDiarioIntegrado.Text = "" If UsuarioActual.CveEmpresa.Contiene(72, 80) Then - TxtFIDiasVacaciones.Text = "6" + TxtFIDiasVacaciones.Text = "12" Else Using objRH As New ClsRH If objRH.VacacionesResumenGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then @@ -6844,7 +6844,7 @@ Partial Class RH_Personal Dim diasvaca As Integer = objRH.DtResultados(0)("Dias").ToString().ToEntero() TxtFIDiasVacaciones.Text = If(diasvaca > 5, diasvaca, 6).ToString() Else - TxtFIDiasVacaciones.Text = "6" + TxtFIDiasVacaciones.Text = "12" End If Else diff --git a/SAT/SolicitudesNominaSat.aspx.cs b/SAT/SolicitudesNominaSat.aspx.cs index 3e15678f4..8b5e40ac2 100644 --- a/SAT/SolicitudesNominaSat.aspx.cs +++ b/SAT/SolicitudesNominaSat.aspx.cs @@ -379,6 +379,7 @@ namespace ADSNetLibraryzd.Helpers.Conexiones.SIGAPI } } catch (Exception e) { + string val = e.Message; //ModExtensiones.GuardaLog(string.Format("{0}{1}{2}{1}{3}{1}{4}{1}", tituloLog, ModVars.NewLine, route, e, strjsonreq), ModVars.ADSNetLibraryLog); } diff --git a/Site.master b/Site.master index 0a9eac6db..c67e7ac23 100644 --- a/Site.master +++ b/Site.master @@ -149,13 +149,7 @@ -
    - + @@ -1741,7 +1742,7 @@ - +
    @@ -4514,11 +4515,7 @@ - - - - - +
    @@ -6686,9 +6683,9 @@
    - - + + diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index a93c2dc7f..be0cd7419 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -917,7 +917,6 @@ Partial Class Clientes ChecaPermiteCredito() - 'Crea y carga CuentasBancarias - tab:Bancos CargaCuentasBancarias() @@ -939,8 +938,6 @@ Partial Class Clientes TxtFechaICredito.Text = Now.AddYears(-2).ToShortDateString() TxtFechaFCredito.Text = Now.ToShortDateString() - - If UsuarioActual.TienePermisoProceso(257) Then 'Falta agregar proceso DivMapAddSucursal.Visible = True LiLnkAgragarDireccion.Visible = True @@ -950,17 +947,12 @@ Partial Class Clientes MostrarTxtDireccionesClienteEnvio() - - If CveCliente > 0 AndAlso UsuarioActual.CveEmpresa.Contiene(119, 1) AndAlso UsuarioActual.CveRol = 1 Then + If CveCliente > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso UsuarioActual.TienePermisoProceso(350) Then CargaCombosLineasAdicionales() TabLineasAdicionales.Visible = True LnkAgregarLineaAdicional.Visible = True GetLineasAdicionales() - - End If - - - + End If End If 'EN SERIO SE OCUPA EN CADA POSTBACK ??? IPP 7 SEPTIEMNRE 2017 @@ -1050,7 +1042,7 @@ Partial Class Clientes DdlEstadoSAT.DataSource = GlobalDTGralEstados(ClaveSATPais) DdlEstadoSAT.DataBind() - DdlEstadoSAT.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlEstadoSAT.Items.Insert(0, New ListItem("-", "-1")) UpDatos.Update() End Sub @@ -1059,11 +1051,11 @@ Partial Class Clientes Dim Dt As DataTable = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("True", "Nombre") DdlResponsable.DataSource = Dt.FiltraParametros("Estatus = 1", "", {"CveUsuario", "Nombre"}) DdlResponsable.DataBind() - DdlResponsable.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlResponsable.Items.Insert(0, New ListItem("-", "-1")) DdlResponsableSucursal.DataSource = Dt DdlResponsableSucursal.DataBind() - DdlResponsableSucursal.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlResponsableSucursal.Items.Insert(0, New ListItem("-", "-1")) UpAgregarSucursal.Update() UpDatos.Update() @@ -1664,7 +1656,8 @@ Partial Class Clientes DdlUsoCFDI.SelectedValueExist(ObjClientes.CveUsoCFDI.ToString()) DdlMetodoPago33.SelectedValueExist(ObjClientes.CveMetodoPago33.ToString()) - DdlFormaPago33.SelectedValueExist(ObjClientes.CveFormaPago33.ToString()) + 'DdlFormaPago33.SelectedValueExist(ObjClientes.CveFormaPago33.ToString()) + CargaFormaDePago(ObjClientes.CveFormaPago33) If ObjClientes.CveRegimenFiscal > 0 Then DdlRegimenFiscal.SelectedValueExist(ObjClientes.CveRegimenFiscal) ChkDesglosarIEPS.Checked = ObjClientes.DesglosaIEPS @@ -1975,6 +1968,7 @@ Partial Class Clientes DtCxCActivas = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda, OrdenVencimiento, FechaVencimiento") GvCxC.DataSource = DtCxCActivas If DtCxCActivas.MAX("LineaAdicional") = "" Then GvCxC.Columns(6).Visible = False + If DtCxCActivas.MAX("CobranzaEstatus") = "" Then GvCxC.Columns(10).Visible = False 'solo tomo los 10 ultimos mas el totalizador general Dim dt As DataTable = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Hist'") DtHistorialCxC = dt @@ -2753,7 +2747,7 @@ Partial Class Clientes CveCondicionEntrega:=DdlCondicionesEntrega.SelectedValue.ToEntero(), ImprimeNombreSucursal:=ChkMuestraNombre.Checked, CveZonaHoraria:=DdlZonaHoraria.SelectedValue.ToEntero(), CobranzaContacto:=TxtCobranzaContacto.Text.Trim, CobranzaTelefono:=TxtCobranzaTelefono.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), CobranzaExt:=TxtCobranzaExt.Text, CobranzaCorreo:=TxtCobranzaCorreo.Text.Trim, Horario:=TxtHorario.Text.Trim, PortalFacturacion:=TxtPortalFacturacion.Text.Trim, Documentacion:=TxtDocumentacion.Text.Trim, DiasEspecifico:=TxtDiasEspecifico.Text.Trim, UsuarioPortal:=TxtUsuarioPortalFacturacion.Text, ContraseñaPortal:=TxtContraseñaPortalFacturacion.Text, DiasRevision:=DiasRevision, ObservacionRevsion:=TxtObsDiasRevision.Text.Trim, ReferenciaFiscal:=TxtReferenciaFiscal.Text.Trim, Celular:=TxtCelular.Text.Trim.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), ExtOtros:=TxtExtOtro.Text.Trim, CveUsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero(), - CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), DesglosaIEPS:=ChkDesglosarIEPS.Checked, AplicaComercioExterior:=ChkAplicaComercioExterior.Checked, CveTipoOperacion:=DdlTipoOperacion.SelectedValue.ToEntero(), CvePedimento:=DdlClavePedimento.SelectedValue.ToEntero(), CveIncoterm:=DdlIncoterm.SelectedValue.ToEntero(), + CveFormaPago:=DdlFormaPago33.SelectedValue.ToEntero(), CveMetodoPago:=DdlMetodoPago33.SelectedValue.ToEntero(), DesglosaIEPS:=ChkDesglosarIEPS.Checked, AplicaComercioExterior:=ChkAplicaComercioExterior.Checked, CveTipoOperacion:=DdlTipoOperacion.SelectedValue.ToEntero(), CvePedimento:=DdlClavePedimento.SelectedValue.ToEntero(), CveIncoterm:=DdlIncoterm.SelectedValue.ToEntero(), CvePais:=DdlPais.SelectedValue.ToEntero(), CveEstado:=DdlEstado.SelectedValue.ToEntero(), CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero(), CveColonia:=DdlColonia.SelectedValue.ToEntero(), CveMotivoTraslado:=IIf(DdlMotivoTraslado.SelectedValue = "-1", "0", DdlMotivoTraslado.SelectedValue).ToString().ToEntero(), NumRegIdTrib:=IIf(TxtNumRegIdTrib.Text = "", "-1", TxtNumRegIdTrib.Text).ToString(), ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()), @@ -2847,7 +2841,7 @@ Partial Class Clientes CveCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtExtension.Text.Trim, TxtTelefonoOtro.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), ChkPermiteCredito.Checked, DdlSubProyecto.SelectedValue.ToEntero(), DdlCorporativo.SelectedValue.ToEntero(), CveClienteClasificacion:=DdlClasificacion.SelectedValue.ToEntero(), CveUsuarioResponsable:=DdlResponsable.SelectedValue.ToEntero(), CveCondicionEntrega:=DdlCondicionesEntrega.SelectedValue.ToEntero(), ImprimeNombreSucursal:=ChkMuestraNombre.Checked, CveZonaHoraria:=DdlZonaHoraria.SelectedValue.ToEntero(), CobranzaContacto:=TxtCobranzaContacto.Text.Trim, CobranzaTelefono:=TxtCobranzaTelefono.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), CobranzaExt:=TxtCobranzaExt.Text, CobranzaCorreo:=TxtCobranzaCorreo.Text.Trim, Horario:=TxtHorario.Text.Trim, PortalFacturacion:=TxtPortalFacturacion.Text.Trim, Documentacion:=TxtDocumentacion.Text.Trim, DiasEspecifico:=TxtDiasEspecifico.Text.Trim, UsuarioPortal:=TxtUsuarioPortalFacturacion.Text, ContraseñaPortal:=TxtContraseñaPortalFacturacion.Text, - DiasRevision:=DiasRevision, ObservacionRevsion:=TxtObsDiasRevision.Text.Trim, ReferenciaFiscal:=TxtReferenciaFiscal.Text.Trim, Celular:=TxtCelular.Text.Trim.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), ExtOtros:=TxtExtOtro.Text.Trim, CveUsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), DesglosaIEPS:=ChkDesglosarIEPS.Checked, + DiasRevision:=DiasRevision, ObservacionRevsion:=TxtObsDiasRevision.Text.Trim, ReferenciaFiscal:=TxtReferenciaFiscal.Text.Trim, Celular:=TxtCelular.Text.Trim.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), ExtOtros:=TxtExtOtro.Text.Trim, CveUsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero(), CveFormaPago:=DdlFormaPago33.SelectedValue.ToEntero(), CveMetodoPago:=DdlMetodoPago33.SelectedValue.ToEntero(), DesglosaIEPS:=ChkDesglosarIEPS.Checked, AplicaComercioExterior:=ChkAplicaComercioExterior.Checked, CveTipoOperacion:=DdlTipoOperacion.SelectedValue.ToEntero(), CvePedimento:=DdlClavePedimento.SelectedValue.ToEntero(), CveIncoterm:=DdlIncoterm.SelectedValue.ToEntero(), CvePais:=DdlPais.SelectedValue.ToEntero(), CveEstado:=DdlEstado.SelectedValue.ToEntero(), CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero(), CveColonia:=DdlColonia.SelectedValue.ToEntero(), CveMotivoTraslado:=IIf(DdlMotivoTraslado.SelectedValue = "-1", "0", DdlMotivoTraslado.SelectedValue).ToString().ToEntero(), NumRegIdTrib:=IIf(TxtNumRegIdTrib.Text = "", "-1", TxtNumRegIdTrib.Text).ToString(), ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), @@ -4070,8 +4064,13 @@ Partial Class Clientes End Sub - Private Sub GenerarPDFCrystal(Optional Formato As String = "PDF") + Private Sub GenerarPDFCrystal(Optional Formato As String = "PDF") + Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.rpt", UsuarioActual.Empresa.Ruta)) + Dim RutaReporteGrales As New System.IO.FileInfo($"{DirectorioEmpresas}Grales\Formatos\RepClientesCxC.rpt") + + + Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) @@ -4257,7 +4256,7 @@ Partial Class Clientes File = ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato) End If Else - File = ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato) + File = ImprimirPDFCrystal(RutaReporteGrales.FullName, DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato) End If Try @@ -4307,7 +4306,7 @@ Partial Class Clientes End If Else - ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato) + ImprimirbytesPDF(ImprimirPDFCrystal(RutaReporteGrales.FullName, DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato) End If End If @@ -4359,7 +4358,7 @@ Partial Class Clientes ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato) End If Else - ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato) + ImprimirbytesPDF(ImprimirPDFCrystal(RutaReporteGrales.FullName, DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato) End If End If End Sub @@ -10351,15 +10350,14 @@ Partial Class Clientes If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then DivRazonSocial2.Attributes.Add("class", "col-md-8") - DVRegimenSociedad.Visible = True - TxtNombreComercial.Enabled = False + DVRegimenSociedad.Visible = True Else TxtNombreComercial.Enabled = True End If ' DdlRegimenFiscal.SelectedIndex = -1 Dim dt As DataTable = GlobalDTRegimenesFiscales(RdTipoPersona.SelectedValue.ToEntero).FiltraParametros("", "CodigoRegimenFiscal") - Dim Val As String + Dim Val As String = "" If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then 'verifico que sino existe el valor. lo limpie @@ -10378,31 +10376,17 @@ Partial Class Clientes - Private Sub CargaCombosLineasAdicionales() - - If (UsuarioActual.Empresa.Funcionalidad(105) = "1") Then - DdlProveedorLineaAdicionalModal.setEsWebService(True) - DdlProveedorLineaAdicionalModal.Attributes.Add("data-metodo", "getproveedores") - DdlProveedorLineaAdicionalModal.SelectedText = "-" - DdlProveedorLineaAdicionalModal.SelectedValue = "-1" - - - - Else - DdlProveedorLineaAdicionalModal.setEsWebService(False) - DdlProveedorLineaAdicionalModal.ddl.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - DdlProveedorLineaAdicionalModal.ddl.DataBind() - DdlProveedorLineaAdicionalModal.ddl.Items.Insert(0, New ListItem("-", "-1")) - End If - - - + Private Sub CargaCombosLineasAdicionales() + + DdlProveedorLineaAdicionalModal.setEsWebService(True) + DdlProveedorLineaAdicionalModal.Attributes.Add("data-metodo", "getproveedores") + DdlProveedorLineaAdicionalModal.SelectedText = "-" + DdlProveedorLineaAdicionalModal.SelectedValue = "-1" + DdlCategoriaLineaAdicionalModal.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa) DdlCategoriaLineaAdicionalModal.DataBind() - DdlCategoriaLineaAdicionalModal.Items.Insert(0, New ListItem("-", "-1")) - - - + DdlCategoriaLineaAdicionalModal.Items.Insert(0, New ListItem("-", "-1")) + End Sub Private Sub GetLineasAdicionales() @@ -10554,5 +10538,36 @@ Partial Class Clientes UpLineaAdicionalmodal.Update() End Sub + + Protected Sub DdlMetodoPago33_SelectedIndexChanged(sender As Object, e As EventArgs) + + CargaFormaDePago(-1) + + End Sub + + Private Sub CargaFormaDePago(Optional CveFormaPago As Integer = -1) + + DdlFormaPago33.Items.Clear() + + If DdlMetodoPago33.SelectedValue.ToEntero = 3 Then + DdlFormaPago33.DataSource = GlobalDTVtaFormaPago.FiltraParametros("CveFormaPago = 20") + Else + DdlFormaPago33.DataSource = GlobalDTVtaFormaPago.FiltraParametros("CveFormaPago <> 20") + End If + + DdlFormaPago33.DataBind() + + If Not DdlMetodoPago33.SelectedValue.ToEntero = 3 Then + DdlFormaPago33.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + End If + + If CveFormaPago > 0 Then + DdlFormaPago33.SelectedValueExist(CveFormaPago) + End If + + UpFiscalContable.Update() + + End Sub + End Class diff --git a/Ventas/ClientesAbonar.aspx b/Ventas/ClientesAbonar.aspx index 326731853..b296b6faa 100644 --- a/Ventas/ClientesAbonar.aspx +++ b/Ventas/ClientesAbonar.aspx @@ -96,7 +96,7 @@
    -
    +
    @@ -114,10 +114,7 @@
    - - - - +
    T.C: @@ -216,13 +213,22 @@
    - - -
    Liquidación:
    +
    - + +
    +
    +
    +
    Préstamo:
    +
    + +
    +
    + +
    +
    Intereses: +
    -
    @@ -811,6 +817,24 @@ Importe = Importe + ToDouble($get('TxtAnticipo').value); } } + if ($get('TxtPrestamoImporte') != null) { + + if ($get('TxtPrestamoImporte').value == '') { + $get('TxtPrestamoImporte').value = 0.00; + } + else { + Importe = Importe - ToDouble($get('TxtPrestamoImporte').value); + } + } + if ($get('TxtPrestamoIntereses') != null) { + + if ($get('TxtPrestamoIntereses').value == '') { + $get('TxtPrestamoIntereses').value = 0.00; + } + else { + Importe = Importe - ToDouble($get('TxtPrestamoIntereses').value); + } + } if ($get('TxtOtrosImportes') != null) { if (pagoMultiple != 0) { diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index f295d80c9..5a0c04c99 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -69,6 +69,14 @@ Partial Class Ventas_ClientesAbonar ViewState("DtIngresos") = value End Set End Property + Private Property DtPrestamos As DataTable + Get + Return CType(ViewState("DtPrestamos"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtPrestamos") = value + End Set + End Property Private Property IdCuentaBancaria As Integer Get @@ -164,15 +172,6 @@ Partial Class Ventas_ClientesAbonar End Set End Property - 'Private Property CveIESustitucion As Integer - ' Get - ' Return ViewState("CveIESustitucion").ToString.ToEntero - ' End Get - ' Set(value As Integer) - ' ViewState("CveIESustitucion") = value - ' End Set - 'End Property - Private Property CFDIRelacionadoSustitucion As String Get If ViewState("CFDIRelacionadoSustitucion") Is Nothing Then @@ -248,16 +247,11 @@ Partial Class Ventas_ClientesAbonar ViewState("IdCtaContMonedaExtranjeraAnticipo") = 0 ViewState("IdCtaContMonedaComplementariaAnticipo") = 0 - ViewState("CveIESustitucion") = IfNull(Request("CveIESustitucion"), "-1").ToString.ToEntero DdlProveedorIntermediario.setEsWebService(True) DdlProveedorIntermediario.Attributes.Add("data-metodo", "getproveedores") FechaCorteIE = DateTime.Now - 'If CveIESustitucion > 0 Then - ' CargaIESustituir() - 'End If - Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, Now.Day - 1, Now.Day) Fecha = (dia.ToString + "/" + Now.Month.ToString + "/" + Now.Year.ToString).ToDate @@ -355,7 +349,6 @@ Partial Class Ventas_ClientesAbonar CargaCuentas() CargaTipoTransaccion() - 'TxtFechaDocumento.Text = IIf(CveIESustitucion > 0, FechaCorteIE.ToShortDateString, Now.ToShortDateString).ToString TxtFechaDocumento.Text = Now.ToShortDateString.ToString TxtAboneA.Enabled = False @@ -390,6 +383,7 @@ Partial Class Ventas_ClientesAbonar 'Dim CveClasificacionCol6 As Integer = 21572 'Dim CveClasificacionCol7 As Integer = 21571 divAnticipo.Visible = True + divPrestamo.Visible = True GvCxC.Columns(17).HeaderText = "Comisión
    Venta" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol1).FiltroPrimeroValor("Clasificacion").Substring(0, 10) GvCxC.Columns(18).HeaderText = "Gastos
    Manejo" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol2).FiltroPrimeroValor("Clasificacion").Substring(0, 12) @@ -406,6 +400,7 @@ Partial Class Ventas_ClientesAbonar DvLiquidacion2.Visible = True DtIngresos = CargaIngresos(2) + DtPrestamos = CargaPrestamos(1) End If CargaDatos(tCveMoneda) @@ -422,18 +417,15 @@ Partial Class Ventas_ClientesAbonar Dim FechaI As String = IfNull(Request("FechaI"), "-1") Dim FechaF As String = IfNull(Request("FechaF"), "-1") - 'Dim FechaCorte As Date = IIf(CveIESustitucion > 0, (FechaCorteIE.ToDate).ToShortDateString, DateTime.Now.AddYears(1).ToShortDateString).ToString.ToDate Dim FechaCorte As Date = DateTime.Now.AddYears(1).ToShortDateString.ToString.ToDate Dim SumDescuentoProntoPago As Double = 0.0 - 'If Mov.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, FechaI, FechaF, pCveMoneda, CveSubProyecto, UsuarioActual.CveEmpresa, CveClienteSucursal, FechaCorte:=FechaCorte, CveIESustitucion:=CveIESustitucion) Then If Mov.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, FechaI, FechaF, pCveMoneda, CveSubProyecto, UsuarioActual.CveEmpresa, CveClienteSucursal, FechaCorte:=FechaCorte) Then Dim TmpCxCAux As DataTable TmpCxCAux = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio") SumDescuentoProntoPago = TmpCxCAux.SUM("DescuentoProntoPago") GvCxC.DataSource = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio") - CveMoneda = pCveMoneda End If @@ -799,12 +791,6 @@ Partial Class Ventas_ClientesAbonar '02-05-2018 MANDAMOS CANCELAR EL COMPLEMENTO A SUSTITUIR Dim ErrorCancelarIE As Boolean = False - 'If CveIESustitucion > 0 Then - ' ErrorCancelarIE = CancelarIE() - ' If ErrorCancelarIE Then - ' Exit Sub - ' End If - 'End If Dim ObjIE As New ClsBancos() Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) @@ -856,11 +842,8 @@ Partial Class Ventas_ClientesAbonar Dim CveProvIntermediario As Integer If ChkProveedorIntermediario.Checked Then CveProvIntermediario = If(DdlProveedorIntermediario.SelectedValue.ToEntero <= 0, -1, DdlProveedorIntermediario.SelectedValue.ToEntero) - End If - - 'CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveIESustitucion:=CveIESustitucion, CveProveedorIntermediario:=CveProvIntermediario) - CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveIESustitucion:=-1, CveProveedorIntermediario:=CveProvIntermediario) + CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveProveedorIntermediario:=CveProvIntermediario) Else If RblTipoPago.SelectedValue.Contiene("3") Then CveIE = DdlIngreso.SelectedValue.ToEntero @@ -878,7 +861,6 @@ Partial Class Ventas_ClientesAbonar filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) End If - 'inserto los movimientos de la conta para abonar al saldo If CvePrePoliza > 0 Then @@ -895,7 +877,6 @@ Partial Class Ventas_ClientesAbonar Dim CveSubProyectoContabilizar As Integer = -1 Dim CveSubProyectoMaximo As Integer = -1 Dim CuentasContablesInvalidas As New StringBuilder - Dim CuentasContablesInvalidasSIG As New StringBuilder Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False) Dim TipoCambioFluctuacion As Decimal = 1 Dim FechaUltimaFluctuacion As Date = MinFecha @@ -903,15 +884,42 @@ Partial Class Ventas_ClientesAbonar Dim tFecha As Date = TxtFechaDocumento.Text.ToDate Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) - If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then - If UltimaFluctuacion.FechaFluctuacion <= tFecha Then - FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion - TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion + Dim ImportePrestamo As Decimal = 0 + Dim TCPrestamo As Decimal = 0 + If TxtPrestamoImporte.Text.ToDecimal <> 0 Then 'amortización del préstamo + ImportePrestamo = TxtPrestamoImporte.Text.ToDecimal + Dim tCveProv As Integer = DtPrestamos.FiltroPrimeroValor("CveProveedor", "CveIE=" & DdlPrestamo.SelectedValue) + Dim tFechaIE As Date = DtPrestamos.FiltroPrimeroValor("FechaDocumento", "CveIE=" & DdlPrestamo.SelectedValue).ToDate + TCPrestamo = DtPrestamos.FiltroPrimeroValor("TipoCambio", "CveIE=" & DdlPrestamo.SelectedValue).ToDecimal + If CveMoneda = 1 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ImportePrestamo, 57, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyecto, TipoCambio:=tipoCambioPago, CveProveedor:=tCveProv) Then + MsgError = "No se pudo insertar la póliza" + End If + Else + If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then + If tFechaIE <= UltimaFluctuacion.FechaFluctuacion Then + FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion + TCPrestamo = UltimaFluctuacion.TCFluctuacion + End If + End If + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ImportePrestamo, 349, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyecto, TipoCambio:=TCPrestamo, ImporteME:=ImportePrestamo, CveProveedor:=tCveProv) Then + MsgError = "No se pudo insertar la póliza" + End If + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ((ImportePrestamo * TCPrestamo) - ImportePrestamo).RoundSQL, 350, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyecto, TipoCambio:=TCPrestamo, ImporteME:=ImportePrestamo, CveProveedor:=tCveProv) Then + MsgError = "No se pudo insertar la póliza" + End If End If - End If + + If TxtPrestamoIntereses.Text.ToDecimal <> 0 AndAlso MsgError = "" Then + tipoCambioPago = If(TxtTCDolares.Visible, TxtTCDolares.Text.ToDecimal, TxtTCDolaresDolares.Text.ToDecimal) + Dim ImporteIntereses As Decimal = (TxtPrestamoIntereses.Text.ToDecimal * tipoCambioPago).RoundSQL + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteIntereses, ImporteIntereses, 51, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=11881, TipoCambio:=tipoCambioPago, CveClasificacion:=21927) Then + MsgError = "No se pudo insertar la póliza" + End If + End If - If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then - dtConceptos = ObjMov.DtResultados End If 'inserto las ventas que voy a pagar @@ -920,11 +928,54 @@ Partial Class Ventas_ClientesAbonar If gvr.FCCheckBox("Chk").Checked Then Dim ObjFactura As Modelos.Factura = Nothing + Dim EsAnticipoEspecial As Boolean = False If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then ObjFactura = New Modelos.Factura(UsuarioActual, gvr.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) End If + Dim VentaActual As New Venta + VentaActual.CveVenta = gvr.DataKey("CveVenta").ToEntero + VentaActual.Fecha = gvr.DataKey("Fecha").ToDate + VentaActual.CveCliente = gvr.DataKey("CveCliente").ToEntero + VentaActual.CveMoneda = gvr.DataKey("CveMoneda").ToEntero + VentaActual.SerieFolio = gvr.DataKey("SerieFolio") + VentaActual.ClienteNombre = NombreComercial + VentaActual.TC = gvr.DataKey("TipoCambio").ToDecimal + VentaActual.Total = gvr.DataKey("Original").ToDecimal + VentaActual.IVA = gvr.DataKey("IVA").ToDecimal + VentaActual.IEPS = gvr.DataKey("IEPS").ToDecimal + VentaActual.RetIVA = gvr.DataKey("RetIVA").ToDecimal + VentaActual.RetISR = gvr.DataKey("RetISR").ToDecimal + + VentaActual.PorcentajeIVA = gvr.DataKey("PorcentajeIVA").ToDecimal + VentaActual.UsuarioActual = UsuarioActual + VentaActual.CveSubProyecto = gvr.DataKey("CveSubProyecto").ToEntero + VentaActual.IdCtaContableCliente = IIf(VentaActual.CveMoneda = 1, IdCuentaCliente, IdCtaContMonedaExtranjera) + VentaActual.IdCtaContableClienteComplementaria = IdCtaContComplementaria + + 'Importe de pago + Dim Pago As New VentaPago + Pago.Fecha = TxtFechaDocumento.Text.ToDate + Pago.CveIE = CveIE + Pago.CveMonedaPago = CveMoneda + Pago.ImportePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal + Pago.ImportePagoVenta = gvr.FCTextBox("TxtAbonar").Text.ToDecimal + Pago.Referencia = TxtFolio.Text + + If RblTipoPago.SelectedValue = "3" Then Pago.TipoPago = "I" + + 'Tipos de cambio + If Pago.CveMonedaPago = 1 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos + Pago.TCPago = TxtTC.Text.ToDecimal + ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES + Pago.TCPago = IIf(TxtTCDolaresDolares.Visible, TxtTCDolaresDolares.Text.ToDecimal, TxtTCDolares.Text.ToDecimal) + ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES + Pago.TCPago = TxtTCDolares.Text.ToDecimal + End If + tipoCambioPago = Pago.TCPago + + If gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos tipoCambioPago = 1 @@ -946,531 +997,173 @@ Partial Class Ventas_ClientesAbonar PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal End If + If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then + EsAnticipoEspecial = True + Pago.AplicaTraslado = False + Dim IdCtaContable As Integer = If(EsAnticipoEspecial, IdCtaAnticipo, IdCuentaCliente) + If VentaActual.CveMoneda = 2 Then IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaExtranjeraAnticipo, IdCtaContMonedaExtranjera) + + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, VentaActual.SerieFolio, 3, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, VentaActual.SerieFolio, 95, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then + MsgError = "No se pudo insertar la póliza" + End If + Else + MsgError = "No se pudo insertar la póliza" + End If + End If + + If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso MsgError = "" Then '' si es empresa agrícola + Dim FluctuacionAnticipo As Decimal = 0 + Dim ImporteLiq1 As Decimal = gvr.FCTextBox("TxtLiqCol1").Text.ToDecimal + Dim ImporteLiq2 As Decimal = gvr.FCTextBox("TxtLiqCol2").Text.ToDecimal + Dim ImporteLiq3 As Decimal = gvr.FCTextBox("TxtLiqCol3").Text.ToDecimal + Dim ImporteLiq4 As Decimal = gvr.FCTextBox("TxtLiqCol4").Text.ToDecimal + Dim ImporteLiq5 As Decimal = gvr.FCTextBox("TxtLiqCol5").Text.ToDecimal + Dim ImporteLiq6 As Decimal = gvr.FCTextBox("TxtLiqCol6").Text.ToDecimal + Dim ImporteLiq7 As Decimal = gvr.FCTextBox("TxtLiqCol7").Text.ToDecimal + Dim ImporteLiq8 As Decimal = gvr.FCTextBox("TxtLiqCol8").Text.ToDecimal + Dim ImporteLiq9 As Decimal = gvr.FCTextBox("TxtLiqCol9").Text.ToDecimal + + Dim CveClasificacionCol1 As Integer = 21514 'comisiones sobre venta + Dim CveClasificacionCol2 As Integer = 21916 ' manejo + Dim CveClasificacionCol3 As Integer = 21917 'servicios de inspección + Dim CveClasificacionCol4 As Integer = 21918 ' seguro liquidación + Dim CveClasificacionCol5 As Integer = 21561 ' gastos aduanales mex + Dim CveClasificacionCol6 As Integer = 21920 ' diveros + Dim CveClasificacionCol7 As Integer = 21919 'gastos aduanales usa + Dim CveClasificacionCol8 As Integer = 21211 'material Empaque + Dim CveClasificacionCol9 As Integer = 21207 'Semilla + + Dim CveSubProyectoLiquidacion As Integer = gvr.DataKey("CveSubProyecto").ToEntero + Dim CveConceptoLiquidacion As Integer = 51 + Dim ConceptoPartida As String = gvr.DataKey("SerieFolio") & " " & gvr.FCDropDownList("DdlTG").SelectedItem.Text + + If ImporteLiq1 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq1, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq1 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol1, ImporteME:=If(CveMoneda > 1, ImporteLiq1, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For + End If + End If + + If ImporteLiq2 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq2, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq2 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2, ImporteME:=If(CveMoneda > 1, ImporteLiq2, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For + End If + End If + + If ImporteLiq3 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq3, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq3 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3, ImporteME:=If(CveMoneda > 1, ImporteLiq3, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For + End If + End If + + If ImporteLiq4 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq4, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq4 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4, ImporteME:=If(CveMoneda > 1, ImporteLiq4, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For + End If + End If + + If ImporteLiq5 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq5, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq5 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5, ImporteME:=If(CveMoneda > 1, ImporteLiq5, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For + End If + End If + + If ImporteLiq6 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq6, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq6 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6, ImporteME:=If(CveMoneda > 1, ImporteLiq6, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For + End If + End If + + If ImporteLiq7 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq7, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq7 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7, ImporteME:=If(CveMoneda > 1, ImporteLiq7, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For + End If + End If + + If ImporteLiq8 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq8, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq8 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol8, ImporteME:=If(CveMoneda > 1, ImporteLiq8, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For + End If + End If + + If ImporteLiq9 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq9, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq9 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol9, ImporteME:=If(CveMoneda > 1, ImporteLiq9, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" : Exit For + End If + End If + + If MsgError = "" AndAlso gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero > 0 Then + Dim TCP As Decimal = 0 + Dim FolioPago As String = " " + If DtIngresos IsNot Nothing Then + TCP = DtIngresos.FiltroPrimeroValor("TipoCambio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti").SelectedValue)) + FolioPago = DtIngresos.FiltroPrimeroValor("Folio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue)) + Dim tTCPFecha As Date = DtIngresos.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti").SelectedValue)).ToDate + 'considera fluctuación + If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then + If tTCPFecha <= UltimaFluctuacion.FechaFluctuacion Then + tTCPFecha = UltimaFluctuacion.FechaFluctuacion + TCP = UltimaFluctuacion.TCFluctuacion + End If + End If + End If + 'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo + FluctuacionAnticipo = ((TCP - tipoCambioPago) * gvr.FCTextBox("TxtAmort").Text.ToDecimal).RoundSQL + MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago) + End If + + If MsgError = "" AndAlso gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero > 0 Then + Dim TCP As Decimal = 0 + Dim FolioPago As String = " " + If DtIngresos IsNot Nothing Then + TCP = DtIngresos.FiltroPrimeroValor("TipoCambio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue)) + FolioPago = DtIngresos.FiltroPrimeroValor("Folio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue)) + Dim tTCPFecha As Date = DtIngresos.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue)).ToDate + 'considera fluctuación + If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then + If tTCPFecha <= UltimaFluctuacion.FechaFluctuacion Then + tTCPFecha = UltimaFluctuacion.FechaFluctuacion + TCP = UltimaFluctuacion.TCFluctuacion + End If + End If + + End If + 'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo + FluctuacionAnticipo += ((TCP - tipoCambioPago) * gvr.FCTextBox("TxtAmort2").Text.ToDecimal).RoundSQL + MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort2").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago) + End If + + If ImportePrestamo <> 0 Then + If TCPrestamo > 0 Then + FluctuacionAnticipo += ((TCPrestamo - tipoCambioPago) * ImportePrestamo).RoundSQL + End If + End If + Pago.ImporteFluctuacionAdicional = FluctuacionAnticipo + End If + + If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then + MsgError = "No se pudo insertar la póliza" + End If + + ' Case 134 'Pago Intermediario + If RblTipoPago.SelectedValue = "2" Then + Dim ImporteMovimiento As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - gvr.FCTextBox("TxtComision").Text.ToDecimal + Dim ImporteMN As Decimal = (ImporteMovimiento * tipoCambioPago).RoundSQL + Dim IdCtaContable As Integer = 0 + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, VentaActual.SerieFolio, 134, VentaActual.SerieFolio, IdCtaContable, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" + End If + End If + 'PARA EMITIR COMPLEMENTO PAGO CveVentasPago.Add(gvr.DataKey("CveVenta").ToEntero) SeriesPago.Add(gvr.DataKey("SerieFolio")) - Dim tipoCambioVentaDiferenciaCambiaria As Double = 1 - Dim EsAnticipoEspecial As Boolean = False - If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then EsAnticipoEspecial = True - Dim FluctuacionAnticipo As Decimal = 0 - - If dtConceptos IsNot Nothing Then - FluctuacionAnticipo = 0 ' se limpia la fluctuación por cada factura. - For Each Row As DataRow In dtConceptos.Rows - - Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero - Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False) - Dim ImporteMovimiento As Decimal = 0 - Dim ImporteMN As Decimal - Dim FechaMovimiento As Date = TxtFechaDocumento.Text - Dim IdCtaContable As Integer = 0 - Dim ConceptoMovimiento As String = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreComercial, gvr.DataKey("SerieFolio").ToString, TxtFolio.Text.Trim) - Dim Referencia As String = gvr.DataKey("SerieFolio").ToString - Dim CveSubProyecto As Integer = gvr.DataKey("CveSubProyecto").ToEntero - CveSubProyectoContabilizar = -1 - Dim PorcentajeImpuesto As Decimal = 0 - If CveSubProyecto > 0 Then CveSubProyectoMaximo = CveSubProyecto - - Select Case ConceptoContable - Case 2 'Pago Cliente - If gvr.DataKey("CveMoneda").ToEntero > 1 Then ConceptoContable = 292 - - ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal).RoundSQL - ImporteMN = ImporteMovimiento '(ImporteMovimiento * tipoCambioVentaValuacion).RoundSQL - TipoCambioGeneral = tipoCambioVentaValuacion - CveSubProyectoContabilizar = CveSubProyecto - - If gvr.DataKey("CveMoneda").ToEntero = 1 Then - IdCtaContable = If(EsAnticipoEspecial, IdCtaAnticipo, IdCuentaCliente) - ConceptoContable = If(EsAnticipoEspecial, 3, ConceptoContable) - Else - ConceptoMovimiento += $" TC:{tipoCambioVentaValuacion} ${ImporteMovimiento.FormatoNumero(2)}" - IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaComplementariaAnticipo, IdCtaContComplementaria) - If ImporteMovimiento <> 0 Then - ImporteMN = ImporteMovimiento - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, If(gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(119, 158), 226, 207), ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=(ImporteMovimiento * tipoCambioVentaValuacion - ImporteMovimiento).RoundSQL, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioVentaValuacion) Then - MsgError = "No se pudo insertar la póliza" - End If - End If - IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaExtranjeraAnticipo, IdCtaContMonedaExtranjera) - ConceptoContable = If(EsAnticipoEspecial, 3, ConceptoContable) - End If - - If EsAnticipoEspecial Then - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, Referencia, 2, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteMN, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Referencia, 95, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteMN, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then - MsgError = "No se pudo insertar la póliza" - End If - Else - MsgError = "No se pudo insertar la póliza" - End If - End If - - If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso MsgError = "" Then '' si es empresa agrícola - - Dim ImporteLiq1 As Decimal = gvr.FCTextBox("TxtLiqCol1").Text.ToDecimal - Dim ImporteLiq2 As Decimal = gvr.FCTextBox("TxtLiqCol2").Text.ToDecimal - Dim ImporteLiq3 As Decimal = gvr.FCTextBox("TxtLiqCol3").Text.ToDecimal - Dim ImporteLiq4 As Decimal = gvr.FCTextBox("TxtLiqCol4").Text.ToDecimal - Dim ImporteLiq5 As Decimal = gvr.FCTextBox("TxtLiqCol5").Text.ToDecimal - Dim ImporteLiq6 As Decimal = gvr.FCTextBox("TxtLiqCol6").Text.ToDecimal - Dim ImporteLiq7 As Decimal = gvr.FCTextBox("TxtLiqCol7").Text.ToDecimal - Dim ImporteLiq8 As Decimal = gvr.FCTextBox("TxtLiqCol8").Text.ToDecimal - Dim ImporteLiq9 As Decimal = gvr.FCTextBox("TxtLiqCol9").Text.ToDecimal - - Dim CveClasificacionCol1 As Integer = 21514 'comisiones sobre venta - Dim CveClasificacionCol2 As Integer = 21916 ' manejo - Dim CveClasificacionCol3 As Integer = 21917 'servicios de inspección - Dim CveClasificacionCol4 As Integer = 21918 ' seguro liquidación - Dim CveClasificacionCol5 As Integer = 21561 ' gastos aduanales mex - Dim CveClasificacionCol6 As Integer = 21920 ' diveros - Dim CveClasificacionCol7 As Integer = 21919 'gastos aduanales usa - Dim CveClasificacionCol8 As Integer = 21211 'material Empaque - Dim CveClasificacionCol9 As Integer = 21207 'Semilla - - Dim CveSubProyectoLiquidacion As Integer = gvr.DataKey("CveSubProyecto").ToEntero - Dim CveConceptoLiquidacion As Integer = 51 - Dim ConceptoPartida As String = gvr.DataKey("SerieFolio") & " " & gvr.FCDropDownList("DdlTG").SelectedItem.Text - - If ImporteLiq1 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq1, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq1 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol1, ImporteME:=If(CveMoneda > 1, ImporteLiq1, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" : Exit For - End If - End If - - If ImporteLiq2 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq2, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq2 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2, ImporteME:=If(CveMoneda > 1, ImporteLiq2, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" : Exit For - End If - End If - - If ImporteLiq3 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq3, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq3 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3, ImporteME:=If(CveMoneda > 1, ImporteLiq3, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" : Exit For - End If - End If - - If ImporteLiq4 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq4, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq4 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4, ImporteME:=If(CveMoneda > 1, ImporteLiq4, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" : Exit For - End If - End If - - If ImporteLiq5 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq5, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq5 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5, ImporteME:=If(CveMoneda > 1, ImporteLiq5, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" : Exit For - End If - End If - - If ImporteLiq6 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq6, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq6 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6, ImporteME:=If(CveMoneda > 1, ImporteLiq6, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" : Exit For - End If - End If - - If ImporteLiq7 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq7, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq7 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7, ImporteME:=If(CveMoneda > 1, ImporteLiq7, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" : Exit For - End If - End If - - If ImporteLiq8 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq8, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq8 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol8, ImporteME:=If(CveMoneda > 1, ImporteLiq8, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" - Exit For - End If - End If - - If ImporteLiq9 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq9, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq9 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol9, ImporteME:=If(CveMoneda > 1, ImporteLiq9, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" - Exit For - End If - End If - - If gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero > 0 Then - Dim TCP As Decimal = 0 - Dim FolioPago As String = " " - If DtIngresos IsNot Nothing Then - TCP = DtIngresos.FiltroPrimeroValor("TipoCambio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti").SelectedValue)) - FolioPago = DtIngresos.FiltroPrimeroValor("Folio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue)) - Dim tTCPFecha As Date = DtIngresos.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti").SelectedValue)).ToDate - 'considera fluctuación - If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then - If tTCPFecha <= UltimaFluctuacion.FechaFluctuacion Then - tTCPFecha = UltimaFluctuacion.FechaFluctuacion - TCP = UltimaFluctuacion.TCFluctuacion - End If - End If - End If - 'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo - FluctuacionAnticipo = ((TCP - tipoCambioVentaValuacion) * gvr.FCTextBox("TxtAmort").Text.ToDecimal).RoundSQL - MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago) - End If - - If gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero > 0 Then - Dim TCP As Decimal = 0 - Dim FolioPago As String = " " - If DtIngresos IsNot Nothing Then - TCP = DtIngresos.FiltroPrimeroValor("TipoCambio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue)) - FolioPago = DtIngresos.FiltroPrimeroValor("Folio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue)) - Dim tTCPFecha As Date = DtIngresos.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue)).ToDate - 'considera fluctuación - If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then - If tTCPFecha <= UltimaFluctuacion.FechaFluctuacion Then - tTCPFecha = UltimaFluctuacion.FechaFluctuacion - TCP = UltimaFluctuacion.TCFluctuacion - End If - End If - - End If - 'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo - FluctuacionAnticipo += ((TCP - tipoCambioVentaValuacion) * gvr.FCTextBox("TxtAmort2").Text.ToDecimal).RoundSQL - MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort2").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago) - End If - - End If - - - - Case 8 'Ret IVA x Trasladar - If EsAnticipoEspecial Then Exit Select - If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then - Exit Select - End If - - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL - ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL - TipoCambioGeneral = tipoCambioVenta - CveSubProyectoContabilizar = CveSubProyecto - - If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" - - - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - 'Conta ContPAQ - If IdCtaContRetIVA <> 0 Then - IdCtaContable = IdCtaContRetIVA - Else - If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjMov.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - End If - - - Case 313 'Ret Iva Servicios - If EsAnticipoEspecial Then Exit Select - If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then - - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL - ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL - TipoCambioGeneral = tipoCambioVenta - CveSubProyectoContabilizar = CveSubProyecto - - If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" - - 'OBTENER CUENTAS - If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjMov.DtResultados.Rows.Count > 0 Then - 'Conta ContPAQ - IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - - End If - End If - - End If - - Case 9 'Ret ISR x Trasladar - If EsAnticipoEspecial Then Exit Select - - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL - ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL - TipoCambioGeneral = tipoCambioVenta - CveSubProyectoContabilizar = CveSubProyecto - - If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" - - - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - 'Conta ContPAQ - If IdCtaContRetISR <> 0 Then - IdCtaContable = IdCtaContRetISR - Else - If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjMov.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - End If - End If - End If - End If - - - - Case 13 'Iva por Trasladar - If EsAnticipoEspecial Then Exit Select - - ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL - ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL - TipoCambioGeneral = tipoCambioVenta - CveSubProyectoContabilizar = CveSubProyecto - - PorcentajeImpuesto = gvr.DataKey("PorcentajeIVA").ToDecimal - Dim IdCtaIVAXTrasladar As Integer = 0 - - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then - IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero - End If - - IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) - If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" - Case 62 'Ret IVA Trasladado - If EsAnticipoEspecial Then Exit Select - If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then - Exit Select - End If - - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL - ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL - TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - CveSubProyectoContabilizar = CveSubProyecto - - If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" - - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - 'Conta ContPAQ - If IdCtaContRetIVA <> 0 Then - IdCtaContable = IdCtaContRetIVA - Else - If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjMov.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero - End If - End If - End If - End If - - Case 314 'Ret Iva Servicios Traslado - If EsAnticipoEspecial Then Exit Select - If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then - - ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL - ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL - TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - CveSubProyectoContabilizar = CveSubProyecto - - If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" - - 'OBTENER CUENTAS - If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjMov.DtResultados.Rows.Count > 0 Then - 'Conta ContPAQ - IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - End If - End If - End If - - Case 63 'Ret ISR Trasladado - If EsAnticipoEspecial Then Exit Select - - ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL - ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL - TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - CveSubProyectoContabilizar = CveSubProyecto - - If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" - - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - 'Conta ContPAQ - If IdCtaContRetISR <> 0 Then - IdCtaContable = IdCtaContRetISR - Else - If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjMov.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - End If - End If - End If - End If - - - - Case 61 'Iva Trasladado - If EsAnticipoEspecial Then Exit Select - - ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL - ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL - TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - CveSubProyectoContabilizar = CveSubProyecto - - PorcentajeImpuesto = gvr.DataKey("PorcentajeIVA").ToDecimal - Dim IdCtaIVATrasladado As Integer = 0 - - If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then - IdCtaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVATrasladado").ToString.ToEntero - End If - - IdCtaContable = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado) - If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" - Case 38 'IEPS por trasladar - If EsAnticipoEspecial Then Exit Select - - ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL - ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL - TipoCambioGeneral = tipoCambioVenta - CveSubProyectoContabilizar = CveSubProyecto - - IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar - Case 39 'IEPS Trasladado - If EsAnticipoEspecial Then Exit Select - - ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL - ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL - TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) - - CveSubProyectoContabilizar = CveSubProyecto - - IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSTrasladado - Case 64 'Ganancia - If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then - - Dim CveMonedaVenta As Integer = gvr.DataKey("CveMoneda").ToEntero - Dim tImporteVenta, tImportePago As Decimal - Dim Diferencia As Decimal = 0 - ImporteMovimiento = 0 - Dim ImportePago As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal.RoundSQL - - If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then - ImportePago = ImportePago - gvr.FCTextBox("TxtAmort").Text.ToDecimal - gvr.FCTextBox("TxtAmort2").Text.ToDecimal - End If - - tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) - - If CveMonedaVenta = 1 And CveMoneda <> 1 Then - 'factura pesos, pago en dolares - tImporteVenta = ImportePago - tImportePago = ((ImportePago * tipoCambioVenta / tipoCambioPago).RoundSQL * tipoCambioPago).RoundSQL - ElseIf CveMonedaVenta <> 1 And CveMoneda <> 1 Then - 'factura dolares, pago en dolares - tImporteVenta = (ImportePago * tipoCambioVentaValuacion).RoundSQL - tImportePago = (ImportePago * tipoCambioPago).RoundSQL - ElseIf CveMonedaVenta <> 1 And CveMoneda = 1 Then - 'factura dolares, pago en pesos - tImporteVenta = (ImportePago * tipoCambioVentaValuacion).RoundSQL - tImportePago = (ImportePago * tipoCambioPago).RoundSQL - End If - - 'If FluctuacionAnticipo <> 0 Then - ' tImportePago += FluctuacionAnticipo - 'End If - - If tImporteVenta <> tImportePago Then - If tImporteVenta < tImportePago Then - ConceptoContable = 64 - IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria - TipoMovimiento = True - 'CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria - Else - ConceptoContable = 65 - IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria - TipoMovimiento = False - ' CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria - End If - Diferencia = tImporteVenta - tImportePago - - End If - - ' si tiene funcionalidad para que tome el TC de pago, que solo afecta a los impuestos - If FuncionalidadFluctuacionImpuestos Then - Dim TCImpuestos As Decimal = tipoCambioPago - - Diferencia -= (((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVentaValuacion) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el IVA - Diferencia -= (((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVentaValuacion) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el RetIVA - Diferencia -= (((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVentaValuacion) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el RetISR - Diferencia -= (((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVentaValuacion) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el IEPS - Diferencia = Diferencia.RoundSQL - End If - - ImporteMovimiento = Math.Abs(Diferencia) - ImporteMN = ImporteMovimiento - - - CveSubProyectoContabilizar = CveSubProyecto - Else - ImporteMovimiento = 0 - End If - - - Case 78 'Otros Ingresos - If ChkAjusteOI.Checked Then - ImporteMovimiento = gvr.FCTextBox("TxtComision").Text.ToDecimal - ImporteMN = ImporteMovimiento * tipoCambioPago.RoundSQL - - If gvr.FCTextBox("TxtComision").Text.ToDecimal < 0 Then - TipoMovimiento = False - ImporteMovimiento = ImporteMovimiento * -1 - ImporteMN = ImporteMN * -1 - Else - TipoMovimiento = True - End If - - ImporteMovimiento = ImporteMovimiento.RoundSQL - ImporteMN = ImporteMN.RoundSQL - TipoCambioGeneral = tipoCambioPago - CveSubProyectoContabilizar = CveSubProyecto - - IdCtaContable = UsuarioActual.Empresa.IdCuentaOtrosIngresos - - If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" - - End If - - Case 134 'Pago Intermediario - If RblTipoPago.SelectedValue = "2" Then - ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - gvr.FCTextBox("TxtComision").Text.ToDecimal - ImporteMN = Math.Round(ImporteMovimiento * tipoCambioPago, 2) - CveSubProyectoContabilizar = CveSubProyecto - - If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, ConceptoMovimiento, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero, ImporteMX:=ImporteMN) Then - MsgError = "No se pudo insertar la póliza" - End If - End If - ImporteMovimiento = 0 - Case 30 - ImporteMovimiento = 0 - Case Else - ImporteMovimiento = 0 - End Select - - If MsgError <> "" Then - Exit For - End If - - If ImporteMovimiento <> 0 AndAlso MsgError = "" Then - 'Conta ContPAQ - If (IdCtaContable < 1 Or IdCuentaBancaria < 1) AndAlso UsuarioActual.CveEmpresa <> 119 Then - CuentasContablesInvalidas.Append("
    " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) - idCuentaContabilizacion = 0 - End If - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteMN, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto) Then - MsgError = "No se pudo insertar la póliza" - Exit For - End If - End If - - Next - - If gvr.FCCheckBox("ChkGenerarNC").Checked AndAlso ObjFactura IsNot Nothing Then - ObjFactura.DescuentoProntoPago = gvr.DataKey("DescuentoProntoPago").ToDecimal() - ListaFacturasGenerarNC.Add(ObjFactura) - End If + If gvr.FCCheckBox("ChkGenerarNC").Checked AndAlso ObjFactura IsNot Nothing Then + ObjFactura.DescuentoProntoPago = gvr.DataKey("DescuentoProntoPago").ToDecimal() + ListaFacturasGenerarNC.Add(ObjFactura) End If End If @@ -1480,7 +1173,7 @@ Partial Class Ventas_ClientesAbonar CveSubProyectoContabilizar = CveSubProyectoMaximo - If tipoCambioPago > 1 AndAlso CveMoneda = 2 Then + If CveMoneda = 2 Then 'If IdCuentaBancariaComplementaria > 0 Then If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES tipoCambioPago = TxtTCDolares.Text.ToDecimal @@ -1522,11 +1215,8 @@ Partial Class Ventas_ClientesAbonar End If End If - End If - If RblTipoPago.SelectedValue = "3" AndAlso MsgError = "" Then - MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, CveIE, TxtImporte.Text.ToDecimal, tipoCambioPago, tipoCambioVenta, -1, TxtObservaciones.Text, DdlIngreso.SelectedItem.Text) End If @@ -1557,7 +1247,6 @@ Partial Class Ventas_ClientesAbonar Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son invalidas: {0}", CuentasContablesInvalidas)) End If End If - Else MsgError = "No se pudo insertar la póliza" End If @@ -1572,7 +1261,6 @@ Partial Class Ventas_ClientesAbonar For Each Fac As Modelos.Factura In ListaFacturasGenerarNC Dim ListaNC As New List(Of Modelos.Factura) ListaNC.Add(Fac) - Dim Resp = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaNC) If Resp IsNot Nothing AndAlso Resp.Respuesta IsNot Nothing AndAlso Resp.Respuesta.CveVenta > 0 Then @@ -1667,20 +1355,6 @@ Partial Class Ventas_ClientesAbonar MsgError = "Error al Agregar la Póliza de Armonización Contable" End If - 'BITACORA - 'If MsgError = "" Then - - ' If CveIESustitucion > 0 And ComplementoSustitucionGenerado Then - ' If Not ObjEvento.AddEventoBitacora($"Complemento de pago Cancelado por sustitución con Folio {TxtFolio.Text}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIESustitucion) Then - ' MsgError = "Ocurrió un error al agregar la bitacora" - ' End If - ' If Not ObjEvento.AddEventoBitacora($"Complemento de pago Generado por Sustitución de {FolioIECancelado}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIE) Then - ' MsgError = "Ocurrió un error al agregar la bitacora" - ' End If - ' End If - - 'End If - Catch ex As Exception MsgError = "Ocurrió un error al guardar el movimiento" OnError("Ocurrió un error al guardar el movimiento", ex) @@ -1718,7 +1392,7 @@ Partial Class Ventas_ClientesAbonar Else If ObjConta IsNot Nothing Then ObjConta.RollBack() ObjIE.RollBack() - Alert(MsgError, TipoMensaje.MsgAdvertencia) + ' Alert(MsgError, TipoMensaje.MsgAdvertencia) End If ObjIE.Dispose() @@ -1811,13 +1485,6 @@ Partial Class Ventas_ClientesAbonar If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then ObjFacturaDevolucion.Version = "4.0" - - 'If ObjFacturaDevolucion.Cliente Is Nothing Then - ' ObjFacturaDevolucion.Cliente = New Modelos.ClienteModel - 'End If - - 'ObjFacturaDevolucion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal - 'ObjFacturaDevolucion.Cliente.RegimenFiscal = ClienteRegimenFiscal Else ObjFacturaDevolucion.Version = "3.3" End If @@ -1826,9 +1493,12 @@ Partial Class Ventas_ClientesAbonar ObjFacturaDevolucion.MetodoPago33 = "PUE - Pago en una sola exhibición" ObjFacturaDevolucion.ClaveMetodoPagoSAT = "PUE" - ObjFacturaDevolucion.CveFormaPago33 = 21 - ObjFacturaDevolucion.FormaPago33 = "30 - Aplicación de anticipos" - ObjFacturaDevolucion.FormaPagoSAT33 = "30" + Dim drtt As DataRow = GlobalDTTipoTransacciones.FiltroPrimero("CveTipoTransaccion =" & DdlTipoTransaccion.SelectedValue) + Dim dra As DataRow = GlobalDTVtaFormaPago.FiltroPrimero("CveFormaPago = " & drtt("CveFormaPago")) + + ObjFacturaDevolucion.CveFormaPago33 = dra("CveFormaPago").ToString + ObjFacturaDevolucion.FormaPago33 = dra("FormaPagoSAT").ToString + ObjFacturaDevolucion.FormaPagoSAT33 = dra("ClaveFormaPagoSAT").ToString ObjFacturaDevolucion.CveSubProyecto = CveSubProyecto ObjFacturaDevolucion.SetSubProyecto() @@ -1840,9 +1510,9 @@ Partial Class Ventas_ClientesAbonar If ObjCliente.GetClientes(ObjFacturaDevolucion.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then If ObjCliente.DtResultados.Rows.Count > 0 Then - ObjFacturaDevolucion.CveUsoCFDI = ObjCliente.CveUsoCFDI - ObjFacturaDevolucion.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) - ObjFacturaDevolucion.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) + ObjFacturaDevolucion.CveUsoCFDI = 2 + ObjFacturaDevolucion.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", 2)) + ObjFacturaDevolucion.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", 2)) ObjFacturaDevolucion.DtDetalle = CreaDTDetalleNC() @@ -2402,7 +2072,6 @@ Partial Class Ventas_ClientesAbonar DdlCuenta.SelectedValue = "-1" DdlTipoTransaccion.SelectedValue = "-1" - 'CveIESustitucion = "-1" CFDIRelacionadoSustitucion = "-1" FechaCorteIE = DateTime.Now.ToDate IDPoliza = -1 @@ -2480,7 +2149,21 @@ Partial Class Ventas_ClientesAbonar Deudores.Dispose() DdlIngreso.DataBind() - DdlIngreso.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlIngreso.Items.Insert(0, New ListItem("-", "-1")) + Return dtt + End Function + + Private Function CargaPrestamos(tCveMoneda As Integer) As DataTable + Dim dtt As DataTable = Nothing + Dim Deudores As New ClsMovimientos + If Deudores.GetDocumentosxPagarDetalle(CveCliente, tCveMoneda, 2, UsuarioActual.CveEmpresa) Then + DdlPrestamo.DataSource = Deudores.DtResultados '.FiltraParametros("CveCliente > 0 AND Saldo > 0 AND CveIE > 0") + dtt = Deudores.DtResultados + End If + Deudores.Dispose() + + DdlPrestamo.DataBind() + DdlPrestamo.Items.Insert(0, New ListItem("-", "-1")) Return dtt End Function @@ -2630,8 +2313,6 @@ Partial Class Ventas_ClientesAbonar 'For i = 0 To CveVentas.Count - 1 Dim ObjBancos As New ClsBancos - - 'If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, If(CveIESustitucion > 0, 2, 1), UsuarioActual.CveEmpresa, -1) Then If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, 1, UsuarioActual.CveEmpresa, -1) Then If Not ObjBancos.DtResultados.Rows.Count > 0 Then ObjBancos.Dispose() @@ -2642,8 +2323,6 @@ Partial Class Ventas_ClientesAbonar ObjBancos.IniciaTransacSQL() - - 'If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente, CFDIRelacionado:=CFDIRelacionadoSustitucion, EsRegeneracion:=If(CveIESustitucion > 0, True, False)) Then If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente, CFDIRelacionado:=CFDIRelacionadoSustitucion, EsRegeneracion:=False) Then ObjBancos.Commit() ComplementoSustitucionGenerado = True @@ -3029,7 +2708,7 @@ Partial Class Ventas_ClientesAbonar Private Sub DdlIngreso_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlIngreso.SelectedIndexChanged 'saco la moneda de la selección - hdnIngresoImporte.Value = 0 + HdnIngresoImporte.Value = 0 If DdlIngreso.SelectedValue.ToEntero > 0 Then Dim Banco As New ClsBancos @@ -3037,7 +2716,7 @@ Partial Class Ventas_ClientesAbonar CveMonedaPago = Banco.CveMoneda Dim Deudores As New ClsMovimientos If Deudores.GetIngresosSaldosDetalle(CveCliente, -1, UsuarioActual.CveEmpresa) Then - hdnIngresoImporte.Value = Deudores.DtResultados.FiltroPrimeroValor("Saldo", String.Format("CveIE = {0}", DdlIngreso.Selectedvalue)) + HdnIngresoImporte.Value = Deudores.DtResultados.FiltroPrimeroValor("Saldo", String.Format("CveIE = {0}", DdlIngreso.SelectedValue)) End If Deudores.Dispose() End If diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index b7f8c3e95..818a55fb5 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -5182,7 +5182,7 @@ Partial Class PV ' End If 'Next If DdlRecepcionUsados.SelectedValue.ToEntero() > 0 Then - Dim DrTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo = {DdlRecepcionUsados.SelectedValue}") + Dim DrTamanio As DataRow = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($" CvePSCargo = {DdlRecepcionUsados.SelectedValue}") Entregado += (1D * DrTamanio("Cargo").ToString().ToDecimal) UltimoEntregado += (DrTamanio("Cargo").ToString().ToDecimal) @@ -7049,13 +7049,13 @@ Partial Class PV DdlFacturas.Items.Insert(0, New ListItem("Sin Factura", "-1")) - DdlTipoUso.DataSource = GlobalDTAcumTiposUso.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") + DdlTipoUso.DataSource = GlobalDTAcumTiposUso(UsuarioActual.CveEmpresa) DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlTipoDefecto.DataSource = GlobalDTAcumTiposDefecto.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") + DdlTipoDefecto.DataSource = GlobalDTAcumTiposDefecto(UsuarioActual.CveEmpresa) DdlTipoDefecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - Dim DtTamanios = GlobalDTAcumTamaños.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo > 0") + Dim DtTamanios = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltraParametros($" CvePSCargo > 0") CargaModelos() CargaBCIAjuste() @@ -7448,7 +7448,7 @@ Partial Class PV End If End If - Dim DrCargo As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} And CveTamaño = {CveTamaño}") + Dim DrCargo As DataRow = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($" CveTamaño = {CveTamaño}") If DrCargo IsNot Nothing Then CargoVendido = DrCargo("Cargo").ToString.ToDecimal @@ -7577,7 +7577,7 @@ Partial Class PV If TmpDT.Select($"Consec={ConsecutivoVenta}").Length > 0 Then Dim Dr As DataRow = TmpDT.Select($"Consec={ConsecutivoVenta}")(0) Dim CvePSCargo As Integer = -1 - Dim DrCargo As DataRow = GlobalDTAcumTamaños.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTamaño = {Dr("CveTamaño").ToString.ToEntero}").FiltroPrimero("") + Dim DrCargo As DataRow = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltraParametros($" CveTamaño = {Dr("CveTamaño").ToString.ToEntero}").FiltroPrimero("") If DrCargo IsNot Nothing Then CvePSCargo = DrCargo("CvePSCargo").ToString.ToEntero CargoActual = DrCargo("Cargo").ToString.ToDouble @@ -7875,7 +7875,7 @@ Partial Class PV ' End If 'Next - Dim DrTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo = {DdlRecepcionUsados.SelectedValue}") + Dim DrTamanio As DataRow = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($" CvePSCargo = {DdlRecepcionUsados.SelectedValue}") If DdlRecepcionUsados.SelectedValue.ToEntero() > 0 Then TotalCargos += CantidadUsado * DrTamanio("Cargo").ToString().ToDecimal @@ -8039,7 +8039,7 @@ Partial Class PV Dim ListaPScargo As New List(Of MConceptoUsado) - Dim DTTamanios As DataTable = GlobalDTAcumTamaños() + Dim DTTamanios As DataTable = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa) Dim DTCvePSCostos = DTTamanios.FiltraParametros("", "", {"CvePSCargo"}) @@ -8470,7 +8470,7 @@ Partial Class PV End Sub Protected Sub DdlRecepcionUsados_SelectedIndexChanged(sender As Object, e As EventArgs) If DdlRecepcionUsados.SelectedValue.ToEntero() > 0 Then - Dim DrTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo = {DdlRecepcionUsados.SelectedValue}") + Dim DrTamanio As DataRow = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($" CvePSCargo = {DdlRecepcionUsados.SelectedValue}") DdlBCIUsado.DataSource = DTBCIUsados.FiltraParametros(String.Format("CveTamaño = {0}", DrTamanio("CveTamaño"))) Else DdlBCIUsado.Items.Clear() @@ -8552,7 +8552,7 @@ Partial Class PV DdlRegimenFiscalCliente.DataBind() Else Dim dt As DataTable = GlobalDTRegimenesFiscales(RdTipoPersona.SelectedValue.ToEntero).FiltraParametros("", "CodigoRegimenFiscal") - Dim Val As String + Dim Val As String = "" If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then 'verifico que sino existe el valor. lo limpie diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index dd685d23e..906b22afb 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -2380,7 +2380,7 @@ Partial Class ProductosyServicios Protected Sub DdlFraccionArancelaria_selectedindexchange(sender As Object, e As EventArgs) If DdlFraccionArancelaria.SelectedValue.ToEntero > 0 Then - LblUnidadAduana.Text = GlobalDTFraccionArancelaria().FiltraParametros($"CveFraccionArancelaria = {DdlFraccionArancelaria.SelectedValue}")(0)("ClaveSATUnidadAduanaDescripcion").ToString + LblUnidadAduana.Text = GlobalDTFraccionArancelaria().CopyToDataTable.FiltraParametros($"CveFraccionArancelaria = {DdlFraccionArancelaria.SelectedValue}")(0)("ClaveSATUnidadAduanaDescripcion").ToString End If End Sub diff --git a/Ventas/RepVentasAutorizaciones.aspx b/Ventas/RepVentasAutorizaciones.aspx index f0af1eacd..d8c3d911e 100644 --- a/Ventas/RepVentasAutorizaciones.aspx +++ b/Ventas/RepVentasAutorizaciones.aspx @@ -16,7 +16,7 @@ - <%--
  • +<%--
  • Ver Dlls en pesos
  • @@ -25,13 +25,13 @@ Ver Grafica - +
    --%>
  • - PDF + Generar PDF
  • - Excel -
  • --%> + Exportar Excel + diff --git a/Ventas/RepVentasAutorizaciones.aspx.cs b/Ventas/RepVentasAutorizaciones.aspx.cs index f230309b6..63655bfe1 100644 --- a/Ventas/RepVentasAutorizaciones.aspx.cs +++ b/Ventas/RepVentasAutorizaciones.aspx.cs @@ -12,12 +12,42 @@ public partial class Ventas_RepVentasAutorizaciones : ClsPaginas get { return DtDatos = (DataTable)ViewState["DtDatos"]; } set { ViewState["DtDatos"] = value; } } + private bool Consultado { + get { return Consultado = (bool)ViewState["Consultado"]; } + set { ViewState["Consultado"] = value; } + } - #endregion - protected void Page_Load(object sender, EventArgs e) + #endregion + + protected void LnkExcel_Click(object sender, EventArgs e) + { + if (Consultado) + { + GvDatos.ExportToExcelG("RepVentasAutorizaciones" + DateTime.Now, "Reporte de Autorizaciones de Ventas", UsuarioActual); + } + else + { + Alert("Por favor realice una consulta primero."); + } + } + + protected void LnkPdf_Click(object sender, EventArgs e) + { + if (Consultado) { + GvDatos.GenerarReportePDF("Reporte de Autorizaciones de Ventas"); + } else { + Alert("Por favor realice una consulta primero."); + } + } + public override void VerifyRenderingInServerForm(System.Web.UI.Control control) + { + } + + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { + Consultado = false; InicializaValores(); } } @@ -45,6 +75,7 @@ public partial class Ventas_RepVentasAutorizaciones : ClsPaginas protected void BtnConsultar_Click(object sender, EventArgs e) { Consulta(); + Consultado = true; } private void Consulta() diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 043bfd18a..92084a0bb 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -3505,7 +3505,7 @@ Forma de entrega: - +