Commit inicial Ventas Productivo
This commit is contained in:
193
Contabilidad/RepEstadoResultadosMensual.aspx.vb
Normal file
193
Contabilidad/RepEstadoResultadosMensual.aspx.vb
Normal file
@@ -0,0 +1,193 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Partial Class Contabilidad_RepEstadoResultadosMensual
|
||||
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 TipoReporte As Integer
|
||||
Get
|
||||
TipoReporte = ViewState("TipoReporte").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("TipoReporte") = 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
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
TipoReporte = -1
|
||||
Else
|
||||
TipoReporte = 1
|
||||
tdTipoReporte.Visible = True
|
||||
End If
|
||||
|
||||
DdlEjercicio.SelectedValue = Now.Year.ToString
|
||||
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
|
||||
|
||||
If ObjConta.GetEstadoResultadosMensual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte) Then
|
||||
DtDatos = ObjConta.DtResultados
|
||||
Else
|
||||
DtDatos = Nothing
|
||||
Alert("Ocurrio un error al cargar los datos del estado de resultados", TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
|
||||
EscondeSubtotales()
|
||||
|
||||
If DtDatos IsNot Nothing Then
|
||||
CargaGrid()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub EscondeSubtotales()
|
||||
|
||||
'Esconde Trimestral
|
||||
GvDatos.Columns(7).Visible = False
|
||||
GvDatos.Columns(8).Visible = False
|
||||
GvDatos.Columns(17).Visible = False
|
||||
GvDatos.Columns(18).Visible = False
|
||||
GvDatos.Columns(27).Visible = False
|
||||
GvDatos.Columns(28).Visible = False
|
||||
GvDatos.Columns(35).Visible = False
|
||||
GvDatos.Columns(36).Visible = False
|
||||
|
||||
'Esconde Cuatrimestral
|
||||
GvDatos.Columns(11).Visible = False
|
||||
GvDatos.Columns(12).Visible = False
|
||||
GvDatos.Columns(23).Visible = False
|
||||
GvDatos.Columns(24).Visible = False
|
||||
GvDatos.Columns(37).Visible = False
|
||||
GvDatos.Columns(38).Visible = False
|
||||
|
||||
If DdlSubtotales.SelectedValue = "2" Then
|
||||
GvDatos.Columns(7).Visible = True
|
||||
GvDatos.Columns(8).Visible = True
|
||||
GvDatos.Columns(17).Visible = True
|
||||
GvDatos.Columns(18).Visible = True
|
||||
GvDatos.Columns(27).Visible = True
|
||||
GvDatos.Columns(28).Visible = True
|
||||
GvDatos.Columns(35).Visible = True
|
||||
GvDatos.Columns(36).Visible = True
|
||||
ElseIf DdlSubtotales.SelectedValue = "3" Then
|
||||
GvDatos.Columns(11).Visible = True
|
||||
GvDatos.Columns(12).Visible = True
|
||||
GvDatos.Columns(23).Visible = True
|
||||
GvDatos.Columns(24).Visible = True
|
||||
GvDatos.Columns(37).Visible = True
|
||||
GvDatos.Columns(38).Visible = True
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaGrid()
|
||||
GvDatos.DataSource = DtDatos
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 4 Then
|
||||
e.Row.FCHyperLink("HLEnero").Text = ""
|
||||
e.Row.FCHyperLink("HLFebrero").Text = ""
|
||||
e.Row.FCHyperLink("HLMarzo").Text = ""
|
||||
e.Row.FCHyperLink("HLAbril").Text = ""
|
||||
e.Row.FCHyperLink("HLMayo").Text = ""
|
||||
e.Row.FCHyperLink("HLJunio").Text = ""
|
||||
e.Row.FCHyperLink("HLJulio").Text = ""
|
||||
e.Row.FCHyperLink("HLAgosto").Text = ""
|
||||
e.Row.FCHyperLink("HLSeptiembre").Text = ""
|
||||
e.Row.FCHyperLink("HLOctubre").Text = ""
|
||||
e.Row.FCHyperLink("HLNoviembre").Text = ""
|
||||
e.Row.FCHyperLink("HLDiciembre").Text = ""
|
||||
e.Row.Cells(2).Text = ""
|
||||
e.Row.Cells(4).Text = ""
|
||||
e.Row.Cells(6).Text = ""
|
||||
e.Row.Cells(8).Text = ""
|
||||
e.Row.Cells(10).Text = ""
|
||||
e.Row.Cells(12).Text = ""
|
||||
e.Row.Cells(14).Text = ""
|
||||
e.Row.Cells(16).Text = ""
|
||||
e.Row.Cells(18).Text = ""
|
||||
e.Row.Cells(20).Text = ""
|
||||
e.Row.Cells(22).Text = ""
|
||||
e.Row.Cells(24).Text = ""
|
||||
End If
|
||||
|
||||
'AGRUPADOR DE CUENTAS
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 4 Then
|
||||
e.Row.FCLabel("LbNombre").Font.Bold = True
|
||||
End If
|
||||
|
||||
'TITULO DE CUENTAS
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
|
||||
e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 10px;")
|
||||
End If
|
||||
|
||||
'CUENTAS
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 1 Then
|
||||
e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 20px;")
|
||||
End If
|
||||
|
||||
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 1 Or e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
|
||||
e.Row.FCHyperLink("HLEnero").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("01/01/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLFebrero").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("01/02/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLMarzo").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("01/03/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLAbril").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("01/04/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLMayo").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("01/05/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLJunio").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("01/06/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLJulio").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("01/07/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLAgosto").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("01/08/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLSeptiembre").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("09/01/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLOctubre").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("01/10/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLNoviembre").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("01/11/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLDiciembre").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), String.Format("01/12/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
|
||||
e.Row.FCHyperLink("HLTrimestral1").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("Id"), String.Format("01/01/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/03/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLTrimestral2").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("Id"), String.Format("01/04/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/06/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLTrimestral3").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("Id"), String.Format("01/07/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/09/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLTrimestral4").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("Id"), String.Format("01/10/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/12/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
|
||||
e.Row.FCHyperLink("HLCuatrimestral1").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("Id"), String.Format("01/01/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/04/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLCuatrimestral2").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("Id"), String.Format("01/05/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/08/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
e.Row.FCHyperLink("HLCuatrimestral3").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("Id"), String.Format("01/09/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/12/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte)
|
||||
|
||||
End If
|
||||
|
||||
'TOTALES
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 5 Then
|
||||
e.Row.Attributes.Add("style", "border-top: 1px solid;")
|
||||
e.Row.FCLabel("LbNombre").Font.Italic = True
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user