diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index 506741f34..d5be1124a 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -105,6 +105,14 @@ Partial Class AF_AF Set(value As Integer) ViewState("AFInvCveAlmacen") = value End Set + End Property + Private Property AFInvCveSeccionAlmacen As Integer + Get + Return If(ViewState("AFInvCveSeccionAlmacen") Is Nothing, -1, ViewState("AFInvCveSeccionAlmacen").ToString.ToEntero()) + End Get + Set(value As Integer) + ViewState("AFInvCveSeccionAlmacen") = value + End Set End Property Private Property AFInvSerie As String Get @@ -2102,8 +2110,8 @@ Partial Class AF_AF If AFInvCvePS > 0 AndAlso AFInvCveAlmacen > 0 Then Dim CveUMInv = GlobalDTPS(CveEmpresaActual, CvePS:=AFInvCvePS).FiltroPrimeroValor("CveUM").ToEntero If CveUMInv > 0 Then - CveMovimientoSalidaInv = ObjInventarios.AddMovimiento(AFInvCveAlmacen, 3, 1, Now, -1, UsuarioActual.CveUsuario, CveEmpresaActual, -1, -1, -1, -1, Observaciones:=$"Salida de inventario para Activo Fijo | {TxtCodigo.Text.Trim}") - If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoSalidaInv, 1, CveUMInv, AFInvCvePS, 0, -1, Serie:=AFInvSerie) Then + CveMovimientoSalidaInv = ObjInventarios.AddMovimiento(AFInvCveAlmacen, 3, 1, Now, -1, UsuarioActual.CveUsuario, CveEmpresaActual, -1, -1, -1, -1, Observaciones:=$"Salida de inventario para Activo Fijo | {TxtCodigo.Text.Trim}", Modulo:="AF1") + If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoSalidaInv, 1, CveUMInv, AFInvCvePS, 0, -1, Serie:=AFInvSerie, CveSeccionAlmacen:=AFInvCveSeccionAlmacen) Then ErrorGuardar = True End If Else @@ -3051,6 +3059,7 @@ Partial Class AF_AF AFInvSerie = "" AFInvCvePS = -1 AFInvCveAlmacen = -1 + AFInvCveSeccionAlmacen = -1 Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlAFInvPS.SelectedValue.ToEntero).FiltroPrimero("") If DrPS Is Nothing Then Exit Sub @@ -3076,6 +3085,7 @@ Partial Class AF_AF AFInvSerie = "" AFInvCvePS = -1 AFInvCveAlmacen = -1 + AFInvCveSeccionAlmacen = -1 Alert("No hay existencias suficientes del producto. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") @@ -3094,7 +3104,7 @@ Partial Class AF_AF AFInvCvePS = DdlAFInvPS.SelectedValue.ToEntero AFInvCveAlmacen = DdlAFInvAlmacen.SelectedValue.ToEntero - + AFInvCveSeccionAlmacen = DdlSeccionAlmacen.SelectedValue.ToEntero RegistraScript("$('#ModalAFInv').modal('hide')", "hide") DivAFInvAdvertencia.Visible = True @@ -3652,6 +3662,7 @@ Partial Class AF_AF DivSeccion.Visible = CBool(drr("AplicaSeccion")) DdlSeccionAlmacen.Items.Clear() If CBool(drr("AplicaSeccion")) Then + 'CargaSeccionesAlmacen(DdlSeccionAlmacen, DdlAFInvAlmacen.SelectedValue.ToEntero, DdlAFInvPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAFInvAlmacen.SelectedValue.ToEntero, DdlAFInvPS.SelectedValue.ToEntero) DdlSeccionAlmacen.DataSource = dtt DdlSeccionAlmacen.DataBind() diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index ee7e27b43..410a4db11 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -3241,6 +3241,198 @@ Public Class ClsAF Return Retorno End Function #End Region +#Region "M E T R I C A S" + Public Function GetMetricas(CveMetrica As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_MetricasGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMetrica", SqlDbType.Int).Value = CveMetrica + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las métricas de Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddMetricas(Metrica As String) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_MetricasAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Metrica", SqlDbType.Int).Value = Metrica + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar la métrica de Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function DeleteMetricas(CveMetrica As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_MetricasRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMetrica", SqlDbType.Int).Value = CveMetrica + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar la métrica de Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetMetricasValores(Optional CveMetricaValor As Integer = -1, Optional CveAF As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveUsuario As Integer = -1, + Optional CveSubProyecto As Integer = -1, Optional Fecha As String = "1900-01-01", Optional FechaIng As String = "1900-01-01") As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_MetricasValoresGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMetricaValor", SqlDbType.Int).Value = CveMetricaValor + .Add("@CveAF", SqlDbType.Int).Value = CveAF + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@Fecha", SqlDbType.DateTime).Value = Fecha + .Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los valores de métricas de Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddMetricasValores(Optional CveAF As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveUsuario As Integer = -1, + Optional CveSubProyecto As Integer = -1, Optional Fecha As String = "1900-01-01", Optional FechaIng As String = "1900-01-01") As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_MetricasValoresAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAF", SqlDbType.Int).Value = CveAF + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@Fecha", SqlDbType.DateTime).Value = Fecha + .Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el valor de métrica de Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveMetricasValores(CveMetricaValor As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_MetricasValoresRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMetricaValor", SqlDbType.Int).Value = CveMetricaValor + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el valor de métrica de Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetMetricasValoresDetalle(Optional CveMetricaValor As Integer = -1, Optional CveMetrica As Integer = -1) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_MetricasValoresDetalleGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMetricaValor", SqlDbType.Int).Value = CveMetricaValor + .Add("@CveMetrica", SqlDbType.Int).Value = CveMetrica + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los valores de métricas de Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddMetricasValoresDetalle(Optional CveMetricaValor As Integer = -1, Optional CveMetrica As Integer = -1, Optional Valor As String = "-1") As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_MetricasValoresDetalleAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMetricaValor", SqlDbType.Int).Value = CveMetricaValor + .Add("@CveMetrica", SqlDbType.Int).Value = CveMetrica + .Add("@Valor", SqlDbType.NVarChar).Value = Valor + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el detalle de los valores de métricas de Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function DeleteMetricasValoresDetalle(Optional CveMetricaValor As Integer = -1, Optional CveMetrica As Integer = -1, Optional Valor As String = "-1") As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_MetricasValoresDetalleAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMetricaValor", SqlDbType.Int).Value = CveMetricaValor + .Add("@CveMetrica", SqlDbType.Int).Value = CveMetrica + .Add("@Valor", SqlDbType.NVarChar).Value = Valor + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el detalle de los valores de métricas de Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + +#End Region #Region " IDisposable Support " diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 8990aaf81..b9f29edb9 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -943,7 +943,7 @@ Public Class ClsBancos #Region "Complemento Pagos" - Public Function GeneraTimbrePago(CveIE As Integer, CveVenta As Integer, UsuarioActual As Usuario, Optional CveCliente As Integer = -1, Optional CFDIRelacionado As String = "-1", Optional EsCancelacion As Boolean = False, Optional EsRegeneracion As Boolean = False, Optional CvePrePoliza As Integer = -1, Optional FechaTimbrado As DateTime = MinFecha) As Boolean + Public Function GeneraTimbrePago(CveIE As Integer, CveVenta As Integer, UsuarioActual As Usuario, Optional CveCliente As Integer = -1, Optional CFDIRelacionado As String = "-1", Optional EsRegeneracion As Boolean = False, Optional CvePrePoliza As Integer = -1, Optional FechaTimbrado As DateTime = MinFecha) As Boolean If FechaTimbrado = MinFecha Then FechaTimbrado = DateTime.Now Dim Serie As String = "Pag" @@ -954,11 +954,11 @@ Public Class ClsBancos Dim dttpagos As DataTable = Nothing Dim dr As Data.DataRow = Nothing - If GetComplementoPagosRep(-1, Now.AddYears(-2), Now, If(CvePrePoliza > 0, -1, CveIE), CveVenta, If(EsCancelacion OrElse EsRegeneracion, 2, 1), UsuarioActual.CveEmpresa, CvePrePoliza:=CvePrePoliza) Then + If GetComplementoPagosRep(-1, Now.AddYears(-2), Now, If(CvePrePoliza > 0, -1, CveIE), CveVenta, If(EsRegeneracion, 2, 1), UsuarioActual.CveEmpresa, CvePrePoliza:=CvePrePoliza) Then dr = DtResultados.FiltroPrimero("CveVenta IS NULL") dttpagos = DtResultados.FiltraParametros("CveVenta > 0") End If - If EsCancelacion Then Estatus = 2 + 'If EsCancelacion Then Estatus = 2 If EsRegeneracion Then Estatus = 3 @@ -1044,9 +1044,9 @@ Public Class ClsBancos End Select - If EsCancelacion AndAlso (CFDIRelacionado = "-1" OrElse CFDIRelacionado = "") Then - Mensaje += " La cancelación debe de tener documento relacionado" - End If + 'If EsCancelacion AndAlso (CFDIRelacionado = "-1" OrElse CFDIRelacionado = "") Then + ' Mensaje += " La cancelación debe de tener documento relacionado" + 'End If If Not Mensaje.Length = 0 Then GuardaLog(Mensaje) @@ -1061,7 +1061,7 @@ Public Class ClsBancos Timbre = Timbrado.PreparaTimbrePago(RFCEmpresa, UsuarioActual.Empresa.Empresa, UsuarioActual.Empresa.CodigoRegimenFiscal, RFCCliente, dr("NombreCliente").ToString, Serie, Folio.ToString, FechaTimbrado, Cuentapago, dr("FechaDocumento").ToString.ToDate, dr("ClaveFormaPagoSAT").ToString, dr("AbreviaturaSAT").ToString, dr("VentasTotalPagado").ToString.ToDouble, - UsuarioActual.Empresa.CP.ToString, CuentaBeneficiario, dr("TipoCambioPago").ToString.ToDouble, dttpagos, CFDIRelacionado:=CFDIRelacionado, EsCancelacion:=EsCancelacion) + UsuarioActual.Empresa.CP.ToString, CuentaBeneficiario, dr("TipoCambioPago").ToString.ToDouble, dttpagos, CFDIRelacionado:=CFDIRelacionado, EsCancelacion:=False) ''PREPARA PARA CANCELACION POR SUSTITUCION DE COMPLEMENTO DE PAGO 'If CFDIRelacionado <> "-1" And CFDIRelacionado <> "" Then @@ -4723,7 +4723,7 @@ Public Class ClsBancos strBody.AppendFormat(" ") - For Each dr As DataRow In DtResultados.FiltraParametros("CveConceptoContable IN (17) AND CveCompra > 0").Rows + For Each dr As DataRow In DtResultados.FiltraParametros("CveConceptoContable IN (17,312) AND CveCompra > 0").Rows strBody.AppendFormat(" ") strBody.AppendFormat(" {0}", dr("Fecha").ToString.ToDate.ToShortDateString()) strBody.AppendFormat(" {0}", dr("SerieFolio").ToString) diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index 9435c83d1..9d76674c8 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -930,9 +930,17 @@ Public Class ClsClientes Retorno = True Catch Ex1 As SqlException If Ex1.Message.Contains("Número: 2627;") Then - Alert("El Cliente no se guardo debido a que actualmente se encuentra registrado.", TipoMensaje.MsgAdvertencia) - ElseIf Ex1.Message.Contains("'UN_ClientesRFCEmpresa'") Then - Alert($"El Cliente no se guardo debido a que el RFC {RFC} se encuentra asignado a otro cliente.", TipoMensaje.MsgAdvertencia) + Alert("El Cliente no se guardo debido a que actualmente se encuentra registrado.", TipoMensaje.MsgAdvertencia) + ElseIf Ex1.Message.Contains("Número: 2601;") Then + + If Ex1.Message.Contains("UN_ClientesRFCEmpresa") Then + Alert($"El Cliente no se guardo debido a que el RFC {RFC} se encuentra asignado a otro cliente.", TipoMensaje.MsgAdvertencia) + End If + + If Ex1.Message.Contains("IND_Clientes_Codigo") Then + Alert("Ya existe un cliente registrado con el mismo Código.", TipoMensaje.MsgAdvertencia) + End If + Else Me.OnError("Ocurrió un error al intentar Actualizar los datos del Cliente.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 202c993ec..0fa040293 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -1211,11 +1211,11 @@ Public Class ClsContabilidad CveConceptoContable = dr("CveConceptoContable").ToString().ToEntero Select Case CveConceptoContable - Case 6, 5, 17, 14, 19, 15, 16, 272, 275 + Case 6, 5, 17, 14, 19, 15, 16, 272, 275, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316 SigReferencia = dr("CveCompra").ToString.ContaReferencia(TipoContaReferencia.Compra) - Case 2, 4, 1, 13, 61, 62, 63, 8, 9, 91, 251, 226 + Case 2, 4, 1, 13, 61, 62, 63, 8, 9, 91, 251, 226, 291, 292, 293, 294, 295, 296 SigReferencia = dr("CveVenta").ToString.ContaReferencia(TipoContaReferencia.Venta) - Case 30, 66, 92 + Case 30, 66, 92, 204 SigReferencia = dr("CveIE").ToString.ContaReferencia(TipoContaReferencia.Banco) End Select @@ -3876,6 +3876,32 @@ Public Class ClsContabilidad Return Retorno End Function + + Public Function GetLibroDiario(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer) As Boolean + Dim Retorno = False + + 'SqlAdapter.SelectCommand.t + + DataAdapter("PA_Conta_LibroDiario") + + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + SqlAdapter.SelectCommand.CommandTimeout = 0 + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + Me.OnError("Ocurrió un error al obtener libro diario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + #End Region #Region "I N C O N S I S T E N C I A S" @@ -4096,7 +4122,7 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function GetAnexoCatalogoMensual(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer) As Boolean + Public Function GetAnexoCatalogoMensual(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, Divisor As Integer, CveUsuario As Integer, Periodo As Integer) As Boolean Dim Retorno = False DataAdapter("PA_Conta_AnexoCatalogoMensualGet") @@ -4106,39 +4132,49 @@ Public Class ClsContabilidad .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio .Add("@CveSubproyecto", SqlDbType.Int).Value = CveSubproyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Divisor", SqlDbType.Int).Value = Divisor + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Periodo", SqlDbType.Int).Value = Periodo End With Try SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - Me.OnError("Ocurrió un error al obtener el Estado Resultados Horizontal CC", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Me.OnError("Ocurrió un error al obtener el Estado Resultados Horizontal Mensual", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno End Function - Public Function GetAnexoCatalogoAnual(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer) As Boolean + Public Function GetAnexoCatalogoAnual(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, EjercicioFinal As Integer, Divisor As Integer, CveUsuario As Integer, Periodo As Integer) As Boolean Dim Retorno = False DataAdapter("PA_Conta_AnexoCatalogoAnualGet") With SqlAdapter.SelectCommand.Parameters + .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio .Add("@CveSubproyecto", SqlDbType.Int).Value = CveSubproyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@EjercicioFinal", SqlDbType.Int).Value = EjercicioFinal + .Add("@Divisor", SqlDbType.Int).Value = Divisor + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Periodo", SqlDbType.Int).Value = Periodo + End With Try SqlAdapter.Fill(DSet) Retorno = True Catch ex As Exception - Me.OnError("Ocurrió un error al obtener el Estado Resultados Horizontal CC", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Me.OnError("Ocurrió un error al obtener el Estado Resultados Horizontal Anual", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno End Function - Public Function GetAnexoCatalagoCC(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer) As Boolean + + Public Function GetAnexoCatalagoCC(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, Divisor As Integer, Periodo As Integer) As Boolean Dim Retorno = False DataAdapter("PA_Conta_AnexoCatalogoCCGet") @@ -4148,6 +4184,10 @@ Public Class ClsContabilidad .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio .Add("@CveSubproyecto", SqlDbType.Int).Value = CveSubproyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Divisor", SqlDbType.Int).Value = Divisor + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Periodo", SqlDbType.Int).Value = Periodo + End With Try @@ -6176,7 +6216,35 @@ Public Class ClsContabilidad End Function - Public Function GetEstadosAnualHorizontal(FechaI As Date, FechaF As Date, CveSubProyecto As Integer, Divisor As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional Tipo As Integer = 1) As Boolean + + Public Function GetAnexoCatalogoMensualHorizontal(IdCuenta As Integer, FechaI As Date, FechaF As Date, OpcionCuentas As Integer, CveSubProyecto As String, CveEmpresa As Integer, Optional TipoMovtos As Integer = -1, Optional SAT As Integer = 0) As Boolean + Dim Retorno = False + + DataAdapter("PA_Conta2_AnexoCatalogoMensualHorizontalGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@IdCuentaPadre", SqlDbType.Int).Value = IdCuenta + .Add("@Tipo", SqlDbType.Int).Value = TipoMovtos + .Add("@OpcionCuentas", SqlDbType.Int).Value = OpcionCuentas + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@SAT", SqlDbType.Int).Value = SAT + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + Me.OnError("Ocurrió un error al obtener el Anexo del Catalogo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function GetEstadosAnualHorizontal(FechaI As Date, FechaF As Date, CveSubProyecto As Integer, Divisor As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional Tipo As Integer = 1, Optional Periodo As Integer = 12) As Boolean Dim Retorno = False DataAdapter("PA_Conta2_EstadoResultadosAnualHorizontal") @@ -6189,6 +6257,7 @@ Public Class ClsContabilidad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@Tipo", SqlDbType.Int).Value = Tipo + .Add("@Periodo", SqlDbType.Int).Value = Periodo End With diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index 8ca3b451f..878dbc95b 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -505,9 +505,110 @@ Public Class ClsEdocumentacion ' Return Retorno ' End Function -#End Region +#End Region +#Region " P A R A M E T R O S " + + Public Function AddDocumentacionParametros(CveDocumentacion As Integer, Parametro As String, Descripcion As String, CveEmpresa As Integer, CveUsaurio As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Edoc_DocumentacionParametrosAdd") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveDocumentacion", SqlDbType.Int).Value = CveDocumentacion + .Add("@Parametro", SqlDbType.VarChar).Value = Parametro + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsaurio", SqlDbType.Int).Value = CveUsaurio + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el pa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + Public Function UpdateDocumentacionParametros(CveDocumentacionParametro As Integer, CveDocumentacion As Integer, Parametro As String, Descripcion As String, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Edoc_DocumentacionParametrosUpdate") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveDocumentacionParametro", SqlDbType.Int).Value = CveDocumentacionParametro + .Add("@CveDocumentacion", SqlDbType.Int).Value = CveDocumentacion + .Add("@Parametro", SqlDbType.VarChar).Value = Parametro + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualiar el parametro.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetDocumentacionParametros(CveDocumentacionParametro As Integer, CveDocumentacion As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Edoc_DocumentacionParametrosGet") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveDocumentacionParametro", SqlDbType.Int).Value = CveDocumentacionParametro + .Add("@CveDocumentacion", SqlDbType.Int).Value = CveDocumentacion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar los parametros.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + Public Function RemoveDocumentacionParametros(CveDocumentacionParametro As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Edoc_DocumentacionParametrosRemove") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveDocumentacionParametro", SqlDbType.Int).Value = CveDocumentacionParametro + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el parametros.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + +#End Region #Region " IDisposable Support " ' IDisposable diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 1ccb1b4c9..7d260f7a6 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -4632,7 +4632,7 @@ Public Class ClsInventarios #Region "INVENTARIOS - REPORTE UNIFORMES RESGUARDO" - Public Function GetResguardoUniformesRep(CveEmpresa As Integer, Optional CvePersonal As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveDepartamento As Integer = -1, Optional FechaInicio As String = "-1", Optional FechaFin As String = "-1") As Boolean + Public Function GetResguardoUniformesRep(CveEmpresa As Integer, Optional CvePersonal As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveDepartamento As Integer = -1, Optional FechaInicio As String = "-1", Optional FechaFin As String = "-1", Optional Todo As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_ResguardoUniformesRep") @@ -4643,6 +4643,7 @@ Public Class ClsInventarios .Add("@CveDepartamento", SqlDbType.Int).Value = CveDepartamento .Add("@FechaInicio", SqlDbType.VarChar).Value = FechaInicio .Add("@FechaFin", SqlDbType.VarChar).Value = FechaFin + .Add("@Todo", SqlDbType.Bit).Value = Todo End With Try SqlAdapter.Fill(Data) @@ -4810,7 +4811,7 @@ Public Class ClsInventarios #Region "MOVIMIENTOS DETALLE SECCION ALMACEN" - Public Function GetMovimientosDetalleSeccionesAlmacen(CveAlmacen As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Folio As String) As Boolean + Public Function GetMovimientosDetalleSeccionesAlmacen(CveAlmacen As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Folio As String, CvePS As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_MovimientosDetalleAjusteSeccionesGet") With SqlAdapter.SelectCommand.Parameters @@ -4818,6 +4819,7 @@ Public Class ClsInventarios .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Folio", SqlDbType.NVarChar).Value = Folio + .Add("@CvePS", SqlDbType.Int).Value = CvePS End With Try SqlAdapter.Fill(Data) @@ -4933,6 +4935,23 @@ Public Class ClsInventarios Return Retorno End Function + Public Function GetProductosServiciosAlmacenSeccionClasificacion(CvePS As Integer, CveAlmacen As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionClasificacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .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 ps de la seccion de almacen..", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function RemoveProductosServiciosAlmacenSeccion(CvePSAlmacenSeccion As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionRemove") diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 6abe367d1..78af613be 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -2836,7 +2836,7 @@ Public Class ClsOIEventos #End Region #Region "OI_DocumentosSubCategoria" - Public Function GetDocumentoSubCategoria(Optional CveSubCategoria As Integer = -1, Optional SubCategoria As String = "-1") As Boolean + Public Function GetDocumentoSubCategoria(Optional CveSubCategoria As Integer = -1, Optional SubCategoria As String = "-1", Optional CveCategoria As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -2845,6 +2845,7 @@ Public Class ClsOIEventos With SqlAdapter.SelectCommand.Parameters .Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria .Add("@SubCategoria", SqlDbType.NVarChar).Value = SubCategoria + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria End With Try @@ -3089,6 +3090,48 @@ Public Class ClsOIEventos Return Retorno End Function + + Public Function UpdateDocumentoAutorizacion(CveAutorizacion As Integer, CveDocumento As Integer, Comentarios As String, Adjunto As String, FechaAprobacion As Date) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosAutorizacionesUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion + .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento + .Add("@Comentarios", SqlDbType.NVarChar).Value = Comentarios + .Add("@Adjunto", SqlDbType.NVarChar).Value = Adjunto + .Add("@FechaAprobacion", SqlDbType.Date).Value = FechaAprobacion + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el usuario para autorizar el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function DesaprobarDocumentoAutorizacion(CveAutorizacion As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_DocumentosAutorizacionesDesaprobar") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al desaprobar la autorización del documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function #End Region #End Region diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 76509068b..40f6c1946 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -15,6 +15,7 @@ Imports CrystalDecisions.ReportSource Imports Stimulsoft.Report Imports System.Xml Imports System.Web.Http.ValueProviders +Imports ADServerControl 'NOTA AD TEAM @@ -278,6 +279,12 @@ Public Class ClsPaginas End Property Property GlobalDTPSATPS() As DataTable Get + If Application("GlobalDTPSATPS") Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing + ObjGrales.Dispose() + End If + GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable End Get Set(value As DataTable) @@ -352,6 +359,12 @@ Public Class ClsPaginas Property GlobalDTEstado(ClaveSATPais As String) As DataTable Get + If Application("GlobalDTEstado") Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATEstado("-1") Then Application("GlobalDTEstado") = ObjGrales.DtResultados Else Application("GlobalDTEstado") = Nothing + ObjGrales.Dispose() + End If + If ClaveSATPais <> "-1" Then Dim Dv As New DataView(DirectCast(Application("GlobalDTEstado"), DataTable), String.Format("ClaveSATPais = '{0}'", ClaveSATPais), "", DataViewRowState.CurrentRows) GlobalDTEstado = Dv.ToTable @@ -368,6 +381,12 @@ Public Class ClsPaginas Property GlobalDTMunicipio(ClaveSATEstado As String) As DataTable Get + If Application("GlobalDTMunicipio") Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATMunicipio("-1") Then Application("GlobalDTMunicipio") = ObjGrales.DtResultados Else Application("GlobalDTMunicipio") = Nothing + ObjGrales.Dispose() + End If + If ClaveSATEstado <> "-1" Then Dim Dv As New DataView(DirectCast(Application("GlobalDTMunicipio"), DataTable), String.Format("ClaveSATEstado = '{0}'", ClaveSATEstado), "", DataViewRowState.CurrentRows) GlobalDTMunicipio = Dv.ToTable @@ -384,6 +403,12 @@ Public Class ClsPaginas Property GlobalDTColonia(ClaveSATMunicipio As String) As DataTable Get + If Application("GlobalDTColonia") Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATColonia("-1") Then Application("GlobalDTColonia") = ObjGrales.DtResultados Else Application("GlobalDTColonia") = Nothing + ObjGrales.Dispose() + End If + If ClaveSATMunicipio <> "-1" Then Dim Dv As New DataView(DirectCast(Application("GlobalDTColonia"), DataTable), String.Format("ClaveSATMunicipio = '{0}'", ClaveSATMunicipio), "", DataViewRowState.CurrentRows) GlobalDTColonia = Dv.ToTable @@ -402,6 +427,11 @@ Public Class ClsPaginas Property GlobalDTPSATUM() As DataTable Get + If Application("GlobalDTPSATUM") Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATUnidadMedida Then Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATUM") = Nothing + ObjGrales.Dispose() + End If 'System.Data.EnumerableRowCollection If Not IsNothing(Application("GlobalDTPSATUM")) Then @@ -1837,37 +1867,42 @@ Public Class ClsPaginas Property GlobalDTInvPSSeccionesAlmacen(CveEmpresa As Integer, CveAlmacen As Integer, CvePS As Integer) As DataTable Get - Dim AppNombre As String = String.Format("GlobalDTInvPSSeccionesAlmacen-{0}", CveEmpresa) - 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then - Dim ObjInv As New ClsInventarios - If ObjInv.GetProductosServiciosAlmacenSeccion(-1, -1, -1, CveEmpresa) Then Application(AppNombre) = ObjInv.DtResultados - ObjInv.Dispose() - End If - If CveEmpresa <> -1 Then - Dim Str As New StringBuilder + Dim dtt As DataTable = Nothing + Dim ObjInv As New ClsInventarios + If ObjInv.GetProductosServiciosAlmacenSeccionClasificacion(CvePS, CveAlmacen, CveEmpresa) Then dtt = ObjInv.DtResultados + ObjInv.Dispose() + GlobalDTInvPSSeccionesAlmacen = dtt + 'Dim AppNombre As String = String.Format("GlobalDTInvPSSeccionesAlmacen-{0}", CveEmpresa) + ''sino existe, recarga los datos + 'If Application(AppNombre) Is Nothing Then + ' Dim ObjInv As New ClsInventarios + ' If ObjInv.GetProductosServiciosAlmacenSeccion(-1, -1, -1, CveEmpresa) Then Application(AppNombre) = ObjInv.DtResultados + ' ObjInv.Dispose() + 'End If + 'If CveEmpresa <> -1 Then + ' Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) - If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen) - If CvePS > 0 Then Str.AppendFormat("AND CvePS = {0}", CvePS) + ' If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) + ' If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen) + ' If CvePS > 0 Then Str.AppendFormat("AND CvePS = {0}", CvePS) - 'si el PS no tiene definido una seccion, toma las del Almacen - If DirectCast(Application(AppNombre), DataTable) IsNot Nothing Then - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTInvPSSeccionesAlmacen = Dv.ToTable - Dv.Dispose() - 'sino tiene datos registrados, toma los de almacen - If GlobalDTInvPSSeccionesAlmacen.Rows.Count = 0 Then - GlobalDTInvPSSeccionesAlmacen = GlobalDTSeccionAlmacen(CveEmpresa, CveAlmacen) - End If - Else - 'sino tiene datos registrados, toma los de almacen - GlobalDTInvPSSeccionesAlmacen = GlobalDTSeccionAlmacen(CveEmpresa, CveAlmacen) - End If + ' 'si el PS no tiene definido una seccion, toma las del Almacen + ' If DirectCast(Application(AppNombre), DataTable) IsNot Nothing Then + ' Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTInvPSSeccionesAlmacen = Dv.ToTable + ' Dv.Dispose() + ' 'sino tiene datos registrados, toma los de almacen + ' If GlobalDTInvPSSeccionesAlmacen.Rows.Count = 0 Then + ' GlobalDTInvPSSeccionesAlmacen = GlobalDTSeccionAlmacen(CveEmpresa, CveAlmacen) + ' End If + ' Else + ' 'sino tiene datos registrados, toma los de almacen + ' GlobalDTInvPSSeccionesAlmacen = GlobalDTSeccionAlmacen(CveEmpresa, CveAlmacen) + ' End If - Else - GlobalDTInvPSSeccionesAlmacen = DirectCast(Application(AppNombre), DataTable) - End If + 'Else + ' GlobalDTInvPSSeccionesAlmacen = DirectCast(Application(AppNombre), DataTable) + 'End If End Get Set(value As DataTable) @@ -4222,6 +4257,7 @@ Public Class ClsPaginas PaginaDict.Add("/Contabilidad2/RepAnexoCatalogoCC.aspx".ToUpper(), 594) PaginaDict.Add("/Contabilidad2/RepVariacionHaciendaPublica.aspx".ToUpper(), 595) PaginaDict.Add("/Contabilidad2/CatCuentas.aspx".ToUpper(), 596) + PaginaDict.Add("/Contabilidad2/RepLibroDiario.aspx".ToUpper(), 544) PaginaDict.Add("/Contabilidad2/RepSituacionFinancieraSAT.aspx".ToUpper(), 615) PaginaDict.Add("/Contabilidad2/RepEstadoActividadesSAT.aspx".ToUpper(), 616) @@ -4234,6 +4270,10 @@ Public Class ClsPaginas PaginaDict.Add("/Contabilidad2/PolizasImpresion.aspx".ToUpper(), 726) PaginaDict.Add("/Contabilidad2/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420) + PaginaDict.Add("/Contabilidad2/RepAnexoCatalogoMensualHorizontal.aspx".ToUpper(), -1) + + + #End Region 'CONTRATOS #Region "Contratos" @@ -4588,7 +4628,7 @@ Public Class ClsPaginas PaginaDict.Add("/OI/CatDocumentoCategoria.aspx".ToUpper(), 760) PaginaDict.Add("/OI/CatDocumentoSubCategoria.aspx".ToUpper(), 761) PaginaDict.Add("/OI/Documentos.aspx".ToUpper(), 762) - PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), 763) + PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), -1) #End Region #Region "Planeacion" 'PLANEACIÓN @@ -8112,5 +8152,22 @@ Public Class ClsPaginas If AplicaTodos <> "" Then DdlSubProyecto.Items.Insert(0, New ListItem(AplicaTodos, "-1")) End If End Sub + + Public Sub CargaSeccionesAlmacen(ByRef DdlSeccionAlmacen As DropDownList, CveAlmacen As Integer, CvePS As Integer, CveEmpresa As Integer, Optional IncluyeSeleccione As Boolean = False) + DdlSeccionAlmacen.Items.Clear() + DdlSeccionAlmacen.ClearSelection() + Dim dtsec As DataTable = GlobalDTInvPSSeccionesAlmacen(CveEmpresa, CveAlmacen, CvePS) + DdlSeccionAlmacen.DataSource = dtsec + DdlSeccionAlmacen.DataBind() + If dtsec Is Nothing Then Exit Sub + If dtsec.Rows.Count = 1 Then + DdlSeccionAlmacen.SelectedIndex = 0 + DdlSeccionAlmacen.Enabled = False + Else 'si es mayor a uno que por default seleccione el primero, que seria el predeterminado + DdlSeccionAlmacen.SelectedValueExist(dtsec.FiltroPrimeroValor("CveSeccionAlmacen", "Predeterminado = 1")) + If IncluyeSeleccione Then DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + dtsec.Dispose() + End Sub End Class diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index ad137e7d5..b29e7d852 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2197,6 +2197,7 @@ Namespace Modelos Dim ImporteAcumulado91 As Decimal = 0 Dim CveUltimaVenta As Integer = 0 If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" + IdCtaContable = 0 If tipoCambio = 1 Then IdCtaContable = ObjFactura.Cliente.IdCtaContClientes CveCuenta = ObjFactura.Cliente.CveCuentaClientes @@ -2600,8 +2601,12 @@ Namespace Modelos 'CTACONTABLE 'IdCtaContable = IdCtaContAnticipos 'CveCuenta = CveCuentaAnticipos - IdCtaContable = ObjFactura.Cliente.IdCtaContClientes - CveCuenta = ObjFactura.Cliente.CveCuentaClientes + + If tipoCambio = 1 Then + IdCtaContable = ObjFactura.Cliente.IdCtaContClientes + Else + IdCtaContable = ObjFactura.Cliente.IdCtaContMonedaExtranjera + End If CveSubProyectoContabilizar = CveSubProyectoVenta diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 802b59115..520ae6bce 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -41,6 +41,8 @@ Public Class Timbrado Retorno = New AcuseCancelacionSAT() End If Catch ex As Exception + Dim Strr As String = String.Format("Error al verificar estatus de cancelacion:{0}", ex.Message) + Strr.GuardaLog() Return Nothing End Try diff --git a/App_WebReferences/Cancelacion/Cancelacion.disco b/App_WebReferences/Cancelacion/Cancelacion.disco new file mode 100644 index 000000000..6a7ff22e0 --- /dev/null +++ b/App_WebReferences/Cancelacion/Cancelacion.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App_WebReferences/Cancelacion/cancelacion.wsdl b/App_WebReferences/Cancelacion/Cancelacion1.wsdl similarity index 71% rename from App_WebReferences/Cancelacion/cancelacion.wsdl rename to App_WebReferences/Cancelacion/Cancelacion1.wsdl index edb3d974d..05d511610 100644 --- a/App_WebReferences/Cancelacion/cancelacion.wsdl +++ b/App_WebReferences/Cancelacion/Cancelacion1.wsdl @@ -1,369 +1,496 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cancela un Cfdi en pruebas - - - - - Obtiene el estatus de un Cfdi en producción - - - - - Obtiene el estatus de un Cfdi en pruebas - - - - - Obtiene los Uuid pendientes de aceptar/rechazar de un Receptor (Producción) - - - - - Obtiene los Uuid pendientes de aceptar/rechazar de un Receptor (Pruebas) - - - - - Acepta/Rechaza una solicitud pendiente de cancelación (Producción) - - - - - Acepta/Rechaza una solicitud pendiente de cancelación (Pruebas) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cancela un Cfdi en pruebas + + + + + Obtiene el estatus de un Cfdi en producción + + + + + Obtiene el estatus de un Cfdi en pruebas + + + + + Obtiene los Uuid pendientes de aceptar/rechazar de un Receptor (Producción) + + + + + Obtiene los Uuid pendientes de aceptar/rechazar de un Receptor (Pruebas) + + + + + Acepta/Rechaza una solicitud pendiente de cancelación (Producción) + + + + + Acepta/Rechaza una solicitud pendiente de cancelación (Pruebas) + + + + + Obtiene el/los Cfdi(s) relacionado(s) de un UUID de un RFC (Pruebas) + + + + + Obtiene el/los Cfdi(s) relacionado(s) de un UUID de un RFC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences/Cancelacion/Reference.svcmap b/App_WebReferences/Cancelacion/Reference.svcmap index 9a78e9a96..b030e1612 100644 --- a/App_WebReferences/Cancelacion/Reference.svcmap +++ b/App_WebReferences/Cancelacion/Reference.svcmap @@ -19,10 +19,11 @@ - + - + + diff --git a/App_WebReferences/Cancelacion/configuration.svcinfo b/App_WebReferences/Cancelacion/configuration.svcinfo index a17bdeb3c..85e827509 100644 --- a/App_WebReferences/Cancelacion/configuration.svcinfo +++ b/App_WebReferences/Cancelacion/configuration.svcinfo @@ -2,9 +2,10 @@ - + + - + \ No newline at end of file diff --git a/App_WebReferences/Cancelacion/configuration91.svcinfo b/App_WebReferences/Cancelacion/configuration91.svcinfo index 02af02716..2e9305310 100644 --- a/App_WebReferences/Cancelacion/configuration91.svcinfo +++ b/App_WebReferences/Cancelacion/configuration91.svcinfo @@ -1,10 +1,119 @@ - + - + - CancelacionSoap + CancelacionSoap1 + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + Transport + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (Collection) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + CancelacionSoap2 @@ -94,7 +203,7 @@ TransportSelected - (Colección) + (Collection) @@ -112,10 +221,10 @@ - + - http://juancalderon-001-site6.ftempurl.com/cancelacion.asmx + https://cancel.gofac.com.mx/Cancelacion.asmx @@ -124,7 +233,7 @@ basicHttpBinding - CancelacionSoap + CancelacionSoap1 Cancelacion.CancelacionSoap @@ -187,7 +296,7 @@ False - CancelacionSoap + CancelacionSoap1 diff --git a/Ashx/GenerarPDFFactura.ashx b/Ashx/GenerarPDFFactura.ashx index e4e126787..e1b597879 100644 --- a/Ashx/GenerarPDFFactura.ashx +++ b/Ashx/GenerarPDFFactura.ashx @@ -17,6 +17,16 @@ Public Class GenerarPDFFactura : Implements IHttpHandler End Get End Property + Public ReadOnly Property EsProduccion As Boolean + Get + If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then + Return False + Else + Return (System.Configuration.ConfigurationManager.AppSettings("EsProduccion").ToString() = "1") + End If + End Get + End Property + Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim retorno As String = "no se encontro la variable" @@ -34,7 +44,13 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Dim ListaDS = New List(Of ReportDataSource) Dim Parametros As New List(Of ReportParameter) - Dim Formato = context.ModExtensiones.DirectorioBaseEmpresas + "Empresas/1/Report.rdlc" + Dim Formato As String = "" + + If datos.API_SALI Then + Formato = ModExtensiones.DirectorioBaseEmpresas + "Empresas/Grales/ReporteAPISali.rdlc" + Else + Formato = ModExtensiones.DirectorioBaseEmpresas + "Empresas/Grales/ReporteAPI.rdlc" + End If Parametros.Add(New ReportParameter("Empresa", datos.Empresa.Empresa)) Parametros.Add(New ReportParameter("RFC", datos.Empresa.RFC)) @@ -49,20 +65,21 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Parametros.Add(New ReportParameter("ImporteLetra", datos.Factura.Total.Texto2Letras())) Parametros.Add(New ReportParameter("FormaPago", datos.Factura.FormaPago)) Parametros.Add(New ReportParameter("MetodoPago", datos.Factura.MetodoPago)) - Parametros.Add(New ReportParameter("SelloCFDI", "")) - Parametros.Add(New ReportParameter("SelloSAT", "")) - Parametros.Add(New ReportParameter("CadenaOriginal", "")) + Parametros.Add(New ReportParameter("SelloCFDI", datos.Timbrado.SelloCFDI)) + Parametros.Add(New ReportParameter("SelloSAT", datos.Timbrado.SelloSAT)) + Parametros.Add(New ReportParameter("CadenaOriginal", datos.Timbrado.CadenaOriginal)) Parametros.Add(New ReportParameter("FolioFiscal", datos.Factura.UUID)) - Parametros.Add(New ReportParameter("SerieCertificadoSAT", "")) - Parametros.Add(New ReportParameter("FechaCertificado", "")) - Parametros.Add(New ReportParameter("CertificadoContribuyente", "")) + Parametros.Add(New ReportParameter("SerieCertificadoSAT", datos.Timbrado.SerieCertificadoSAT)) + Parametros.Add(New ReportParameter("FechaCertificado", datos.Timbrado.FechaCertificado)) + Parametros.Add(New ReportParameter("CertificadoContribuyente", datos.Timbrado.CertificadoContribuyente)) Parametros.Add(New ReportParameter("UsoCFDI", datos.Factura.UsoCFDI)) - Parametros.Add(New ReportParameter("Vencimiento", Now.AddDays(30))) + Parametros.Add(New ReportParameter("Vencimiento", datos.Factura.FechaVencimiento)) Parametros.Add(New ReportParameter("SubTotal", datos.Factura.SubTotal)) + Parametros.Add(New ReportParameter("Descuentos", datos.Factura.Descuentos)) Parametros.Add(New ReportParameter("IVA", datos.Factura.IVA)) Parametros.Add(New ReportParameter("IEPS", datos.Factura.IEPS)) Parametros.Add(New ReportParameter("Total", datos.Factura.Total)) - Parametros.Add(New ReportParameter("QR", "")) + Parametros.Add(New ReportParameter("QR", datos.Timbrado.QR)) Dim DtDatos As New DataTable DtDatos.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) @@ -71,8 +88,17 @@ Public Class GenerarPDFFactura : Implements IHttpHandler DtDatos.Columns.Add(New DataColumn("PU", GetType(Decimal))) DtDatos.Columns.Add(New DataColumn("IVA", GetType(Decimal))) DtDatos.Columns.Add(New DataColumn("IEPS", GetType(Decimal))) + DtDatos.Columns.Add(New DataColumn("Descuento", GetType(Decimal))) DtDatos.Columns.Add(New DataColumn("Total", GetType(Decimal))) + Dim DtImpuestos As New DataTable + DtImpuestos.Columns.Add(New DataColumn("Impuesto", GetType(String))) + DtImpuestos.Columns.Add(New DataColumn("Tipo", GetType(String))) + DtImpuestos.Columns.Add(New DataColumn("Base", GetType(Decimal))) + DtImpuestos.Columns.Add(New DataColumn("TipoFactor", GetType(String))) + DtImpuestos.Columns.Add(New DataColumn("TasaOCuota", GetType(String))) + DtImpuestos.Columns.Add(New DataColumn("Importe", GetType(Decimal))) + For Each PS In datos.Factura.ListaProductos Dim Row = DtDatos.NewRow() Row("Cantidad") = PS.Cantidad @@ -81,13 +107,26 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Row("PU") = PS.PU Row("IVA") = PS.IVA Row("IEPS") = PS.IEPS + Row("Descuento") = PS.Descuento Row("Total") = (PS.Cantidad * PS.PU) + PS.IVA + PS.IEPS DtDatos.Rows.Add(Row) Next - ListaDS.Add(New ReportDataSource("DsProductos", DtDatos)) - ImprimirbytesPDF(context, StreamPDF(context, Formato, ListaDS, Parametros), "test") + Dim RowImpuesto = DtImpuestos.NewRow() + RowImpuesto("Impuesto") = "IVA" + RowImpuesto("Tipo") = "Traslado" + RowImpuesto("Base") = datos.Factura.SubTotal + RowImpuesto("TipoFactor") = "Tasa" + RowImpuesto("TasaOCuota") = "16%" + RowImpuesto("Importe") = datos.Factura.IVA + + DtImpuestos.Rows.Add(RowImpuesto) + + ListaDS.Add(New ReportDataSource("DsProductos", DtDatos)) + ListaDS.Add(New ReportDataSource("DsImpuestos", DtImpuestos)) + + ImprimirbytesPDF(context, StreamPDF(context, Formato, ListaDS, Parametros), "Factura") End If Catch ex As Exception @@ -97,48 +136,87 @@ Public Class GenerarPDFFactura : Implements IHttpHandler End Sub - Public Function StreamPDF(ByVal context As HttpContext, RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte() - 'limpio ReportViwer - Dim sw As New System.Diagnostics.Stopwatch() - sw.Start() - - If IsNothing(MR) Then MR = New ReportViewer - Dim Bytes As Byte() = Nothing - Try - ' MasterReporteador.LocalReport.DataSources.Clear() - For Each RDS As ReportDataSource In DataSource - MR.LocalReport.DataSources.Add(RDS) - Next - - MR.LocalReport.ReportPath = RutaReporte - MR.ProcessingMode = ProcessingMode.Local - MR.LocalReport.EnableExternalImages = True - MR.LocalReport.SetParameters(Parametros) - MR.LocalReport.Refresh() - Dim Warnings As Warning() = Nothing - Dim StreamIds As String() = Nothing - Dim MimeType As String = Nothing - Dim Encoding As String = Nothing - Dim Extension As String = Nothing - Bytes = MR.LocalReport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings) - Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException - GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") - 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 - 'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") - Catch ex As Exception - GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") - 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 - 'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") - End Try - - sw.Stop() - If sw.Elapsed.TotalSeconds > 10 Then - GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ") - End If - - Return Bytes + Public Function StreamPDF(ByVal context As HttpContext, RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte() + 'limpio ReportViwer + Dim sw As New System.Diagnostics.Stopwatch() + sw.Start() + Dim Bytes As Byte() = Nothing + + Dim bdir As String = If(RutaReporte.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory) + RutaReporte.Replace("/", "\") + If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then + RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) + End If + + If EsProduccion Then + + Dim CveUsuario As Integer = 0 + Dim CveEmpresa As Integer = 0 + + Dim wsreport As New WSRDLC.WebServiceSoapClient + Dim params As New List(Of WSRDLC.ReportParameter) + Dim ds As New DataSet + For Each rpds As ReportDataSource In DataSource + Dim dt As DataTable = DirectCast(rpds.Value, Data.DataTable) + If dt Is Nothing Then + dt = New DataTable() + Else + dt = dt.Copy() + End If + dt.TableName = rpds.Name + ds.Tables.Add(dt) + Next + For Each rpds As ReportParameter In Parametros + Dim param As New WSRDLC.ReportParameter + param.Name = rpds.Name + param.Values = {rpds.Values(0)} + params.Add(param) + Next + Bytes = wsreport.StreamPDFBytes(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario) + wsreport = Nothing + params = Nothing + Else + If IsNothing(MR) Then MR = New ReportViewer + Try + ' MasterReporteador.LocalReport.DataSources.Clear() + For Each RDS As ReportDataSource In DataSource + MR.LocalReport.DataSources.Add(RDS) + Next + + MR.LocalReport.ReportPath = RutaReporte + MR.ProcessingMode = ProcessingMode.Local + MR.LocalReport.EnableExternalImages = True + MR.LocalReport.SetParameters(Parametros) + MR.LocalReport.Refresh() + Dim Warnings As Warning() = Nothing + Dim StreamIds As String() = Nothing + Dim MimeType As String = Nothing + Dim Encoding As String = Nothing + Dim Extension As String = Nothing + Bytes = MR.LocalReport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings) + Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException + GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") + 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 + 'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") + Catch ex As Exception + GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") + 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 + 'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") + End Try + MR.Dispose() + + End If + sw.Stop() + + If sw.Elapsed.TotalSeconds > 5 Then + GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ") + End If + + Return Bytes End Function + + Public Sub ImprimirbytesPDF(ByVal context As HttpContext, bytes As Byte(), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional Descarga As Boolean = False) 'limpio ReportViwer Dim mimeType As String = Nothing @@ -181,6 +259,7 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Public Property CveCliente As Integer Public Property NombreCliente As String Public Property Fecha As DateTime + Public Property FechaVencimiento As DateTime Public Property CveSubCentroCosto As Integer Public Property CveTipoDocumento As Integer Public Property TipoDocumento As String @@ -271,10 +350,22 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Public Property RegimenFiscal As String End Class + Public Class DatosSATWS + Public Property SelloCFDI As String + Public Property SelloSAT As String + Public Property CadenaOriginal As String + Public Property SerieCertificadoSAT As String + Public Property FechaCertificado As String + Public Property CertificadoContribuyente As String + Public Property QR As String + End Class + Public Class ParametroWS Public Property Factura As FacturaWS Public Property Cliente As ClienteWS Public Property Empresa As EmpresaWS + Public Property Timbrado As DatosSATWS + Public Property API_SALI As Boolean End Class diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index 5ab24ec65..eb3f2fa7d 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -11,40 +11,64 @@ Imports Extensiones Imports System.IO Imports Modelos -Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState +Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState + + Private Property CveEmpresaFacturar As Integer = 143 Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest - context.Response.ContentType = "application/json" - Try - If context.Request.InputStream IsNot Nothing Then - Using reader As New StreamReader(context.Request.InputStream) - Dim json = reader.ReadToEnd + context.Response.ContentType = "text/plain" + Dim Retorno As Boolean = False - If Not String.IsNullOrEmpty(json) Then - Dim JsonRequest As JObject = JObject.Parse(json) - If JsonRequest IsNot Nothing Then - Dim Metodo = JsonRequest("Metodo").ToString() - If Metodo = "FactMasivaRemisiones" Then - Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString() - Dim pFechaI As String = "" - Dim pFechaF As String = "" - - If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then - pFechaI = JsonRequest("FechaI") - pFechaF = JsonRequest("FechaF") - End If - - IniciaFacturacionMasiva(context, pCveEmpresa, pFechaI, pFechaF) - End If - End If - End If - - End Using + Try + 'If context.Request.InputStream IsNot Nothing Then + ' Using reader As New StreamReader(context.Request.InputStream) + ' Dim json = reader.ReadToEnd + + ' If Not String.IsNullOrEmpty(json) Then + ' Dim JsonRequest As JObject = JObject.Parse(json) + ' If JsonRequest IsNot Nothing Then + ' Dim Metodo = JsonRequest("Metodo").ToString() + ' If Metodo = "FactMasivaRemisiones" Then + ' Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString() + ' Dim pFechaI As String = "" + ' Dim pFechaF As String = "" + + ' If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then + ' pFechaI = JsonRequest("FechaI") + ' pFechaF = JsonRequest("FechaF") + ' End If + + ' IniciaFacturacionMasiva(context, CveEmpresaFacturar, pFechaI, pFechaF) + ' End If + ' End If + ' End If + + ' End Using + 'End If + + Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString()) + If Metodo = "FactMasivaRemisiones" Then + Dim pFechaI As String = "" + Dim pFechaF As String = "" + + If context.Request("FechaI") IsNot Nothing AndAlso context.Request("FechaF") IsNot Nothing Then + pFechaI = context.Request("FechaI") + pFechaF = context.Request("FechaF") + End If + + Retorno = IniciaFacturacionMasiva(CveEmpresaFacturar, pFechaI, pFechaF) End If Catch ex As Exception ex.GuardaLog(ex.Message) - End Try + End Try + + If Retorno Then + context.Response.Write("True") + Else + context.Response.Write("False") + End If + End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable @@ -53,7 +77,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState End Get End Property - Private Sub IniciaFacturacionMasiva(ByVal context As HttpContext, pCveEmpresa As String, pFechaI As String, pFechaF As String) + Private Function IniciaFacturacionMasiva(pCveEmpresa As String, pFechaI As String, pFechaF As String) As Boolean + Dim Retorno As Boolean = True Dim JsonRetorno As New JObject() Dim CveEmpresa As Integer = pCveEmpresa.ToEntero() If CveEmpresa > 0 Then @@ -71,7 +96,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState FechaI = New DateTime(DomingoAnterior.Year, DomingoAnterior.Month, DomingoAnterior.Day, 0, 0, 0) FechaF = New DateTime(Sabado.Year, Sabado.Month, Sabado.Day, 23, 59, 59) - JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion) + JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion) + Else + Retorno = False + GuardaLogFacturacion("Ejecución no permitida, no es el dia permitido para ejecucion o no se espeficaron las fechas") End If Else FechaI = pFechaI.ToDateTime() @@ -79,11 +107,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion) End If - - - End If - context.Response.Write(JsonRetorno) - End Sub + End If + + GuardaLogFacturacion("Ejecución Exitosa, se generaron las siguientes facturas:") + GuardaLogFacturacion(JsonRetorno.ToString()) + + Return Retorno + End Function Public Shared Function GetNextWeekday(ByVal start As DateTime, ByVal day As DayOfWeek, hora As TimeSpan) As DateTime diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index bd5cbd3fa..7b3891368 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -2469,17 +2469,25 @@ Partial Class Bancos_IE - 'If CveOCSolicitudAnticipo > 0 Then - ' If TxtImporte.Text.ToDecimal > SaldoOCAnticipo Then - ' EsValido = False - ' Alert($"El importe del movimiento es mayor al saldo de la orden de compra importe movmiento {TxtImporte.Text.FormatoNumero } saldo orden de compra: {SaldoOCAnticipo.ToString.FormatoNumero}", TipoMensaje.MsgAdvertencia) + If CveOCSolicitudAnticipo > 0 Then - ' End If - 'End If - + Dim ObjOC As New ClsOC + If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then + SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal + Else + SaldoOCAnticipo = 0 + End If + ObjOC.Dispose() + + If TxtImporte.Text.ToDecimal > SaldoOCAnticipo Then + EsValido = False + Alert($"El importe del movimiento es mayor al saldo de la orden de compra importe movmiento {TxtImporte.Text.FormatoNumero } saldo orden de compra: {SaldoOCAnticipo.ToString.FormatoNumero}", TipoMensaje.MsgAdvertencia) + End If + End If Return EsValido + End Function Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs) diff --git a/Bancos/RepComplementoPago.aspx b/Bancos/RepComplementoPago.aspx index 82e03fe94..9b28d447a 100644 --- a/Bancos/RepComplementoPago.aspx +++ b/Bancos/RepComplementoPago.aspx @@ -114,7 +114,7 @@ diff --git a/Bancos/RepComplementoPago.aspx.vb b/Bancos/RepComplementoPago.aspx.vb index 287bbdbdb..bcfde9140 100644 --- a/Bancos/RepComplementoPago.aspx.vb +++ b/Bancos/RepComplementoPago.aspx.vb @@ -300,23 +300,72 @@ Partial Class Bancos_RepComplementoPago Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero Dim SerieFolioPago As String = Gvr.DataKey("SerieFolioPago").ToString - Dim CFDIRelacionado As String = Gvr.DataKey("FolioFiscalComplemento").ToString + Dim FolioFiscalCancelar As String = Gvr.DataKey("FolioFiscalComplemento").ToString + Dim CveComplementoPagoCancelar As Integer = Gvr.DataKey("CveComplementoPago").ToEntero + Dim CvePACCancelacion As Integer = UsuarioActual.Empresa.CvePAC + Dim RFCReceptorCancelar As String = Gvr.DataKey("RFC").ToString - If CFDIRelacionado <> "" Then - Dim objBancos As New ClsBancos + If FolioFiscalCancelar <> "" Then + Dim ObjCancelacion As New Timbrado + Dim ObjBanco As New ClsBancos + + If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then + + If ObjBanco.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then + + Alert("El complemento se cancelo correctamente.") + End If - If objBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, -1, CFDIRelacionado, True) Then - Alert($"Complemento {SerieFolioPago} cancelado correctamente.") Else - Alert($"Se presento un error al cancelar el complementob {SerieFolioPago}.", TipoMensaje.MsgError) + + If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then + + If ObjBanco.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then + + Alert("El complemento se cancelo correctamente.") + End If + Else + Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgError) + End If + End If - objBancos.Dispose() + ObjBanco.Dispose() + + 'Dim objBancos As New ClsBancos + + 'If objBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, -1, CFDIRelacionado, True) Then + ' Alert($"Complemento {SerieFolioPago} cancelado correctamente.") + 'Else + ' Alert($"Se presento un error al cancelar el complementob {SerieFolioPago}.", TipoMensaje.MsgError) + 'End If + + 'objBancos.Dispose() End If End Sub + Function EstatusSATCancelado(FolioFiscal As String, RFCDe As String, RFCReceptor As String) As Boolean + + Dim respuesta As Boolean = False + + Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, RFCDe, RFCReceptor, "0", True) + + If Vigencia IsNot Nothing Then + If Vigencia.Estado.ToUpper = "CANCELADO" Then + respuesta = True + Else + respuesta = False + End If + Else + respuesta = False + End If + + Return respuesta + End Function + + Protected Sub LnkSendMail_Click(sender As Object, e As EventArgs) Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) HdnSerieFolioPago.Value = gvRow.DataKey("SerieFolioPago").ToString diff --git a/Bancos/RepProgramarRecursos.aspx.vb b/Bancos/RepProgramarRecursos.aspx.vb index b5f74e352..99b914bed 100644 --- a/Bancos/RepProgramarRecursos.aspx.vb +++ b/Bancos/RepProgramarRecursos.aspx.vb @@ -142,7 +142,7 @@ Partial Class Bancos_RepProgramarRecursos DdlMoneda.DataSource = GlobalDTMonedas DdlMoneda.DataBind() - DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1)) + DdlProyecto.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1)) DdlProyecto.DataBind() DtCuentas = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) @@ -257,8 +257,8 @@ Partial Class Bancos_RepProgramarRecursos DdlSubProyecto.Items.Clear() ListSubProyecto.Items.Clear() If DdlProyecto.SelectedValue.ToEntero > 0 Then - DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1)) - ListSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1)) + DdlSubProyecto.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1)) + ListSubProyecto.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1)) Else DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) ListSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 7fce911ba..9db681e2b 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1270,14 +1270,10 @@ Partial Class Compras_Compras ' LitHProyecto.Text = "Sucursal" ' DdlSubProyecto.Items.Clear() - ' DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)) - ' DdlSubProyecto.DataBind() - ' DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + ' DdlAsignaSubProyecto.Items.Clear() - ' DdlAsignaSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)) - ' DdlAsignaSubProyecto.DataBind() - ' DdlAsignaSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + ' divproyecto.Visible = False ' divasignaproyecto.Visible = False @@ -3150,6 +3146,8 @@ Partial Class Compras_Compras ViewState("CveProveedor") = ObjProveedor.CveProveedor ViewState("CveTipoProveedor") = ObjProveedor.CveTipoProveedor + If ObjProveedor.CveTipoProveedor = 1 Then LblProveedor.Text = "Proveedor:" Else LblProveedor.Text = "Acreedor:" + CveTipoConcepto = ObjProveedor.CveTipoProveedor 'Conta ContPAQ ViewState("CtaProveedor") = ObjProveedor.IdCtaContProveedores @@ -5716,7 +5714,7 @@ Partial Class Compras_Compras importeMovimiento = importeMovimiento / TipoCambioCompra End If importeMN = importeMovimiento * TipoCambioCompra * Multiplicador - IdCtaContable = CtaProveedor + IdCtaContable = If(CveTipoConcepto = 2, CtaProveedorAcreedores, CtaProveedor) CveCuenta = CveCuentaProveedor @@ -5757,11 +5755,7 @@ Partial Class Compras_Compras CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString) idCuentaContabilizacion = 0 End If - 'Conta SIG - If CveCuenta = 0 Then - CuentasContablesInvalidasSIG.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString) - CveCuentaContabilizacion = 0 - End If + End If Next @@ -6373,11 +6367,7 @@ Partial Class Compras_Compras CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 49))("ConceptoContable").ToString) idCuentaContabilizacion = 0 End If - 'Conta SIG - If CveCuenta = 0 Then - CuentasContablesInvalidasSIG.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 49))("ConceptoContable").ToString) - CveCuentaContabilizacion = 0 - End If + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Row2("CodAF").ToString, 49, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveActivoFijo:=Row2("CveActivoFijo").ToString.ToEntero, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If @@ -6548,9 +6538,11 @@ Partial Class Compras_Compras 'SumatoriaOCINV = -SumatoriaOCINV Dim CveClasificacionCostoOC = TmpDT.FiltroPrimeroValor("CveClasificacion", "ISNULL(TipoAF, 0) <> 2 And ISNULL(CveAlmacen, 0) = 0 And ISNULL(AplicaCostoIndirecto, 0) <> 1 And ISNULL(CveTipoPS, 0) = 2").ToEntero + Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero + IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then ErrorPrepoliza = True Exit For End If @@ -6589,6 +6581,8 @@ Partial Class Compras_Compras If RegistraConcepto225 Then + + importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador @@ -6637,13 +6631,18 @@ Partial Class Compras_Compras importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 ").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then + + + Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero + + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then ErrorPrepoliza = True End If Else ErrorPrepoliza = True End If + End If End If @@ -6810,7 +6809,7 @@ Partial Class Compras_Compras If CveTipoConcepto = 2 Then CveConceptoContableComplementaria = 307 If tipoCambioActual = 1 Then - IdCtaContable = CtaProveedor + IdCtaContable = If(CveTipoConcepto = 2, CtaProveedorAcreedores, CtaProveedor) CveCuenta = CveCuentaProveedor Else IdCtaContable = CtaProveedorComplementaria @@ -6853,11 +6852,6 @@ Partial Class Compras_Compras CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) idCuentaContabilizacion = 0 End If - 'Conta SIG - If CveCuenta = 0 Then - CuentasContablesInvalidasSIG.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) - CveCuentaContabilizacion = 0 - End If If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=rw.DataKey("CveIE").ToString.ToEntero, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True @@ -7113,11 +7107,6 @@ Partial Class Compras_Compras CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) idCuentaContabilizacion = 0 End If - 'Conta SIG - If CveCuenta = 0 Then - CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) - idCuentaContabilizacion = 0 - End If 'AMORTIZACIÓN NC ESPECIAL COMPLEMENTARIA If ConceptoContableAnticipo.Contiene(60) And DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then @@ -7450,11 +7439,7 @@ Partial Class Compras_Compras CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) idCuentaContabilizacion = 0 End If - 'COnta SIG - If CveCuenta = 0 Then - CuentasContablesInvalidasSIG.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) - CveCuentaContabilizacion = 0 - End If + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True @@ -16867,14 +16852,8 @@ Partial Class Compras_Compras 'VALIDA IMPORTES 'VALIDA TOTAL CON LOS IMPORTES TOTALES Dim TempSubTotal, TempDescuentos, TempIVA, TempSubTotal2, TempRetIVA, TempRetISR, TempTotal, DifTotales, TempIEPS As Double - 'Dim TempPorcentajeRetIVA = LblRetIVA.Text.ToDouble / 100 - 'Dim TempPorcentajeRetISR = LblRetISR.Text.ToDouble / 100 - Dim Amortizacion As Decimal = 0 - If UsuarioActual.CveEmpresa = 119 Then - Amortizacion = LblAmortizacion.Text.Trim.ToDecimal - TxtSubTotal.Text = (TxtSubTotal.Text.ToDouble + Amortizacion).ToString - End If + Dim Amortizacion As Decimal = 0 Dim TieneAmortizacion As Boolean = False If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 Then TieneAmortizacion = True @@ -16884,6 +16863,12 @@ Partial Class Compras_Compras LblAmortizacion.Text = "0.00" End If + If UsuarioActual.CveEmpresa = 119 AndAlso TieneAmortizacion Then + Amortizacion = LblAmortizacion.Text.Trim.ToDecimal + TxtSubTotal.Text = (TxtSubTotal.Text.ToDouble + Amortizacion).ToString + End If + + TempSubTotal = TxtSubTotal.Text.ToDouble SubTotalOriginal = TxtSubTotal.Text.ToDouble SubTotal2Original = TxtSubTotal2.Text.ToDouble @@ -17388,9 +17373,9 @@ Partial Class Compras_Compras Private Sub CargaSubProyecto() Dim CveProyecto = If(DdlProyecto.SelectedValue.ToEntero > 0, DdlProyecto.SelectedValue.ToEntero, -1) DdlSubProyecto.Items.Clear() - If CveProyecto > 0 Then - DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(CveProyecto, -1, UsuarioActual.CveEmpresa, 1)) - End If + + DdlSubProyecto.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(CveProyecto, -1, UsuarioActual.CveEmpresa, 1)) + DdlSubProyecto.DataBind() DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub @@ -19512,6 +19497,8 @@ Partial Class Compras_Compras '' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero + Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero + If DiferenciaInvOC.RoundSQL() <> 0 Then CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If CvePrePoliza > 0 Then @@ -19523,14 +19510,14 @@ Partial Class Compras_Compras Dim DifImporte As Decimal = DiferenciaInvOC - (ImporteME + ImporteMEComp) - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, ConceptoPartida, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, ConceptoPartida, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=CveSubProyecto) Then Retorno = False Exit For End If If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteME, SerieFolio, 228, ConceptoPartida, Fecha, IdCtaContableRecepcionOCME, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteME, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMEComp, SerieFolio, 229, ConceptoPartida, Fecha, IdCtaContableRecepcionOCComplementaria, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteMEComp, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then - If DifImporte <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifImporte, SerieFolio, 69, ConceptoPartida, Fecha, IdCtaContable69, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DifImporte, ImporteME:=DifImporte, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle, CveClasificacion:=CveClasificacionCostoOC) Then + If DifImporte <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifImporte, SerieFolio, 69, ConceptoPartida, Fecha, IdCtaContable69, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DifImporte, ImporteME:=DifImporte, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle, CveClasificacion:=CveClasificacionCostoOC, CveSubProyecto:=CveSubProyecto) Then Retorno = False Exit For End If @@ -19544,7 +19531,7 @@ Partial Class Compras_Compras End If Else '2018.11.24 se cambia concepto 177, de cargo a abono negativo., petición MALL - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), ConceptoPartida, Fecha, If(ConceptoSalida = 0, IdCtaContableAlmacen, IdCtaContableRecepcionOCER), -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveCuenta:=CveCuentaAlmacen, CveOCDetalle:=CveOCDetalle) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), ConceptoPartida, Fecha, If(ConceptoSalida = 0, IdCtaContableAlmacen, IdCtaContableRecepcionOCER), -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveCuenta:=CveCuentaAlmacen, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=CveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaInvOC, SerieFolio, 176, ConceptoPartida, Fecha, IdCtaContableRecepcionOC, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then Retorno = False Exit For diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 1c4f06b5f..39658a220 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1327,7 +1327,7 @@ Partial Class PopUpVerFactura Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacen}").ToString.ToEntero - If CveTipoAlmacen = 19 Or CveTipoAlmacen = 20 Then + If CveTipoAlmacen = 20 Then CveConcepto = 24 End If @@ -1341,7 +1341,7 @@ Partial Class PopUpVerFactura EstadoOrigen, PaisOrigen, CPOrigen, CalleDestino, NoExtDestino, ColoniaDestino, LocalidadDestino, MunicipioDestino, EstadoDestino, PaisDestino, CPDestino, FechaMovimiento, NombreCapturo, PuestoRecibio, PuestoEnrego, RazonSocial, ResponsableCarga, ResponsableRecibio, NombreCliente, - CantidadProductos:=CantidadProductos, CantidadUsados:=CantidadUsados) + CantidadProductos:=CantidadProductos, CantidadUsados:=CantidadUsados, CveTipoAlmacen:=CveTipoAlmacen) End Sub Private Sub PUanacExtr(CveMoneda As Integer) 'preciounitario a moneda nacional o extranjera @@ -1358,7 +1358,7 @@ Partial Class PopUpVerFactura Remision As String, Proveedor As String, CalleOrigen As String, NoExtOrigen As String, ColoniaOrigen As String, LocalidadOrigen As String, MunicipioOrigen As String, EstadoOrigen As String, PaisOrigen As String, CPOrigen As String, CalleDestino As String, NoExtDestino As String, ColoniaDestino As String, LocalidadDestino As String, MunicipioDestino As String, EstadoDestino As String, PaisDestino As String, CPDestino As String, FechaMovimiento As Date, NombreCapturo As String, PuestoRecibio As String, PuestoEntrego As String, - RazonSocial As String, ResponsableCarga As String, ResponsableRecibio As String, NombreCliente As String, Optional CantidadProductos As Decimal = 0, Optional CantidadUsados As Decimal = 0) + RazonSocial As String, ResponsableCarga As String, ResponsableRecibio As String, NombreCliente As String, Optional CantidadProductos As Decimal = 0, Optional CantidadUsados As Decimal = 0, Optional CveTipoAlmacen As Integer = -1) Select Case CveConcepto @@ -1444,8 +1444,9 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("Concepto", ConceptoFormato)) params.Add(New ReportParameter("Almacen", Almacen)) - params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) - + params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) + + params.Add(New ReportParameter("Folio", Folio)) params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0, dr("SerieFolio").ToString, ""))) @@ -1455,6 +1456,10 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Fecha", Fecha)) End If + If UsuarioActual.CveEmpresa = 72 Then + params.Add(New ReportParameter("CveTipoAlmacen", CveTipoAlmacen.ToString())) + End If + params.Add(New ReportParameter("Observaciones", Observaciones)) If UsuarioActual.CveEmpresa.Contiene(72, 80) Then @@ -2460,19 +2465,19 @@ Partial Class PopUpVerFactura If (UsuarioActual.CveEmpresa = 72) Then params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) End If - ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidasGarantia.rdlc", DtMovimientos, params, String.Format("SalidaGarantia{0}", Folio.ToString), RDSName:="DsInventarios") - 'Else - ' params.Add(New ReportParameter("Folio", Folio)) - ' params.Add(New ReportParameter("Fecha", Fecha)) - ' params.Add(New ReportParameter("Almacen", Almacen)) - ' params.Add(New ReportParameter("SubProyecto", SubProyecto)) - ' params.Add(New ReportParameter("Observaciones", Observaciones)) - ' params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) - ' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) - ' ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios") - 'End If - - + ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidasGarantia.rdlc", DtMovimientos, params, String.Format("SalidaGarantia{0}", Folio.ToString), RDSName:="DsInventarios") + 'Else + ' params.Add(New ReportParameter("Folio", Folio)) + ' params.Add(New ReportParameter("Fecha", Fecha)) + ' params.Add(New ReportParameter("Almacen", Almacen)) + ' params.Add(New ReportParameter("SubProyecto", SubProyecto)) + ' params.Add(New ReportParameter("Observaciones", Observaciones)) + ' params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) + ' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) + ' ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios") + 'End If + + Case 18 'D E V O L U C I O N D E L C L I E N T E Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/DevolucionCliente.rdlc", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) @@ -2649,36 +2654,36 @@ Partial Class PopUpVerFactura ImprimirPDF(Archivo, DtMovimientos, params, String.Format("Salida por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios") ElseIf CveConcepto = 22 Then ImprimirPDF(Archivo, DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios") - End If - - 'Case 22 'ENTRADA POR PRESTAMO - ' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - ' Dim params As New List(Of ReportParameter) - - ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - ' If Imagen.Exists Then - ' params.Add(New ReportParameter("LogoPath", logouri)) - ' Else - ' params.Add(New ReportParameter("LogoPath", "")) - ' End If - - ' params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) - ' params.Add(New ReportParameter("Concepto", "Entrada por Prestamo")) - ' params.Add(New ReportParameter("Almacen", Almacen)) - ' params.Add(New ReportParameter("Fecha", Fecha)) - ' params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) - ' params.Add(New ReportParameter("Folio", Folio)) - ' params.Add(New ReportParameter("Descuentos", "")) - ' params.Add(New ReportParameter("IVA", "")) - ' params.Add(New ReportParameter("Total", "")) - ' 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) - ' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) - ' params.Add(New ReportParameter("FacturadoA", NombreCliente)) - ' If (UsuarioActual.CveEmpresa = 72) Then - ' params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) - ' End If - ' ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios") - + End If + + 'Case 22 'ENTRADA POR PRESTAMO + ' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + ' Dim params As New List(Of ReportParameter) + + ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + ' If Imagen.Exists Then + ' params.Add(New ReportParameter("LogoPath", logouri)) + ' Else + ' params.Add(New ReportParameter("LogoPath", "")) + ' End If + + ' params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) + ' params.Add(New ReportParameter("Concepto", "Entrada por Prestamo")) + ' params.Add(New ReportParameter("Almacen", Almacen)) + ' params.Add(New ReportParameter("Fecha", Fecha)) + ' params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) + ' params.Add(New ReportParameter("Folio", Folio)) + ' params.Add(New ReportParameter("Descuentos", "")) + ' params.Add(New ReportParameter("IVA", "")) + ' params.Add(New ReportParameter("Total", "")) + ' 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) + ' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) + ' params.Add(New ReportParameter("FacturadoA", NombreCliente)) + ' If (UsuarioActual.CveEmpresa = 72) Then + ' params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) + ' End If + ' ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios") + Case 24 'SALIDA POR RESGUARDO If DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 20 Or DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 19 Then Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) @@ -3153,11 +3158,11 @@ Partial Class PopUpVerFactura If CveConcepto = 2 Then ElseIf CveConcepto = 3 Then End If - End Sub - - + End Sub + + #End Region - + #Region "OP = 'OC' - IMPRIME PDF OC" Private Sub ImprimePDFOC(CveOrdenCompra As Integer) Dim reporte As Byte() = NewGeneraBytesOC(CveOrdenCompra, ConBitacora:=(UsuarioActual.Empresa.Funcionalidad(119) = "1")) diff --git a/Contabilidad/LibroDiario.aspx.vb b/Contabilidad/LibroDiario.aspx.vb index d3507a095..fd61a89cf 100644 --- a/Contabilidad/LibroDiario.aspx.vb +++ b/Contabilidad/LibroDiario.aspx.vb @@ -51,11 +51,12 @@ Partial Class Contabilidad_LibroDiario InicializaValores() - If UsuarioActual.Empresa.UsaAC Then - BtnConsultar.Enabled = True - Else - Alert("La empresa no usa Armonización Contable", TipoMensaje.MsgError) - End If + BtnConsultar.Enabled = True + 'If UsuarioActual.Empresa.UsaAC Then + ' BtnConsultar.Enabled = True + 'Else + ' Alert("La empresa no usa Armonización Contable", TipoMensaje.MsgError) + 'End If End If End Sub @@ -212,7 +213,6 @@ Partial Class Contabilidad_LibroDiario #Region " IMPRIMIR " -#End Region Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click 'FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate) 'FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate) @@ -245,5 +245,6 @@ Partial Class Contabilidad_LibroDiario ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/LibroDiario.rpt"), DtDatos, lista, "LibroDiario", Formato), "LibroDiario", Formato) End Sub +#End Region End Class diff --git a/Contabilidad2/RepAnexoCatalogoAnual.aspx b/Contabilidad2/RepAnexoCatalogoAnual.aspx index ffe9e4e8a..569e1ad17 100644 --- a/Contabilidad2/RepAnexoCatalogoAnual.aspx +++ b/Contabilidad2/RepAnexoCatalogoAnual.aspx @@ -25,17 +25,38 @@
    -
  • Ejercicio: +
  • Ejercicio Inicio:
  • +
  • Ejercicio Fin: + +
  • +
  • + + + + + + + + + + + + + + + + +
  • SubProyecto:
  • Divisor: - - - - + + + +
@@ -159,7 +180,10 @@ + diff --git a/Contabilidad2/RepAnexoCatalogoMensualHorizontal.aspx.vb b/Contabilidad2/RepAnexoCatalogoMensualHorizontal.aspx.vb new file mode 100644 index 000000000..e2ab70cc6 --- /dev/null +++ b/Contabilidad2/RepAnexoCatalogoMensualHorizontal.aspx.vb @@ -0,0 +1,328 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class Contabilidad_RepAnexoCatalogoMensualHorizontal + Inherits ClsPaginas + + +#Region "PROPIEDADES" + Private Property DtDatos As DataTable + Get + DtDatos = DirectCast(ViewState("DtDatos"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtDatos") = value + End Set + End Property + Private Property FechaInicio As Date + Get + FechaInicio = ViewState("FechaInicio").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaInicio") = value + End Set + End Property + + Private Property FechaFin As Date + Get + FechaFin = ViewState("FechaFin").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaFin") = value + End Set + End Property + Private Property IdCuenta As Integer + Get + IdCuenta = ViewState("CveCuenta").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveCuenta") = value + End Set + End Property + 'Private Property DTCuentas As DataTable + ' Get + ' Return CType(ViewState("DTCuentas"), DataTable) + ' End Get + ' Set(value As DataTable) + ' ViewState("DTCuentas") = value + ' End Set + 'End Property + Private Property CveSubProyecto As String + Get + CveSubProyecto = ViewState("CveSubProyecto").ToString + End Get + Set(value As String) + ViewState("CveSubProyecto") = value + End Set + End Property + + Private Property TipoReporte As Integer + Get + TipoReporte = ViewState("TP").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("TP") = value + End Set + End Property +#End Region + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + Dim ErrorParametros = True + DtDatos = Nothing + CargaTipoCuentas() + + FechaInicio = Now.FirstDayOfMonth + FechaFin = Date.Now + + 'If UsuarioActual.Empresa.UsaAC Then + ' TipoReporte = -1 + 'Else + ' TipoReporte = 1 + ' tdTipoReporte.Visible = True + ' tdTipoReporte2.Visible = True + 'End If + + + If Request("CveCuenta") IsNot Nothing AndAlso IsNumeric(Request("CveCuenta")) AndAlso Request("CveCuenta").ToEntero > 0 Then + 'If Request("FI") IsNot Nothing AndAlso Request("FI").ToString.Length = 10 AndAlso Request("FI").ToDate > "01/01/1000".ToDate Then + If Request("FF") IsNot Nothing AndAlso Request("FF").ToString.Length = 10 AndAlso Request("FF").ToDate > "01/01/1000".ToDate Then + IdCuenta = Request("CveCuenta").ToEntero + 'FechaInicio = Request("FI").ToDate + FechaFin = Request("FF").ToDate + DdlCuentas.SelectedValueExist(IdCuenta) + If DdlCuentas.SelectedValue.ToEntero <> -1 Then + 'RegistraScript("Enable();") + DdlTipoCuentas.SelectedValueExist(-2) + End If + + If Request("FI") IsNot Nothing AndAlso Request("FI").ToString.Length = 10 AndAlso Request("FI").ToDate > "01/01/1000".ToDate Then + FechaInicio = Request("FI").ToDate + Else + If Request("ER") IsNot Nothing AndAlso Request("ER").ToString = "1" Then + FechaInicio = DateSerial(Year(FechaFin), Month(FechaFin), 1) + Else + FechaInicio = ("1900/01/01").ToDate + End If + End If + + + If Request("CM") IsNot Nothing AndAlso IsNumeric(Request("CM")) AndAlso Request("CM").ToEntero > 0 Then + DdlCuenta.SelectedValueExist(Request("CM").ToString) + End If + + If Request("CveSubProyecto") IsNot Nothing AndAlso IsNumeric(Request("CveSubProyecto")) Then + CveSubProyecto = Request("CveSubProyecto").ToString + End If + + + ErrorParametros = False + + + If Request("TP") IsNot Nothing AndAlso IsNumeric(Request("TP")) AndAlso Request("TP").ToEntero > 0 Then + TipoReporte = Request("TP").ToEntero + + DdlTipoReporte.SelectedValue = TipoReporte.ToString + End If + End If + 'End If + End If + + + TxtFechaDel.Text = FechaInicio.ToShortDateString + TxtFechaAl.Text = FechaFin.ToShortDateString + + If Not ErrorParametros Then + CargaDatos() + End If + + End If + End Sub + +#Region "CARGA DATOS Y GRID" + 'Public Function WSCuentas() As String + ' Dim Str As New StringBuilder + ' Dim i As Integer = 0 + ' Dim dt As DataTable = DTCuentas '.FiltraParametros("Afectable = 1") + + ' If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then + + ' For Each dr As DataRow In dt.Rows + ' i += 1 + ' Str.AppendFormat("{{value:""{0}"",label:""{1}{3}""}}{2}", dr("CveCuenta"), dr("CtaCodigo").ToString.Replace("""", ""), If(i < dt.Rows.Count, ",", ""), If(dr("Afectable").ToString = "1", " *", "")) + ' Next + + ' End If + + + ' Return Str.ToString + 'End Function + Private Sub CargaTipoCuentas() + 'Dim ObjTipoCuenta As New ClsContPAQi(UsuarioActual.Empresa) + Dim ObjTipoCuenta As New ClsContabilidad + Dim strGlobal As String = "" + + If ObjTipoCuenta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then + Dim dr As DataRow = ObjTipoCuenta.DtResultados.FiltroPrimero("Codigo IN ('_GLOBAL')") + If dr IsNot Nothing Then strGlobal = dr.Item(0).ToString + 'DTCuentas = ObjTipoCuenta.DtResultados '.FiltraParametros("Afectable = 1") + DdlTipoCuentas.DataSource = ObjTipoCuenta.DtResultados.FiltraParametros("Codigo IN ('_ACTIVO', '_BPASIVO', '_CAPITAL', '_CUADRE', '_ESTADISTICAS', '_ORDEN', '_RACREEDOR', '_RDEUDOR', '_UTILIDAD')") + DdlCuentas.DataSource = ObjTipoCuenta.DtResultados + End If + ObjTipoCuenta.Dispose() + DdlTipoCuentas.DataBind() + 'If strGlobal.Length > 0 Then DdlTipoCuentas.Items.Insert(0, New ListItem("Todas", strGlobal)) + DdlTipoCuentas.Items.Insert(0, New ListItem("Todas las Cuentas", "-1")) + DdlTipoCuentas.Items.Add(New ListItem("Algun específico", "-2")) + DdlTipoCuentas.SelectedValue = "-2" + + DdlCuentas.DataBind() + + DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1) + DdlSubproyecto.DataBind() + End Sub + Private Sub CargaDatos() + 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) + Dim ObjConta As New ClsContabilidad + + If Request("TipoReporte") IsNot Nothing Then + TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero) + Else + TipoReporte = DdlTipoReporte.SelectedValue.ToEntero + End If + 'Dim CveSubProyecto As String + If Request("CveSubProyecto") IsNot Nothing Then + CveSubProyecto = Request("CveSubProyecto").ToString + Else + CveSubProyecto = DdlSubproyecto.SelectedValue.ToEntero.ToString + End If + + If ObjConta.GetAnexoCatalogoMensualHorizontal(IdCuenta, FechaInicio, FechaFin, DdlCuenta.SelectedValue.ToEntero, CveSubProyecto, UsuarioActual.CveEmpresa, TipoReporte) Then + + If Request("CveCuenta") IsNot Nothing AndAlso IsNumeric(Request("CveCuenta")) AndAlso Request("CveCuenta").ToEntero > 0 Then + DtDatos = ObjConta.DtResultados.FiltraParametros(" SaldoInicial <> 0 OR Cargos <> 0 OR Abonos <> 0") + Else + DtDatos = ObjConta.DtResultados + End If + + CargaGrid() + Else + DtDatos = Nothing + Alert("Ocurrio un error al cargar los datos del Anexo del Catálogo.", TipoMensaje.MsgError) + End If + + ObjConta.Dispose() + End Sub + Private Sub CargaGrid() + GvDatos.DataSource = DtDatos + 'GvDatos.Dispose() + GvDatos.DataBind() + UpDatos.Update() + If DtDatos.Rows.Count > 0 Then + RegistraScript("Scroll();") + End If + + End Sub +#End Region + + Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + + If e.Row.DBCampo("CveCuenta").ToEntero = IdCuenta Then + e.Row.ControlStyle.Font.Bold = True + 'e.Row.ControlStyle.Font.Size = 9 + 'e.Row.ControlStyle.Height = 30 + Else + e.Row.ControlStyle.Font.Bold = False + End If + + 'If e.Row.DBCampo("CtaMayor") = "4" Or e.Row.DBCampo("CtaMayor") = "1" Then + ' e.Row.ControlStyle.Font.Bold = True + 'End If + + 'Acomoda Deudor y Acreedor + If e.Row.DBCampo("Tipo") <> "D" Then + 'e.Row.FCLabel("LbSaldoInicial").Text = String.Format("{0}{1}", e.Row.DBCampo("SaldoInicial").FormatoNumero, "          ") + e.Row.FCLabel("LbSaldoInicial2").Visible = True + e.Row.FCLabel("LbSaldoActual").Visible = True + End If + + 'Colorea NEGATIVOS + If e.Row.DBCampo("SaldoInicial").ToString.ToDouble < 0 Then + e.Row.FCLabel("LbSaldoInicial").ForeColor = Drawing.Color.Red + End If + If e.Row.DBCampo("Cargos").ToString.ToDouble < 0 Then + e.Row.FCLabel("LbCargos").ForeColor = Drawing.Color.Red + End If + If e.Row.DBCampo("Abonos").ToString.ToDouble < 0 Then + e.Row.FCLabel("LbAbonos").ForeColor = Drawing.Color.Red + End If + If e.Row.DBCampo("SaldoActual").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLSaldoActual").ForeColor = Drawing.Color.Red + End If + + e.Row.FCHyperLink("HLSaldoActual").NavigateUrl = String.Format("/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&CveSubProyecto={3}&TP={4}", e.Row.DBCampo("CveCuenta"), FechaInicio.ToShortDateString, FechaFin.ToShortDateString, CveSubProyecto, TipoReporte) + End If + End Sub + + Protected Sub LnkImprimir_Click(sender As Object, e As EventArgs) Handles LnkImprimir.Click + If Not IsNothing(DtDatos) Then + ImprimirReporte() + End If + End Sub + + Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click + If Not IsNothing(DtDatos) Then + ImprimirReporte("Excel") + 'GvDatos.ExportToExcelG("AnexoCatalogo" & Now.ToShortDateString & ".xlsx") + 'GvDatos.ExportToExcelG("ExistenciasHorizontal.xlsx", "Anexo Catalogo", UsuarioActual, "".ToString, 100, 200) + End If + End Sub + Private Sub ImprimirReporte(Optional Formato As String = "PDF") + 'ubicacion del rdlc + Dim reportpath As String = "Contabilidad/Reportes/RepAnexoCatalogo.rdlc" + 'nombre del reporte + Dim fileName As String = "AnexoCatalogo" + 'parametros a enviar al reporte + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("IdCuenta", IdCuenta.ToString)) + params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("usuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri)) + params.Add(New ReportParameter("pFechaFin", FechaFin.ToString("dd/MM/yyyy"))) + params.Add(New ReportParameter("pFechaInicio", FechaInicio.ToString("dd/MM/yyyy"))) + + ImprimirPDF(reportpath, DtDatos, params, fileName, Formato) + End Sub + Public Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click + + If DdlTipoCuentas.SelectedValue.ToEntero = -2 AndAlso DdlCuentas.SelectedValue.ToEntero = -1 Then + Alert("El campo Cuenta es obligatorio.", TipoMensaje.MsgError) + Else + FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate) + FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate) + IdCuenta = If(DdlTipoCuentas.SelectedValue.ToEntero = -2, DdlCuentas.SelectedValue.ToEntero, DdlTipoCuentas.SelectedValue.ToEntero) + + CargaDatos() + End If + 'RegistraScript("Enable();") + End Sub + Protected Sub DdlTipoCuentas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoCuentas.SelectedIndexChanged + If DdlTipoCuentas.SelectedValue.ToEntero = -2 Then + DdlCuentas.Enabled = True + Else + DdlCuentas.Enabled = False + DdlCuentas.SelectedValueExist(-1) + End If + End Sub + + Public Overrides Sub VerifyRenderingInServerForm(control As Control) + + End Sub + +End Class diff --git a/Contabilidad2/RepAnexoCatalogoVertical.aspx.vb b/Contabilidad2/RepAnexoCatalogoVertical.aspx.vb index 64d542999..d0582aa0c 100644 --- a/Contabilidad2/RepAnexoCatalogoVertical.aspx.vb +++ b/Contabilidad2/RepAnexoCatalogoVertical.aspx.vb @@ -71,7 +71,7 @@ Partial Class Contabilidad2_RepAnexoCatalogoVertical Private Sub CargaDatos() Dim Conta As New ClsContabilidad - If Conta.GetAnexoCatalagoCC(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + If Conta.GetAnexoCatalagoCC(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1, 12) Then Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0) GvCC.DataSource = Conta.DSResultados.Tables(1) diff --git a/Contabilidad2/RepEstadoResultadosHorizontal.aspx b/Contabilidad2/RepEstadoResultadosHorizontal.aspx index ce71fff6b..55f95ed26 100644 --- a/Contabilidad2/RepEstadoResultadosHorizontal.aspx +++ b/Contabilidad2/RepEstadoResultadosHorizontal.aspx @@ -10,8 +10,10 @@ - - + +
  • + Generar Excel +
  • @@ -27,15 +29,15 @@
      - +
      - +
      - +
      - +
      @@ -58,10 +60,10 @@
    - -
    + +
    - +
    @@ -92,7 +94,7 @@ - + @@ -106,16 +108,16 @@ - - <%----%> + + <%-- --%> - - <%----%> + + <%-- --%> @@ -124,7 +126,7 @@

    - + @@ -161,7 +163,7 @@ - +
    + @@ -192,11 +195,13 @@ - + + - + <%----%> + @@ -298,12 +303,13 @@

    - + - + <%----%> + @@ -405,7 +411,7 @@

    - + @@ -492,14 +498,7 @@ - <%-- - - - - - --%> - - <%-- --%> + @@ -558,13 +557,14 @@ - + <%----%> + - + @@ -593,41 +593,7 @@ - <%-- - - - - - - - - - - - - - - - - - - - - - - - - --%> - - - <%-- - - - - - --%> - - <%----%> + @@ -644,13 +610,14 @@ - + <%----%> + - + @@ -700,47 +667,47 @@

    - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + <%-- @@ -756,7 +723,7 @@ - + @@ -801,7 +768,8 @@ - + <%----%> + diff --git a/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb b/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb index c051bc71c..28d168f57 100644 --- a/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb +++ b/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb @@ -3,7 +3,9 @@ Option Strict On Imports System.Data Imports System.Drawing +Imports System.IO Imports Extensiones +Imports GemBox.Spreadsheet Imports Microsoft.Reporting.WebForms Partial Class Contabilidad_RepEstadoResultadosHorizontal @@ -21,6 +23,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal ViewState("DtDatosMes") = value End Set End Property + Private Property DtIngresosMes As DataTable Get DtIngresosMes = DirectCast(ViewState("DtIngresosMes"), DataTable) @@ -244,10 +247,17 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal 'TxtFechaFin.Text = Date.Now.ToShortDateString CargaEjercicios() - DdlSubproyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) - DdlSubproyecto.DataBind() + CargarCentrosDeCosto(Nothing, DdlSubproyecto, Nothing, LblSubProyecto) + TabSubProyecto.HeaderText = LblSubProyecto.Text & " H." + + 'DdlSubproyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) + 'DdlSubproyecto.DataBind() ' CargaDatos() + + DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual) + ValidaEjercicios() + End If End Sub @@ -281,17 +291,20 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal LiEjercicioDdl2.Visible = False LiEjercicioLbl2.Visible = False - LiPeriodoDdl.Visible = False - LiPeriodoLbl.Visible = False + LiPeriodoDdl.Visible = True + LiPeriodoLbl.Visible = True LiDivisorDdl.Visible = True LiDivisorLbl.Visible = True + DdlPeriodo.SelectedValueExist(12) End If If Tab.ActiveTabIndex = 2 Then + ValidaEjercicios() + LiSubProyectoDdl.Visible = True LiSubProyectoLbl.Visible = True @@ -301,8 +314,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal LiEjercicioDdl2.Visible = True LiEjercicioLbl2.Visible = True - LiPeriodoDdl.Visible = False - LiPeriodoLbl.Visible = False + LiPeriodoDdl.Visible = True + LiPeriodoLbl.Visible = True LiDivisorDdl.Visible = True LiDivisorLbl.Visible = True @@ -326,6 +339,39 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal LiDivisorLbl.Visible = True End If + UpFiltros.Update() + End Sub + + + Protected Sub DdlEjercicio_SelectedIndexChanged(sender As Object, e As EventArgs) + ValidaEjercicios() + End Sub + + Protected Sub DdlEjercicio2_SelectedIndexChanged(sender As Object, e As EventArgs) + ValidaEjercicios() + End Sub + + Private Sub ValidaEjercicios() + + + Dim EInicio As Integer = DdlEjercicio.SelectedValue.ToEntero + + + If EInicio > DdlEjercicio2.SelectedValue.ToEntero Then + + If DdlEjercicio2.Items.Count > 0 Then + DdlEjercicio2.SelectedIndex = DdlEjercicio2.Items.Count - 1 + End If + + Dim Fejerciosio As Integer = DdlEjercicio2.SelectedValue.ToEntero + + If Not EInicio + 1 > Fejerciosio Then + DdlEjercicio2.SelectedValueExist(EInicio + 1) + End If + + End If + + UpFiltros.Update() End Sub @@ -366,6 +412,11 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal 'AÑO HORIZONTAL If Tab.ActiveTabIndex = 2 Then + + If DdlEjercicio.SelectedValue.ToEntero > DdlEjercicio2.SelectedValue.ToEntero Then + Alert("El ejercicio inicio no debe ser mayor al ejercicio fin.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If CargaDatosAnualH() End If @@ -375,6 +426,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal End If + + End Sub @@ -478,12 +531,20 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal - Private Sub SumaTotales() - 'Llena Lb´s Totales - LbTotalActual.Text = TotalActualMes.ToString.FormatoNumero - - LbTotalAnterior.Text = TotalAnteriorMes.ToString.FormatoNumero - + Private Sub SumaTotales() + 'Llena Lb´s Totales + + + If DdlDivisor.SelectedValue.ToEntero > 1 Then + LbTotalActual.Text = TotalActualMes.ToString("###,###,##0") + LbTotalAnterior.Text = TotalAnteriorMes.ToString("###,###,##0") + Else + LbTotalActual.Text = TotalActualMes.ToString("###,###,##0.00") + LbTotalAnterior.Text = TotalAnteriorMes.ToString("###,###,##0.00") + End If + + + LbTotalActual.ForeColor = If(TotalActualMes < 0, Drawing.Color.Red, Color.Black) LbTotalAnterior.ForeColor = If(TotalAnteriorMes < 0, Drawing.Color.Red, Color.Black) @@ -493,8 +554,10 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal #Region "GV´S ROW DATA BOUND" - Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then + Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then TotalActualMes += e.Row.DBCampo("ImporteActual").ToString.ToDouble TotalAnteriorMes += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble @@ -507,10 +570,20 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal End If If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then - e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) - End If + e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) + e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) + + + If DdlDivisor.SelectedValue.ToEntero > 1 Then + e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToEntero.ToString("###,###,##0") + e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToEntero.ToString("###,###,##0").ToString + Else + e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToDecimal.ToString("###,###,##0.00").ToString + End If + + End If If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then @@ -540,6 +613,14 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) End If + If DdlDivisor.SelectedValue.ToEntero > 1 Then + e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToEntero.ToString("###,###,##0") + e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToEntero.ToString("###,###,##0").ToString + Else + e.Row.FCHyperLink("HLActual").Text = e.Row.DataKey("ImporteActual").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLAnterior").Text = e.Row.DataKey("ImporteAcumulado").ToDecimal.ToString("###,###,##0.00").ToString + End If + If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red End If @@ -564,7 +645,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal FechaIMes = $"01/01/{DdlEjercicio.SelectedValue}" - FechaFMes = $"31/12/{DdlEjercicio.SelectedValue}" + Dim FechaFin As Date = $"01/{DdlPeriodo.SelectedValue.ToEntero.ToString("00")}/{DdlEjercicio.SelectedValue}".ToDate + FechaFMes = $"{FechaFin.LastDayOfMonth.Day.ToString("00")}/{DdlPeriodo.SelectedValue.ToEntero.ToString("00")}/{DdlEjercicio.SelectedValue}" Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero @@ -579,8 +661,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal ObjConta.Dispose() If DtDatosMesH IsNot Nothing Then - CargaGridsMesH() - SumaTotalesMesH() + CargaGridsMesH() Else End If @@ -616,7 +697,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Row.Item("Noviembre") = DtIngresosMesH.SUM("Noviembre", "NOT CtaMayor in (3,4)") Row.Item("Diciembre") = DtIngresosMesH.SUM("Diciembre", "NOT CtaMayor in (3,4)") - Row.Item("Nombre") = "TOTAL INGRESOS " + Row.Item("Nombre") = "TOTAL INGRESOS" Row.Item("ImporteActual") = TotalActual.ToString Row.Item("PorcentajeActual") = "100.00" Row.Item("ImporteAcumulado") = TotalAnterior.ToString @@ -714,34 +795,25 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal End Sub - Private Sub SumaTotalesMesH() - ''Llena Lb´s Totales - ''********************************************************************************* - 'LbTotalActual.Text = TotalActualMes.ToString.FormatoNumero - 'LbTotalAnterior.Text = TotalAnteriorMes.ToString.FormatoNumero - - 'LbTotalActual.ForeColor = If(TotalActualMes < 0, Drawing.Color.Red, Color.Black) - 'LbTotalAnterior.ForeColor = If(TotalAnteriorMes < 0, Drawing.Color.Red, Color.Black) - - - End Sub Protected Sub GvIngresosMesH_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then TotalActualMes += e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalAnteriorMes += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble - 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray - 'e.Row.ControlStyle.ForeColor = Drawing.Color.White + TotalAnteriorMes += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble e.Row.ControlStyle.Font.Bold = True - ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then - 'e.Row.CssClass = "SubTotales3" + ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then e.Row.ControlStyle.Font.Bold = True End If If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then + + 'e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensualHorizontal.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&FF=31/12/{DdlEjercicio.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1" + + e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" + e.Row.FCHyperLink("HLEnero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/01/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/01/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) e.Row.FCHyperLink("HLFebrero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/02/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/02/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) e.Row.FCHyperLink("HLMarzo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/03/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/03/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) @@ -756,17 +828,65 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal e.Row.FCHyperLink("HLDiciembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/12/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/12/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) + ' e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) + + e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogoMensual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" + End If - 'If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then - ' e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red - 'End If + If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Or e.Row.DBCampo("Nombre") = "TOTAL INGRESOS" Then + + If DdlDivisor.SelectedValue.ToEntero > 1 Then + + e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0") + Else + e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0.00") + End If + + End If + + + e.Row.FCHyperLink("HLEnero").ForeColor = If(e.Row.DataKey("Enero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLEnero").ForeColor) + e.Row.FCHyperLink("HLFebrero").ForeColor = If(e.Row.DataKey("Febrero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLFebrero").ForeColor) + e.Row.FCHyperLink("HLMarzo").ForeColor = If(e.Row.DataKey("Marzo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMarzo").ForeColor) + e.Row.FCHyperLink("HLAbril").ForeColor = If(e.Row.DataKey("Abril").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) + e.Row.FCHyperLink("HLMayo").ForeColor = If(e.Row.DataKey("Mayo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) + e.Row.FCHyperLink("HLJunio").ForeColor = If(e.Row.DataKey("Junio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMayo").ForeColor) + e.Row.FCHyperLink("HLJulio").ForeColor = If(e.Row.DataKey("Julio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLJulio").ForeColor) + e.Row.FCHyperLink("HLAgosto").ForeColor = If(e.Row.DataKey("Agosto").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAgosto").ForeColor) + e.Row.FCHyperLink("HLSeptiembre").ForeColor = If(e.Row.DataKey("Septiembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLSeptiembre").ForeColor) + e.Row.FCHyperLink("HLOctubre").ForeColor = If(e.Row.DataKey("Octubre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLOctubre").ForeColor) + e.Row.FCHyperLink("HLNoviembre").ForeColor = If(e.Row.DataKey("Noviembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLNoviembre").ForeColor) + e.Row.FCHyperLink("HLDiciembre").ForeColor = If(e.Row.DataKey("Diciembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLDiciembre").ForeColor) If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - End If + e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red + End If + + End If + End Sub Protected Sub GvGastosMesH_RowDataBound(sender As Object, e As GridViewRowEventArgs) @@ -786,6 +906,9 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Dim CveCuenta As Integer = e.Row.DataKey("CveCuenta").ToEntero + 'e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensualHorizontal.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&FF=31/12/{DdlEjercicio.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1" + e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoMensual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" + e.Row.FCHyperLink("HLEnero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/01/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/01/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) e.Row.FCHyperLink("HLFebrero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/02/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/02/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) e.Row.FCHyperLink("HLMarzo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/03/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/03/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) @@ -799,10 +922,62 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal e.Row.FCHyperLink("HLNoviembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/11/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/11/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) e.Row.FCHyperLink("HLDiciembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), $"01/12/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString, $"01/12/{DdlEjercicio.SelectedValue}".ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) + 'e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) + e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogoMensual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" + + End If + + + + If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Or e.Row.DBCampo("Nombre") = "TOTAL GASTOS" Then + + If DdlDivisor.SelectedValue.ToEntero > 1 Then + + 'Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre,PorcentajeAcumulado + e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0") + + Else + e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0.00") + End If + End If + + e.Row.FCHyperLink("HLEnero").ForeColor = If(e.Row.DataKey("Enero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLEnero").ForeColor) + e.Row.FCHyperLink("HLFebrero").ForeColor = If(e.Row.DataKey("Febrero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLFebrero").ForeColor) + e.Row.FCHyperLink("HLMarzo").ForeColor = If(e.Row.DataKey("Marzo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMarzo").ForeColor) + e.Row.FCHyperLink("HLAbril").ForeColor = If(e.Row.DataKey("Abril").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) + e.Row.FCHyperLink("HLMayo").ForeColor = If(e.Row.DataKey("Mayo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) + e.Row.FCHyperLink("HLJunio").ForeColor = If(e.Row.DataKey("Junio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMayo").ForeColor) + e.Row.FCHyperLink("HLJulio").ForeColor = If(e.Row.DataKey("Julio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLJulio").ForeColor) + e.Row.FCHyperLink("HLAgosto").ForeColor = If(e.Row.DataKey("Agosto").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAgosto").ForeColor) + e.Row.FCHyperLink("HLSeptiembre").ForeColor = If(e.Row.DataKey("Septiembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLSeptiembre").ForeColor) + e.Row.FCHyperLink("HLOctubre").ForeColor = If(e.Row.DataKey("Octubre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLOctubre").ForeColor) + e.Row.FCHyperLink("HLNoviembre").ForeColor = If(e.Row.DataKey("Noviembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLNoviembre").ForeColor) + e.Row.FCHyperLink("HLDiciembre").ForeColor = If(e.Row.DataKey("Diciembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLDiciembre").ForeColor) + + - End If - If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red End If @@ -818,6 +993,52 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal If e.Row.RowType = DataControlRowType.DataRow Then e.Row.Attributes.Add("style", "Font-weight: bold") + + + If DdlDivisor.SelectedValue.ToEntero > 0 Then + + e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0") + e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0") + + Else + e.Row.FCHyperLink("HLEnero").Text = e.Row.DataKey("Enero").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLFebrero").Text = e.Row.DataKey("Febrero").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLMarzo").Text = e.Row.DataKey("Marzo").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLAbril").Text = e.Row.DataKey("Abril").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLMayo").Text = e.Row.DataKey("Mayo").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLJunio").Text = e.Row.DataKey("Junio").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLJulio").Text = e.Row.DataKey("Julio").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLAgosto").Text = e.Row.DataKey("Agosto").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLSeptiembre").Text = e.Row.DataKey("Septiembre").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLOctubre").Text = e.Row.DataKey("Octubre").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLNoviembre").Text = e.Row.DataKey("Noviembre").ToDecimal.ToString("###,###,##0.00") + e.Row.FCHyperLink("HLDiciembre").Text = e.Row.DataKey("Diciembre").ToDecimal.ToString("###,###,##0.00") + End If + + e.Row.FCHyperLink("HLEnero").ForeColor = If(e.Row.DataKey("Enero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLEnero").ForeColor) + e.Row.FCHyperLink("HLFebrero").ForeColor = If(e.Row.DataKey("Febrero").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLFebrero").ForeColor) + e.Row.FCHyperLink("HLMarzo").ForeColor = If(e.Row.DataKey("Marzo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMarzo").ForeColor) + e.Row.FCHyperLink("HLAbril").ForeColor = If(e.Row.DataKey("Abril").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) + e.Row.FCHyperLink("HLMayo").ForeColor = If(e.Row.DataKey("Mayo").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAbril").ForeColor) + e.Row.FCHyperLink("HLJunio").ForeColor = If(e.Row.DataKey("Junio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLMayo").ForeColor) + e.Row.FCHyperLink("HLJulio").ForeColor = If(e.Row.DataKey("Julio").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLJulio").ForeColor) + e.Row.FCHyperLink("HLAgosto").ForeColor = If(e.Row.DataKey("Agosto").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLAgosto").ForeColor) + e.Row.FCHyperLink("HLSeptiembre").ForeColor = If(e.Row.DataKey("Septiembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLSeptiembre").ForeColor) + e.Row.FCHyperLink("HLOctubre").ForeColor = If(e.Row.DataKey("Octubre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLOctubre").ForeColor) + e.Row.FCHyperLink("HLNoviembre").ForeColor = If(e.Row.DataKey("Noviembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLNoviembre").ForeColor) + e.Row.FCHyperLink("HLDiciembre").ForeColor = If(e.Row.DataKey("Diciembre").ToDecimal < 0, Drawing.Color.Red, e.Row.FCHyperLink("HLDiciembre").ForeColor) + + End If End Sub @@ -838,7 +1059,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) Dim ObjConta As New ClsContabilidad - If ObjConta.GetEstadosAnualHorizontal(FechaIMes.ToDate, FechaFMes.ToDate, CveSubProyecto, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then + If ObjConta.GetEstadosAnualHorizontal(FechaIMes.ToDate, FechaFMes.ToDate, CveSubProyecto, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, DdlPeriodo.SelectedValue.ToEntero, Periodo:=DdlPeriodo.SelectedValue.ToEntero) Then DtDatosAnualH = ObjConta.DtResultados.FiltraParametros("(ImporteActual <> 0 OR ImporteAcumulado <> 0)") Else DtDatosAnualH = Nothing @@ -928,6 +1149,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = "100.00" Row.Item("CtaMayor") = -1 + Row.Item("CountDinamico") = DtGastosAnualH.MAX("CountDinamico") DtIngresosAnualH.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL INGRESOS " @@ -989,7 +1211,9 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal IndexData = 13 For IndexData = 13 To IndexMax + Row.Item(IndexData) = DtGastosAnualH.SUM($"[{DtIngresosAnualH.Columns(IndexData).ColumnName}]", "Not CtaMayor In (3,4)") + Next Row.Item("Nombre") = "TOTAL GASTOS" @@ -998,6 +1222,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Row.Item("ImporteAcumulado") = TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnterior * 100 / T2).ToString, "0").FormatoNumero Row.Item("CtaMayor") = -1 + Row.Item("CountDinamico") = DtGastosAnualH.MAX("CountDinamico") DtGastosAnualH.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL GASTOS" @@ -1018,11 +1243,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Next Row.Item("Nombre") = "Resultados del Ejercicio" - 'Row.Item("ImporteActual") = TotalActual.ToString - 'Row.Item("PorcentajeActual") = "100.00" Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)") - DtGastosAnualH.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)") - 'Row.Item("PorcentajeAcumulado") = "100.00" - 'Row.Item("CtaMayor") = -1 + DTTotalesAnualH.Rows.Add(Row) @@ -1062,19 +1284,41 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Dim CveCuenta As Integer = e.Row.DataKey("CveCuenta").ToEntero Dim CveSubProyecto As Integer = e.Row.DataKey("CveSubProyecto").ToEntero + If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then + e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&EjercicioFinal={DdlEjercicio2.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero Dim IndiceInicio As Integer = 1 Dim IndiceMax As Integer = 1 + CountDinamico + For IndiceInicio = 1 To IndiceMax Dim Anio As String = CType(GvGastosAnualH.Columns(IndiceInicio), BoundField).DataField - Dim Importe As String = e.Row.Cells(IndiceInicio).Text - e.Row.Cells(IndiceInicio).Text = $"{Importe}" + Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal + e.Row.Cells(IndiceInicio).Text = $"{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }" + 'e.Row.Cells(IndiceInicio).ForeColor = If(Importe < 0, Drawing.Color.Red, e.Row.Cells(IndiceInicio).ForeColor) Next IndiceInicio - e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{DdlEjercicio2.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={CveSubProyecto}" + 'e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{DdlEjercicio2.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={CveSubProyecto}" + e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&EjercicioFinal={DdlEjercicio2.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" + + + + ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -1 Then + + Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero + Dim IndiceInicio As Integer = 1 + Dim IndiceMax As Integer = 1 + CountDinamico + + For IndiceInicio = 1 To IndiceMax + + Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal + e.Row.Cells(IndiceInicio).Text = $"{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }" + + Next IndiceInicio + + End If @@ -1102,17 +1346,36 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Dim CveSubProyecto As Integer = e.Row.DataKey("CveSubProyecto").ToEntero If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then + 'e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto=-1&EjercicioFinal={DdlEjercicio2.SelectedValue}" + e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&EjercicioFinal={DdlEjercicio2.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero Dim IndiceInicio As Integer = 1 Dim IndiceMax As Integer = 1 + CountDinamico For IndiceInicio = 1 To IndiceMax Dim Anio As String = CType(GvGastosAnualH.Columns(IndiceInicio), BoundField).DataField - Dim Importe As String = e.Row.Cells(IndiceInicio).Text - e.Row.Cells(IndiceInicio).Text = $"{Importe}" + Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal + e.Row.Cells(IndiceInicio).Text = $"{If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00"))}" + 'e.Row.Cells(IndiceInicio).ForeColor = If(Importe < 0, Drawing.Color.Red, e.Row.Cells(IndiceInicio).ForeColor) + Next IndiceInicio + + 'e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{DdlEjercicio2.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={CveSubProyecto}" + e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&EjercicioFinal={DdlEjercicio2.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" + + + ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -1 Then + + Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero + Dim IndiceInicio As Integer = 1 + Dim IndiceMax As Integer = 1 + CountDinamico + + For IndiceInicio = 1 To IndiceMax + + Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal + e.Row.Cells(IndiceInicio).Text = $"{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }" + Next IndiceInicio - e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF=31/12/{DdlEjercicio2.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={CveSubProyecto}" End If If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then @@ -1161,7 +1424,6 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal If DtDatosSubProyectoH IsNot Nothing And DTSubProyectosCabecerasH IsNot Nothing Then CargaGridsSubProyectoH() - SumaTotalesSubProyectoH() End If End Sub @@ -1184,11 +1446,18 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Dim IndexSubProyectoMAx As Integer = DTSubProyectosCabecerasH.Rows.Count - 1 Dim IndexTotatles As Integer = 13 + IndexSubProyectoMAx + '34 + Dim IDX_LIMPIAR As Integer = 1 + + For IDX_LIMPIAR = 1 To 34 + CType(GvIngresosSubProyectoH.Columns(IDX_LIMPIAR), BoundField).DataField = Nothing + CType(GvIngresosSubProyectoH.Columns(IDX_LIMPIAR), BoundField).HeaderText = "" + Next + + + If DtIngresosSubProyectoH.Rows.Count > 0 Then - - - For Each dCoumn As DataColumn In DtIngresosSubProyectoH.Columns If IndexData >= 13 Then @@ -1237,6 +1506,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Row.Item("ImporteAcumulado") = DtIngresosSubProyectoH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = "100.00" Row.Item("CtaMayor") = -1 + Row.Item("CountDinamico") = DtIngresosSubProyectoH.MAX("CountDinamico") DtIngresosSubProyectoH.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL INGRESOS " @@ -1297,6 +1567,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Row.Item("ImporteAcumulado") = TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnterior * 100 / T2).ToString, "0").FormatoNumero Row.Item("CtaMayor") = -1 + Row.Item("CountDinamico") = DtGastosSubProyectoH.MAX("CountDinamico") + DtGastosSubProyectoH.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL GASTOS" @@ -1310,19 +1582,15 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Row = DTTotalesSubProyectoH.NewRow - - IndexData = 13 For IndexData = 13 To IndexTotatles Row.Item(IndexData) = DtIngresosSubProyectoH.SUM($"[{DtIngresosSubProyectoH.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (-1,3,4)") - DtGastosSubProyectoH.SUM($"[{DtGastosSubProyectoH.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (-1,3,4)") Next - Row.Item("Nombre") = "Totales:" - 'Row.Item("ImporteActual") = TotalActual.ToString - 'Row.Item("PorcentajeActual") = "100.00" + Row.Item("Nombre") = "Resultado del ejercicio" Row.Item("ImporteAcumulado") = DtIngresosSubProyectoH.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DtGastosSubProyectoH.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - 'Row.Item("PorcentajeAcumulado") = "100.00" Row.Item("CtaMayor") = -2 + Row.Item("CountDinamico") = DtIngresosSubProyectoH.MAX("CountDinamico") DTTotalesSubProyectoH.Rows.Add(Row) @@ -1335,27 +1603,23 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal GvIngresosSubProyectoH.DataSource = DtIngresosSubProyectoH GvIngresosSubProyectoH.DataBind() - 'GvGastosSubProyectoH.DataSource = DtGastosSubProyectoH - 'GvGastosSubProyectoH.DataBind() - 'GvTotalesSubProyectoH.DataSource = DTTotalesSubProyectoH - 'GvTotalesSubProyectoH.DataBind() UpDatosSubProyectoH.Update() End Sub - Private Sub SumaTotalesSubProyectoH() - ''Llena Lb´s Totales - ''********************************************************************************* - 'LbTotalActual.Text = TotalActualMes.ToString.FormatoNumero - 'LbTotalAnterior.Text = TotalAnteriorMes.ToString.FormatoNumero + 'Private Sub SumaTotalesSubProyectoH() + ' ''Llena Lb´s Totales + ' ''********************************************************************************* + ' 'LbTotalActual.Text = TotalActualMes.ToString.FormatoNumero + ' 'LbTotalAnterior.Text = TotalAnteriorMes.ToString.FormatoNumero - 'LbTotalActual.ForeColor = If(TotalActualMes < 0, Drawing.Color.Red, Color.Black) - 'LbTotalAnterior.ForeColor = If(TotalAnteriorMes < 0, Drawing.Color.Red, Color.Black) + ' 'LbTotalActual.ForeColor = If(TotalActualMes < 0, Drawing.Color.Red, Color.Black) + ' 'LbTotalAnterior.ForeColor = If(TotalAnteriorMes < 0, Drawing.Color.Red, Color.Black) - End Sub + 'End Sub Protected Sub GvIngresosSubProyectoH_RowDataBound(sender As Object, e As GridViewRowEventArgs) @@ -1381,6 +1645,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal 'Dim CveSubProyecto As Integer = e.Row.DataKey("CveSubProyecto").ToEntero If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then + e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoCC.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero Dim IndiceInicio As Integer = 1 @@ -1391,17 +1656,47 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal For IndiceInicio = 1 To IndiceMax Dim CveSubProyectoIntermo As String = CType(GvGastosSubProyectoH.Columns(IndiceInicio), BoundField).DataField - Dim Importe As String = e.Row.Cells(IndiceInicio).Text + Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal + + e.Row.Cells(IndiceInicio).Text = $"{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }" - - e.Row.Cells(IndiceInicio).Text = $"{Importe}" Next IndiceInicio - e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF={FEchaMesFinal.ToString("dd/MM/yyyy")}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={-1}" + e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogoCC.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto={DdlSubproyecto.SelectedValue}&Periodo={DdlPeriodo.SelectedValue}" + + ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -1 Then + + Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero + Dim IndiceInicio As Integer = 1 + Dim IndiceMax As Integer = 1 + CountDinamico + + For IndiceInicio = 1 To IndiceMax + + Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal + e.Row.Cells(IndiceInicio).Text = $"
    { If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }
    " + Next IndiceInicio + + + + ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = -2 Then + + Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero + Dim IndiceInicio As Integer = 1 + Dim IndiceMax As Integer = 1 + CountDinamico + + For IndiceInicio = 1 To IndiceMax + + Dim Importe As Decimal = e.Row.Cells(IndiceInicio).Text.ToDecimal + e.Row.Cells(IndiceInicio).Text = $"
    { If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }
    " + + Next IndiceInicio + End If + e.Row.FCHyperLink("HLAnterior").Text = If(DdlDivisor.SelectedValue.ToEntero > 1, e.Row.DBCampo("ImporteAcumulado").ToString.ToDecimal.ToString("###,###,##0"), e.Row.DBCampo("ImporteAcumulado").ToString.ToDecimal.ToString("###,###,##0.00")) + If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red End If @@ -1414,22 +1709,13 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then TotalActualMes -= e.Row.DBCampo("ImporteActual").ToString.ToDouble TotalAnteriorMes -= e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble - 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray - 'e.Row.ControlStyle.ForeColor = Drawing.Color.White e.Row.ControlStyle.Font.Bold = True ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then 'e.Row.CssClass = "SubTotales" e.Row.ControlStyle.Font.Bold = True End If - 'If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then - ' e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) - ' e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString) - 'End If - 'If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then - ' e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red - 'End If If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red @@ -1453,4 +1739,222 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal #End Region + + + +#Region "DESCARGA EXCEL" + + Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click + Imprimir("Excel") + End Sub + + Private Sub Imprimir(Optional reporte As String = "PDF") + + + If Tab.ActiveTabIndex = 0 AndAlso GvIngresosMes.Rows.Count > 0 Then + ExportToExcelG(GvIngresosMes, GvGastosMes, TMesT1, "Reporte_Mensual", UsuarioActual, "Mensual") + ElseIf Tab.ActiveTabIndex = 1 AndAlso GvIngresosMesH.Rows.Count > 0 Then + ExportToExcelG(GvIngresosMesH, GvGastosMesH, TMesT1, "Reporte_Mensual_Horizontal", UsuarioActual, "Mensual Horizontal", Gv3:=GvTotalesMesH) + ElseIf Tab.ActiveTabIndex = 2 AndAlso GvIngresosAnualH.Rows.Count > 0 Then + ExportToExcelG(GvIngresosAnualH, GvGastosAnualH, TMesT1, "Reporte_Anual_Horizontal", UsuarioActual, "Anual Horizontal", Gv3:=GvTotalesAnualH) + + ElseIf Tab.ActiveTabIndex = 3 AndAlso GvIngresosSubProyectoH.Rows.Count > 0 Then + ExportToExcelG(GvIngresosSubProyectoH, GvGastosSubProyectoH, TMesT1, "Reporte_Proyecto_Horizontal", UsuarioActual, "Proyecto Horizontal", Gv3:=GvTotalesSubProyectoH, EsPorSubProtyecto:=True) + End If + End Sub + + 'Public Sub ExportToExcelG(Gv1 As GridView, Gv2 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) + Public Sub ExportToExcelG(Gv1 As GridView, Gv2 As GridView, TablaResultados As HtmlTable, NombreArchivoXLSx As String, Usuario As Usuario, Titulo As String, Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100, Optional Gv3 As GridView = Nothing, Optional EsPorSubProtyecto As Boolean = False) + + Dim sw1 As New StringWriter() + Dim htw1 As New HtmlTextWriter(sw1) + Gv1.RenderControl(htw1) + + Dim sw2 As New StringWriter() + Dim htw2 As New HtmlTextWriter(sw2) + Gv2.RenderControl(htw2) + + + TablaResultados.Width = Gv2.Width.ToString + + Dim sw3 As New StringWriter() + Dim htw3 As New HtmlTextWriter(sw3) + TablaResultados.RenderControl(htw3) + + Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault + + Dim htmlStream1 = New MemoryStream(options.Encoding.GetBytes(sw1.ToString())) + Dim htmlStream2 = New MemoryStream(options.Encoding.GetBytes(sw2.ToString())) + Dim htmlStream3 = New MemoryStream(options.Encoding.GetBytes(sw3.ToString())) + + htmlStream1.Position = 0 + Dim sr1 As New StreamReader(htmlStream1) + + htmlStream2.Position = 0 + Dim sr2 As New StreamReader(htmlStream2) + + htmlStream3.Position = 0 + Dim sr3 As New StreamReader(htmlStream3) + + + Dim myStr1 = sr1.ReadToEnd() + Dim myStr2 = sr2.ReadToEnd() + Dim myStr3 = sr3.ReadToEnd() + + sr1.Dispose() + sr2.Dispose() + sr3.Dispose() + + htmlStream1.Dispose() + htmlStream2.Dispose() + htmlStream3.Dispose() + + sw1.Dispose() + sw2.Dispose() + sw3.Dispose() + + If Gv3 IsNot Nothing Then + + Gv3.ShowHeader = False + + Dim sw4 As New StringWriter() + Dim htw4 As New HtmlTextWriter(sw4) + Gv3.RenderControl(htw4) + Dim htmlStream4 = New MemoryStream(options.Encoding.GetBytes(sw4.ToString())) + htmlStream4.Position = 0 + Dim sr4 As New StreamReader(htmlStream4) + myStr3 = sr4.ReadToEnd() + + sr4.Dispose() + htmlStream2.Dispose() + sw4.Dispose() + + End If + + + Dim HtmlCompleto As String = myStr1 & "
    " & myStr2 & "
    " & myStr3 + + + HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "") + + Dim asd As String = "" + + + Dim htmlStream5 = New MemoryStream(options.Encoding.GetBytes(HtmlCompleto)) + + + + + GemBox.Spreadsheet.SpreadsheetInfo.SetLicense("ESWN-4QFD-26JF-1SZ8") + + Dim excel As GemBox.Spreadsheet.ExcelFile + 'Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault + + 'Using htmlStream = New MemoryStream(options.Encoding.GetBytes(sw.ToString())) + ' excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream, options) + + excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream5, options) + + If Usuario IsNot Nothing Then + 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 = 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 + + 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 Not EsPorSubProtyecto Then + worksheet.Rows(8 + Gv1.Rows.Count + 2).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 + Gv1.Rows.Count + 2).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) + Else + worksheet.Rows(18).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(18).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) + End If + + + + If i > 0 Then + Try + worksheet.Columns(i).AutoFit(1) + Catch ex As Exception + End Try + End If + Next + + Dim IndexEndTable As Integer = Gv1.Rows.Count + Gv2.Rows.Count + 4 + TotalRowHeader + TotalRowFooter + + worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió" + worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre + + worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión" + worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy") + + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)) + + If Imagen.Exists Then + Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta) + 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 + + 'End Using + 'htw.Dispose() + + excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx") + + + End Sub + + Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) + End Sub + +#End Region + + + + + End Class + diff --git a/Contabilidad2/RepLibroDiario.aspx b/Contabilidad2/RepLibroDiario.aspx new file mode 100644 index 000000000..33fb505ac --- /dev/null +++ b/Contabilidad2/RepLibroDiario.aspx @@ -0,0 +1,104 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepLibroDiario.aspx.vb" Inherits="Contabilidad2_RepLibroDiario" %> + + + + + + + Libro Diario + + + + + + +
  • + Generar EXCEL +
  • +
  • + Imprimir +
  • +
    + + + + +
    +
    + + + + + + +
    +
    +
    + +
    +
    +
    + +
    +
    + + + + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + + diff --git a/Contabilidad2/RepLibroDiario.aspx.vb b/Contabilidad2/RepLibroDiario.aspx.vb new file mode 100644 index 000000000..9ae6cf4b7 --- /dev/null +++ b/Contabilidad2/RepLibroDiario.aspx.vb @@ -0,0 +1,186 @@ +Option Explicit On +Option Strict On +Imports System.Data +Imports Extensiones + +Partial Class Contabilidad2_RepLibroDiario + Inherits ClsPaginas + +#Region "PROPIEDADES" + Private Property DtDatos As DataTable + Get + DtDatos = DirectCast(ViewState("DtDatos"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtDatos") = value + End Set + End Property + Private Property FechaInicio As Date + Get + FechaInicio = ViewState("FechaInicio").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaInicio") = value + End Set + End Property + Private Property FechaFin As Date + Get + FechaFin = ViewState("FechaFin").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaFin") = value + End Set + End Property + +#End Region + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + InicializaValores() + + BtnConsultar.Enabled = True + + End If + End Sub + + Private Sub InicializaValores() + + TxtFechaDel.Text = $"01/01/{Now.Year}" + TxtFechaAl.Text = Now.ToShortDateString + End Sub + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub + +#Region "C A R G A - D A T O S" + Private Sub CargaDatos() + + FechaInicio = If(IsDate(TxtFechaDel.Text), TxtFechaDel.Text.ToDate, MinFecha) + FechaFin = If(IsDate(TxtFechaAl.Text), TxtFechaAl.Text.ToDate, MaxFecha) + + 'FechaInicio = New Date(2016, 1, 1) + 'FechaFin = New Date(2016, 1, 31) + + Dim ObjConta As New ClsContabilidad + If ObjConta.GetLibroDiario(FechaInicio, FechaFin, UsuarioActual.CveEmpresa) Then + DtDatos = ObjConta.DtResultados + Else + DtDatos = Nothing + End If + ObjConta.Dispose() + + GvDatos.DataSource = DtDatos + GvDatos.DataBind() + UpDatos.Update() + + If DtDatos IsNot Nothing Then + ImgExcel.Visible = True + Imprimir.Visible = True + + Else + ImgExcel.Visible = False + Imprimir.Visible = False + End If + + End Sub +#End Region + + Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + 'CABECERA + If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 1 Then + e.Row.Font.Bold = True + e.Row.Cells(4).Text = "" + e.Row.Cells(4).Visible = False + e.Row.Cells(5).Text = "" + e.Row.Cells(5).Visible = False + e.Row.Cells(6).Text = "" + e.Row.Cells(6).Visible = False + e.Row.Cells(7).Text = "" + e.Row.Cells(7).Visible = False + e.Row.Cells(8).Text = "" + e.Row.Cells(8).Visible = False + e.Row.Cells(3).ColumnSpan = 6 + e.Row.CssClass = "SubTotales" ' + End If + + 'DETALLE + If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 2 Then + e.Row.Cells(0).Text = "" + e.Row.Cells(1).Text = "" + e.Row.Cells(2).Text = "" + e.Row.Cells(3).Text = "" + e.Row.Cells(7).Text = If(e.Row.Cells(7).Text.ToEntero() > 0, e.Row.Cells(7).Text, "") + e.Row.Cells(8).Text = If(e.Row.Cells(8).Text.ToEntero() > 0, e.Row.Cells(8).Text, "") + End If + + 'SUBTOTAL + If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 3 Then + e.Row.Font.Bold = True + e.Row.Cells(0).Text = "" + e.Row.Cells(1).Text = "" + e.Row.Cells(2).Text = "" + e.Row.Cells(3).Text = "" + e.Row.Cells(4).Text = "" + e.Row.Cells(5).Text = "" + e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right + e.Row.Cells(6).Text = "Total:" + e.Row.CssClass = "SubTotales" + End If + + 'TOTAL + If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 4 Then + e.Row.Font.Bold = True + e.Row.Cells(0).Text = "" + e.Row.Cells(1).Text = "" + e.Row.Cells(2).Text = "" + e.Row.Cells(3).Text = "" + e.Row.Cells(4).Text = "" + e.Row.Cells(5).Text = "" + e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right + e.Row.Cells(6).Text = "Total:" + e.Row.CssClass = "Totales" + End If + + End If + End Sub + +#Region " IMPRIMIR " + + Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click + 'FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate) + 'FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate) + 'DtDatos = DtDatos + ImprimirReporte() + End Sub + + Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click + 'FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate) + 'FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate) + 'DtDatos = DtDatos + ImprimirReporte("EXCEL") + End Sub + + Private Sub ImprimirReporte(Optional Formato As String = "PDF") + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + Dim lista = New List(Of CrystalParametro) + lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa)) + lista.Add(New CrystalParametro("FechaInicio", FechaInicio.ToString("dd/MM/yyyy"))) + lista.Add(New CrystalParametro("FechaFin", FechaFin.ToString("dd/MM/yyyy"))) + lista.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre)) + + If Imagen.Exists Then + lista.Add(New CrystalParametro("LogoPath", logouri)) + Else + lista.Add(New CrystalParametro("LogoPath", "")) + End If + + ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/LibroDiario.rpt"), DtDatos, lista, "LibroDiario", Formato), "LibroDiario", Formato) + End Sub +#End Region +End Class diff --git a/Contratos/PopUpBuscarContrato.aspx b/Contratos/PopUpBuscarContrato.aspx index c0311468f..c77389ac3 100644 --- a/Contratos/PopUpBuscarContrato.aspx +++ b/Contratos/PopUpBuscarContrato.aspx @@ -70,11 +70,11 @@
    - + - + diff --git a/Empresas/119/Formatos/Polizas.rdlc b/Empresas/119/Formatos/Polizas.rdlc index a2c8d63c8..30145ef5f 100644 --- a/Empresas/119/Formatos/Polizas.rdlc +++ b/Empresas/119/Formatos/Polizas.rdlc @@ -1295,6 +1295,7 @@ End + true @@ -1331,9 +1332,11 @@ + true DataSet1 End + true 0.05076cm 3.18542cm @@ -1642,7 +1645,8 @@ Textbox35 - 17.03312cm + 0.26458cm + 16.57041cm 0.52564cm 2.8175cm 2 @@ -1790,7 +1794,8 @@ ReportParameter1 - REM Reset Page Number: + + REM Reset Page Number: Shared offset As Integer Shared newPage As Object Shared currentgroup1 As Object @@ -1822,7 +1827,8 @@ End If End If Return newPage - End Function + End Function + image/jpeg diff --git a/Empresas/72/Formatos/Entradas.rdlc b/Empresas/72/Formatos/Entradas.rdlc index 927878af3..36bd50101 100644 --- a/Empresas/72/Formatos/Entradas.rdlc +++ b/Empresas/72/Formatos/Entradas.rdlc @@ -6,19 +6,19 @@ - 1.60907cm + 1.24394cm 2.06688cm - 6.26873cm + 5.79535cm 2.82959cm - 1.67979cm + 2.51831cm 1.11844cm @@ -43,7 +43,7 @@ - CANTIDAD + CANT - SeccionAlmacen @@ -699,8 +701,8 @@ DsInventarios 0.17639cm 0.12931cm - 0.96717cm - 19.16933cm + 1.03773cm + 19.16934cm @@ -708,7 +710,7 @@ - 1.21412cm + 1.53162cm 0.17882cm 0cm 19.11979cm @@ -740,7 +742,7 @@ ImporteLetra - 0.73158in + 0.98158in 1.49813in 0.18861in 6.09975in @@ -853,7 +855,7 @@ DsInventarios - 1.31995cm + 1.95495cm 15.70179cm 0.46771cm 3.59684cm @@ -864,11 +866,77 @@ + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + OBSERVACIONES: + + + + + + 2pt + 2pt + 2pt + 2pt + + - 1.75444in + 1.94921in @@ -1168,9 +1239,9 @@ Textbox50 0.74112cm - 10.83216cm + 3.80525cm 1.86797cm - 8.38745cm + 15.41436cm 3 - 2.33028cm + 2.93363cm true true - 0.92688cm + 1.1404cm 0.05012cm 0cm 19.16949cm @@ -1224,7 +1295,7 @@ Textbox12 - 1.03271cm + 1.22061cm 0.12893cm 0.44125cm 1.36232cm @@ -1259,7 +1330,7 @@ Textbox18 - 1.03271cm + 1.22061cm 1.49125cm 0.44125cm 5.21516cm @@ -1292,7 +1363,7 @@ Textbox12 - 1.03271cm + 1.22061cm 7.7587cm 0.44125cm 2.68521cm @@ -1328,7 +1399,7 @@ Textbox18 - 1.03271cm + 1.22061cm 10.44391cm 0.44125cm 3.44953cm @@ -1363,7 +1434,7 @@ Textbox3 - 1.03271cm + 1.22061cm 15.59511cm 0.38981cm 3.61081cm @@ -1396,7 +1467,7 @@ Textbox29 - 1.47396cm + 1.66186cm 0.12912cm 0.41981cm 5.78083cm @@ -1414,7 +1485,7 @@ - 0.19459cm + 0.3175cm 1.19476cm 0cm 5.13525cm @@ -1442,9 +1513,9 @@ Textbox31 - 0.37098cm + 0.4239cm 0.77992cm - 0.09729cm + 0.56472cm 5.95755cm 1 - 0.19459cm + 0.3175cm 13.20536cm 0cm 5.24108cm @@ -1487,9 +1558,9 @@ Textbox31 - 0.3357cm + 0.38862cm 12.80849cm - 0.13257cm + 0.6cm 5.95755cm 3 - - 0.75931cm - 0.05417cm - 0cm - 19.1695cm - 4 - - - - - - true - true - - - - - OBSERVACIONES: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - true - 0.05922cm - 0.90952cm + 0.04233cm + 0.05012cm + 0.98862cm 19.22367cm 7 @@ -1817,6 +1810,12 @@ true ReportParameter1 + + String + true + true + ReportParameter1 + diff --git a/Empresas/Grales/Formatos/EntradaSalida.rdlc b/Empresas/Grales/Formatos/EntradaSalida.rdlc index 39632b298..c80980b50 100644 --- a/Empresas/Grales/Formatos/EntradaSalida.rdlc +++ b/Empresas/Grales/Formatos/EntradaSalida.rdlc @@ -6,22 +6,19 @@ - 1.72112cm + 1.14223cm - 2.33244cm + 3.14766cm - 7.27452cm + 11.67011cm 2.70027cm - 1.89819cm - - - 1.57864cm + 1.73945cm @@ -172,7 +169,7 @@ - Serie Lote + Serie - - - - - - Textbox12 - - - - Black - - 1pt - - - Black - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - @@ -314,7 +266,7 @@ =Fields!Cantidad.Value @@ -347,7 +299,7 @@ =Fields!Codigo.Value @@ -379,7 +331,7 @@ =Fields!PS.Value @@ -409,7 +361,7 @@ =Fields!SerieLote.Value @@ -439,7 +391,7 @@ =Fields!Lote.Value @@ -458,36 +410,6 @@ - - - - true - true - - - - - =Fields!Batch.Value - - - - - - 2pt - 2pt - =IIf(RowNumber(Nothing)=1,"1pt","0pt") - - - - @@ -503,11 +425,6 @@ =IIF(String.IsNullOrEmpty(Fields!Lote.Value), True,False) - - - =IIF(String.IsNullOrEmpty(Fields!Batch.Value), True,False) - - @@ -524,7 +441,7 @@ 0.17639cm 0.22456cm 1.11096cm - 17.50518cm + 20.39971cm @@ -567,7 +484,7 @@ 0.82291in @@ -937,9 +857,9 @@ Textbox32 3.09701cm - 14.14cm + 14.4575cm 0.59999cm - 3.65324cm + 5.9022cm 11 - - - - - - Textbox14 - - - - White - - 1pt - - - LightGrey - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - - Textbox9 - - - - White - - 1pt - - - LightGrey - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Cantidad - - - - - - - Textbox10 - - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - 4 - - - - - - - - - true - true - - - - - Importe - - - - - - - Textbox18 - - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - - LightGrey - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - 4 - - - - - - - - - 0.9175cm - - - - - true - true - - - - - Código - - - - - - - Textbox15 - - - - White - - 1pt - - - LightGrey - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Articulos - - - - - - - Textbox2 - - - - White - - 1pt - - - LightGrey - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Exist. Inicial - - - - - - - Textbox4 - - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Entradas - - - - - - - Textbox7 - - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Salidas - - - - - - - Textbox13 - - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Exist. - - - - - - - - - Final - - - - - - - Textbox16 - - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Saldo Inicial - - - - - - - Textbox19 - - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Entradas - - - - - - - Textbox22 - - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Salidas - - - - - - - Textbox25 - - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Saldo Final - - - - - - - Textbox28 - - - - White - - 1pt - - - White - - 1pt - - - White - - 1pt - - - LightGrey - - 1pt - - #d3d3d3 - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.40421cm - - - - - true - - - - - =Fields!Codigo.Value - - - - - - - LightGrey - - - - LightGrey - - - =Iif(Fields!CvePS.Value=-1, "#67809F","White") - 2pt - 2pt - 1pt - - - - - - - - true - - - - - =Fields!PS.Value - - - - - - - LightGrey - - - - LightGrey - - - =Iif(Fields!CvePS.Value=-1, "#67809F","White") - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =IIF(Fields!SaldoIniCant.Value = "0", "-", Fields!SaldoIniCant.Value) - - - - - - - SaldoInitCant - - - - LightGrey - - - - LightGrey - - - =Iif(Fields!CvePS.Value=-1, "#67809F","White") - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =IIF(Fields!EntradaCant.Value = "0", "-", Fields!EntradaCant.Value) - - - - - - - EntradaCant - - - - LightGrey - - - - LightGrey - - - =Iif(Fields!CvePS.Value=-1, "#67809F","White") - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =IIF(Fields!SalidaCant.Value = "0", "-", Fields!SalidaCant.Value) - - - - - - - SalidaCant - - - - LightGrey - - - - LightGrey - - - =Iif(Fields!CvePS.Value=-1, "#67809F","White") - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =IIF(Fields!SaldoFCant.Value = "0", "-", Fields!SaldoFCant.Value) - - - - - - - SaldoFCant - - - - LightGrey - - - - LightGrey - - - =Iif(Fields!CvePS.Value=-1, "#67809F","White") - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =IIF(Fields!SaldoIniImp.Value = "0", "-", Fields!SaldoIniImp.Value) - - - - - - - SaldoIniImp - - - - LightGrey - - - - LightGrey - - - =Iif(Fields!CvePS.Value=-1, "#67809F","White") - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =IIF(Fields!EntradaImp.Value = "0", "-", Fields!EntradaImp.Value) - - - - - - - EntradaImp - - - - LightGrey - - - - LightGrey - - - =Iif(Fields!CvePS.Value=-1, "#67809F","White") - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =IIF(Fields!SalidaImp.Value = "0", "-", Fields!SalidaImp.Value) - - - - - - - SalidaImp - - - - LightGrey - - - - LightGrey - - - =Iif(Fields!CvePS.Value=-1, "#67809F","White") - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =IIF(Fields!SaldoFImp.Value = "0", "-", Fields!SaldoFImp.Value) - - - - - - - SaldoFImp - - - - LightGrey - - - - LightGrey - - - =Iif(Fields!CvePS.Value=-1, "#67809F","White") - 2pt - 2pt - 1pt - - - - - - - - 0.6cm - - - - - true - true - - - - - - - - - - - =Iif(Fields!CvePS.Value=-1, "LightGrey","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - =Iif(Fields!CvePS.Value=-1, "LightGrey","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!SaldoInitCant.Value, "DataSet1") - - - - - - =Iif(Fields!CvePS.Value=-1, "LightGrey","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!EntradaCant.Value, "DataSet1") - - - - - - =Iif(Fields!CvePS.Value=-1, "LightGrey","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!SalidaCant.Value, "DataSet1") - - - - - - =Iif(Fields!CvePS.Value=-1, "LightGrey","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!SaldoFCant.Value, "DataSet1") - - - - - - =Iif(Fields!CvePS.Value=-1, "LightGrey","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!SaldoIniImp.Value, "DataSet1") - - - - - - =Iif(Fields!CvePS.Value=-1, "LightGrey","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!EntradaImp.Value, "DataSet1") - - - - - - =Iif(Fields!CvePS.Value=-1, "LightGrey","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!SalidaImp.Value, "DataSet1") - - - - - - =Iif(Fields!CvePS.Value=-1, "LightGrey","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!SaldoFImp.Value, "DataSet1") - - - - - - =Iif(Fields!CvePS.Value=-1, "LightGrey","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - After - true - true - - - - - - - true - - Before - - - - DataSet1 - 0.20849cm - 0.00415cm - 2.52171cm - 20.90254cm - - - - - - 1.16692in - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - REPORTE DE ENTRADAS Y SALIDAS - - - - - - - - - - - - - - - - Textbox2 - 1.13799cm - 4.68157cm - 0.52945cm - 9.98771cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - External - = Parameters!pImg.Value - FitProportional - 0.01325cm - 2.22362cm - 2.33715cm - 2 - - - - - - true - true - - - - - =Parameters!AgrupadoPor.Value - HTML - - - 2pt - 2pt - 2pt - 2pt - - - - 4.4023cm - 0.01325cm - 0cm - 20.90669cm - 4 - - - - - - - - - - - 0.727cm - true - true - - - true - true - - - - - ="Página: " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 0.28575cm - 15.06595cm - 0.44125cm - 5.51625cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Usuario: - - - - - - - Textbox8 - 0.28575cm - 0.6059cm - 0.44125cm - 1.60042cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!UsuarioImprimio.Value - - - - - - - Textbox9 - 0.28575cm - 2.15023cm - 0.44125cm - 5.14936cm - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - - Textbox10 - 0.28575cm - 7.47001cm - 0.44125cm - 2.92333cm - 3 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - = Format(Now(),"dd-MM-yyyy HH:mm tt") - - - - - - - Textbox11 - 0.28575cm - 10.37923cm - 0.44125cm - 4.32745cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - 0.127cm - 0cm - 0cm - 20.90669cm - 5 - - - - - - - - - - 27.94cm - 21.59cm - 0.5cm - 0cm - 0.5cm - 1cm - 0.13cm - + + + + + + Textbox14 + + + + White + + 1pt + + + LightGrey + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox9 + + + + White + + 1pt + + + LightGrey + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Cantidad + + + + + + + Textbox10 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox18 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + LightGrey + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + 0.9175cm + + + + + true + true + + + + + Código + + + + + + + Textbox15 + + + + White + + 1pt + + + LightGrey + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Articulos + + + + + + + Textbox2 + + + + White + + 1pt + + + LightGrey + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Exist. Inicial + + + + + + + Textbox4 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Entradas + + + + + + + Textbox7 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Salidas + + + + + + + Textbox13 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Exist. + + + + + + + + + Final + + + + + + + Textbox16 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Saldo Inicial + + + + + + + Textbox19 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Entradas + + + + + + + Textbox22 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Salidas + + + + + + + Textbox25 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Saldo Final + + + + + + + Textbox28 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + LightGrey + + 1pt + + #d3d3d3 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.40421cm + + + + + true + + + + + =Fields!Codigo.Value + + + + + + + LightGrey + + + + LightGrey + + + =Iif(Fields!CvePS.Value=-1, "#67809F","White") + 2pt + 2pt + 1pt + + + + + + + + true + + + + + =Fields!PS.Value + + + + + + + LightGrey + + + + LightGrey + + + =Iif(Fields!CvePS.Value=-1, "#67809F","White") + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =IIF(Fields!SaldoIniCant.Value = "0", "-", Fields!SaldoIniCant.Value) + + + + + + + SaldoInitCant + + + + LightGrey + + + + LightGrey + + + =Iif(Fields!CvePS.Value=-1, "#67809F","White") + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =IIF(Fields!EntradaCant.Value = "0", "-", Fields!EntradaCant.Value) + + + + + + + EntradaCant + + + + LightGrey + + + + LightGrey + + + =Iif(Fields!CvePS.Value=-1, "#67809F","White") + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =IIF(Fields!SalidaCant.Value = "0", "-", Fields!SalidaCant.Value) + + + + + + + SalidaCant + + + + LightGrey + + + + LightGrey + + + =Iif(Fields!CvePS.Value=-1, "#67809F","White") + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =IIF(Fields!SaldoFCant.Value = "0", "-", Fields!SaldoFCant.Value) + + + + + + + SaldoFCant + + + + LightGrey + + + + LightGrey + + + =Iif(Fields!CvePS.Value=-1, "#67809F","White") + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =IIF(Fields!SaldoIniImp.Value = "0", "-", Fields!SaldoIniImp.Value) + + + + + + + SaldoIniImp + + + + LightGrey + + + + LightGrey + + + =Iif(Fields!CvePS.Value=-1, "#67809F","White") + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =IIF(Fields!EntradaImp.Value = "0", "-", Fields!EntradaImp.Value) + + + + + + + EntradaImp + + + + LightGrey + + + + LightGrey + + + =Iif(Fields!CvePS.Value=-1, "#67809F","White") + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =IIF(Fields!SalidaImp.Value = "0", "-", Fields!SalidaImp.Value) + + + + + + + SalidaImp + + + + LightGrey + + + + LightGrey + + + =Iif(Fields!CvePS.Value=-1, "#67809F","White") + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =IIF(Fields!SaldoFImp.Value = "0", "-", Fields!SaldoFImp.Value) + + + + + + + SaldoFImp + + + + LightGrey + + + + LightGrey + + + =Iif(Fields!CvePS.Value=-1, "#67809F","White") + 2pt + 2pt + 1pt + + + + + + + + 0.6cm + + + + + true + true + + + + + + + + + + + =Iif(Fields!CvePS.Value=-1, "LightGrey","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + =Iif(Fields!CvePS.Value=-1, "LightGrey","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!SaldoInitCant.Value, "DataSet1") + + + + + + =Iif(Fields!CvePS.Value=-1, "LightGrey","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!EntradaCant.Value, "DataSet1") + + + + + + =Iif(Fields!CvePS.Value=-1, "LightGrey","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!SalidaCant.Value, "DataSet1") + + + + + + =Iif(Fields!CvePS.Value=-1, "LightGrey","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!SaldoFCant.Value, "DataSet1") + + + + + + =Iif(Fields!CvePS.Value=-1, "LightGrey","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!SaldoIniImp.Value, "DataSet1") + + + + + + =Iif(Fields!CvePS.Value=-1, "LightGrey","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!EntradaImp.Value, "DataSet1") + + + + + + =Iif(Fields!CvePS.Value=-1, "LightGrey","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!SalidaImp.Value, "DataSet1") + + + + + + =Iif(Fields!CvePS.Value=-1, "LightGrey","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!SaldoFImp.Value, "DataSet1") + + + + + + =Iif(Fields!CvePS.Value=-1, "LightGrey","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + After + true + true + + + + + + + true + + Before + + + + DataSet1 + 0.20849cm + 0.00415cm + 2.52171cm + 20.90254cm + + + + + + 1.16692in + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE DE ENTRADAS Y SALIDAS + + + + + + + + + + + + + + + + Textbox2 + 1.13799cm + 4.68157cm + 0.52945cm + 9.98771cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + = Parameters!pImg.Value + FitProportional + 0.01325cm + 2.22362cm + 2.33715cm + 2 + + + + + + true + true + + + + + =Parameters!AgrupadoPor.Value + HTML + + + 2pt + 2pt + 2pt + 2pt + + + + 4.4023cm + 0.01325cm + 0cm + 20.90669cm + 4 + + + + + + + + + + + 0.727cm + true + true + + + true + true + + + + + ="Página: " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.28575cm + 15.06595cm + 0.44125cm + 5.51625cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + + Textbox8 + 0.28575cm + 0.6059cm + 0.44125cm + 1.60042cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + + Textbox9 + 0.28575cm + 2.15023cm + 0.44125cm + 5.14936cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + + Textbox10 + 0.28575cm + 7.47001cm + 0.44125cm + 2.92333cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + = Format(Now(),"dd-MM-yyyy HH:mm tt") + + + + + + + Textbox11 + 0.28575cm + 10.37923cm + 0.44125cm + 4.32745cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + 0.127cm + 0cm + 20.90669cm + 5 + + + + + + + + + + 27.94cm + 21.59cm + 0.5cm + 0cm + 0.5cm + 1cm + 0.13cm + @@ -564,7 +564,7 @@ 8.23098in - 3.71891cm + 3.99542cm true true @@ -609,7 +609,7 @@ - REPORTE DE PAQUETERÍAS GUÍAS + Reporte de Envíos - - true - true - - - - - Sucursal: - HTML - - - - - HTML - - - - =Parameters!Sucursal.Value - HTML - - - - - - 2pt - 2pt - 2pt - 2pt - - - 3.625cm + 3.9425cm 0cm 20.90669cm - 4 + 3 - + true true - Estatus: + =Parameters!Filtros.Value HTML - - - - HTML - - - - =Parameters!Estatus.Value - HTML - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Paquetería: - HTML - - - - - HTML - - - - =Parameters!Paqueteria.Value - HTML - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Inicial: - HTML - - - - - HTML - - - - =Parameters!FechaInicio.Value - HTML - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Final: - HTML - - - - - HTML - - - - =Parameters!FechaFin.Value - HTML - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Usuario Entrego: - - - - =Parameters!FiltroUsuario.Value - - - - @@ -1338,6 +1090,24 @@ true ReportParameter1 + + String + true + true + ReportParameter1 + + + String + true + true + ReportParameter1 + + + String + true + true + ReportParameter1 + Cm 1d5d9525-4bdd-4783-9df6-cce93069c30f diff --git a/Empresas/Grales/Formatos/RepUniformesResguardo.rdlc b/Empresas/Grales/Formatos/RepUniformesResguardo.rdlc index 82f16f2b2..815874b86 100644 --- a/Empresas/Grales/Formatos/RepUniformesResguardo.rdlc +++ b/Empresas/Grales/Formatos/RepUniformesResguardo.rdlc @@ -1,1181 +1,1180 @@ - - - 0 - - - - System.Data.DataSet - /* Local Connection */ - - f55ecc33-47ff-4fc5-a233-35ea9bb1f578 - - - - - - DataSet - /* Local Query */ - - - - NombreCompleto - System.String - - - Folio - System.String - - - CodigoPS - System.String - - - FechaMovto - System.Date - - - SubProyecto - System.String - - - Departamento - System.String - - - Cantidad - System.Integer - - - Precio - System.Decimal - - - - DataSet - C:\Users\Caudillo\Documents\Visual Studio 2013\WebSites\WebSite9\App_Code\DataSet.xsd - DataTable1 - - - - - - - - - - - - true - true - - - - - =Parameters!AgrupadoPor.Value - HTML - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 0.84237cm - 0.20849cm - 0cm - 27.38607cm - 1 - - - - - - - - - 5.86021cm - - - 1.40551cm - - - 1.83854cm - - - 9.56026cm - - - 2.34042cm - - - 2.91042cm - - - 1.70625cm - - - 1.89146cm - - - - - 0.6cm - - - - - true - true - - - - - Nombre Completo - - - - - - - Textbox4 - - - - Silver - - - Silver - - - Silver - - - Silver - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Folio - - - - - - - Textbox15 - - - - Silver - - - Silver - - - Silver - - - Silver - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fecha - - - - - - - Textbox17 - - - - Silver - - - Silver - - - Silver - - - Silver - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Descripción - - - - - - - Textbox3 - - - - Silver - - - Silver - - - Silver - - - Silver - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Sucursal - - - - - - - Textbox5 - - - - Silver - - - Silver - - - Silver - - - Silver - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Departamento - - - - - - - Textbox13 - - - - Silver - - - Silver - - - Silver - - - Silver - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Cantidad - - - - - - - Textbox14 - - - - Silver - - - Silver - - - Silver - - - Silver - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Total - - - - - - - Textbox18 - - - - Silver - - - Silver - - - Silver - - - Silver - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - =Fields!NombreCompleto.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Folio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!FechaMovto.Value - - - - - - - FechaMovto - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!CodigoPS.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SubProyecto.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Departamento.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Surtir - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Precio.Value - - - - - - - Precio - - - 2pt - 2pt - 2pt - 2pt - - - true - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DataSet1 - 1.10695cm - 0.08149cm - 1.2cm - 27.51307cm - 2 - - - - - - 0.94992in - - - - - - - Textbox1 - 0.18521cm - 6.07218cm - 0.6cm - 14.02238cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - REPORTE UNIFORMES - - - - - - - - - - - - - - - - Textbox2 - 1.10271cm - 6.07218cm - 0.52945cm - 14.02238cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!LogoPath.Value - FitProportional - 0.06614cm - 2.22362cm - 2.33715cm - 2 - - - - - - - - - - - 0.76376cm - true - true - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 0.08291cm - 25.20741cm - 0.68085cm - 2.09233cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Usuario: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!UsuarioImprimio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FechaImpresion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 21cm - 29.7cm - 1cm - 1cm - 0.25cm - 0.25cm - 0.13cm - + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.84237cm + 0.20849cm + 0cm + 27.38607cm + 1 + + + + + + + + + 5.86021cm + + + 1.40551cm + + + 1.83854cm + + + 9.56026cm + + + 2.34042cm + + + 2.91042cm + + + 1.70625cm + + + 1.89146cm + + + + + 0.6cm + + + + + true + true + + + + + Nombre Completo + + + + + + + Textbox4 + + + + Silver + + + Silver + + + Silver + + + Silver + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Folio + + + + + + + Textbox15 + + + + Silver + + + Silver + + + Silver + + + Silver + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox17 + + + + Silver + + + Silver + + + Silver + + + Silver + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Descripción + + + + + + + Textbox3 + + + + Silver + + + Silver + + + Silver + + + Silver + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Sucursal + + + + + + + Textbox5 + + + + Silver + + + Silver + + + Silver + + + Silver + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Departamento + + + + + + + Textbox13 + + + + Silver + + + Silver + + + Silver + + + Silver + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Cantidad + + + + + + + Textbox14 + + + + Silver + + + Silver + + + Silver + + + Silver + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + + Textbox18 + + + + Silver + + + Silver + + + Silver + + + Silver + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!NombreCompleto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Folio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FechaMovto.Value + + + + + + + FechaMovto + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!CodigoPS.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SubProyecto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Departamento.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Surtir + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Precio.Value + + + + + + + Precio + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet1 + 1.10695cm + 0.08149cm + 1.2cm + 27.51307cm + 2 + + + + + + 0.94992in + + + + + + + Textbox1 + 0.18521cm + 6.07218cm + 0.6cm + 14.02238cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE RESGUARDO UNIFORMES + + + + + + + + + + + + + + + + Textbox2 + 1.10271cm + 6.07218cm + 0.52945cm + 14.02238cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.06614cm + 2.22362cm + 2.33715cm + 2 + + + + + + + + + + + 0.76376cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.08291cm + 25.20741cm + 0.68085cm + 2.09233cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 21cm + 29.7cm + 1cm + 1cm + 0.25cm + 0.25cm + 0.13cm + + + + + + + Textbox15 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + Unidad + + + + + + + Textbox33 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + Descripción + + + + + + + Textbox17 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + Precio + + + + + + + Textbox21 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + IVA + + + + + + + Textbox1 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + IEPS + + + + + + + Textbox14 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox23 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + 0.25521in + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!UnidadMedida.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + PU + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!IVA.Value + + + + + + + IVA + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!IEPS.Value + + + + + + + IEPS + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Total.Value + + + + + + + Total + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.03125in + + + + + true + true + + + + + =Sum(Fields!Cantidad.Value) + + + + + + + Textbox71 + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!PU.Value) + + + + + + + Textbox74 + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!IVA.Value) + + + + + + + Textbox5 + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!IEPS.Value) + + + + + + + Textbox26 + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!Total.Value) + + + + + + + Textbox75 + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + Before + + + + DsProductos + 2.02937in + 0.03703cm + 0.5in + 7.86283in + + + + + + true + true + + + + + Tipo + + + + + + + Textbox3 + 0.912in + 5.63144in + 0.5cm + 2.24597in + 1 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha y hora de emisión + + + + + + + + + + + + + + + + Textbox3 + 0.46414in + 5.63144in + 0.5cm + 2.24597in + 2 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Serie.Value + + + + - + + + + =Parameters!Folio.Value + + + + + + + Textbox3 + 0.22455in + 5.63144in + 0.60856cm + 2.24597in + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + FACTURA + + + + + + + Textbox3 + 0.0412cm + 5.63144in + 0.5cm + 2.24597in + 4 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Empresa.Value + + + + + + + + + R.F.C + + + + =Parameters!RFC.Value + + + + + + + Textbox4 + 1.75306in + 0.46414in + 3.96172in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SON: ( + + + + =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) + + + + ) + + + + + + + ImporteLetra + 2.53743in + 1.36047in + 0.23264in + 4.73657in + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloCFDI.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloSAT.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CadenaOriginal.Value + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Database + =System.Convert.FromBase64String(Parameters!QR.Value) + image/png + FitProportional + 4.61035in + 0.00068in + 1.46528in + 1.56699in + 10 + + + + + + true + true + + + + + =Parameters!Fecha.Value + + + + + + + Textbox3 + 0.66099in + 5.63144in + 0.25114in + 2.24597in + 11 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Factura + + + + + + + Textbox3 + 1.10885in + 5.63144in + 0.20721in + 2.24597in + 12 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Domicilio Fiscal + + + + + + + + + =Parameters!DomicilioExpedicion.Value + + + + + + + Textbox10 + 0.46414in + 1.75306in + 0.69679in + 1.74651in + 13 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Lugar de Expedición + + + + + + + + + =Parameters!DomicilioExpedicion.Value + + + + + + + Textbox10 + 0.46414in + 3.81766in + 0.69679in + 1.786in + 14 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Nombre + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteNombre.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Dirección + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteDireccion.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cuidad + + + + + + + #4f81bd + + 1.25pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteLugar.Value + + + + RFC: + + + + =Parameters!ClienteRFC.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sub Total + + + + + + + Textbox19 + 2.55788in + 6.12482in + 0.25in + 0.86113in + 21 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + IEPS + + + + + + + Textbox19 + 2.96771in + 6.12482in + 0.21875in + 0.84815in + 22 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total + + + + + + + Textbox19 + 3.18334in + 6.12482in + 0.21875in + 0.84815in + 23 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SubTotal.Value + + + + + + + Textbox42 + 2.57352in + 6.97297in + 0.18211in + 0.89055in + 24 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!IVA.Value + + + + + + + Textbox42 + 2.76813in + 6.97297in + 0.19289in + 0.89054in + 25 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!IEPS.Value + + + + + + + Textbox42 + 2.97282in + 6.97297in + 0.20219in + 0.89054in + 26 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Total.Value + + + + + + + Textbox42 + 3.19376in + 6.97297in + 0.19791in + 0.89054in + 27 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Importe con letra: + + + + + + + Textbox19 + 2.53316in + 0.00068in + 0.2053in + 1.35979in + 28 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Forma de pago: + + + + + + + Textbox19 + 2.73851in + 0.00068in + 0.24305in + 1.35979in + 29 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello digital del CFDI: + + + + + + + Textbox19 + 2.93573in + 0.00068in + 0.61916in + 1.35979in + 30 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello del SAT: + + + + + + + Textbox19 + 3.55489in + 0.00068in + 0.30208in + 1.36417in + 31 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cadena original del complemento de certificación digital del SAT: + + + + + + + Textbox19 + 3.85765in + 0.21875in + 7.87741in + 32 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FormaPago.Value + + + + + + + ImporteLetra + 2.73851in + 1.36047in + 0.20833in + 4.73657in + 33 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Folio Fiscal: + + + + + + + Textbox54 + 4.59646in + 1.62669in + 0.19445in + 4.36369in + 34 + + + + + + + White + + + + + + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + No. Serie del Certificado del SAT: + + + + + + + Textbox54 + 4.79091in + 1.62322in + 0.21105in + 4.37758in + 35 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha y Hora de certificación: + + + + + + + Textbox54 + 5.00196in + 1.62322in + 0.19444in + 4.37064in + 36 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Certificado del Contribuyente: + + + + + + + Textbox54 + 5.19715in + 1.62322in + 0.20487in + 4.37064in + 37 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaCertificado.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CertificadoContribuyente.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Regímen: Regímen General de Ley Personas Morales; Uso CFDI: + + + + =Parameters!UsoCFDI.Value + + + + ; Método de Pago: + + + + =Parameters!MetodoPago.Value + + + + ; + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Éste documento es una representacion impresa de un CFDi + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + P A G A R E con Folio + + + + =Parameters!Serie.Value + + + + - + + + + =Parameters!Folio.Value + + + + Por éste pagare prometo (emos) pagar incondicionalmente a la orden de + + + + =Parameters!Empresa.Value + + + + a su vencimiento el + + + + =Parameters!Vencimiento.Value + + + + , en Hermosillo, Sonora o en el domicilio señalado a elección del acreedor o tenedor la cantidad de $ + + + + =Parameters!Total.Value + + + + SON: ( + + + + =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) + + + + ). Valor recibido a mi (nuestra) entera satisfaccion. la falta de pago de éste documento a su vencimiento dará derecho a + + + + =Parameters!Empresa.Value + + + + o tenedor, desde el dia siguiente a cobrar el 10% mensual de interes moratorios hasta su total liquidación y los gastos judiciales que se ocasionén. Lugar y Fecha de Suscripcion: Hermosillo, Sonora a + + + + =Parameters!Fecha.Value + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Nombre: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Dirección: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteNombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteDireccion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Acepto de conformidad + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.26711cm + 0.05457cm + 0cm + 0.57653cm + 7 + + + + + + 0.26711cm + 0.69053cm + 0cm + 0.57653cm + 8 + + + + + + 0.26711cm + 1.32627cm + 0cm + 0.57653cm + 9 + + + + + + 0.26711cm + 1.63234cm + 0cm + 0.57653cm + 10 + + + + + + 0.26711cm + 2.2683cm + 0cm + 0.57653cm + 11 + + + + + + 0.26711cm + 2.90404cm + 0cm + 0.57653cm + 12 + + + + + + 0.26711cm + 3.57348cm + 0cm + 0.57653cm + 13 + + + + + + 0.26711cm + 4.20944cm + 0cm + 0.57653cm + 14 + + + + + + 0.26711cm + 4.84518cm + 0cm + 0.57653cm + 15 + + + + + + 0.26711cm + 5.15125cm + 0cm + 0.57653cm + 16 + + + + + + 0.26711cm + 5.78721cm + 0cm + 0.57653cm + 17 + + + + + + 0.26711cm + 6.42295cm + 0cm + 0.57653cm + 18 + + + + + + 0.26711cm + 7.10321cm + 0cm + 0.57653cm + 19 + + + + + + 0.26711cm + 7.73917cm + 0cm + 0.57653cm + 20 + + + + + + 0.26711cm + 8.37491cm + 0cm + 0.57653cm + 21 + + + + + + 0.26711cm + 8.68098cm + 0cm + 0.57653cm + 22 + + + + + + 0.26711cm + 9.31694cm + 0cm + 0.57653cm + 23 + + + + + + 0.26711cm + 9.95268cm + 0cm + 0.57653cm + 24 + + + + + + 0.26711cm + 14.03363cm + 0cm + 0.57653cm + 25 + + + + + + 0.26711cm + 14.66959cm + 0cm + 0.57653cm + 26 + + + + + + 0.26711cm + 15.30533cm + 0cm + 0.57653cm + 27 + + + + + + 0.26711cm + 15.6114cm + 0cm + 0.57653cm + 28 + + + + + + 0.26711cm + 16.24736cm + 0cm + 0.57653cm + 29 + + + + + + 0.26711cm + 16.8831cm + 0cm + 0.57653cm + 30 + + + + + + 0.26711cm + 10.5767cm + 0cm + 0.57653cm + 31 + + + + + + 0.26711cm + 11.21266cm + 0cm + 0.57653cm + 32 + + + + + + 0.26711cm + 11.8484cm + 0cm + 0.57653cm + 33 + + + + + + 0.26711cm + 12.15447cm + 0cm + 0.57653cm + 34 + + + + + + 0.26711cm + 12.79043cm + 0cm + 0.57653cm + 35 + + + + + + 0.26711cm + 13.42617cm + 0cm + 0.57653cm + 36 + + + + + + 0.26711cm + 18.37745cm + 0cm + 0.57653cm + 37 + + + + + + 0.26711cm + 19.01341cm + 0cm + 0.57653cm + 38 + + + + + + 0.26711cm + 17.71435cm + 0cm + 0.57653cm + 39 + + + + + + true + 15.71618cm + 0.01661cm + 4.36819cm + 20.04854cm + 44 + + + + + + true + true + + + + + IVA + + + + + + + Textbox19 + 2.76952in + 6.12573in + 0.19444in + 0.86113in + 45 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + 20.08437cm + - Reporte de Compras / Notas Sin Entrada + Reporte de Compras Sin Entrada-Ventas Sin Salida @@ -139,7 +139,7 @@ --%> -
    Proyecto:
    +
    diff --git a/Inventarios/RepNotasSinAlmacen.aspx.vb b/Inventarios/RepNotasSinAlmacen.aspx.vb index 0f7e28329..95cdd8db2 100644 --- a/Inventarios/RepNotasSinAlmacen.aspx.vb +++ b/Inventarios/RepNotasSinAlmacen.aspx.vb @@ -93,12 +93,13 @@ Partial Class RepNotasSinAlmacen 'DdlSucursal.DataSource = GlobalDTSucursales(UsuarioActual.CveEmpresa) 'DdlSucursal.DataBind() - DdlSubProyecto.Items.Clear() - DdlSubProyecto.SelectedValue = Nothing - DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1) - DdlSubProyecto.DataBind() + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + 'DdlSubProyecto.Items.Clear() + 'DdlSubProyecto.SelectedValue = Nothing + 'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1) + 'DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Sin SubProyecto Asignado", "-1")) + 'DdlSubProyecto.Items.Insert(0, New ListItem("Sin SubProyecto Asignado", "-1")) End Sub Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click diff --git a/Inventarios/RepTraspasoAlmacen.aspx b/Inventarios/RepTraspasoAlmacen.aspx index fb7c223f9..51762e3f8 100644 --- a/Inventarios/RepTraspasoAlmacen.aspx +++ b/Inventarios/RepTraspasoAlmacen.aspx @@ -204,13 +204,13 @@ + data-sort="true" GridLines="None"> - - - - + + + + diff --git a/Inventarios/RepTraspasoAlmacen.aspx.vb b/Inventarios/RepTraspasoAlmacen.aspx.vb index 56ec9a426..dfcf7ef57 100644 --- a/Inventarios/RepTraspasoAlmacen.aspx.vb +++ b/Inventarios/RepTraspasoAlmacen.aspx.vb @@ -77,7 +77,7 @@ Partial Class RepTraspasoAlmacen If ObjInventarios.RepTraspasoAlmacen(FechaI.ToDate, FechaF.ToDate, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, ChkRecibido.Checked, UsuarioActual.CveEmpresa) Then GvDatos.DataSource = ObjInventarios.DtResultados DtInventarios = ObjInventarios.DtResultados - + GvDatos.Columns(4).Visible = DtInventarios.MAX("Serie") <> "" End If ObjInventarios.Dispose() diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index c2f7c86af..fb4e1fd2c 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -352,13 +352,14 @@ Partial Class Inventarios_ResguardoMaterial TrSeccion.Visible = True If DdlAlmacen.SelectedValue.ToEntero > 0 Then DdlSeccionAlmacen.Items.Clear() - Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, DdlProducto2.SelectedValue.ToEntero) - DdlSeccionAlmacen.DataSource = dtt - DdlSeccionAlmacen.DataBind() - If dtt.Rows.Count > 1 Then - DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - dtt.Dispose() + CargaSeccionesAlmacen(DdlSeccionAlmacen, DdlAlmacen.SelectedValue.ToEntero, DdlProducto2.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) + 'Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, DdlProducto2.SelectedValue.ToEntero) + 'DdlSeccionAlmacen.DataSource = dtt + 'DdlSeccionAlmacen.DataBind() + 'If dtt.Rows.Count > 1 Then + ' DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'End If + 'dtt.Dispose() End If End If 'activa lote diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 9ce5b10d3..9ef01b59d 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -872,7 +872,7 @@ Partial Class Inventarios_TraspasoAlmacen Dim Cont As Integer = 0 For Each Dr As DataRow In ObjInventario.DtResultados.Rows Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal()) - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=-1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then ErrorMovInv = True TextoError = "Ocurrió un error al guardar los movimientos de entrada" Exit For @@ -1534,13 +1534,14 @@ Partial Class Inventarios_TraspasoAlmacen e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", String.Format("ValidaCantidad(this,{0});", e.Row.DBCampo("Cantidad"))) If CBool(e.Row.DBCampo("AplicaSeccion")) AndAlso DdlAlmacenRecepcion.SelectedValue.ToEntero > 0 Then - Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenRecepcion.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt - e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() - If dtt.Rows.Count > 1 Then - e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - dtt.Dispose() + CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenRecepcion.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa) + 'Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenRecepcion.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) + 'e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt + 'e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() + 'If dtt.Rows.Count > 1 Then + ' e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + 'End If + 'dtt.Dispose() End If End If diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 523be0307..be7031de6 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -1799,13 +1799,12 @@ Partial Class OC DdlProyectoContrato.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub Private Sub CargaSubProyectos() - Dim Filtro As String = If(DdlProyecto.SelectedValue.ToEntero > 0, String.Format("CveProyecto = {0}", DdlProyecto.SelectedValue.ToEntero), "") + Dim Filtro As String = If(DdlProyecto.SelectedValue.ToEntero > 0 AndAlso UsuarioActual.Empresa.Tipo_CentroCosto.Contiene(4, 5), String.Format("CveProyecto = {0}", DdlProyecto.SelectedValue.ToEntero), "") DdlSubProyecto.Items.Clear() - If Filtro <> "" Or UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then - DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros(Filtro, "", {"CveSubProyecto", "SubProyecto"}) 'If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, CveEmpresaActual, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, CveEmpresaActual, 1)) 'DtEstatusUsuarios.FiltraParametros(Filtro, "", {"CveSubProyecto", "SubProyecto"}) ' GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero) - End If + DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros(Filtro, "", {"CveSubProyecto", "SubProyecto"}) 'If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, CveEmpresaActual, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, CveEmpresaActual, 1)) 'DtEstatusUsuarios.FiltraParametros(Filtro, "", {"CveSubProyecto", "SubProyecto"}) ' GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero) DdlSubProyecto.DataBind() + DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) End Sub Private Sub CargaSubProyectosEdit(DdlSP As DropDownList, CveProyectoEdit As Integer) @@ -2770,7 +2769,10 @@ Partial Class OC ' TieneError = True ' Exit For 'End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then + + + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then TieneError = True Exit For End If @@ -2788,7 +2790,7 @@ Partial Class OC '2018.11.24 se cambia concepto 176, de cargo a abono negativo., petición MALL '2019.03.26 se cambia concepto 177, de abono a cargo., petición MALL '2019.04.10 se cambia concepto 177, de cargo a abono., petición MALL - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), SerieFolio, Fecha, If(ConceptoSalida = 0, IdCtaContableAlmacen, IdCtaContableRecepcionOCER), -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveCuenta:=CveCuentaAlmacen, CveOCDetalle:=CveOCDetalle) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), SerieFolio, Fecha, If(ConceptoSalida = 0, IdCtaContableAlmacen, IdCtaContableRecepcionOCER), -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveCuenta:=CveCuentaAlmacen, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaInvOC, SerieFolio, 176, SerieFolio, Fecha, IdCtaContableRecepcionOC, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then TieneError = True Exit For diff --git a/OI/DocumentoDetalle.aspx b/OI/DocumentoDetalle.aspx index d5af82e6c..990f00d77 100644 --- a/OI/DocumentoDetalle.aspx +++ b/OI/DocumentoDetalle.aspx @@ -13,118 +13,172 @@ - <%--
  • - +
  • +
  • - Imprimir PDF +
  • -
  • - Imprimir Excel -
  • --%>
    - - -
    -
    - - -
    -
    - - - +
    + + +
    +
    + + +
    +
    + + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + + +
    + + +
    +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4; border: 1px solid #e5e5e5" /> + " class="btn btn-circle btn-sm label-info"> +
    + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    -
    -
    -
    - - -
    -
    -
    -
    - - - - - -
    -
    -
    - - - -
    -
    -
    - - - -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    - - -
    -
    - - - - - - - -
    -
    -

    -
    - " style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4; border:1px solid #e5e5e5" /> - " class="btn btn-circle btn-sm label-info"> -
    - +
    + -
    -
    -
    - -
    +
    -
    -
    -
    -
    + + +
    diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs index 0c35f9eb6..ce4b59da1 100644 --- a/OI/DocumentoDetalle.aspx.cs +++ b/OI/DocumentoDetalle.aspx.cs @@ -11,6 +11,19 @@ using System.Text; public partial class OI_DocumentoDetalle : ClsPaginas { + private int CveUsuarioResponsable + { + get + { + return ViewState["CveUsuarioResponsable"].ToString().ToEntero(); + } + + set + { + ViewState["CveUsuarioResponsable"] = value; + } + } + private int CveDocumento { get @@ -50,6 +63,32 @@ public partial class OI_DocumentoDetalle : ClsPaginas } } + private int CveUsuarioSeleccionado + { + get + { + return ViewState["CveUsuarioSeleccionado"].ToString().ToEntero(); + } + + set + { + ViewState["CveUsuarioSeleccionado"] = value; + } + } + + private int CveAsignacion + { + get + { + return ViewState["CveAsignacion"].ToString().ToEntero(); + } + + set + { + ViewState["CveAsignacion"] = value; + } + } + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -74,25 +113,73 @@ public partial class OI_DocumentoDetalle : ClsPaginas private void CargarMensajeNuevoEditado() { string MensajeNuevoEditado = Page.Request["Mensaje"]; - if (MensajeNuevoEditado == "Nuevo") + switch (MensajeNuevoEditado) { - Alert("El Documento ha sido creado correctamente"); - }else if(MensajeNuevoEditado == "Editado") - { - Alert("Los cambios en el Documento han sido guardado correctamente"); + case "Nuevo": + Alert("El Documento ha sido creado correctamente"); + break; + case "NuevaVersion": + Alert("Nueva versión del Documento creado correctamente"); + break; + case "Publicado": + Alert("Documento publicado"); + break; } } private void CargarUsuarios() { - GvUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa); + GvUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1"); GvUsuarios.DataBind(); } + private void CargarUsuariosParticipantes() + { + + DataTable UsuariosAux = null; + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.GetDocumentoAutorizacion(this.CveDocumento)) + { + GvUsuarios.DataSource = ObjOI.DtResultados; + UsuariosAux = ObjOI.DtResultados; + } + ObjOI.Dispose(); + GvUsuarios.DataBind(); + IndicarQuienesYaAutorizaron(UsuariosAux); + + } + + private void IndicarQuienesYaAutorizaron(DataTable Usuarios) + { + if (Usuarios != null) + { + GridViewRowCollection UsuariosEnGrid = GvUsuarios.Rows; + foreach (GridViewRow Usuario in UsuariosEnGrid) + { + int CveUsuario = Usuario.DataKey("CveUsuario").ToEntero(); + string FechaAprobacion = Usuarios.FiltroPrimeroValor("FechaAprobacion", string.Format("CveUsuario = {0}", CveUsuario)); + Usuario.FCCheckBox("ChkAprobar").Checked = FechaAprobacion != "" || (UsuarioActual.CveUsuario == CveUsuarioResponsable && CveUsuario == UsuarioActual.CveUsuario); + } + } + } + + protected void GvUsuarios_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + LinkButton LkbSubirPropuestaAux = e.Row.FCLinkButton("LkbSubirPropuesta"); + ScriptManager.GetCurrent(this).RegisterPostBackControl(LkbSubirPropuestaAux); + LinkButton LkbDescargarPropuestaAux = e.Row.FCLinkButton("LkbDescargarPropuesta"); + ScriptManager.GetCurrent(this).RegisterPostBackControl(LkbDescargarPropuestaAux); + } + } + private void CargarSubCategoria() { + DdlSubCategoria.Items.Clear(); + int CveCategoria = DdlCategoria.SelectedValue.ToEntero(); ClsOIEventos ObjOI = new ClsOIEventos(); - if (ObjOI.GetDocumentoSubCategoria()) + if (ObjOI.GetDocumentoSubCategoria(CveCategoria: CveCategoria)) { DdlSubCategoria.DataSource = ObjOI.DtResultados; DdlSubCategoria.DataBind(); @@ -114,7 +201,10 @@ public partial class OI_DocumentoDetalle : ClsPaginas { DataRow Documento = ObjOI.DtResultados.Rows[0]; + CveUsuarioResponsable = Documento["CveUsuario"].ToString().ToEntero(); TxtDescripcion.Text = Documento["Descripcion"].ToString(); + DdlCategoria.SelectedValue = Documento["CveCategoria"].ToString(); + CargarSubCategoria(); DdlSubCategoria.SelectedValue = Documento["CveSubCategoria"].ToString(); DdlEstatus.SelectedValue = Documento["CveEstatus"].ToString(); TxtVersion.Text = Documento["Version"].ToString(); @@ -122,9 +212,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas TxtObs.InnerText = Documento["Observacion"].ToString(); ArchivoAdjuntoNombre = Documento["ArchivoFisico"].ToString(); - string[] ArchivoAux = Documento["ArchivoFisico"].ToString().Split('_'); - string ArchivoAdjunto = ArchivoAux[1]; - LkbDescargarArchivo.Text = ArchivoAdjunto; + LkbDescargarArchivo.Text = ArchivoAdjuntoNombre; DivDescargarArchivo.Visible = true; } } @@ -149,28 +237,102 @@ public partial class OI_DocumentoDetalle : ClsPaginas private void ConfiguracionActualizar() { - LkbGuardar.Text = "Actualizar"; + LkbGuardar.Visible = false; + LkbActualizar.Visible = true; + LkbPublicar.Visible = true; + GvUsuarios.Columns[1].Visible = false; + GvUsuarios.Columns[2].Visible = true; + GvUsuarios.Columns[3].Visible = true; + } + + private void ConfigurarGridUsuariosParticipantes() + { + int CveUsuarioActual = UsuarioActual.CveUsuario; + GridViewRowCollection Usuarios = GvUsuarios.Rows; + foreach (GridViewRow Usuario in Usuarios) + { + int CveUsuarioIteracion = Usuario.DataKey("CveUsuario").ToEntero(); + if (CveUsuarioIteracion != CveUsuarioActual) + { + Usuario.FCCheckBox("ChkAprobar").Enabled = false; + Usuario.FCLinkButton("LkbSubirPropuesta").Visible = false; + } + } + } + + private void ConfigurarCamposDetalleSegunUsuario() + { + if (UsuarioActual.CveUsuario != CveUsuarioResponsable) + { + TxtDescripcion.Enabled = false; + DdlSubCategoria.Enabled = false; + DdlEstatus.Enabled = false; + TxtVersion.Enabled = false; + TxtResponsable.Enabled = false; + TxtObs.Disabled = true; + DivFileDropZone.Visible = false; + LkbActualizar.Visible = false; + } + } + + private void ConfigurarSegunEstatus() + { + bool MostrarSegunAprobado = (DdlEstatus.SelectedValue == "2"); + DivBotonesAcciones.Visible = !MostrarSegunAprobado; + UpAgregar.Visible = MostrarSegunAprobado; + } + + private void CargarCategorias() + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.GetDocumentoCategoria()) + { + DdlCategoria.DataSource = ObjOI.DtResultados; + } + ObjOI.Dispose(); + DdlCategoria.DataBind(); + DdlCategoria.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlSubCategoria.Items.Insert(0, new ListItem("Seleccione", "-1")); + } + + protected void DdlCategoria_SelectedIndexChanged(object sender, EventArgs e) + { + if (DdlCategoria.SelectedValue != "-1") + { + CargarSubCategoria(); + } + } + + private void EstatusMostrar(bool Mostrar) + { + DivEstatus.Visible = Mostrar; + brEstatus.Visible = Mostrar; + DivEstatusInicial.Visible = !Mostrar; + brEstatusInicial.Visible = !Mostrar; } private void Cargar() { - CargarUsuarios(); - CargarSubCategoria(); + CargarCategorias(); CargarResponsable(); CargarCveDocumento(); + CargarUsuarios(); if (this.CveDocumento > 0) { + EstatusMostrar(true); CargarDocumentoYaExistente(); + CargarUsuariosParticipantes(); CargarUsuariosAutorizo(); ConfiguracionActualizar(); + ConfigurarGridUsuariosParticipantes(); + ConfigurarCamposDetalleSegunUsuario(); CargarMensajeNuevoEditado(); } + ConfigurarSegunEstatus(); } #endregion #region "GENERAR DOCUMENTO" - - protected void LblGuardar_Click(object sender, EventArgs e) { ClsOIEventos ObjOI = new ClsOIEventos(); @@ -188,7 +350,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas if (!TieneError) { CorreosNotificacion = GuardarUsuariosQueAutorizan(CveDocumento, RutaArchivo, ref ObjOI, ref TieneError); }//asignamos a los usuarios que participaran en aprovar este documento if (!TieneError) { - ArchivoNotifiacion = GenerarArchivoByte(RutaArchivo); + ArchivoNotifiacion = GenerarArchivoByte(CveDocumento, RutaArchivo); NotificarPorCorreo(CorreosNotificacion, RutaArchivo, ArchivoNotifiacion); } @@ -196,7 +358,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas if (!TieneError) { ObjOI.Commit(); - string ParamMensaje = LkbGuardar.Text == "Guardar" ? "Nuevo" : "Editado";//Esto indica la acción de usuario la cual se mostrará como alert al cargar la página + string ParamMensaje = LkbGuardar.Text == "Guardar" ? "Nuevo" : "NuevaVersion";//Esto indica la acción de usuario la cual se mostrará como alert al cargar la página Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", CveDocumento, ParamMensaje)); } else @@ -212,7 +374,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas { int CveDocumentoPadre = this.CveDocumento > 0 ? this.CveDocumento : -1; //Asociamos el nuevo insert con un CveDocumento ya generado en caso de ser una nueva versión del documento - int CveDocumento = ObjOI.AddDocumento(DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, DdlEstatus.SelectedValue.ToEntero(), + int CveDocumento = ObjOI.AddDocumento(DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, 1, "", TxtResponsable.Text, CveDocumentoPadre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); if (!(CveDocumento > 0)) { @@ -251,7 +413,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas if (GvRow.FCCheckBox("ChkUnir").Checked && !TieneError) { int CveUsuario = GvRow.DataKey("CveUsuario").ToEntero(); - if (!ObjOI.AddDocumentoAutorizacion(CveDocumento, CveUsuario, RutaArchivo)) + if (!ObjOI.AddDocumentoAutorizacion(CveDocumento, CveUsuario, "")) { TieneError = true; this.ErrorMensaje = "Hubo un error al asignar los usuarios a este documento"; @@ -268,32 +430,70 @@ public partial class OI_DocumentoDetalle : ClsPaginas } #endregion + #region "ACTUALIZAR DOCUMENTO" + protected void LbkActualizar_Click(object sender, EventArgs e) + { + string Archivo = ActualizarArchivoEnDirectorio(); + ActualizarDocumentoYaExistente(Archivo); + Cargar(); + UpCliente.Update(); + Alert("Documento actualizado"); + } + + private string ActualizarArchivoEnDirectorio() + { + string ArchivoFisicoActualizado = ArchivoAdjuntoNombre; + if (TxtDocumentoFile.Text != "[]") + { + string RutaArchivo = string.Format(@"{0}DocumentosRepo\{1}\{2}", UsuarioActual.Empresa.Ruta, this.CveDocumento, ArchivoAdjuntoNombre); + if (File.Exists(RutaArchivo)) + { + File.Delete(RutaArchivo); + } + + ArchivoFisicoActualizado = GuardarArchivo(this.CveDocumento); + } + return ArchivoFisicoActualizado; + } + + private void ActualizarDocumentoYaExistente(string ArchivoFisico) + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (!ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, DdlEstatus.SelectedValue.ToEntero(), + ArchivoFisico, UsuarioActual.Nombre, ModExtensiones.MinFecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + Alert("Error al actualizar", ModExtensiones.TipoMensaje.MsgError); + } + ObjOI.Dispose(); + } + #endregion + #region "ARCHIVO ADJUNTO" private string GuardarArchivo(int CveDocumento) { string RutaArchivo = "-1"; List Filesgral = TxtDocumentoFile.getfiles().Archivos; + + //Si no existe la carpeta donde se guardan se crea + if (!Directory.Exists(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo\" + CveDocumento)) + { + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo\" + CveDocumento); + } + if (TxtDocumentoFile.Text != "[]") { foreach (Archivo fileItem in Filesgral) { try { - string Version = TxtVersion.Text; string NombreArchivo = fileItem.filenameO; //Preparamos la ruta donde moveremos el archivo cargado - string NombreArchivoGuardado = string.Format("{0}_{1}", CveDocumento, NombreArchivo); - string RutaDestino = UsuarioActual.Empresa.Ruta + @"DocumentosRepo\" + NombreArchivoGuardado; + string RutaDestino = string.Format(@"{0}DocumentosRepo\{1}\{2}", UsuarioActual.Empresa.Ruta, CveDocumento, NombreArchivo); - //Si no existe la carpeta donde se guardan se crea - if (!Directory.Exists(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo")) - { - Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo"); - } //Movemos el archivo de la carpeta temporal hacia la carpeta de la empresa System.IO.File.Move(fileItem.FileUrl, RutaDestino); - RutaArchivo = NombreArchivoGuardado; + RutaArchivo = NombreArchivo; } catch (Exception e) { @@ -302,12 +502,36 @@ public partial class OI_DocumentoDetalle : ClsPaginas } } } + else if (this.CveDocumento > 0) + { + try + { + if (ArchivoAdjuntoNombre != "") + { + string RutaOrigen = string.Format(@"{0}DocumentosRepo\{1}\{2}", UsuarioActual.Empresa.Ruta, this.CveDocumento, ArchivoAdjuntoNombre); + string RutaDestino = string.Format(@"{0}DocumentosRepo\{1}\{2}", UsuarioActual.Empresa.Ruta, CveDocumento, ArchivoAdjuntoNombre); + + System.IO.File.Move(RutaOrigen, RutaDestino); + RutaArchivo = ArchivoAdjuntoNombre; + } + else + { + RutaArchivo = ""; + } + } + catch (Exception e) + { + Alert(e.Message); + RutaArchivo = "Error"; + } + } + return RutaArchivo; } protected void LkbDescargarArchivo_Click(object sender, EventArgs e) { - string Ruta = string.Format("{0}Empresas/{1}/DocumentosRepo/{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ArchivoAdjuntoNombre); + string Ruta = string.Format("{0}Empresas/{1}/DocumentosRepo/{2}/{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, this.CveDocumento, ArchivoAdjuntoNombre); byte[] archivoBytes = File.ReadAllBytes(Ruta); HttpContext.Current.Response.Clear(); @@ -354,9 +578,9 @@ public partial class OI_DocumentoDetalle : ClsPaginas } } - private byte[] GenerarArchivoByte(string NombreArchivo) + private byte[] GenerarArchivoByte(int CveDocumento, string NombreArchivo) { - string ArchivoEnviar = string.Format(@"{0}DocumentosRepo\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo); + string ArchivoEnviar = string.Format(@"{0}DocumentosRepo\{1}\{2}", UsuarioActual.Empresa.Ruta, CveDocumento, NombreArchivo); if (File.Exists(ArchivoEnviar)) { System.IO.FileStream fs = System.IO.File.Open(ArchivoEnviar, System.IO.FileMode.Open, System.IO.FileAccess.Read); @@ -373,4 +597,180 @@ public partial class OI_DocumentoDetalle : ClsPaginas } #endregion + #region "PROPUESTAS DE USUARIOS" + private DataRow GetUsuarioParticipante(int CveUsuario) + { + DataRow UsuarioRetorno = null; + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.GetDocumentoAutorizacion(this.CveDocumento)) + { + UsuarioRetorno = ObjOI.DtResultados.FiltroPrimero(string.Format("CveUsuario = {0}", CveUsuario)); + } + ObjOI.Dispose(); + return UsuarioRetorno; + } + + protected void LkbSubirPropuesta_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + int CveUsuarioSeleccionado = GvRow.DataKey("CveUsuario").ToEntero(); + DataRow UsuarioSeleccionado = GetUsuarioParticipante(CveUsuarioSeleccionado); + this.CveUsuarioSeleccionado = CveUsuarioSeleccionado; + this.CveAsignacion = UsuarioSeleccionado["CveAutorizacion"].ToString().ToEntero(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarPropuesta")); + } + + protected void LkbDescargarPropuesta_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + int CveUsuario = GvRow.DataKey("CveUsuario").ToEntero(); + DataRow UsuarioSeleccionado = GetUsuarioParticipante(CveUsuario); + string Propuesta = UsuarioSeleccionado["Adjunto"] == null ? "" : UsuarioSeleccionado["Adjunto"].ToString(); + string Ruta = string.Format("{0}Empresas/{1}/DocumentosRepo/{2}/{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, this.CveDocumento, Propuesta); + if (File.Exists(Ruta)) + { + byte[] archivoBytes = File.ReadAllBytes(Ruta); + + HttpContext.Current.Response.Clear(); + HttpContext.Current.Response.ClearContent(); + HttpContext.Current.Response.ContentType = "application/octet-stream"; + HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", Propuesta)); + HttpContext.Current.Response.AddHeader("Content-Length", archivoBytes.Length.ToString()); + HttpContext.Current.Response.OutputStream.Write(archivoBytes, 0, archivoBytes.Length); + HttpContext.Current.Response.End(); + } + else + { + Alert("El Usuario no ha realizado una propuesta", ModExtensiones.TipoMensaje.MsgAdvertencia); + } + } + + protected void BtnAgregarPropuesta_Click(object sender, EventArgs e) + { + + string Archivo = SubirPropuestaEnDirectorio(this.CveUsuarioSeleccionado); + ActualizarUsuario(this.CveAsignacion, Archivo); + } + + private string SubirPropuestaEnDirectorio(int CveUsuario) + { + List Filesgral = TxtArchivoPropuesta.getfiles().Archivos; + string fileNameReturn = "-1"; + if (TxtArchivoPropuesta.Text != "[]") + { + foreach (Archivo fileItem in Filesgral) + { + try + { + string NombreArchivo = fileItem.filenameO; + fileNameReturn = string.Format("{0}_{1}", CveUsuario, NombreArchivo); + string RutaDestino = string.Format(@"{0}DocumentosRepo\{1}\{2}_{3}", UsuarioActual.Empresa.Ruta, this.CveDocumento, CveUsuario, NombreArchivo); + System.IO.File.Move(fileItem.FileUrl, RutaDestino); + } + catch (Exception ex) + { + Alert(ex.Message); + } + } + } + return fileNameReturn; + } + + private void ActualizarUsuario(int CveAutorizacion, string Archivo) + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (!ObjOI.UpdateDocumentoAutorizacion(CveAutorizacion, this.CveDocumento, TxtComentarios.InnerText, Archivo, ModExtensiones.MinFecha)) + { + Alert("Error al actualizar el archivo subido propuesto por el usuario"); + } + ObjOI.Dispose(); + } + #endregion + + #region "APROBACIÓN DEL DOCUMENTO" + protected void ChkAprobar_Checked(object sender, EventArgs e) + { + CheckBox SelectedCheckBox = (CheckBox)sender; + GridViewRow UsuarioAux = (GridViewRow)((Control)sender).Parent.Parent; + int CveUsuario = UsuarioAux.DataKey("CveUsuario").ToEntero(); + DataRow Usuario = GetUsuarioParticipante(CveUsuario); + + AprobacionDeUsuario(Usuario, SelectedCheckBox.Checked); + } + + private void AprobacionDeUsuario(DataRow Usuario, bool Autorizar) + { + int CveAutorizacion = Usuario["CveAutorizacion"].ToString().ToEntero(); + ClsOIEventos ObjOI = new ClsOIEventos(); + if (Autorizar) + { + if (ObjOI.UpdateDocumentoAutorizacion(CveAutorizacion, -1, "-1", "-1", DateTime.Now)) + { + Alert("Haz aprobado la versión actual del Documento"); + } + } + else + { + if (ObjOI.DesaprobarDocumentoAutorizacion(CveAutorizacion)) + { + Alert("Haz desaprobado la versión actual del Documento"); + } + } + ObjOI.Dispose(); + } + + protected void LkbPublicar_Click(object sender, EventArgs e) + { + GridViewRowCollection Usuarios = GvUsuarios.Rows; + bool Aprobado = true; + foreach (GridViewRow Usuario in Usuarios) + { + if (!Usuario.FCCheckBox("ChkAprobar").Checked) + { + Aprobado = false; + break; + } + } + + if (Aprobado) + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, 2, "-1", TxtResponsable.Text, + DateTime.Now, -1, -1, UsuarioActual.CveEmpresa)) + { + Alert("Documento publicado"); + } + ObjOI.Dispose(); + } + else + { + Alert("Los usuarios participantes aún no autorizan este Documento"); + } + Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", this.CveDocumento, "Publicado")); + } + #endregion + + #region "NUEVA VERSION" + protected void LkbNuevaVersion_Click(object sender, EventArgs e) + { + CargarUsuarios(); + LkbGuardar.Text = "Crear Nueva Versión"; + DivBotonesAcciones.Visible = true; + LkbActualizar.Visible = false; + LkbPublicar.Visible = false; + LkbGuardar.Visible = true; + GvUsuarios.Columns[1].Visible = true; + GvUsuarios.Columns[2].Visible = false; + GvUsuarios.Columns[3].Visible = false; + EstatusMostrar(false); + UpCliente.Update(); + } + #endregion + + protected void LbPruebas_Click(object sender,EventArgs e) + { + Cargar(); + UpCliente.Update(); + Alert("Documento actualizado"); + } } \ No newline at end of file diff --git a/OI/Documentos.aspx b/OI/Documentos.aspx index 818d0df70..5e37a8679 100644 --- a/OI/Documentos.aspx +++ b/OI/Documentos.aspx @@ -28,17 +28,22 @@ - + Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None" OnRowDataBound="GvDatos_RowDataBound"> + - <%----%> - + + + + + + diff --git a/OI/Documentos.aspx.cs b/OI/Documentos.aspx.cs index 2f162df73..9f02947a3 100644 --- a/OI/Documentos.aspx.cs +++ b/OI/Documentos.aspx.cs @@ -6,6 +6,7 @@ using System.Web.UI; using System.Web.UI.WebControls; using Extensiones; using System.Data; +using System.IO; public partial class OI_Documentos : ClsPaginas { @@ -27,4 +28,32 @@ public partial class OI_Documentos : ClsPaginas } ObjOI.Dispose(); } + + protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + LinkButton lkButonAux = e.Row.FCLinkButton("LkbDescargarDoc"); + ScriptManager.GetCurrent(this).RegisterPostBackControl(lkButonAux); + } + } + + protected void LkbDescargarDoc_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + + string ArchivoFisico = GvRow.DataKey("ArchivoFisico"); + string NombreArchivo = ArchivoFisico.Split('_')[1]; + + string Ruta = string.Format("{0}Empresas/{1}/DocumentosRepo/{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ArchivoFisico); + byte[] archivoBytes = File.ReadAllBytes(Ruta); + + HttpContext.Current.Response.Clear(); + HttpContext.Current.Response.ClearContent(); + HttpContext.Current.Response.ContentType = "application/octet-stream"; + HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", NombreArchivo)); + HttpContext.Current.Response.AddHeader("Content-Length", archivoBytes.Length.ToString()); + HttpContext.Current.Response.OutputStream.Write(archivoBytes, 0, archivoBytes.Length); + HttpContext.Current.Response.End(); + } } \ No newline at end of file diff --git a/RH/CatDocumentos.aspx b/RH/CatDocumentos.aspx index 12ac82c01..064ddb9d3 100644 --- a/RH/CatDocumentos.aspx +++ b/RH/CatDocumentos.aspx @@ -154,7 +154,8 @@

    Resultados del Ejercicio:

    @@ -169,6 +171,7 @@