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("
", 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
+ CancelacionSoap1Cancelacion.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 @@
-
-
+
+
"
+ 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 = $"