146 lines
4.3 KiB
VB.net
146 lines
4.3 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports Microsoft.Reporting.WebForms
|
|
Imports Extensiones
|
|
Partial Class RepCuadreContaAdmon
|
|
Inherits ClsPaginas
|
|
Private Shared missing As Object = System.Reflection.Missing.Value
|
|
|
|
#Region "PROPIEDADES"
|
|
Private Property DtVentas As DataTable
|
|
Get
|
|
Return DirectCast(ViewState("DtVentas"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DtVentas") = value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
|
|
End If
|
|
End Sub
|
|
|
|
#Region " C A R G A - D A T O S "
|
|
Public Sub CargaDatos()
|
|
Dim ObjContpaq As New ClsContPAQi(UsuarioActual.Empresa)
|
|
|
|
Dim FechaI As Date = If(txtFechaI.Text = "", MinFecha, txtFechaI.Text.ToDate)
|
|
Dim FechaF As Date = If(txtFechaF.Text = "", MaxFecha, txtFechaF.Text.ToDate)
|
|
|
|
If ObjContpaq.GetReporteCuadreContaAdmon(UsuarioActual.CveEmpresa, FuncionalidadGrupoGet(DdlGrupo.SelectedValue.ToEntero), DdlGrupo.SelectedValue.ToEntero, 1, FechaI, FechaF) Then
|
|
GvDatos.DataSource = ObjContpaq.DtResultados
|
|
GvDatos.DataBind()
|
|
UPDatos.Update()
|
|
Else
|
|
Alert("Ocurrio un error al obtener el reporte", TipoMensaje.MsgError)
|
|
End If
|
|
|
|
ObjContpaq.Dispose()
|
|
End Sub
|
|
|
|
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
|
CargaDatos()
|
|
End Sub
|
|
|
|
Private Function FuncionalidadGrupoGet(Grupo As Integer) As Integer
|
|
|
|
Select Case Grupo
|
|
|
|
Case 1 'Clientes
|
|
Return 211
|
|
|
|
Case 2 'Proveedores
|
|
Return 201
|
|
|
|
Case 3 'Bancos
|
|
Return 209
|
|
|
|
Case 4 'Caja Chica
|
|
Return 218
|
|
|
|
Case 5 'Deudores
|
|
Return 205
|
|
|
|
Case 6 'Acreedores
|
|
Return 202
|
|
|
|
Case 7 'Ant Clientes
|
|
Return 212
|
|
|
|
Case 8 'Ant Proveedores
|
|
Return 204
|
|
|
|
Case 9 'IVA x Acreditar
|
|
Return UsuarioActual.Empresa.IdCuentaIVAxAcreditar
|
|
|
|
Case 10 'IVA Acreditado
|
|
Return UsuarioActual.Empresa.IdCuentaIVAAcreditable
|
|
|
|
Case 11 'IVA x Trasladar
|
|
Return UsuarioActual.Empresa.IdCuentaIVAxTrasladar
|
|
|
|
Case 12 'IVA Trasladado
|
|
Return UsuarioActual.Empresa.IdCuentaIVATrasladado
|
|
|
|
Case 13 'Ingresos
|
|
Return 222
|
|
|
|
Case 14 'Gastos
|
|
Return 216
|
|
End Select
|
|
|
|
Return 0
|
|
End Function
|
|
#End Region
|
|
|
|
#Region "O R D E N A M I E N T O"
|
|
Private Sub OrdenaDatos()
|
|
If (GvDatos.Rows.Count > 0) Then
|
|
GvDatos.UseAccessibleHeader = True
|
|
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
|
RegistraScript("OrdenarGV();")
|
|
End If
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region "G V - D A T O S "
|
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
Dim Css As String = "Texto"
|
|
|
|
If e.Row.FCLiteral("LtlImporteContable").Text <> e.Row.FCLiteral("LtlImporteAdmon").Text AndAlso e.Row.DataKey("Orden") = "2" Then
|
|
e.Row.ForeColor = Drawing.Color.Red
|
|
ElseIf e.Row.FCLiteral("LtlImporteContable").Text = e.Row.FCLiteral("LtlImporteAdmon").Text AndAlso e.Row.DataKey("Orden") = "1" Then
|
|
e.Row.Cells(2).ForeColor = Drawing.Color.Green
|
|
e.Row.Cells(3).ForeColor = Drawing.Color.Green
|
|
End If
|
|
|
|
If e.Row.DataKey("Orden").Contiene("0", "1") Then
|
|
e.Row.CssClass = "Totales"
|
|
End If
|
|
|
|
'LIGA A DETALLE
|
|
Dim Liga As String = $"/Contabilidad/Reportes/RepCuadreContaAdmonDetalle.aspx?GPO={DdlGrupo.SelectedValue}&FechaI={txtFechaI.Text}&FechaF={txtFechaF.Text}"
|
|
e.Row.FCLiteral("LtlCuenta").Text = "<a class=""" & Css & """ Target=_blank href=""" & Liga & """>" & e.Row.FCLiteral("LtlCuenta").Text & "</a>"
|
|
|
|
End If
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region "CARGA COMBOS FILTRO"
|
|
|
|
#End Region
|
|
|
|
#Region "DDLS SELECTED INDEX CHANGED"
|
|
#End Region
|
|
|
|
#Region "PDF"
|
|
#End Region
|
|
|
|
End Class
|