Commit inicial Ventas Productivo

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-08-14 16:40:54 -07:00
commit c35cf91883
13328 changed files with 3711549 additions and 0 deletions

View File

@@ -0,0 +1,220 @@
<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatCuentas.aspx.vb" Inherits="Contabilidad2_CatCuentas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
#treeviewarbolmiarbol, .catcuentascontarbol .catcuentasarbol {
width: 100%;
}
#listviewbuscar {
width: 50%;
}
.aradd {
margin-left: 15px;
background-color: #1caf9a;
color: #ffffff;
font-weight: 300;
padding: 2px 7px 3px 8px;
text-align: center;
height: 15px;
border-radius: 18px !important;
vertical-align: middle;
}
.aradd::before {
font: normal normal normal 14px/1 FontAwesome;
font-size: 9px !important;
content: "\f067";
}
.aredit {
margin-left: 15px;
background-color: #E87E04;
color: #ffffff;
font-weight: 300;
padding: 2px 7px 3px 8px;
text-align: center;
height: 15px;
border-radius: 18px !important;
vertical-align: middle;
}
.aredit::before {
font: normal normal normal 14px/1 FontAwesome;
font-size: 9px !important;
content: "\f040";
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Cuentas Contables
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upcuentas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="updatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="catcuentascontarbol">
<fieldset>
<legend>Cuentas</legend>
<div class="catcuentasarbol">
<div id="treeviewarbolmiarbol">
<asp:Literal ID="Literal1" Visible="false" runat="server"></asp:Literal>
<ADS:Arbol runat="server" ID="ArbolCuentas"></ADS:Arbol>
</div>
</div>
</fieldset>
</div>
<%-- <asp:Button ID="BtnCambiaAgrupadorSAT" OnClick="BtnCambiaAgrupadorSAT_Click" ClientIDMode="Static" Style="display: none;" runat="server" />--%>
<div class="catcuentasform">
<asp:TextBox ID="Textbuscar" Style="display: none;" runat="server"></asp:TextBox>
<asp:HiddenField ID="HdnID" runat="server" Value="" ClientIDMode="Static" />
<asp:Button ID="editar" runat="server" Style="display: none;" Text="Buscar" />
<asp:Button ID="agregar" Style="display: none;" runat="server" Text="Buscar" />
<asp:Button ID="borrar" Style="display: none;" runat="server" Text="borrar" />
<fieldset>
<legend>Información de la cuenta</legend>
<div class="form-line">
<div class="catcuentas left">Cuenta</div>
<div class="catcuentas right">
<asp:TextBox ID="TxtCuenta" Style="width: 200px" runat="server" MaxLength="30"></asp:TextBox>
<ajax:MaskedEditExtender TargetControlID="Tcuenta" ID="MEECuenta" runat="server" MaskType="Number" AutoComplete="True" AutoCompleteValue="0" />
<asp:TextBox ID="Tcuenta" Style="width: 100px" runat="server" MaxLength="30" Visible="false"></asp:TextBox>
</div>
</div>
<div class="form-line">
<div class="catcuentas left">Nombre</div>
<div class="catcuentas right">
<asp:TextBox ID="Tnombre" Style="width: 100%;" runat="server" MaxLength="50"></asp:TextBox>
</div>
</div>
<br />
<hr />
<div class="form-line">
<div class="catcuentas left">Subcuenta de</div>
<div class="catcuentas right">
<asp:TextBox ID="Tsubcuenta" runat="server" Enabled="False" Width="140px" ClientIDMode="Static"></asp:TextBox>
<br />
<asp:Label ID="LblSubCuenta" runat="server" Text="" Font-Italic="True" Font-Size="7pt" ClientIDMode="Static"></asp:Label>
</div>
</div>
<div class="form-line">
<div class="catcuentas left">Tipo de Cuenta</div>
<div class="catcuentas right">
<asp:DropDownList ID="DTcuenta" CssClass="form-control input-sm input-small select2me" runat="server">
<asp:ListItem Selected="True" Text="Seleccione " Value="-1"></asp:ListItem>
<asp:ListItem Text="Activo Deudora " Value="A"></asp:ListItem>
<asp:ListItem Text="Activo Acreedora " Value="B"></asp:ListItem>
<asp:ListItem Text="Pasivo Deudora " Value="C"></asp:ListItem>
<asp:ListItem Text="Pasivo Acreedora " Value="D"></asp:ListItem>
<asp:ListItem Text="Capital Deudora " Value="E"></asp:ListItem>
<asp:ListItem Text="Capital Acreedora " Value="F"></asp:ListItem>
<asp:ListItem Text="Resultados Deudora " Value="G"></asp:ListItem>
<asp:ListItem Text="Resultados Acreedora" Value="H"></asp:ListItem>
<asp:ListItem Text="Estadisticas Deudora" Value="I"></asp:ListItem>
<asp:ListItem Text="Estadisticas Acredora " Value="J"></asp:ListItem>
<asp:ListItem Text="Orden Deudora " Value="K"></asp:ListItem>
<asp:ListItem Text="Orden Acreedora " Value="L"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="form-line">
<div class="catcuentas left">Cuenta Mayor</div>
<div class="catcuentas right">
<asp:DropDownList ID="DcuentaMayor" CssClass="form-control input-sm input-small select2me" runat="server">
<asp:ListItem Selected="True" Text="Seleccione " Value="-1"></asp:ListItem>
<asp:ListItem Text="Mayor " Value="1"></asp:ListItem>
<asp:ListItem Text="No " Value="2"></asp:ListItem>
<asp:ListItem Text="Titulo " Value="3"></asp:ListItem>
<asp:ListItem Text="SubTitulo " Value="4"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="form-line">
<div class="catcuentas left">Agrupador SAT</div>
<div class="catcuentas right">
<asp:DropDownList ID="DdlAgrupadorSAT" DataTextField="CodigoNombre" DataValueField="CveAgrupadorSAT" CssClass="form-control input-sm input-small select2me" Width="100%" runat="server">
</asp:DropDownList>
</div>
</div>
<div class="form-line">
<div class="catcuentas left">Moneda</div>
<div class="catcuentas right">
<asp:DropDownList ID="DdlMoneda" DataTextField="Moneda" DataValueField="CveMoneda" CssClass="form-control input-sm input-small select2me" runat="server">
</asp:DropDownList>
</div>
</div>
<div class="form-line">
<div class="catcuentas left">Dígito agrupador</div>
<div class="catcuentas right">
<asp:TextBox ID="TxtDigAgrup" Style="width: 40px;" runat="server"></asp:TextBox>
</div>
</div>
<div class="form-line">
<div class="catcuentas left">Nombre en ingles</div>
<div class="catcuentas right">
<asp:TextBox ID="TxtNomIngles" Style="width: 100%;" runat="server"></asp:TextBox>
</div>
</div>
<br />
<asp:Button ID="Guardar" CssClass="btn btn-primary" Visible="false" runat="server" Text="Guardar" />
<asp:Button ID="nuevacuenta" CssClass="btn btn-success" Visible="false" runat="server" Text="Guardar" />
<asp:Button ID="BtnEliminar" CssClass="btn btn-danger" Visible="false" runat="server" Text="Eliminar" OnClientClick="return confirm('Esta seguro de eliminar la cuenta?')" />
</fieldset>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="content7" ContentPlaceHolderID="JS" runat="server">
<script>
function buscararbolito(inputid, ulid) {
var texto = $("input#" + inputid).val();
if ((texto == '') && ($('ul#' + ulid))) {
$('ul#' + ulid + '').removeClass("listainvicible");
}
else {
if ($('ul#' + ulid).hasClass('listainvicible') == false) {
$('ul#' + ulid).addClass("listainvicible");
}
if ($('ul#' + ulid + ' li.livisible')) {
$('ul#' + ulid + ' li.livisible').removeClass("livisible");
}
if ($('ul#' + ulid + ' input:checked')) {
$('ul#' + ulid + ' input:checked').prop('checked', false);
}
if ($('ul#' + ulid + ' li:contains("' + texto + '") > input[type=checkbox]')) {
$('ul#' + ulid + ' li:contains("' + texto + '") > input[type=checkbox]').prop('checked', true);
}
if ($('ul#' + ulid + ' li:contains("' + texto + '")')) {
$('ul#' + ulid + ' li:contains("' + texto + '")').addClass("livisible");
}
if ($('ul#' + ulid + ' label:contains("' + texto + '") ~ ul li')) {
$('ul#' + ulid + ' label:contains(""' + texto + '"") ~ ul li').addClass("livisible");
}
}
}
jQuery(document).ready(function () {
Sys.Application.add_load(function (s, e) {
buscararbolito('C_ArbolCuentas_Abuscar', 'C_ArbolCuentas_miarbol')
});
});
</script>
</asp:Content>

View File

@@ -0,0 +1,376 @@
Imports System.Data
Imports Extensiones
Partial Class Contabilidad2_CatCuentas
Inherits ClsPaginas
#Region "Propiedades"
Private Property DtDatos As DataTable
Get
Return CType(ViewState("DtDatos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
Private Property IDSelected As Integer
Get
Return ViewState("idsel").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("idsel") = 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
'inicio()
'RegistraScript("$('#Tsubcuenta').mask('00000-0000-0000-00000');")
If UsuarioActual.Empresa.UsaContabilidad Then
CargaMonedas()
CargaAgrupadorSAT()
CargaDatos()
Else
Alert("Este módulo requiere el uso de Contabilidad.", TipoMensaje.MsgAdvertencia)
MEECuenta.Enabled = False
End If
End If
End Sub
Private Sub CargaMonedas()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObJConta As New ClsContabilidad
If ObJConta.GetMonedas() Then
DdlMoneda.DataSource = ObJConta.DtResultados
End If
ObJConta.Dispose()
DdlMoneda.DataBind()
End Sub
Private Sub CargaAgrupadorSAT()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
If ObjConta.GetAgrupadoresSAT(UsuarioActual.CveEmpresa) Then
DdlAgrupadorSAT.DataSource = ObjConta.DtResultados
End If
ObjConta.Dispose()
DdlAgrupadorSAT.DataBind()
DdlAgrupadorSAT.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Private Sub CargaDatos()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
DtDatos = ObjConta.DtResultados
End If
ObjConta.Dispose()
'para obtener la mascara, tomo el primer dato y reemplazo los numeros por cero
Dim Mascara As String = "####-####-###"
If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then
Mascara = DtDatos.Rows(0)("Codigo").ToString.Replace("1", "0").Replace("2", "0").Replace("3", "0").Replace("4", "0").Replace("5", "0").Replace("6", "0").Replace("7", "0").Replace("8", "0").Replace("9", "0")
End If
MEECuenta.Mask = Mascara.Replace("0", "9")
MEECuenta.AutoComplete = True
MEECuenta.AutoCompleteValue = Mascara
ArbolCuentas.DataSource = DtDatos
ArbolCuentas.nivel = "CtaInicial"
ArbolCuentas.nodoid = "CveCuenta"
ArbolCuentas.padre = "CvePadre"
ArbolCuentas.titulo = "CtaCodigo"
End Sub
'Private Function getNodosHijos(nodo As Integer) As DataTable
' Return DtDatos.FiltraParametros(String.Format("IdPadre = {0}", nodo))
'End Function
Private Function getNodospadreHijos(nodo As Integer) As DataTable
Return DtDatos.FiltraParametros(String.Format("CveCuenta = {0}", nodo))
End Function
Protected Sub agregar_Click(sender As Object, e As EventArgs) Handles ArbolCuentas.addclick
LimpiarCampos()
Dim dt As New DataTable
'IDSelected = HdnID.Value.ToEntero() "ul" + itempadre.Cve;
Dim obj As ADServerControl.DragableItem = DirectCast(sender, ADServerControl.DragableItem)
IDSelected = obj.Cve
'obj.FindControl(String.Format("ul{0}", obj.Cve))
'obj.Controls.Add(New TextBox())
dt = getNodospadreHijos(IDSelected)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
Dim dr As DataRow = dt.Rows(0)
TxtCuenta.Text = Trim(dr("CuentaFormato").ToString.Replace("-", "").ToString)
'Tcuenta.Text = Trim(dr("CuentaFormato").ToString.Replace("-", "").ToString)
Tsubcuenta.Text = dr("CuentaFormato").ToString()
DTcuenta.SelectedValue = dr("Tipo").ToString()
DcuentaMayor.SelectedValue = dr("CtaMayor").ToString
LblSubCuenta.Text = dr("Nombre").ToString
End If
TxtCuenta.Enabled = True
'Tcuenta.Enabled = True
nuevacuenta.Visible = True
updatos.Visible = True
updatos.Update()
End Sub
Protected Sub editar_Click(sender As Object, e As EventArgs) Handles ArbolCuentas.editclick
LimpiarCampos()
Dim dt As DataTable
Dim obj As ADServerControl.DragableItem = DirectCast(sender, ADServerControl.DragableItem)
IDSelected = obj.Cve
dt = getNodospadreHijos(IDSelected)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
Dim dr As DataRow = dt.Rows(0)
TxtCuenta.Text = dr("CuentaFormato").ToString.Replace("-", "").ToString
'Tcuenta.Text = dr("CuentaFormato").ToString.Replace("-", "").ToString
Tnombre.Text = dr("Nombre").ToString()
DTcuenta.SelectedValue = dr("Tipo").ToString()
DcuentaMayor.SelectedValue = dr("CtaMayor").ToString
DdlMoneda.SelectedValue = dr("CveMoneda").ToString
If dr("CveAgrupadorSAT").ToString.ToEntero = 0 Then
DdlAgrupadorSAT.SelectedValue = -1
Else
DdlAgrupadorSAT.SelectedValueExist(dr("CveAgrupadorSAT").ToString)
End If
TxtDigAgrup.Text = dr("DigAgrup").ToString
TxtNomIngles.Text = dr("NomIdioma").ToString
Dim Hijos As Integer = DtDatos.FiltraParametros(String.Format("CvePadre = {0}", IDSelected)).Rows.Count
If Hijos = 0 Then BtnEliminar.Visible = True
dt = getNodospadreHijos(dr("CvePadre").ToString.ToEntero)
If dt.Rows.Count > 0 Then
Dim drt As DataRow = dt.Rows(0)
Tsubcuenta.Text = drt("Codigo").ToString
LblSubCuenta.Text = drt("Nombre").ToString
End If
End If
Guardar.Visible = True
updatos.Visible = True
updatos.Update()
End Sub
Protected Sub Guardar_Click(sender As Object, e As EventArgs) Handles Guardar.Click
If Tnombre.Text.Trim = "" Then Alert("Ingrese nombre de la cuenta", TipoMensaje.MsgError) : Exit Sub
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
Dim ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
If ObjConta.UpdateCuenta(IDSelected.ToEntero, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToString.ToEntero, DdlAgrupadorSAT.SelectedValue.ToEntero, TxtNomIngles.Text.ToString) Then
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
If ObjConta2.GetCuentas(-1, "-1", -1) Then
Dim Id As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigo}'").ToEntero
Dim IdAgrupador As Integer
If ObjConta2.GetAgrupadoresSAT() Then
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
End If
If Id > 0 Then
If ObjConta2.UpdateCuenta(Id, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, DdlMoneda.SelectedValue.ToEntero, IdAgrupador, SubCuentaDe:=Tsubcuenta.Text.Trim) > 0 Then
End If
End If
End If
Dim customerRow As Data.DataRow
customerRow = DtDatos.Select(String.Format("CveCuenta = {0}", IDSelected))(0)
customerRow("Nombre") = Tnombre.Text
DtDatos.AcceptChanges()
CargaDatos()
ArbolCuentas.DataSource = DtDatos
Dim item As CheckBox = DirectCast(ArbolCuentas.FindControl(String.Format("chk{0}", IDSelected)), CheckBox)
item.Text = String.Format("{0} - {1}", customerRow("CuentaFormato").ToString, Tnombre.Text)
'updatos.Visible = False
'Guardar.Visible = False
LimpiarCampos()
'RegistraScript("$get('BtnCambiaAgrupadorSAT').click();")
updatos.Update()
Alert("La cuenta se guardo correctamente")
End If
ObjConta.Dispose()
ObjConta2.Dispose()
End Sub
Protected Sub nuevacuenta_Click(sender As Object, e As EventArgs) Handles nuevacuenta.Click
If Tnombre.Text.Trim = "" Then Alert("Ingrese nombre de la cuenta", TipoMensaje.MsgError) : Exit Sub
If TxtCuenta.Text.Trim = "" Then Alert("Ingrese la cuenta", TipoMensaje.MsgError) : Exit Sub
'If Tcuenta.Text.Trim = "" Then Alert("Ingrese la cuenta", TipoMensaje.MsgError) : Exit Sub
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
Dim ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
Dim CuentaEfectivo As Integer = 0
Dim Afectable As Integer = 1 'If(DcuentaMayor.SelectedValue <> 2, 0, 1) ' cuando sea tipo 2, va a ser afectable
Tcuenta.Text.Replace("-", "")
Dim idnew As Integer = ObjConta.AddCuenta(
IDSelected,
TxtCuenta.Text.Replace("-", ""),
Tnombre.Text,
DTcuenta.SelectedValue.ToString,
DcuentaMayor.SelectedValue.ToString.ToEntero,
DdlMoneda.SelectedValue.ToEntero,
TxtDigAgrup.Text.ToEntero,
DdlAgrupadorSAT.SelectedValue.ToEntero,
TxtNomIngles.Text.ToString)
If idnew > 0 Then
Dim codigoPadre As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}") 'Tsubcuenta.Text
If ObjConta2.GetCuentas(-1, "-1", -1) Then
Dim IdPadre As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigoPadre}'").ToEntero
Dim IdAgrupador As Integer
If ObjConta2.GetAgrupadoresSAT() Then
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
End If
If IdPadre > 0 Then
Dim idnew2 As Integer = ObjConta2.AddCuenta(TxtCuenta.Text.Replace("-", ""), Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, CuentaEfectivo, DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToEntero, TxtNomIngles.Text.Trim, Afectable, IdPadre, IdAgrupador)
If idnew2 > 0 Then
If ObjConta.UpdateCuentaCompaq(idnew, idnew2, UsuarioActual.CveEmpresa) Then
End If
End If
End If
End If
Dim dr As DataRow = DtDatos.NewRow
dr("CveCuenta") = idnew
dr("CuentaFormato") = TxtCuenta.Text
'dr("CuentaFormato") = Tcuenta.Text
dr("Nombre") = Tnombre.Text
dr("CtaCodigo") = String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text)
'dr("CtaCodigo") = String.Format("{0} - {1}", Tcuenta.Text, Tnombre.Text)
dr("Tipo") = DTcuenta.SelectedValue.ToString
dr("CtaMayor") = DcuentaMayor.SelectedValue.ToString
dr("CvePadre") = IDSelected
dr("Codigo") = Tnombre.Text
dr("CveMoneda") = DdlMoneda.SelectedValue.ToEntero
dr("DigAgrup") = TxtDigAgrup.Text.Trim.ToEntero
dr("NomIdioma") = TxtNomIngles.Text.Trim
DtDatos.Rows.Add(dr)
ArbolCuentas.DataSource = DtDatos
'.Attributes.Add("data-hijos","0");
Dim item As ADServerControl.DragableItem = DirectCast(ArbolCuentas.FindControl(String.Format("{0}", IDSelected)), ADServerControl.DragableItem)
item.Attributes.Item("data-hijos") = item.Attributes.Item("data-hijos").ToEntero + 1
Dim objul As ADServerControl.DragableUL = DirectCast(ArbolCuentas.FindControl(String.Format("ul{0}", IDSelected)), ADServerControl.DragableUL)
If (IsNothing(objul)) Then
objul = New ADServerControl.DragableUL
objul.ID = String.Format("ul{0}", item.Cve)
item.Controls.Add(objul)
End If
ArbolCuentas.additem(objul, idnew, IDSelected, String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text))
'ArbolCuentas.additem(objul, idnew, IDSelected, String.Format("{0} - {1}", Tcuenta.Text, Tnombre.Text))
'updatos.Visible = False
'nuevacuenta.Visible = False
LimpiarCampos()
updatos.Update()
CargaDatos()
Alert("La cuenta se guardo correctamente")
End If
ObjConta.Dispose()
ObjConta2.Dispose()
End Sub
Private Sub LimpiarCampos()
TxtCuenta.Text = ""
'Tcuenta.Text = ""
Tnombre.Text = ""
DTcuenta.SelectedValue = "-1"
DcuentaMayor.SelectedValue = "-1"
DdlAgrupadorSAT.SelectedValue = "-1"
Tsubcuenta.Text = ""
TxtDigAgrup.Text = ""
Guardar.Visible = False
nuevacuenta.Visible = False
TxtCuenta.Enabled = False
'Tcuenta.Enabled = False
BtnEliminar.Visible = False
End Sub
Protected Sub borrar_Click(sender As Object, e As EventArgs) Handles borrar.Click
End Sub
Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
Dim ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
'ObjConta.IniciaTransacSQL()
If ObjConta.RemoveCuenta(IDSelected.ToEntero) Then
' ObjConta.Commit()
Dim customerRow As Data.DataRow
customerRow = DtDatos.Select(String.Format("CveCuenta = {0}", IDSelected))(0)
customerRow("CvePadre") = "-5"
DtDatos.AcceptChanges()
ArbolCuentas.DataSource = DtDatos
Dim item As ADServerControl.DragableItem = DirectCast(ArbolCuentas.FindControl(String.Format("{0}", IDSelected)), ADServerControl.DragableItem)
Dim padre As ADServerControl.DragableItem = DirectCast(ArbolCuentas.FindControl(String.Format("{0}", item.CvePadre)), ADServerControl.DragableItem)
padre.Attributes.Item("data-hijos") = padre.Attributes.Item("data-hijos").ToEntero - 1
ArbolCuentas.Controls.Remove(item)
RegistraScript(String.Format("$('#{0}').click();", editar.ClientID))
LimpiarCampos()
upcuentas.Update()
Alert("La Cuenta ha sido eliminada", TipoMensaje.MsgInformacion)
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
If ObjConta2.GetCuentas(-1, "-1", -1) Then
Dim Id As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigo}'").ToEntero
If Id > 0 Then
If ObjConta2.RemoveCuenta(Id) Then
End If
End If
End If
Else
Alert("La Cuenta no pudo ser eliminada", TipoMensaje.MsgError)
' ObjConta.RollBack()
End If
ObjConta.Dispose()
ObjConta2.Dispose()
End Sub
'Protected Sub BtnCambiaAgrupadorSAT_Click(sender As Object, e As EventArgs)
' CargaAgrupadorSAT()
'End Sub
End Class

View File

@@ -0,0 +1,323 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="MovimientosconProveedores.aspx.vb" Inherits="MovimientosconProveedores" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.table-VH {
padding-top: 58px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Label runat="server" ID="LbTitulo" Text="Anexo del Catálogo"></asp:Label>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-ad-excel"></i> Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle magindate">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" CssClass="btn btn-default" OnClick="BtnConsultar_Click" />
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a><%--class="expand"--%>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption ">
<%--<div class="row">--%>
<ul class="list-inline text-size-12">
<li>F. I.</li>
<li style="margin-right: 30px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 93px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaDel" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10" Height="24px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioDel" class="btn default " Text="<i class='fa fa-calendar'></i>" Height="24px" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaDel" runat="server" TargetControlID="TxtFechaDel" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioDel" runat="server" TargetControlID="TxtFechaDel" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</li>
<li>F. F. </li>
<li style="margin-right: 30px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 94px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAl" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10" Height="24px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioAl" class="btn default " Text="<i class='fa fa-calendar'></i>" Height="24px" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaAl" runat="server" TargetControlID="TxtFechaAl" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioAl" runat="server" TargetControlID="TxtFechaAl" PopupButtonID="ImgCalendarioAl" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</li>
<li>Tipo de Cuentas:
</li>
<li>
<asp:DropDownList CssClass="form-control input-sm" Width="150px" ID="DdlTipoCuentas" ClientIDMode="Static" runat="server" DataTextField="Nombre" DataValueField="CveCuenta" TabIndex="4" onchange="Enable();">
</asp:DropDownList>
</li>
<li>Cuenta:
</li>
<li>
<asp:HiddenField ID="HdnCveCuenta" runat="server" ClientIDMode="Static" />
<asp:TextBox ID="TxtCuenta" runat="server" Width="150px" ClientIDMode="Static" Enabled="false" TabIndex="5" CssClass="form-control input-sm"></asp:TextBox>
</li>
<li>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-7">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</li>
<li runat="server" id="tdTipoReporte" visible="true">Tipo:
</li>
<%--</label>--%>
<%--<div class="col-md-9">--%>
<li runat="server" id="tdTipoReporte2" visible="true">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm" runat="server" Width="150px">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementario" Value="3"></asp:ListItem>
<asp:ListItem Text="Complementario" Value="2"></asp:ListItem>
</asp:DropDownList>
</li>
<%--</div>--%>
<%--</div>--%>
<%--</div>--%>
<%--</div>--%>
</ul>
</div>
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<%--style="display:none;"--%>
<%--<div class="row">--%>
<ul class="list-inline text-size-12">
<li>
<%--<div class="" style="line-height:1;">--%>
<%--<label class="col-md-1 text-right text-size-12">--%>
Cuentas:
<%--</label>--%>
<%--</div>--%>
</li>
<li>
<%--<div class="col-md-2" style="width: 250px;">--%>
<asp:DropDownList CssClass="form-control input-sm" ID="DdlCuenta" runat="server" DataTextField="Cuenta" DataValueField="CveCuenta" TabIndex="4">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Con movimientos" Value="1"></asp:ListItem>
<asp:ListItem Text="Saldo actual no igual a cero" Value="2"></asp:ListItem>
<asp:ListItem Text="Con movimientos y saldo no igual a cero" Value="3"></asp:ListItem>
<asp:ListItem Text="Con movimientos o saldo no igual a cero" Value="4"></asp:ListItem>
</asp:DropDownList>
<%--</div>--%>
</li>
<%--<label class="col-md-1">Cuenta:</label>
<div class="col-md-2" style="width: 140px;">
<asp:HiddenField ID="HdnCveCuenta2" runat="server" ClientIDMode="Static" />
<asp:TextBox ID="TxtCuenta2" runat="server" ClientIDMode="Static" Enabled="false" TabIndex="5" CssClass="form-control input-sm"></asp:TextBox>
</div>--%>
</ul>
<%--</div>--%>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" CssClass="ScrollAD table table-smallpadding Widthall" data-heighterror="375" data-freezecols="0" data-freezerows="-1"
ShowHeader="True" ShowHeaderWhenEmpty="true" AllowPaging="False" ShowFooter="False" EmptyDataText="No se encontraron cuentas con los parametros establecidos." AutoGenerateColumns="False" OnRowDataBound="GvIngresos_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Cuenta" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbCodigoSAT" runat="server" Text='<%# Eval("CodigoSAT")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="180" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbNombreSAT" runat="server" Text='<%# Eval("NombreSAT")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="320" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbCodigo" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="320" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="320" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Saldos Iniciales">
<HeaderTemplate>
<table width="100%">
<tr>
<td colspan="2">Saldos Iniciales</td>
</tr>
<tr>
<td>Deudor</td>
<td>Acreedor</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LbSaldoInicial" runat="server" Text='<%# Eval("SaldoInicial", "{0:N2}")%>'></asp:Label>
<asp:Label ID="LbSaldoInicial2" runat="server" Width="30px" Visible="false"></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Cargos">
<ItemTemplate>
<asp:Label ID="LbCargos" runat="server" Text='<%# Eval("Cargos", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Abonos">
<ItemTemplate>
<asp:Label ID="LbAbonos" runat="server" Text='<%# Eval("Abonos", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Saldos Actuales">
<HeaderTemplate>
<table width="100%">
<tr>
<td colspan="2">Saldos Actuales</td>
</tr>
<tr>
<td>Deudor</td>
<td>Acreedor</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HLSaldoActual" runat="server" Text='<%# Eval("SaldoActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<asp:Label ID="LbSaldoActual" runat="server" Width="30px" Visible="false"></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<HeaderStyle Font-Bold="true" HorizontalAlign="Center" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function pageLoad(sender, args) {
$(function () {
//Genero las cuentas en el arreglo
var ArrCuentas = [<%= WSCuentas()%>];
$("#TxtCuenta").autocomplete({
minLength: 0,
source: ArrCuentas,
focus: function (event, ui) {
$("#TxtCuenta").val(ui.item.label);
$("#HdnCveCuenta").val(ui.item.value);
return false;
},
select: function (event, ui) {
$("#TxtCuenta").val(ui.item.label);
$("#HdnCveCuenta").val(ui.item.value);
//$("#project-description").html(ui.item.desc);
//$("#project-icon").attr("src", "images/" + ui.item.icon);
return false;
}
})
//.autocomplete("instance")._renderItem = function (ul, item) {
// return $("<li>")
// .append("<a>" + item.label + "</a>")
// .appendTo(ul);
//};
});
// Al presionar cualquier tecla en cualquier campo de texto, ejectuamos la siguiente funcion
$('input[type=text]').on('keydown', function (e) {
// Si la tecla ENTER es presionada...
if (e.keyCode === 13) {
var currentTabIndex = $(this).attr('tabindex'); // Obtenemos el número del tabindex del campo actual
var nextTabIndex = parseInt(currentTabIndex) + 1; // Le sumamos 1
var nextField = $('[tabindex=' + nextTabIndex + ']'); // Obtenemos (si existe) el siguiente elemento que usando nextTabIndex
if (nextField.length > 0) { // Si se encontró un elemento:
nextField.focus(); // Hacerle focus / seleccionarlo
nextField.select();
e.preventDefault(); // Ignorar el funcionamiento predeterminado (enviar el formulario)
}
}
});
// Al presionar cualquier tecla en cualquier campo de texto, ejectuamos la siguiente funcion
$('select').on('keydown', function (e) {
// Si la tecla ENTER es presionada...
if (e.keyCode === 13) {
var currentTabIndex = $(this).attr('tabindex'); // Obtenemos el número del tabindex del campo actual
var nextTabIndex = parseInt(currentTabIndex) + 1; // Le sumamos 1
var nextField = $('[tabindex=' + nextTabIndex + ']'); // Obtenemos (si existe) el siguiente elemento que usando nextTabIndex
if (nextField.length > 0) { // Si se encontró un elemento:
nextField.focus(); // Hacerle focus / seleccionarlo
nextField.select();
e.preventDefault(); // Ignorar el funcionamiento predeterminado (enviar el formulario)
}
}
});
}
function Enable() {
var Producto = $get("DdlTipoCuentas").value;
if (Producto == "-2") {
document.getElementById("TxtCuenta").disabled = false;
//document.getElementById("TxtCuenta").focus();
//alert(Producto);
}
else {
document.getElementById("TxtCuenta").value = " ";
document.getElementById("TxtCuenta").disabled = true;
}
}
function Scroll() {
var Tam = TamañoVentana();
var Alto = Tam.height - 360;
if (Alto < 100) {
Alto = 100;
}
$('#<%=GvDatos.ClientID%>').ADScroll({
height: Alto
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,298 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class MovimientosconProveedores
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 = DateSerial(Year(Now), Month(Now), 1)
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
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
FechaInicio = DateSerial(Year(FechaFin), Month(FechaFin), 1)
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("Codigo").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', '_PASIVO', '_CAPITAL', '_CUADRE', '_ESTADISTICAS', '_ORDEN', '_RACREEDOR', '_RDEUDOR', '_UTILIDAD')")
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.SelectedIndex = 0
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.GetAnexoCatalogo(IdCuenta, FechaInicio, FechaFin, DdlCuenta.SelectedValue.ToEntero, CveSubProyecto, UsuarioActual.CveEmpresa, TipoReporte, 1) 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, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
' 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")
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("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
params.Add(New ReportParameter("pFechaFin", FechaFin.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 TxtCuenta.Text.Trim = "" 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, HdnCveCuenta.Value.ToEntero, DdlTipoCuentas.SelectedValue.ToEntero)
CargaDatos()
End If
RegistraScript("Enable();")
End Sub
End Class

View File

@@ -0,0 +1,76 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAlmacenConta.aspx.vb" Inherits="Contabilidad2_RepAlmacenConta" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Reporte Almacen Contable
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption">
<div class="row">
<div class="col-md-1 truncate" style="text-align: right!important">Fecha Inicio:</div>
<div class="col-md-2 ">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
<asp:TextBox Style="width: 80px !important;" ID="TxtFechaI" runat="server" CssClass="form-control" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
<div class="col-md-1 truncate" style="text-align: right!important">Fecha Fin:</div>
<div class="col-md-2 ">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
<asp:TextBox Style="width: 80px !important;" ID="TxtFechaF" runat="server" CssClass="form-control" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVAlmacen" runat="server" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Almacen" DataField="Almacen" />
<asp:BoundField HeaderText="Saldo Inicial" ItemStyle-HorizontalAlign="Right" DataField="SaldoInicial" DataFormatString="{0:N2}"/>
<asp:BoundField HeaderText="Cargos" ItemStyle-HorizontalAlign="Right" DataField="Cargos" DataFormatString="{0:N2}"/>
<asp:BoundField HeaderText="Abonos" ItemStyle-HorizontalAlign="Right" DataField="Abonos" DataFormatString="{0:N2}"/>
<asp:BoundField HeaderText="Saldo Final" ItemStyle-HorizontalAlign="Right" DataField="SaldoFinal" DataFormatString="{0:N2}"/>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,34 @@
Imports Extensiones
Partial Class Contabilidad2_RepAlmacenConta
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
End If
End Sub
Private Sub CargaDatos()
Dim objInv As New ClsContabilidad
Dim FechaI, FechaF As Date
FechaI = If(IsDate(TxtFechaI.Text.Trim()), TxtFechaI.Text.Trim().ToDate, MinFecha)
FechaF = If(IsDate(TxtFechaF.Text.Trim()), TxtFechaF.Text.Trim().ToDate, MaxFecha)
If objInv.GetAlmacenContable(FechaI, FechaF, UsuarioActual.CveEmpresa) Then
GVAlmacen.DataSource = objInv.DtResultados
End If
objInv.Dispose()
GVAlmacen.DataBind()
End Sub
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
UpDatos.Update()
End Sub
End Class

View File

@@ -0,0 +1,302 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogo.aspx.vb" Inherits="AC2_RepAnexoCatalogo" EnableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.table-VH {
padding-top: 58px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Label runat="server" ID="LbTitulo" Text="Anexo del Catálogo"></asp:Label>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkImprimir" runat="server"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle magindate">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" CssClass="btn btn-default" OnClick="BtnConsultar_Click" />
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a><%--class="expand"--%>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption ">
<%--<div class="row">--%>
<ul class="list-inline text-size-12">
<li>F. I.</li>
<li style="margin-right: 30px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaDel" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10" Height="24px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioDel" class="btn default " Text="<i class='fa fa-calendar'></i>" Height="24px" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaDel" runat="server" TargetControlID="TxtFechaDel" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioDel" runat="server" TargetControlID="TxtFechaDel" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</li>
<li>F. F. </li>
<li style="margin-right: 30px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAl" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10" Height="24px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioAl" class="btn default " Text="<i class='fa fa-calendar'></i>" Height="24px" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaAl" runat="server" TargetControlID="TxtFechaAl" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioAl" runat="server" TargetControlID="TxtFechaAl" PopupButtonID="ImgCalendarioAl" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</li>
<li>Cuentas:
</li>
<li>
<asp:DropDownList ID="DdlCuentas" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="CveCuenta" CssClass="form-control input-sm select2me" Enabled="true" Width="350px">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<ul class="list-inline text-size-12">
<li>
Tipo Movto:
</li>
<li>
<asp:DropDownList CssClass="form-control input-sm" ID="DdlCuenta" runat="server" DataTextField="Cuenta" DataValueField="CveCuenta" TabIndex="4">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Con movimientos" Value="1"></asp:ListItem>
<asp:ListItem Text="Saldo actual no igual a cero" Value="2"></asp:ListItem>
<asp:ListItem Text="Con movimientos y saldo no igual a cero" Value="3"></asp:ListItem>
<asp:ListItem Text="Con movimientos o saldo no igual a cero" Value="4"></asp:ListItem>
</asp:DropDownList>
</li>
<li>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2">
<asp:DropDownList ID="DdlSubproyecto" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</li>
<li runat="server" id="tdTipoReporte" visible="true">Tipo:
</li>
<li runat="server" id="tdTipoReporte2" visible="true">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm" runat="server" Width="150px">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementario" Value="3"></asp:ListItem>
<asp:ListItem Text="Complementario" Value="2"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Tipo de Cuentas:
</li>
<li>
<asp:DropDownList Visible="false" CssClass="form-control input-sm" Width="150px" ID="DdlTipoCuentas" ClientIDMode="Static" runat="server" DataTextField="Nombre" DataValueField="CveCuenta" TabIndex="4" AutoPostBack="true">
</asp:DropDownList>
</li>
</ul>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" CssClass="ScrollAD table table-smallpadding Widthall" data-heighterror="375" data-freezecols="0" data-freezerows="-1"
ShowHeader="True" ShowHeaderWhenEmpty="true" AllowPaging="False" ShowFooter="False" EmptyDataText="No se encontraron cuentas con los parametros establecidos." AutoGenerateColumns="False" OnRowDataBound="GvIngresos_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Cuenta" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbCodigo" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="180" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="320" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Saldos Iniciales">
<HeaderTemplate>
<table width="100%">
<tr>
<td colspan="2">Saldos Iniciales</td>
</tr>
<tr>
<td>Deudor</td>
<td>Acreedor</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LbSaldoInicial" runat="server" Text='<%# Eval("SaldoInicial", "{0:N2}")%>'></asp:Label>
<asp:Label ID="LbSaldoInicial2" runat="server" Width="30px" Visible="false"></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Cargos">
<ItemTemplate>
<asp:Label ID="LbCargos" runat="server" Text='<%# Eval("Cargos", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Abonos">
<ItemTemplate>
<asp:Label ID="LbAbonos" runat="server" Text='<%# Eval("Abonos", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Saldos Actuales">
<HeaderTemplate>
<table width="100%">
<tr>
<td colspan="2">Saldos Actuales</td>
</tr>
<tr>
<td>Deudor</td>
<td>Acreedor</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HLSaldoActual" runat="server" Text='<%# Eval("SaldoActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbSaldoActual" runat="server" Text='<%# Eval("SaldoActual", "{0:N2}")%>'></asp:Label>--%>
<asp:Label ID="LbSaldoActual" runat="server" Width="30px" Visible="false"></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<HeaderStyle Font-Bold="true" HorizontalAlign="Center" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
<%-- function pageLoad(sender, args) {
$(function () {
//Genero las cuentas en el arreglo
var ArrCuentas = [<%= WSCuentas()%>];
$("#TxtCuenta").autocomplete({
minLength: 0,
source: ArrCuentas,
focus: function (event, ui) {
$("#TxtCuenta").val(ui.item.label);
$("#HdnCveCuenta").val(ui.item.value);
return false;
},
select: function (event, ui) {
$("#TxtCuenta").val(ui.item.label);
$("#HdnCveCuenta").val(ui.item.value);
//$("#project-description").html(ui.item.desc);
//$("#project-icon").attr("src", "images/" + ui.item.icon);
return false;
}
})
//.autocomplete("instance")._renderItem = function (ul, item) {
// return $("<li>")
// .append("<a>" + item.label + "</a>")
// .appendTo(ul);
//};
});
// Al presionar cualquier tecla en cualquier campo de texto, ejectuamos la siguiente funcion
$('input[type=text]').on('keydown', function (e) {
// Si la tecla ENTER es presionada...
if (e.keyCode === 13) {
var currentTabIndex = $(this).attr('tabindex'); // Obtenemos el número del tabindex del campo actual
var nextTabIndex = parseInt(currentTabIndex) + 1; // Le sumamos 1
var nextField = $('[tabindex=' + nextTabIndex + ']'); // Obtenemos (si existe) el siguiente elemento que usando nextTabIndex
if (nextField.length > 0) { // Si se encontró un elemento:
nextField.focus(); // Hacerle focus / seleccionarlo
nextField.select();
e.preventDefault(); // Ignorar el funcionamiento predeterminado (enviar el formulario)
}
}
});
// Al presionar cualquier tecla en cualquier campo de texto, ejectuamos la siguiente funcion
$('select').on('keydown', function (e) {
// Si la tecla ENTER es presionada...
if (e.keyCode === 13) {
var currentTabIndex = $(this).attr('tabindex'); // Obtenemos el número del tabindex del campo actual
var nextTabIndex = parseInt(currentTabIndex) + 1; // Le sumamos 1
var nextField = $('[tabindex=' + nextTabIndex + ']'); // Obtenemos (si existe) el siguiente elemento que usando nextTabIndex
if (nextField.length > 0) { // Si se encontró un elemento:
nextField.focus(); // Hacerle focus / seleccionarlo
nextField.select();
e.preventDefault(); // Ignorar el funcionamiento predeterminado (enviar el formulario)
}
}
});
}--%>
function Enable() {
var Producto = $get("DdlTipoCuentas").value;
if (Producto == "-2") {
//document.getElementById("TxtCuenta").disabled = false;
document.getElementById("C_DdlCuentas").disabled = false;
//document.getElementById("TxtCuenta").focus();
//alert(Producto);
}
else {
//document.getElementById("TxtCuenta").value = " ";
//document.getElementById("TxtCuenta").disabled = true;
$get("C_DdlCuentas").value = "-1";
document.getElementById("C_DdlCuentas").disabled = true;
}
}
function Scroll() {
var Tam = TamañoVentana();
var Alto = Tam.height - 360;
if (Alto < 100) {
Alto = 100;
}
$('#<%=GvDatos.ClientID%>').ADScroll({
height: Alto
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,327 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class AC2_RepAnexoCatalogo
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.GetAnexoCatalogo(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, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
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")))
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

View File

@@ -0,0 +1,208 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoAnual.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoAnual" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Anexo del Catálogo - Anual
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpFiltros">
<ContentTemplate>
<asp:Panel runat="server" DefaultButton="BtnCargaAsignados">
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle magindate">
<div class="tools">
<asp:Button ID="BtnCargaAsignados" runat="server" Text="Consultar" class="btn btn-default" />
</div>
<div class="titlefiltros caption ">
<ul class="list-inline" style="font-size: 12px;">
<li>Ejercicio:
<asp:DropDownList ID="DdlEjercicio" runat="server" DataTextField="Ejercicio" DataValueField="Ejercicio" CssClass="form-control input-sm select2me" Style="width: 250px !important;" ValidationGroup="GrpCargaAsignados"></asp:DropDownList>
</li>
<li>SubProyecto:
<asp:DropDownList ID="DdlSubProyecto" Width="230px" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me"></asp:DropDownList>
</li>
<li>Divisor:
<asp:DropDownList ID="DdlDivisor" Width="100px" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Text="Unidad" Value="1"></asp:ListItem>
<asp:ListItem Text="Miles" Value="1000" Selected="True"></asp:ListItem>
<asp:ListItem Text="Millones" Value="1000000"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpAnual" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvAnual" runat="server" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron datos" GridLines="none" CssClass="table table-hover">
<Columns>
<asp:BoundField HeaderText="Nombre" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
function LimpiaCeros(Divisor) {
$('.ceros').each(function (i, obj) {
debugger;
if ($(this).html() == '0.00' || $(this).html() == '0.00%') {
$(this).html('-');
}
if (!($(this).html() == '-' || $(this).html() == '' || ~$(this).html().indexOf("%"))) {
if (Divisor > 1) {
$(this).attr('data-toggle', 'tooltip');
$(this).attr('data-container', 'body');
$(this).attr('title', $(this).html());
}
$(this).html(FormatoNumeroIPP(ToDouble($(this).html()) / Divisor, ((Divisor == 1) ? 2 : 0)));
}
if (ToDouble($(this).html()) < 0) {
$(this).css("color", "red");
}
});
}
function FormatoNumeroIPP(Importe, Decimales) {
debugger;
if (typeof Decimales === 'undefined') { Decimales = 2; }
if (isNaN(parseInt(Importe))) return "NaN";
var tmpNum = Importe;
tmpNum = tmpNum.toFixed(Decimales).replace(/./g, function (c, i, a) {
return i && c !== "." && !((a.length - i) % 3) ? ',' + c : c;
});
return tmpNum;
}
function pageLoad(sender, e) {
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,146 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Contabilidad2_RepAnexoCatalogoAnual
Inherits ClsPaginas
#Region " PROPIEDADES "
Public Property CveCuenta As Integer
Get
Return ViewState("CveCuenta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveCuenta") = value
End Set
End Property
Public Property EsVertical As Integer
Get
Return ViewState("EsVertical").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("EsVertical") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim EjercicioParametro, SubProyectoParametro, DivisorParametro As Integer
CveCuenta = IfNull(Request("C"), "-1").ToString.ToEntero
EjercicioParametro = IfNull(Request("E"), "-1").ToString.ToEntero
SubProyectoParametro = IfNull(Request("S"), "-1").ToString.ToEntero
DivisorParametro = IfNull(Request("D"), "-1").ToString.ToEntero
EsVertical = IfNull(Request("V"), "-1").ToString.ToEntero
InicializaValores()
DdlEjercicio.SelectedValueExist(EjercicioParametro.ToString)
DdlSubProyecto.SelectedValueExist(SubProyectoParametro.ToString)
DdlDivisor.SelectedValueExist(DivisorParametro.ToString)
CargaDatos()
End If
End Sub
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
CargaCombos()
End Sub
Private Sub CargaCombos()
Dim Conta As New ClsContabilidad
If Conta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = Conta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
Conta.Dispose()
DdlEjercicio.DataBind()
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyecto.SelectedValue = "-1"
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnCargaAsignados_Click(sender As Object, e As EventArgs) Handles BtnCargaAsignados.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim Conta As New ClsContabilidad
If Conta.GetAnexoCatalogoAnual(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0)
GvAnual.DataSource = Conta.DSResultados.Tables(1)
Dim Index = 1
For Index = 1 To GvAnual.Columns.Count - 1
GvAnual.Columns(Index).Visible = False
Next Index
Index = 1
For Each Dr As DataRow In DtHeaders.Rows
GvAnual.Columns(Index).Visible = True
CType(GvAnual.Columns(Index), BoundField).DataField = $"Ejercicio{Dr("Ejercicio").ToString}"
GvAnual.Columns(Index).HeaderText = Dr("Ejercicio").ToString
If Not DdlEjercicio.SelectedValue = Dr("Ejercicio").ToString Then
If EsVertical <> 1 Then
GvAnual.Columns(Index + 1).Visible = True
CType(GvAnual.Columns(Index + 1), BoundField).DataField = $"Ejercicio{Dr("Ejercicio").ToString}VariacionImporte"
GvAnual.Columns(Index + 1).HeaderText = "$"
End If
GvAnual.Columns(Index + 2).Visible = True
CType(GvAnual.Columns(Index + 2), BoundField).DataField = $"Ejercicio{Dr("Ejercicio").ToString}{If(EsVertical = 1, "", "Variacion")}Porcentaje"
GvAnual.Columns(Index + 2).HeaderText = "%"
End If
Index += 3
Next
GvAnual.DataBind()
UpAnual.Update()
Else
GvAnual.DataSource = Nothing
End If
GvAnual.DataBind()
UpAnual.Update()
RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
Conta.Dispose()
End Sub
#End Region
#Region " GV ROW DATABOUND "
Protected Sub GvAnual_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvAnual.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Style.Add("font-weight", "bold")
End If
e.Row.Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
End If
End Sub
#End Region
End Class

View File

@@ -0,0 +1,248 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoCC.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoCC" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Anexo de Catálogo - Centro Costo
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpFiltros">
<ContentTemplate>
<asp:Panel runat="server" DefaultButton="BtnCargaAsignados">
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle magindate">
<div class="tools">
<asp:Button ID="BtnCargaAsignados" runat="server" Text="Consultar" class="btn btn-default" />
</div>
<div class="titlefiltros caption ">
<ul class="list-inline" style="font-size: 12px;">
<li>Ejercicio:
<asp:DropDownList ID="DdlEjercicio" runat="server" DataTextField="Ejercicio" DataValueField="Ejercicio" CssClass="form-control input-sm select2me" Style="width: 250px !important;" ValidationGroup="GrpCargaAsignados"></asp:DropDownList>
</li>
<li>SubProyecto:
<asp:DropDownList ID="DdlSubProyecto" Width="230px" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me"></asp:DropDownList>
</li>
<li>Divisor:
<asp:DropDownList ID="DdlDivisor" Width="100px" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Text="Unidad" Value="1"></asp:ListItem>
<asp:ListItem Text="Miles" Value="1000" Selected="True"></asp:ListItem>
<asp:ListItem Text="Millones" Value="1000000"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpCC" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvCC" runat="server" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron datos" GridLines="none" CssClass="table table-hover">
<Columns>
<asp:BoundField HeaderText="Nombre" DataField="Nombre" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="500px" />
<asp:BoundField DataFormatString="{0:N2}" DataField="SubProyectoGeneral" HeaderText="Total" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" DataField="SubProyectoNA" HeaderText="Sin SubProyecto" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" DataField="SubProyectoNAPorcentaje" HeaderText="%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
function LimpiaCeros(Divisor) {
$('.ceros').each(function (i, obj) {
debugger;
if ($(this).html() == '0.00' || $(this).html() == '0.00%') {
$(this).html('-');
}
if (!($(this).html() == '-' || $(this).html() == '' || ~$(this).html().indexOf("%"))) {
if (Divisor > 1) {
$(this).attr('data-toggle', 'tooltip');
$(this).attr('data-container', 'body');
$(this).attr('title', $(this).html());
}
$(this).html(FormatoNumeroIPP(ToDouble($(this).html()) / Divisor, ((Divisor == 1) ? 2 : 0)));
}
if (ToDouble($(this).html()) < 0) {
$(this).css("color", "red");
}
});
}
function FormatoNumeroIPP(Importe, Decimales) {
debugger;
if (typeof Decimales === 'undefined') { Decimales = 2; }
if (isNaN(parseInt(Importe))) return "NaN";
var tmpNum = Importe;
tmpNum = tmpNum.toFixed(Decimales).replace(/./g, function (c, i, a) {
return i && c !== "." && !((a.length - i) % 3) ? ',' + c : c;
});
return tmpNum;
}
function pageLoad(sender, e) {
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,127 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Contabilidad2_RepAnexoCatalogoCC
Inherits ClsPaginas
#Region " PROPIEDADES "
Public Property CveCuenta As Integer
Get
Return ViewState("CveCuenta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveCuenta") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim EjercicioParametro, SubProyectoParametro, DivisorParametro As Integer
CveCuenta = IfNull(Request("C"), "-1").ToString.ToEntero
EjercicioParametro = IfNull(Request("E"), "-1").ToString.ToEntero
SubProyectoParametro = IfNull(Request("S"), "-1").ToString.ToEntero
DivisorParametro = IfNull(Request("D"), "-1").ToString.ToEntero
InicializaValores()
DdlEjercicio.SelectedValueExist(EjercicioParametro.ToString)
DdlSubProyecto.SelectedValueExist(SubProyectoParametro.ToString)
DdlDivisor.SelectedValueExist(DivisorParametro.ToString)
CargaDatos()
End If
End Sub
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
CargaCombos()
End Sub
Private Sub CargaCombos()
Dim Conta As New ClsContabilidad
If Conta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = Conta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
Conta.Dispose()
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValueExist(Now.Year.ToString)
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyecto.SelectedValue = "-1"
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnCargaAsignados_Click(sender As Object, e As EventArgs) Handles BtnCargaAsignados.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim Conta As New ClsContabilidad
If Conta.GetAnexoCatalagoCC(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubproyecto.selectedvalue.toentero, UsuarioActual.CveEmpresa) Then
Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0)
GvCC.DataSource = Conta.DSResultados.Tables(1)
Dim Index = 4
For Index = 4 To GvCC.Columns.Count - 1
GvCC.Columns(Index).Visible = False
Next Index
Index = 4
For Each Dr As DataRow In DtHeaders.Rows
GvCC.Columns(Index).Visible = True
CType(GvCC.Columns(Index), BoundField).DataField = $"SubProyecto{Dr("SubProyecto").ToString}"
GvCC.Columns(Index).HeaderText = Dr("SubProyecto").ToString
GvCC.Columns(Index + 1).Visible = True
CType(GvCC.Columns(Index + 1), BoundField).DataField = $"SubProyecto{Dr("SubProyecto").ToString}Porcentaje"
GvCC.Columns(Index + 1).HeaderText = "%"
Index += 2
Next
GvCC.DataBind()
UpCC.Update()
Else
GvCC.DataSource = Nothing
End If
RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
Conta.Dispose()
End Sub
#End Region
#Region " GV ROW DATABOUND "
Protected Sub GvCC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Style.Add("font-weight", "bold")
End If
e.Row.Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
End If
End Sub
#End Region
End Class

View File

@@ -0,0 +1,148 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoMensual.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoMensual" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Anexo del Catálogo - Mensual
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpFiltros">
<ContentTemplate>
<asp:Panel runat="server" DefaultButton="BtnCargaAsignados">
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle magindate">
<div class="tools">
<asp:Button ID="BtnCargaAsignados" runat="server" Text="Consultar" class="btn btn-default" />
</div>
<div class="titlefiltros caption ">
<ul class="list-inline" style="font-size: 12px;">
<li>Ejercicio:
<asp:DropDownList ID="DdlEjercicio" runat="server" DataTextField="Ejercicio" DataValueField="Ejercicio" CssClass="form-control input-sm select2me" Style="width: 250px !important;" ValidationGroup="GrpCargaAsignados"></asp:DropDownList>
</li>
<li>SubProyecto:
<asp:DropDownList ID="DdlSubProyecto" Width="230px" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me"></asp:DropDownList>
</li>
<li>Divisor:
<asp:DropDownList ID="DdlDivisor" Width="100px" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Text="Unidad" Value="1"></asp:ListItem>
<asp:ListItem Text="Miles" Value="1000" Selected="True"></asp:ListItem>
<asp:ListItem Text="Millones" Value="1000000"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpMensual" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvMensual2" runat="server" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron datos" GridLines="none" CssClass="table table-hover">
<Columns>
<asp:BoundField HeaderText="Nombre" DataField="Nombre" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="500px" ControlStyle-Width="500px" />
<asp:BoundField HeaderText="Enero" DataField="Enero" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="Febrero" DataField="Febrero" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="$" DataField="VariacionFebreroImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField HeaderText="%" DataField="VariacionFebreroPorcentaje" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Marzo" DataField="Marzo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="$" DataField="VariacionMarzoImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField HeaderText="%" DataField="VariacionMarzoPorcentaje" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Abril" DataField="Abril" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="$" DataField="VariacionAbrilImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField HeaderText="%" DataField="VariacionAbrilPorcentaje" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Mayo" DataField="Mayo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="$" DataField="VariacionMayoImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField HeaderText="%" DataField="VariacionMayoPorcentaje" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Junio" DataField="Junio" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="$" DataField="VariacionJunioImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField HeaderText="%" DataField="VariacionJunioPorcentaje" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Julio" DataField="Julio" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="$" DataField="VariacionJulioImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField HeaderText="%" DataField="VariacionJulioPorcentaje" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Agosto" DataField="Agosto" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="$" DataField="VariacionAgostoImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField HeaderText="%" DataField="VariacionAgostoPorcentaje" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Septiembre" DataField="Septiembre" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="$" DataField="VariacionSeptiembreImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField HeaderText="%" DataField="VariacionSeptiembrePorcentaje" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Octubre" DataField="Octubre" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="$" DataField="VariacionOctubreImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField HeaderText="%" DataField="VariacionOctubrePorcentaje" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Noviembre" DataField="Noviembre" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="$" DataField="VariacionNoviembreImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField HeaderText="%" DataField="VariacionNoviembrePorcentaje" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Diciembre" DataField="Diciembre" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="$" DataField="VariacionDiciembreImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="75px" />
<asp:BoundField HeaderText="%" DataField="VariacionDiciembrePorcentaje" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
function LimpiaCeros(Divisor) {
$('.ceros').each(function (i, obj) {
debugger;
if ($(this).html() == '0.00' || $(this).html() == '0.00%') {
$(this).html('-');
}
if (!($(this).html() == '-' || $(this).html() == '' || ~$(this).html().indexOf("%"))) {
if (Divisor > 1) {
$(this).attr('data-toggle', 'tooltip');
$(this).attr('data-container', 'body');
$(this).attr('title', $(this).html());
}
$(this).html(FormatoNumeroIPP(ToDouble($(this).html()) / Divisor, ((Divisor == 1) ? 2 : 0)));
}
if (ToDouble($(this).html()) < 0) {
$(this).css("color", "red");
}
});
}
function FormatoNumeroIPP(Importe, Decimales) {
debugger;
if (typeof Decimales === 'undefined') { Decimales = 2; }
if (isNaN(parseInt(Importe))) return "NaN";
var tmpNum = Importe;
tmpNum = tmpNum.toFixed(Decimales).replace(/./g, function (c, i, a) {
return i && c !== "." && !((a.length - i) % 3) ? ',' + c : c;
});
return tmpNum;
}
function pageLoad(sender, e) {
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,106 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Contabilidad2_RepAnexoCatalogoMensual
Inherits ClsPaginas
#Region " PROPIEDADES "
Public Property CveCuenta As Integer
Get
Return ViewState("CveCuenta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveCuenta") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim EjercicioParametro, SubProyectoParametro, DivisorParametro As Integer
CveCuenta = IfNull(Request("C"), "-1").ToString.ToEntero
EjercicioParametro = IfNull(Request("E"), "-1").ToString.ToEntero
SubProyectoParametro = IfNull(Request("S"), "-1").ToString.ToEntero
DivisorParametro = IfNull(Request("D"), "-1").ToString.ToEntero
InicializaValores()
DdlEjercicio.SelectedValueExist(EjercicioParametro.ToString)
DdlSubProyecto.SelectedValueExist(SubProyectoParametro.ToString)
DdlDivisor.SelectedValueExist(DivisorParametro.ToString)
CargaDatos()
End If
End Sub
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
CargaCombos()
End Sub
Private Sub CargaCombos()
Dim Conta As New ClsContabilidad
If Conta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = Conta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
Conta.Dispose()
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValueExist(Now.Year.ToString)
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyecto.SelectedValue = "-1"
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnCargaAsignados_Click(sender As Object, e As EventArgs) Handles BtnCargaAsignados.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim Conta As New ClsContabilidad
If Conta.GetAnexoCatalogoMensual(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvMensual2.DataSource = Conta.DtResultados
Else
GvMensual2.DataSource = Nothing
End If
GvMensual2.DataBind()
UpMensual.Update()
RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
Conta.Dispose()
End Sub
#End Region
#Region " GV ROW DATABOUND "
Protected Sub GvMensual1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMensual2.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Style.Add("font-weight", "bold")
End If
e.Row.Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
End If
End Sub
#End Region
End Class

View File

@@ -0,0 +1,323 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoSAT.aspx.vb" Inherits="FinanzasSAT_RepAnexoCatalogo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.table-VH {
padding-top: 58px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Label runat="server" ID="LbTitulo" Text="Anexo del Catálogo"></asp:Label>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-ad-excel"></i> Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle magindate">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" CssClass="btn btn-default" OnClick="BtnConsultar_Click" />
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a><%--class="expand"--%>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption ">
<%--<div class="row">--%>
<ul class="list-inline text-size-12">
<li>F. I.</li>
<li style="margin-right: 30px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 93px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaDel" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10" Height="24px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioDel" class="btn default " Text="<i class='fa fa-calendar'></i>" Height="24px" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaDel" runat="server" TargetControlID="TxtFechaDel" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioDel" runat="server" TargetControlID="TxtFechaDel" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</li>
<li>F. F. </li>
<li style="margin-right: 30px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 94px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAl" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10" Height="24px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioAl" class="btn default " Text="<i class='fa fa-calendar'></i>" Height="24px" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaAl" runat="server" TargetControlID="TxtFechaAl" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioAl" runat="server" TargetControlID="TxtFechaAl" PopupButtonID="ImgCalendarioAl" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</li>
<li>Tipo de Cuentas:
</li>
<li>
<asp:DropDownList CssClass="form-control input-sm" Width="150px" ID="DdlTipoCuentas" ClientIDMode="Static" runat="server" DataTextField="Nombre" DataValueField="CveCuenta" TabIndex="4" onchange="Enable();">
</asp:DropDownList>
</li>
<li>Cuenta:
</li>
<li>
<asp:HiddenField ID="HdnCveCuenta" runat="server" ClientIDMode="Static" />
<asp:TextBox ID="TxtCuenta" runat="server" Width="150px" ClientIDMode="Static" Enabled="false" TabIndex="5" CssClass="form-control input-sm"></asp:TextBox>
</li>
<li>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-7">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</li>
<li runat="server" id="tdTipoReporte" visible="true">Tipo:
</li>
<%--</label>--%>
<%--<div class="col-md-9">--%>
<li runat="server" id="tdTipoReporte2" visible="true">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm" runat="server" Width="150px">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementario" Value="3"></asp:ListItem>
<asp:ListItem Text="Complementario" Value="2"></asp:ListItem>
</asp:DropDownList>
</li>
<%--</div>--%>
<%--</div>--%>
<%--</div>--%>
<%--</div>--%>
</ul>
</div>
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<%--style="display:none;"--%>
<%--<div class="row">--%>
<ul class="list-inline text-size-12">
<li>
<%--<div class="" style="line-height:1;">--%>
<%--<label class="col-md-1 text-right text-size-12">--%>
Cuentas:
<%--</label>--%>
<%--</div>--%>
</li>
<li>
<%--<div class="col-md-2" style="width: 250px;">--%>
<asp:DropDownList CssClass="form-control input-sm" ID="DdlCuenta" runat="server" DataTextField="Cuenta" DataValueField="CveCuenta" TabIndex="4">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Con movimientos" Value="1"></asp:ListItem>
<asp:ListItem Text="Saldo actual no igual a cero" Value="2"></asp:ListItem>
<asp:ListItem Text="Con movimientos y saldo no igual a cero" Value="3"></asp:ListItem>
<asp:ListItem Text="Con movimientos o saldo no igual a cero" Value="4"></asp:ListItem>
</asp:DropDownList>
<%--</div>--%>
</li>
<%--<label class="col-md-1">Cuenta:</label>
<div class="col-md-2" style="width: 140px;">
<asp:HiddenField ID="HdnCveCuenta2" runat="server" ClientIDMode="Static" />
<asp:TextBox ID="TxtCuenta2" runat="server" ClientIDMode="Static" Enabled="false" TabIndex="5" CssClass="form-control input-sm"></asp:TextBox>
</div>--%>
</ul>
<%--</div>--%>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" CssClass="ScrollAD table table-smallpadding Widthall" data-heighterror="375" data-freezecols="0" data-freezerows="-1"
ShowHeader="True" ShowHeaderWhenEmpty="true" AllowPaging="False" ShowFooter="False" EmptyDataText="No se encontraron cuentas con los parametros establecidos." AutoGenerateColumns="False" OnRowDataBound="GvIngresos_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Cuenta" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbCodigoSAT" runat="server" Text='<%# Eval("CodigoSAT")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="180" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbNombreSAT" runat="server" Text='<%# Eval("NombreSAT")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="320" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbCodigo" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="320" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="320" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Saldos Iniciales">
<HeaderTemplate>
<table width="100%">
<tr>
<td colspan="2">Saldos Iniciales</td>
</tr>
<tr>
<td>Deudor</td>
<td>Acreedor</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LbSaldoInicial" runat="server" Text='<%# Eval("SaldoInicial", "{0:N2}")%>'></asp:Label>
<asp:Label ID="LbSaldoInicial2" runat="server" Width="30px" Visible="false"></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Cargos">
<ItemTemplate>
<asp:Label ID="LbCargos" runat="server" Text='<%# Eval("Cargos", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Abonos">
<ItemTemplate>
<asp:Label ID="LbAbonos" runat="server" Text='<%# Eval("Abonos", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Saldos Actuales">
<HeaderTemplate>
<table width="100%">
<tr>
<td colspan="2">Saldos Actuales</td>
</tr>
<tr>
<td>Deudor</td>
<td>Acreedor</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HLSaldoActual" runat="server" Text='<%# Eval("SaldoActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<asp:Label ID="LbSaldoActual" runat="server" Width="30px" Visible="false"></asp:Label>
</ItemTemplate>
<ItemStyle Width="145" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<HeaderStyle Font-Bold="true" HorizontalAlign="Center" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function pageLoad(sender, args) {
$(function () {
//Genero las cuentas en el arreglo
var ArrCuentas = [<%= WSCuentas()%>];
$("#TxtCuenta").autocomplete({
minLength: 0,
source: ArrCuentas,
focus: function (event, ui) {
$("#TxtCuenta").val(ui.item.label);
$("#HdnCveCuenta").val(ui.item.value);
return false;
},
select: function (event, ui) {
$("#TxtCuenta").val(ui.item.label);
$("#HdnCveCuenta").val(ui.item.value);
//$("#project-description").html(ui.item.desc);
//$("#project-icon").attr("src", "images/" + ui.item.icon);
return false;
}
})
//.autocomplete("instance")._renderItem = function (ul, item) {
// return $("<li>")
// .append("<a>" + item.label + "</a>")
// .appendTo(ul);
//};
});
// Al presionar cualquier tecla en cualquier campo de texto, ejectuamos la siguiente funcion
$('input[type=text]').on('keydown', function (e) {
// Si la tecla ENTER es presionada...
if (e.keyCode === 13) {
var currentTabIndex = $(this).attr('tabindex'); // Obtenemos el número del tabindex del campo actual
var nextTabIndex = parseInt(currentTabIndex) + 1; // Le sumamos 1
var nextField = $('[tabindex=' + nextTabIndex + ']'); // Obtenemos (si existe) el siguiente elemento que usando nextTabIndex
if (nextField.length > 0) { // Si se encontró un elemento:
nextField.focus(); // Hacerle focus / seleccionarlo
nextField.select();
e.preventDefault(); // Ignorar el funcionamiento predeterminado (enviar el formulario)
}
}
});
// Al presionar cualquier tecla en cualquier campo de texto, ejectuamos la siguiente funcion
$('select').on('keydown', function (e) {
// Si la tecla ENTER es presionada...
if (e.keyCode === 13) {
var currentTabIndex = $(this).attr('tabindex'); // Obtenemos el número del tabindex del campo actual
var nextTabIndex = parseInt(currentTabIndex) + 1; // Le sumamos 1
var nextField = $('[tabindex=' + nextTabIndex + ']'); // Obtenemos (si existe) el siguiente elemento que usando nextTabIndex
if (nextField.length > 0) { // Si se encontró un elemento:
nextField.focus(); // Hacerle focus / seleccionarlo
nextField.select();
e.preventDefault(); // Ignorar el funcionamiento predeterminado (enviar el formulario)
}
}
});
}
function Enable() {
var Producto = $get("DdlTipoCuentas").value;
if (Producto == "-2") {
document.getElementById("TxtCuenta").disabled = false;
//document.getElementById("TxtCuenta").focus();
//alert(Producto);
}
else {
document.getElementById("TxtCuenta").value = " ";
document.getElementById("TxtCuenta").disabled = true;
}
}
function Scroll() {
var Tam = TamañoVentana();
var Alto = Tam.height - 360;
if (Alto < 100) {
Alto = 100;
}
$('#<%=GvDatos.ClientID%>').ADScroll({
height: Alto
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,298 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class FinanzasSAT_RepAnexoCatalogo
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 = DateSerial(Year(Now), Month(Now), 1)
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
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
FechaInicio = DateSerial(Year(FechaFin), Month(FechaFin), 1)
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("Codigo").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', '_PASIVO', '_CAPITAL', '_CUADRE', '_ESTADISTICAS', '_ORDEN', '_RACREEDOR', '_RDEUDOR', '_UTILIDAD')")
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.SelectedIndex = 0
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.GetAnexoCatalogo(IdCuenta, FechaInicio, FechaFin, DdlCuenta.SelectedValue.ToEntero, CveSubProyecto, UsuarioActual.CveEmpresa, TipoReporte, 1) 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, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
' 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")
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("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
params.Add(New ReportParameter("pFechaFin", FechaFin.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 TxtCuenta.Text.Trim = "" 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, HdnCveCuenta.Value.ToEntero, DdlTipoCuentas.SelectedValue.ToEntero)
CargaDatos()
End If
RegistraScript("Enable();")
End Sub
End Class

View File

@@ -0,0 +1,264 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoVertical.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoVertical" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Anexo de Catálogo - Vertical
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpFiltros">
<ContentTemplate>
<asp:Panel runat="server" DefaultButton="BtnCargaAsignados">
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle magindate">
<div class="tools">
<asp:Button ID="BtnCargaAsignados" runat="server" Text="Consultar" class="btn btn-default" />
</div>
<div class="titlefiltros caption ">
<ul class="list-inline" style="font-size: 12px;">
<li>Ejercicio:
<asp:DropDownList ID="DdlEjercicio" runat="server" DataTextField="Ejercicio" DataValueField="Ejercicio" CssClass="form-control input-sm select2me" Style="width: 250px !important;" ValidationGroup="GrpCargaAsignados"></asp:DropDownList>
</li>
<li>Periodo:
<asp:DropDownList ID="DdlPeriodo" Width="100px" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</li>
<li>SubProyecto:
<asp:DropDownList ID="DdlSubProyecto" Width="230px" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me"></asp:DropDownList>
</li>
<li>Divisor:
<asp:DropDownList ID="DdlDivisor" Width="100px" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Text="Unidad" Value="1"></asp:ListItem>
<asp:ListItem Text="Miles" Value="1000" Selected="True"></asp:ListItem>
<asp:ListItem Text="Millones" Value="1000000"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpCC" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvCC" runat="server" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron datos" GridLines="none" CssClass="table table-hover">
<Columns>
<asp:BoundField HeaderText="Nombre" DataField="Nombre" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="500px" />
<asp:BoundField DataFormatString="{0:N2}" DataField="SubProyectoGeneral" HeaderText="Total" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" DataField="SubProyectoNA" HeaderText="Sin SubProyecto" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" DataField="SubProyectoNAPorcentaje" HeaderText="%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
function LimpiaCeros(Divisor) {
$('.ceros').each(function (i, obj) {
debugger;
if ($(this).html() == '0.00' || $(this).html() == '0.00%') {
$(this).html('-');
}
if (!($(this).html() == '-' || $(this).html() == '' || ~$(this).html().indexOf("%"))) {
if (Divisor > 1) {
$(this).attr('data-toggle', 'tooltip');
$(this).attr('data-container', 'body');
$(this).attr('title', $(this).html());
}
$(this).html(FormatoNumeroIPP(ToDouble($(this).html()) / Divisor, ((Divisor == 1) ? 2 : 0)));
}
if (ToDouble($(this).html()) < 0) {
$(this).css("color", "red");
}
});
}
function FormatoNumeroIPP(Importe, Decimales) {
debugger;
if (typeof Decimales === 'undefined') { Decimales = 2; }
if (isNaN(parseInt(Importe))) return "NaN";
var tmpNum = Importe;
tmpNum = tmpNum.toFixed(Decimales).replace(/./g, function (c, i, a) {
return i && c !== "." && !((a.length - i) % 3) ? ',' + c : c;
});
return tmpNum;
}
function pageLoad(sender, e) {
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,127 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Contabilidad2_RepAnexoCatalogoVertical
Inherits ClsPaginas
#Region " PROPIEDADES "
Public Property CveCuenta As Integer
Get
Return ViewState("CveCuenta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveCuenta") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim EjercicioParametro, SubProyectoParametro, DivisorParametro As Integer
CveCuenta = IfNull(Request("C"), "-1").ToString.ToEntero
EjercicioParametro = IfNull(Request("E"), "-1").ToString.ToEntero
SubProyectoParametro = IfNull(Request("S"), "-1").ToString.ToEntero
DivisorParametro = IfNull(Request("D"), "-1").ToString.ToEntero
InicializaValores()
DdlEjercicio.SelectedValueExist(EjercicioParametro.ToString)
DdlSubProyecto.SelectedValueExist(SubProyectoParametro.ToString)
DdlDivisor.SelectedValueExist(DivisorParametro.ToString)
CargaDatos()
End If
End Sub
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
CargaCombos()
End Sub
Private Sub CargaCombos()
Dim Conta As New ClsContabilidad
If Conta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = Conta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
Conta.Dispose()
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValueExist(Now.Year.ToString)
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyecto.SelectedValue = "-1"
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnCargaAsignados_Click(sender As Object, e As EventArgs) Handles BtnCargaAsignados.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim Conta As New ClsContabilidad
If Conta.GetAnexoCatalagoCC(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0)
GvCC.DataSource = Conta.DSResultados.Tables(1)
Dim Index = 4
For Index = 4 To GvCC.Columns.Count - 1
GvCC.Columns(Index).Visible = False
Next Index
Index = 4
For Each Dr As DataRow In DtHeaders.Rows
GvCC.Columns(Index).Visible = True
CType(GvCC.Columns(Index), BoundField).DataField = $"SubProyecto{Dr("SubProyecto").ToString}"
GvCC.Columns(Index).HeaderText = Dr("SubProyecto").ToString
GvCC.Columns(Index + 1).Visible = True
CType(GvCC.Columns(Index + 1), BoundField).DataField = $"SubProyecto{Dr("SubProyecto").ToString}Porcentaje"
GvCC.Columns(Index + 1).HeaderText = "%"
Index += 2
Next
GvCC.DataBind()
UpCC.Update()
Else
GvCC.DataSource = Nothing
End If
RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
Conta.Dispose()
End Sub
#End Region
#Region " GV ROW DATABOUND "
Protected Sub GvCC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Style.Add("font-weight", "bold")
End If
e.Row.Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
End If
End Sub
#End Region
End Class

View File

@@ -0,0 +1,928 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepBalanceGeneral.aspx.vb" Inherits="Contabilidad2_RepBalanceGeneral" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />&nbsp;--%>
</li>
<li>
<asp:LinkButton ID="Imprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
<%--<asp:ImageButton ID="Imprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" />&nbsp;--%>
</li>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="CSS" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="E" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpFiltros" UpdateMode="Conditional" >
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" Text="Consultar" runat="server" CssClass="btn btn-default" OnClick="BtnConsultar_Click" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1" style="width: 60px;">Ejercicio:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlEjercicio" DataTextField="Ejercicio" DataValueField="Ejercicio" CssClass="form-control input-sm" runat="server" Width="70px">
</asp:DropDownList>
</div>
<div class="col-md-2" runat="server" id="TdPeriodo" width="80px">
<div class="row">
<label class="col-md-3 truncate" >Periodo:</label>
<div class="col-md-7" >
<asp:DropDownList ID="DdlPeriodo" CssClass="form-control input-sm" runat="server">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2" runat="server" id="tdTipoReporte" visible="false">
<div class="row">
<label class="col-md-3 truncate">Tipo:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm" runat="server">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementarias" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementarias" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<div class="col-md-4" runat="server" id="TdSubTotales" visible="false">
<div class="row">
<label class="col-md-2">SubTotales:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlSubtotales" CssClass="form-control input-sm" runat="server">
<asp:ListItem Text="Sin Subtotales" Value="1"></asp:ListItem>
<asp:ListItem Text="Trimestral" Value="2"></asp:ListItem>
<asp:ListItem Text="Cuatrimestral" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<%--<asp:UpdatePanel runat="server">
<ContentTemplate>
<ajax:TabContainer runat="server" ID="Tabs" AutoPostBack="true" OnActiveTabChanged="TabContainer_ActiveTabChanged">--%>
<%--NORMAL--%>
<%-- <ajax:TabPanel HeaderText="Balance General" ID="TabNormal" runat="server">
<ContentTemplate>--%>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<table style="width: 100%; float: left; margin-right: 20px;">
<tr>
<td width="100%" padding="0">
<center>
<h3>ACTIVO</h3>
<asp:UpdatePanel ID="UpActivo" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvActivo" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvActivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="ACTIVO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvActivoNoCirculante" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvActivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="ACTIVO NO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvActivoDiferido" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvActivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="ACTIVO DIFERIDO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</center>
</td>
</tr>
</table>
</div>
<div class="col-md-6">
<table style="width: 100%; float: left;">
<tr>
<td width="100%">
<center>
<h3>PASIVO</h3>
<asp:UpdatePanel ID="UpPasivo" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvPasivo" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPasivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PASIVO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPasivoNoCirculante" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPasivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PASIVO NO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPasivoDiferido" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPasivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PASIVO DIFERIDO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</center>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<table style="max-width: 550px; width: 90%;">
<tr>
<td width="275px" align="center">
<h4>Total del Pasivo:</h4>
</td>
<td width="100px" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoActual"></asp:Label>
</td>
<td runat="server" id="TdTotalPasivo" width="100px" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoAnterior"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>
<center>
<h3>
<asp:Literal Text="HACIENDA PÚBLICA/PATRIMONIO" ID="LtlTituloHacienda" runat="server" />
</h3>
<asp:UpdatePanel ID="UpPatrimonio" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvPatrimonio" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PATRIMONIO CONTRIBUIDO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<asp:GridView ID="GvUtilidad" ShowHeader="false" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPatrimonioGenerado" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PATRIMONIO GENERADO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPatrimonioActualizacion" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="EXCESO O INSUFICIENCIA DE ACTUALIZACION"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</center>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<table style="max-width: 550px; width: 90%;">
<tr>
<td width="50%" style="text-align: center;">
<h4>
<asp:Literal ID="LtlTotalHacienda" Text="Total Hacienda Pública/Patrimonio:" runat="server" />
</h4>
</td>
<td width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPatrimonioActual"></asp:Label>
</td>
<td runat="server" id="TdTotalPatrimonio" width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPatrimonioAnterior"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="col-md-12">
<br />
</div>
</div>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<center>
<table style="max-width: 550px; width: 90%;">
<tr>
<td width="50%" style="text-align: center;">
<h4>Total del Activo:</h4>
</td>
<td width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalActivoActual"></asp:Label>
</td>
<td runat="server" id="TdTotalActivoAnterior" width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalActivoAnterior"></asp:Label>
</td>
</tr>
</table>
</center>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-6">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<center>
<table style="max-width: 550px; width: 90%;">
<tr>
<td style="text-align: center; width: 50%;">
<h4>
<asp:Literal ID="LtlTotalPasivoPatrimonio" Text="Total del Pasivo y Patrimonio:" runat="server" />
</h4>
</td>
<td width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoPatrimonioActual"></asp:Label>
</td>
<td runat="server" id="TdTotalPasivoAnterior" width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoPatrimonioAnterior"></asp:Label>
</td>
</tr>
</table>
</center>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:Label runat="server" ID="LbDescuadre" ForeColor="Red" Font-Bold="false" Font-Size="Small"></asp:Label>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%-- </ContentTemplate>
</ajax:TabPanel>--%>
<%--MENSUAL
<ajax:TabPanel HeaderText="Balance General Mensual" ID="TabMensual" runat="server" Visible="false">
<ContentTemplate>
<asp:UpdatePanel ID="UpDatosMensual" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosMensual" runat="server" AutoGenerateColumns="False" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="400" HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Enero">
<ItemTemplate>
<asp:HyperLink ID="HLEnero" runat="server" Text='<%# Eval("Enero", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Febrero">
<ItemTemplate>
<asp:HyperLink ID="HLFebrero" runat="server" Text='<%# Eval("Febrero", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Marzo">
<ItemTemplate>
<asp:HyperLink ID="HLMarzo" runat="server" Text='<%# Eval("Marzo", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Subtotal 1er Trimestre">
<ItemTemplate>
<asp:HyperLink ID="HLTrimestral1" runat="server" Text='<%# Eval("Trimestral1", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Abril">
<ItemTemplate>
<asp:HyperLink ID="HLAbril" runat="server" Text='<%# Eval("Abril", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Subtotal 1er Cuatrimestre">
<ItemTemplate>
<asp:HyperLink ID="HLCuatrimestral1" runat="server" Text='<%# Eval("Cuatrimestral1", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Mayo">
<ItemTemplate>
<asp:HyperLink ID="HLMayo" runat="server" Text='<%# Eval("Mayo", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Junio">
<ItemTemplate>
<asp:HyperLink ID="HLJunio" runat="server" Text='<%# Eval("Junio", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Subtotal 2do Trimestre">
<ItemTemplate>
<asp:HyperLink ID="HLTrimestral2" runat="server" Text='<%# Eval("Trimestral2", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Julio">
<ItemTemplate>
<asp:HyperLink ID="HLJulio" runat="server" Text='<%# Eval("Julio", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Agosto">
<ItemTemplate>
<asp:HyperLink ID="HLAgosto" runat="server" Text='<%# Eval("Agosto", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Subtotal 2do Cuatrimestre">
<ItemTemplate>
<asp:HyperLink ID="HLCuatrimestral2" runat="server" Text='<%# Eval("Cuatrimestral2", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Septiembre">
<ItemTemplate>
<asp:HyperLink ID="HLSeptiembre" runat="server" Text='<%# Eval("Septiembre", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Subtotal 3er Trimestre">
<ItemTemplate>
<asp:HyperLink ID="HLTrimestral3" runat="server" Text='<%# Eval("Trimestral3", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Octubre">
<ItemTemplate>
<asp:HyperLink ID="HLOctubre" runat="server" Text='<%# Eval("Octubre", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Noviembre">
<ItemTemplate>
<asp:HyperLink ID="HLNoviembre" runat="server" Text='<%# Eval("Noviembre", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Diciembre">
<ItemTemplate>
<asp:HyperLink ID="HLDiciembre" runat="server" Text='<%# Eval("Diciembre", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Subtotal 4to Trimestre">
<ItemTemplate>
<asp:HyperLink ID="HLTrimestral4" runat="server" Text='<%# Eval("Trimestral4", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Subtotal 3er Cuatrimestre">
<ItemTemplate>
<asp:HyperLink ID="HLCuatrimestral3" runat="server" Text='<%# Eval("Cuatrimestral3", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
--%>
<%--ANUAL
<ajax:TabPanel HeaderText="Balance General Anual" ID="TabAnual" runat="server" Visible="false">
<ContentTemplate>
<asp:UpdatePanel ID="UpDatosAnual" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosAnual" runat="server" AutoGenerateColumns="False" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="400" HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano1" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno1" runat="server" Text='<%# Eval("Ano1", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano2" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno2" runat="server" Text='<%# Eval("Ano2", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano3" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno3" runat="server" Text='<%# Eval("Ano3", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano4" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno4" runat="server" Text='<%# Eval("Ano4", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano5" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno5" runat="server" Text='<%# Eval("Ano5", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano6" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno6" runat="server" Text='<%# Eval("Ano6", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano7" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno7" runat="server" Text='<%# Eval("Ano7", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano8" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno8" runat="server" Text='<%# Eval("Ano8", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano9" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno9" runat="server" Text='<%# Eval("Ano9", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano10" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno10" runat="server" Text='<%# Eval("Ano10", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano11" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno11" runat="server" Text='<%# Eval("Ano11", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano12" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno12" runat="server" Text='<%# Eval("Ano12", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano13" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno13" runat="server" Text='<%# Eval("Ano13", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano14" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno14" runat="server" Text='<%# Eval("Ano14", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano15" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno15" runat="server" Text='<%# Eval("Ano15", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano16" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno16" runat="server" Text='<%# Eval("Ano16", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano17" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno17" runat="server" Text='<%# Eval("Ano17", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano18" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno18" runat="server" Text='<%# Eval("Ano18", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano19" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno19" runat="server" Text='<%# Eval("Ano19", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano20" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno20" runat="server" Text='<%# Eval("Ano20", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
--%>
<%-- </ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>--%>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="JS" runat="Server">
<%-- <script type="text/javascript">
function pageLoad() {
$(document).ready(function () {
gridviewScrollMensual();
gridviewScrollAnual();
});
function gridviewScrollMensual() {
var Tam = TamañoVentana();
var Alto = Tam.height - 210;
$('#<%=GvDatosMensual.ClientID%>').gridviewScroll({
width: 995,
height: Alto,
freezesize: 1,
headerrowcount: 1
});
}
function gridviewScrollAnual() {
var Tam = TamañoVentana();
var Alto = Tam.height - 210;
$('#<%=GvDatosAnual.ClientID%>').gridviewScroll({
width: 995,
height: Alto,
freezesize: 1,
headerrowcount: 1
});
}
}
</script>--%>
</asp:Content>

View File

@@ -0,0 +1,977 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Contabilidad2_RepBalanceGeneral
Inherits ClsPaginas
#Region " P R O P I E D A D E S - B A L A N C E - G E N E R A L"
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 TotalActivoActual As Double
Get
TotalActivoActual = ViewState("TotalActivoActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActivoActual") = value
End Set
End Property
Private Property TotalActivoAnterior As Double
Get
TotalActivoAnterior = ViewState("TotalActivoAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActivoAnterior") = value
End Set
End Property
Private Property TotalPasivoActual As Double
Get
TotalPasivoActual = ViewState("TotalPasivoActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoActual") = value
End Set
End Property
Private Property TotalPasivoAnterior As Double
Get
TotalPasivoAnterior = ViewState("TotalPasivoAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoAnterior") = value
End Set
End Property
Private Property TotalPatrimonioActual As Double
Get
TotalPatrimonioActual = ViewState("TotalPatrimonioActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPatrimonioActual") = value
End Set
End Property
Private Property TotalPatrimonioAnterior As Double
Get
TotalPatrimonioAnterior = ViewState("TotalPatrimonioAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPatrimonioAnterior") = value
End Set
End Property
Private Property TotalPasivoPatrimonioActual As Double
Get
TotalPasivoPatrimonioActual = ViewState("TotalPasivoPatrimonioActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoPatrimonioActual") = value
End Set
End Property
Private Property TotalPasivoPatrimonioAnterior As Double
Get
TotalPasivoPatrimonioAnterior = ViewState("TotalPasivoPatrimonioAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoPatrimonioAnterior") = value
End Set
End Property
Private Property FechaInicioActual As Date
Get
FechaInicioActual = ViewState("FechaInicioActual").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicioActual") = value
End Set
End Property
Private Property FechaFinActual As Date
Get
FechaFinActual = ViewState("FechaFinActual").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFinActual") = value
End Set
End Property
Private Property FechaInicioAnterior As Date
Get
FechaInicioAnterior = ViewState("FechaInicioAnterior").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicioAnterior") = value
End Set
End Property
Private Property FechaFinAnterior As Date
Get
FechaFinAnterior = ViewState("FechaFinAnterior").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFinAnterior") = value
End Set
End Property
#End Region
#Region " PROPIEDADES MENSUAL "
Private Property DtDatosMensual As DataTable
Get
DtDatosMensual = DirectCast(ViewState("DtDatosMensual"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatosMensual") = value
End Set
End Property
#End Region
#Region " PROPIEDADES - ANUAL "
Private Property DtDatosAnual As DataTable
Get
DtDatosAnual = DirectCast(ViewState("DtDatosAnual"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatosAnual") = value
End Set
End Property
Private Property Anos As Integer
Get
Anos = ViewState("Anos").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("Anos") = value
End Set
End Property
#End Region
#Region " PROPIEDADES"
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
Dim CuentaResultados As Integer
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
tdTipoReporte.Visible = True
TipoReporte = 1
' End If
'SI NO USA AC
If TipoReporte > 0 Then
LtlTituloHacienda.Text = "CAPITAL"
LtlTotalHacienda.Text = "Total Capital:"
LtlTotalPasivoPatrimonio.Text = "Total del Pasivo y Capital:"
GvActivo.Columns(2).Visible = False
GvActivoNoCirculante.Columns(2).Visible = False
GvActivoDiferido.Columns(2).Visible = False
GvPasivo.Columns(2).Visible = False
GvPasivoNoCirculante.Columns(2).Visible = False
GvPasivoDiferido.Columns(2).Visible = False
GvPatrimonio.Columns(2).Visible = False
GvUtilidad.Columns(2).Visible = False
GvPatrimonioGenerado.Visible = False
GvPatrimonioActualizacion.Visible = False
TdTotalActivoAnterior.Visible = False
TdTotalPasivoAnterior.Visible = False
TdTotalPasivo.Visible = False
TdTotalPatrimonio.Visible = False
Else
GvUtilidad.Visible = False
GvActivoDiferido.Visible = False
GvPasivoDiferido.Visible = False
End If
CargaDatosGenerales()
DdlEjercicio.SelectedValue = Now.Year.ToString
'Anual
Anos = 0
'Normal
InicializaValores()
'TabContainer_ActiveTabChanged(Tabs, EventArgs.Empty)
End If
End Sub
Private Sub CargaDatosGenerales()
Dim ClsConta As New ClsContabilidad
If ClsConta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = ClsConta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
ClsConta.Dispose()
DdlEjercicio.DataBind()
End Sub
#Region " REPORTE NORMAL "
Private Sub InicializaValores()
TotalActivoActual = 0
TotalActivoAnterior = 0
TotalPasivoActual = 0
TotalPasivoAnterior = 0
TotalPatrimonioActual = 0
TotalPatrimonioAnterior = 0
TotalPasivoPatrimonioActual = 0
TotalPasivoPatrimonioAnterior = 0
End Sub
Private Sub CargaDatos()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim Anio As String = If(DdlEjercicio.SelectedValue <> "", DdlEjercicio.SelectedValue, Now.Year.ToString)
Dim ObjConta As New ClsContabilidad
Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, "0"c), Anio)
Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
If ObjConta.GetCuentas(-1, "00321", -1, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
DtDatos = ObjConta.DtResultados
CuentaResultados = DtDatos.Rows(0)("CveCuenta").ToString.ToEntero
End If
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetSituacionFinanciera("01/01/1000".ToDate, FechaF.ToDate, UsuarioActual.CveEmpresa, CveSubProyecto, TipoReporte) Then
DtDatos = ObjConta.DtResultados
CargaGrids()
SumaTotales()
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del estado de situación financiera", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
End Sub
Private Sub CargaGrids()
'ACTIVO
Dim DtActivoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND (Sup = 'ACTIVO CIRCULANTE' OR Nombre = 'ACTIVO CIRCULANTE' OR Sup = 'CIRCULANTE' OR Nombre ='CIRCULANTE')")
Dim DtActivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND (Sup = 'ACTIVO NO CIRCULANTE' OR Nombre = 'ACTIVO NO CIRCULANTE' OR Sup = 'FIJO' OR Nombre ='FIJO')")
Dim DtActivoDiferido = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND (Sup = 'DIFERIDO' OR Nombre = 'DIFERIDO')")
Dim Row As DataRow = DtActivoCirculante.NewRow
If DtActivoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO CIRCULANTE"
Row.Item("ImporteActual") = DtActivoCirculante.Rows(0)("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtActivoCirculante.Rows(0)("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
DtActivoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtActivoCirculante.Rows.Add(Row)
Row = DtActivoNoCirculante.NewRow
If DtActivoNoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO NO CIRCULANTE"
Row.Item("ImporteActual") = DtActivoNoCirculante.Rows(0)("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtActivoNoCirculante.Rows(0)("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
DtActivoNoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO NO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtActivoNoCirculante.Rows.Add(Row)
Row = DtActivoDiferido.NewRow
If DtActivoDiferido.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO DIFERIDO"
Row.Item("ImporteActual") = DtActivoDiferido.Rows(0)("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtActivoDiferido.Rows(0)("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
DtActivoDiferido.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO DIFERIDO"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtActivoDiferido.Rows.Add(Row)
GvActivo.DataSource = DtActivoCirculante
GvActivo.DataBind()
GvActivoNoCirculante.DataSource = DtActivoNoCirculante
GvActivoNoCirculante.DataBind()
GvActivoDiferido.DataSource = DtActivoDiferido
GvActivoDiferido.DataBind()
UpActivo.Update()
'PASIVO
Dim DtPasivoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND (Sup = 'PASIVO CIRCULANTE' OR Sup = 'PASIVO' OR Sup = 'CIRCULANTE' OR Nombre = 'PASIVO CIRCULANTE' OR Sup = 'CORTO PLAZO' OR Nombre = 'CORTO PLAZO')")
Dim DtPasivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND (Sup = 'PASIVO NO CIRCULANTE' OR Nombre = 'PASIVO NO CIRCULANTE' OR Sup = 'LARGO PLAZO' OR Nombre = 'LARGO PLAZO')")
Dim DtPasivoDiferido = DtDatos.FiltraParametros("Tipo in ('D') AND (Sup = 'DIFERIDO' OR Nombre = 'DIFERIDO')")
Row = DtPasivoCirculante.NewRow
If DtPasivoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO CIRCULANTE"
Row.Item("ImporteActual") = DtPasivoCirculante.Rows(0)("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPasivoCirculante.Rows(0)("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
DtPasivoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPasivoCirculante.Rows.Add(Row)
Row = DtPasivoNoCirculante.NewRow
If DtPasivoNoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO NO CIRCULANTE"
Row.Item("ImporteActual") = DtPasivoNoCirculante.Rows(0)("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPasivoNoCirculante.Rows(0)("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
DtPasivoNoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO NO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPasivoNoCirculante.Rows.Add(Row)
Row = DtPasivoDiferido.NewRow
If DtPasivoDiferido.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO DIFERIDO"
Row.Item("ImporteActual") = DtPasivoDiferido.Rows(0)("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPasivoDiferido.Rows(0)("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
DtPasivoDiferido.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO DIFERIDO"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPasivoDiferido.Rows.Add(Row)
GvPasivo.DataSource = DtPasivoCirculante
GvPasivo.DataBind()
GvPasivoNoCirculante.DataSource = DtPasivoNoCirculante
GvPasivoNoCirculante.DataBind()
GvPasivoDiferido.DataSource = DtPasivoDiferido
GvPasivoDiferido.DataBind()
UpPasivo.Update()
'PATRIMONIO
Dim DtPatrimonioContribuido = DtDatos.FiltraParametros("Tipo in ('F') AND (Sup = 'PATRIMONIO CONTRIBUIDO' OR Nombre = 'PATRIMONIO CONTRIBUIDO' OR Sup = 'CAPITAL CONTABLE' OR Sup = 'CAPITAL' OR Nombre = 'CAPITAL CONTABLE' OR Nombre = 'CAPITAL')")
Dim DtUtilidad = DtDatos.FiltraParametros("Tipo in ('F') AND (Codigo = '_UTILIDAD')")
Dim DtPatrimonioGenerado = DtDatos.FiltraParametros("Tipo in ('F') AND (Sup = 'PATRIMONIO GENERADO' OR Nombre = 'PATRIMONIO GENERADO')")
Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros("Tipo in ('F') AND (Sup = 'EXCESO O INSUFICIENCIA EN LA ACTUALIZACION D/PATRI' OR Nombre = 'EXCESO O INSUFICIENCIA EN LA ACTUALIZACION D/PATRI')")
Row = DtPatrimonioContribuido.NewRow
If DtPatrimonioContribuido.Rows.Count > 0 Then
Row.Item("Nombre") = String.Format("&nbsp;&nbsp;&nbsp;{0}", If(TipoReporte < 0, "TOTAL PATRIMONIO CONTRIBUIDO", "TOTAL CAPITAL"))
Row.Item("ImporteActual") = DtPatrimonioContribuido.Rows(0)("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPatrimonioContribuido.Rows(0)("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
DtPatrimonioContribuido.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = String.Format("&nbsp;&nbsp;&nbsp;{0}", If(TipoReporte < 0, "TOTAL PATRIMONIO CONTRIBUIDO", "TOTAL CAPITAL"))
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPatrimonioContribuido.Rows.Add(Row)
Row = DtPatrimonioGenerado.NewRow
If DtPatrimonioGenerado.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PATRIMONIO GENERADO"
'El id = 87 es el id de la cuenta "RESULTADOS DEL EJERCICIO:(AHORRO/DESAHORRO)"
If DtPatrimonioGenerado.FiltraParametros("CveCuenta = " & CuentaResultados).Rows.Count > 0 Then
Row.Item("ImporteActual") = (DtPatrimonioGenerado.Rows(0)("ImporteActual").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero("CveCuenta = " & CuentaResultados)("ImporteActual").ToString.ToDouble).ToString
Row.Item("ImporteAnterior") = (DtPatrimonioGenerado.Rows(0)("ImporteAnterior").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero("CveCuenta = " & CuentaResultados)("ImporteAnterior").ToString.ToDouble).ToString
Else
Row.Item("ImporteActual") = DtPatrimonioGenerado.Rows(0)("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPatrimonioGenerado.Rows(0)("ImporteAnterior").ToString
End If
Row.Item("CtaMayor") = -1
DtPatrimonioGenerado.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PATRIMONIO GENERADO"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPatrimonioGenerado.Rows.Add(Row)
Row = DtPatrimonioActualizacion.NewRow
If DtPatrimonioActualizacion.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION"
Row.Item("ImporteActual") = DtPatrimonioActualizacion.Rows(0)("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPatrimonioActualizacion.Rows(0)("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
DtPatrimonioActualizacion.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPatrimonioActualizacion.Rows.Add(Row)
GvPatrimonio.DataSource = DtPatrimonioContribuido
GvPatrimonio.DataBind()
GvUtilidad.DataSource = DtUtilidad
GvUtilidad.DataBind()
GvPatrimonioGenerado.DataSource = DtPatrimonioGenerado
GvPatrimonioGenerado.DataBind()
GvPatrimonioActualizacion.DataSource = DtPatrimonioActualizacion
GvPatrimonioActualizacion.DataBind()
UpPatrimonio.Update()
End Sub
Private Sub SumaTotales()
TotalPasivoPatrimonioActual = TotalPasivoActual + TotalPatrimonioActual
TotalPasivoPatrimonioAnterior = TotalPasivoAnterior + TotalPatrimonioAnterior
'Llena Lb´s Totales
LbTotalActivoActual.Text = TotalActivoActual.ToString.FormatoNumero
LbTotalActivoAnterior.Text = TotalActivoAnterior.ToString.FormatoNumero
LbTotalPasivoActual.Text = TotalPasivoActual.ToString.FormatoNumero
LbTotalPasivoAnterior.Text = TotalPasivoAnterior.ToString.FormatoNumero
LbTotalPatrimonioActual.Text = TotalPatrimonioActual.ToString.FormatoNumero
LbTotalPatrimonioAnterior.Text = TotalPatrimonioAnterior.ToString.FormatoNumero
LbTotalPasivoPatrimonioActual.Text = TotalPasivoPatrimonioActual.ToString.FormatoNumero
LbTotalPasivoPatrimonioAnterior.Text = TotalPasivoPatrimonioAnterior.ToString.FormatoNumero
Dim Descuadre = False
'COLOREA ROJO SI NO CUADRAN TOTALES
If TotalActivoActual <> TotalPasivoPatrimonioActual Then
LbTotalActivoActual.ForeColor = Drawing.Color.Red
LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Red
Descuadre = True
Else
LbTotalActivoActual.ForeColor = Drawing.Color.Black
LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Black
End If
If TotalActivoAnterior <> TotalPasivoPatrimonioAnterior Then
LbTotalActivoAnterior.ForeColor = Drawing.Color.Red
LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Red
Descuadre = True
Else
LbTotalActivoAnterior.ForeColor = Drawing.Color.Black
LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Black
End If
If Descuadre Then
LbDescuadre.Text = "Las sumas de los totales están descuadradas."
Else
LbDescuadre.Text = ""
End If
End Sub
#Region "GV´S ROW DATA BOUND"
Protected Sub GvActivo_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalActivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalActivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
Else
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
End If
End Sub
Protected Sub GvPasivo_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'Totales
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalPasivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalPasivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
'Cuentas
Else
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
'e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
'e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
End If
'Colorea NEGATIVOS
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
End If
End Sub
Protected Sub GvPatrimonio_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.Header Then
If e.Row.FCLabel("LbTitulo") IsNot Nothing Then e.Row.FCLabel("LbTitulo").Text = "CAPITAL CONTABLE"
End If
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Or e.Row.DBCampo("CtaMayor").ToString.ToEntero = 2 Then
TotalPatrimonioActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalPatrimonioAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
'e.Row.ControlStyle.Font.Bold = True
Else
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
'e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
'e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
End If
End Sub
#End Region
#End Region
#Region " REPORTE MENSUAL "
Private Sub CargaDatosMensual()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetBalanceGeneralMensual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte, DdlSubtotales.SelectedValue.ToEntero, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatosMensual = ObjConta.DtResultados
Else
DtDatosMensual = Nothing
Alert("Ocurrió un error al cargar los datos del balance general mensual", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
EscondeSubtotales()
If DtDatosMensual IsNot Nothing Then
CargaGridMensual()
End If
End Sub
Private Sub EscondeSubtotales()
'Esconde Trimestral
'GvDatosMensual.Columns(4).Visible = False
'GvDatosMensual.Columns(9).Visible = False
'GvDatosMensual.Columns(14).Visible = False
'GvDatosMensual.Columns(18).Visible = False
''Esconde Cuatrimestral
'GvDatosMensual.Columns(6).Visible = False
'GvDatosMensual.Columns(12).Visible = False
'GvDatosMensual.Columns(19).Visible = False
'If DdlSubtotales.SelectedValue = "2" Then
' GvDatosMensual.Columns(4).Visible = True
' GvDatosMensual.Columns(9).Visible = True
' GvDatosMensual.Columns(14).Visible = True
' GvDatosMensual.Columns(18).Visible = True
'ElseIf DdlSubtotales.SelectedValue = "3" Then
' GvDatosMensual.Columns(6).Visible = True
' GvDatosMensual.Columns(12).Visible = True
' GvDatosMensual.Columns(19).Visible = True
'End If
End Sub
Private Sub CargaGridMensual()
'GvDatosMensual.DataSource = DtDatosMensual
'GvDatosMensual.DataBind()
'UpDatosMensual.Update()
End Sub
'Protected Sub GvDatosMensual_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosMensual.RowDataBound
' If e.Row.RowType = DataControlRowType.DataRow Then
' If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 5 Or 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 = ""
' 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 = 5 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;")
' e.Row.FCHyperLink("HLEnero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/01/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLFebrero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/02/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLMarzo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/03/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLAbril").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/04/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLMayo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/05/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLJunio").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/06/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLJulio").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/07/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLAgosto").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/08/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLSeptiembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("09/01/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLOctubre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/10/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLNoviembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/11/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLDiciembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/12/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLTrimestral1").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CveSubProyecto={4}", e.Row.DBCampo("CveCuenta"), String.Format("01/01/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/03/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLTrimestral2").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CveSubProyecto={4}", e.Row.DBCampo("CveCuenta"), String.Format("01/04/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/06/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLTrimestral3").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CveSubProyecto={4}", e.Row.DBCampo("CveCuenta"), String.Format("01/07/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/09/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLTrimestral4").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CveSubProyecto={4}", e.Row.DBCampo("CveCuenta"), String.Format("01/10/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/12/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLCuatrimestral1").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CveSubProyecto={4}", e.Row.DBCampo("CveCuenta"), String.Format("01/01/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/04/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLCuatrimestral2").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CveSubProyecto={4}", e.Row.DBCampo("CveCuenta"), String.Format("01/05/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/08/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' e.Row.FCHyperLink("HLCuatrimestral3").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CveSubProyecto={4}", e.Row.DBCampo("CveCuenta"), String.Format("01/09/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/12/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
' End If
' 'TOTALES
' If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
' e.Row.Attributes.Add("style", "border-top: 1px solid;")
' e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 10px;")
' e.Row.FCLabel("LbNombre").Font.Italic = True
' End If
' 'SUMAS
' If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 6 Then
' e.Row.FCLabel("LbNombre").Font.Bold = True
' End If
' End If
'End Sub
#End Region
#Region " REPORTE ANUAL "
Private Sub CargaDatosAnual()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetBalanceGeneralAnual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte, UsuarioActual.CveEmpresa, CveSubProyecto) Then
DtDatos = ObjConta.DtResultados
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del balance general anual", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
Anos = (Year(Date.Now) - DdlEjercicio.SelectedValue.ToEntero) + 1
'Esconde todo
'For index = 1 To 20
' GvDatosAnual.Columns(index).Visible = False
'Next
'For index = 1 To Anos
' GvDatosAnual.Columns(index).Visible = True
' GvDatosAnual.Columns(index).HeaderText = (DdlEjercicio.SelectedValue.ToEntero + index - 1).ToString
'Next
If DtDatos IsNot Nothing Then
'CargaGridAnual()
End If
End Sub
'Private Sub CargaGridAnual()
' GvDatosAnual.DataSource = DtDatos
' GvDatosAnual.DataBind()
' UpDatosAnual.Update()
'End Sub
'Protected Sub GvDatosAnual_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosAnual.RowDataBound
' If e.Row.RowType = DataControlRowType.DataRow Then
' If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 5 Or e.Row.DBCampo("CtaMayor").ToString.ToEntero = 4 Then
' For index = 1 To Anos
' e.Row.FCHyperLink("HLAno" + index.ToString).Text = ""
' Next
' 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 = 5 Then
' e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 10px;")
' e.Row.FCLabel("LbNombre").Font.Italic = True
' End If
' 'CUENTAS
' If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 1 Then
' e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 20px;")
' For index = 1 To Anos
' e.Row.FCHyperLink("HLAno" + index.ToString).NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CveSubProyecto={4}", e.Row.DBCampo("CveCuenta"), String.Format("01/01/{0}", (DdlEjercicio.SelectedValue.ToEntero + index - 1).ToString), String.Format("31/12/{0}", (DdlEjercicio.SelectedValue.ToEntero + index - 1).ToString), TipoReporte, DdlSubproyecto.SelectedValue)
' Next
' End If
' 'TOTALES
' If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
' e.Row.Attributes.Add("style", "border-top: 1px solid;")
' e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 10px;")
' e.Row.FCLabel("LbNombre").Font.Italic = True
' End If
' 'SUMAS
' If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 6 Then
' e.Row.FCLabel("LbNombre").Font.Bold = True
' End If
' End If
'End Sub
#End Region
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
'Nota:
' 0 = Normal
' 1 = Mensual
' 2 = Anual
'If Tabs.ActiveTabIndex = 0 Then
' TotalActivoActual = 0
' TotalActivoAnterior = 0
' TotalPasivoActual = 0
' TotalPasivoAnterior = 0
' TotalPatrimonioActual = 0
' TotalPatrimonioAnterior = 0
' TotalPasivoPatrimonioActual = 0
' TotalPasivoPatrimonioAnterior = 0
' CargaDatos()
'ElseIf Tabs.ActiveTabIndex = 1 Then
' CargaDatosMensual()
'ElseIf Tabs.ActiveTabIndex = 2 Then
CargaDatosAnual()
'End If
End Sub
Protected Sub TabContainer_ActiveTabChanged(sender As Object, e As EventArgs)
'Nota:
' 0 = Normal
' 1 = Mensual
' 2 = Anual
'Esconde Todo de lo variable de Filtros
TdSubTotales.Visible = False
TdPeriodo.Visible = False
'If Tabs.ActiveTabIndex = 0 Then
' TdPeriodo.Visible = True
'ElseIf Tabs.ActiveTabIndex = 1 Then
' TdSubTotales.Visible = True
'ElseIf Tabs.ActiveTabIndex = 2 Then
'End If
UpFiltros.Update()
BtnConsultar_Click(BtnConsultar, EventArgs.Empty)
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
ImprimirReporte("Excel")
End Sub
Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
'If ChkFirma.Checked = True Then
' Dim Row As DataRow = DtDatos.NewRow
' Row.Item("Nombre") = String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de contabilidad", "")
' Row.Item("Sup") = String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", "")
' Row.Item("ImporteActual") = "0"
' Row.Item("ImporteAnterior") = "0"
' Row.Item("Tipo") = "Firma"
' DtDatos.Rows.Add(Row)
'End If
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetSituacionFinanciera("01/01/1000".ToDate, FechaF.ToDate, UsuarioActual.CveEmpresa, CveSubProyecto, TipoReporte) Then
DtDatos = ObjConta.DtResultados
For Each row As DataRow In DtDatos.Rows
If row("Level").ToString = "0" Then
row("Sup") = ""
Else
If row("Tipo").ToString = "A" OrElse row("Tipo").ToString = "B" OrElse row("Tipo").ToString = "C" Then
If row("Sup").ToString = "ACTIVO CIRCULANTE" OrElse row("Nombre").ToString = "ACTIVO CIRCULANTE" OrElse row("Sup").ToString = "CIRCULANTE" OrElse row("Nombre").ToString = "CIRCULANTE" Then
row("Sup") = "ACTIVO CIRCULANTE"
Else
If row("Sup").ToString = "ACTIVO NO CIRCULANTE" OrElse row("Nombre").ToString = "ACTIVO NO CIRCULANTE" OrElse row("Sup").ToString = "FIJO" OrElse row("Nombre").ToString = "FIJO" Then
row("Sup") = "ACTIVO NO CIRCULANTE"
Else
If row("Sup").ToString = "DIFERIDO" OrElse row("Nombre").ToString = "DIFERIDO" Then
row("Sup") = "DIFERIDO"
Else
row("Sup") = ""
End If
End If
End If
Else
If row("Tipo").ToString = "D" Then
If row("Sup").ToString = "PASIVO CIRCULANTE" OrElse row("Nombre").ToString = "PASIVO CIRCULANTE" OrElse row("Sup").ToString = "CIRCULANTE" OrElse row("Nombre").ToString = "CIRCULANTE" OrElse row("Sup").ToString = "PASIVO" OrElse row("Nombre").ToString = "PASIVO" OrElse row("Sup").ToString = "CORTO PLAZO" OrElse row("Nombre").ToString = "CORTO PLAZO" Then
row("Sup") = "PASIVO CIRCULANTE"
Else
If row("Sup").ToString = "PASIVO NO CIRCULANTE" OrElse row("Nombre").ToString = "PASIVO NO CIRCULANTE" OrElse row("Sup").ToString = "LARGO PLAZO" OrElse row("Nombre").ToString = "LARGO PLAZO" Then
row("Sup") = "PASIVO NO CIRCULANTE"
Else
If row("Sup").ToString = "DIFERIDO" OrElse row("Nombre").ToString = "DIFERIDO" Then
row("Sup") = "DIFERIDO"
Else
row("Sup") = ""
End If
End If
End If
Else
If row("Tipo").ToString = "F" Then '
If row("Sup").ToString = "CAPITAL" OrElse row("Nombre").ToString = "CAPITAL" OrElse row("Sup").ToString = "CAPITAL CONTABLEE" OrElse row("Nombre").ToString = "CAPITAL CONTABLE" OrElse row("Sup").ToString = "PATRIMONIO CONTRIBUIDO" OrElse row("Nombre").ToString = "PATRIMONIO CONTRIBUIDO" Then
row("Sup") = "CAPITAL"
Else
row("Sup") = ""
End If
Else
row("Sup") = ""
End If
End If
End If
End If
Next
DtDatos.AcceptChanges()
ImprimirReporte()
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del estado de situación financiera", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
'nombre del archivo a generar
Dim fileName As String = "BalanceGeneral"
'ubicacion del rdlc
Dim reportpath As String = "Contabilidad/Reportes/RepBalanceGeneral.rdlc"
'parametros a enviar al reporte
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
params.Add(New ReportParameter("pFirma1", ""))
params.Add(New ReportParameter("pFirma2", ""))
params.Add(New ReportParameter("pFechaFin", FechaF))
ImprimirPDF(reportpath, DtDatos, params, fileName, Formato)
End Sub
End Class

View File

@@ -0,0 +1,710 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepBalanceGeneralVertical.aspx.vb" Inherits="Contabilidad_RepBalanceGeneralVertical" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
table > tbody > tr.ADSRow > td,table > tbody > tr > td.adsCol{
padding:0px!important;
}
.AdsCEll,.AdsRHeader,.AdsCHeader,.AdsBody{
display:inline; float: left;
}
.ADSContainer > div{
display:table;overflow:hidden;
}
.AdsRHeader > .ADSCroll{
overflow:hidden;
}
.AdsCHeader > .ADSCroll{
overflow:hidden;
}
.AdsBody .ADSCroll{
overflow:auto;
}
.AdsCHeader > .ADSCroll::-webkit-scrollbar,.AdsRHeader > .ADSCroll::-webkit-scrollbar {
display: none;
}
.AdsBody .ADSCroll::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
background-color: #F5F5F5;
border-radius: 10px;
}
.AdsBody .ADSCroll::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
}
.AdsBody .ADSCroll::-webkit-scrollbar-thumb
{
background-color: #AAA;
border-radius: 10px;
background-image: -webkit-linear-gradient(90deg, rgba(0, 0, 0, .2) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, .2) 25%,
rgba(0, 0, 0, .2) 25%, transparent 25%, transparent)
}
.txtid2em > td:nth-child(1) > span
{
padding-left: 2em;
}
.txtid4em > td:nth-child(1) > span
{
padding-left: 4em;
max-height: 19px;
}
.GvMensual1 > tbody > tr > td {
padding-top: 2px;
padding-bottom: 1px;
}
.truncate {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
}
.noMargin {
padding-right: 0px;
padding-left: 0px;
}
.chart, .chartanio {
cursor: pointer;
}
.grafica {
font-size: 4em;
cursor: pointer;
color: #AAA;
margin: 0px 20px;
}
.gselected {
color: #009688;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Balance General Vertical
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpFiltros">
<ContentTemplate>
<asp:Panel runat="server" DefaultButton="BtnCargaDatos">
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle magindate" style="min-height: 65px;">
<div class="tools">
<asp:Button ID="BtnCargaDatos" runat="server" Text="Consultar" class="btn btn-default" />
</div>
<div class="titlefiltros caption ">
<ul class="list-inline" style="font-size: 12px;">
<li>Ejercicio:
<asp:DropDownList ID="DdlEjercicio" runat="server" DataTextField="Ejercicio" DataValueField="Ejercicio" CssClass="form-control input-sm select2me" Style="width: 80px !important;" ></asp:DropDownList>
</li>
<li>Periodo:
<asp:DropDownList ID="DdlPeriodo" Width="100px" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</li>
<li>SubProyecto:
<asp:DropDownList ID="DdlSubProyecto" Width="130px" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me"></asp:DropDownList>
</li>
<li>Divisor:
<asp:DropDownList ID="DdlDivisor" Width="100px" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Text="Unidad" Value="1"></asp:ListItem>
<asp:ListItem Text="Miles" Value="1000" Selected="True"></asp:ListItem>
<asp:ListItem Text="Millones" Value="1000000"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Cuentas:
<asp:DropDownList ID="DdlTipo" Width="100px" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Text="Todas" Value="-1"></asp:ListItem>
<asp:ListItem Text="Con saldo" Value="1" Selected="True"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" Width="100%" OnActiveTabChanged="Tab_ActiveTabChanged" AutoPostBack="true">
<ajax:TabPanel ID="TabPanel1" runat="server" HeaderText="Vertical">
<ContentTemplate>
<asp:UpdatePanel ID="UpNormal" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvVertical" runat="server" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron datos" GridLines="none" CssClass="table table-hover">
<Columns>
<asp:BoundField HeaderText="Nombre" DataField="Nombre" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="500px" />
<asp:BoundField HeaderText="Importe" DataField="ImporteActual" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="Porcentaje" DataField="ImporteActualPorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabPanel3" runat="server" HeaderText="Mensual">
<ContentTemplate>
<asp:UpdatePanel ID="UpMensual" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvMensual2" runat="server" data-widthmenos="280" data-heightmenos="290" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron datos" data-cols="1" GridLines="none" CssClass="table table-hover ScrollAD">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<span class="truncate">
<asp:Label ID="lblchart" Visible="false" CssClass="chart" runat="server"><i class="fa fa-bar-chart fa-2" aria-hidden="true"></i></asp:Label>
<%# Eval("Nombre")%>
</span>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Enero" DataField="Enero" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="EneroPorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Febrero" DataField="Febrero" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="FebreroPorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Marzo" DataField="Marzo" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="MarzoPorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Abril" DataField="Abril" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="AbrilPorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Mayo" DataField="Mayo" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="MayoPorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Junio" DataField="Junio" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="JunioPorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Julio" DataField="Julio" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="JulioPorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Agosto" DataField="Agosto" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="AgostoPorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Septiembre" DataField="Septiembre" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="SeptiembrePorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Octubre" DataField="Octubre" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="OctubrePorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Noviembre" DataField="Noviembre" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="NoviembrePorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Diciembre" DataField="Diciembre" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="%" DataField="DiciembrePorcentaje" ItemStyle-CssClass="ceros" DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="50px" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabPanel2" runat="server" HeaderText="Anual">
<ContentTemplate>
<asp:UpdatePanel ID="UpAnual" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvAnual" runat="server" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron datos" GridLines="none" CssClass="table table-hover">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="500px">
<ItemTemplate>
<span class="truncate ">
<asp:Label ID="lblchart" Visible="false" CssClass="chartanio" runat="server"> <i class="fa fa-bar-chart fa-2" aria-hidden="true"></i></asp:Label>
<asp:HyperLink runat="server" ID="HLNombre" Target="_blank" ItemStyle-HorizontalAlign="Left"> <%# Eval("Nombre") %></asp:HyperLink>
</span>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
<div id="Mgraficas" class="modal ADS fade" role="dialog">
<div class="modal-dialog " style="width: 1100px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UPModal" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="ltltitulo" runat="server"> Grafica</asp:Literal></h4>
</div>
<div class="modal-body">
<asp:HiddenField ID="HdfValuesPorcentaje" ClientIDMode="Static" runat="server" />
<asp:HiddenField ID="HdfValues" ClientIDMode="Static" runat="server" />
<asp:HiddenField ID="HdfTitulosA" ClientIDMode="Static" Value="" runat="server" />
<asp:HiddenField ID="HdfTitulos" ClientIDMode="Static" Value="Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre" runat="server" />
<div style="text-align: center; padding: 20px 0px 40px;">
<div style="display: inline-block;">
<i class="fa fa-bar-chart fa-3 grafica gc" onclick="GColumna();"></i>
<i class="fa fa-line-chart fa-3 grafica gl" onclick="GCLineas();"></i>
<i class="fa fa-pie-chart fa-3 grafica gp" onclick="GPastel();"></i>
</div>
</div>
<div id="container" style="width: 1100px; height: 400px; margin: 0 auto"></div>
</div>
<%--<div class="modal-footer">
<asp:Button ID="BtnAgregarSucursal" runat="server" CssClass="btn btn-success" Text="Agregar" ValidationGroup="GrpGuardarSucursal" />
<button id="BtnCancelarSucursal" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>--%>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
function LimpiaCeros(Divisor) {
$('.ceros').each(function (i, obj) {
if ($(this).html() == '0.00' || $(this).html() == '0.00%') {
$(this).html('-');
}
if (!($(this).html() == '-' || $(this).html() == '' || ~$(this).html().indexOf("%"))) {
if (Divisor > 1) {
$(this).attr('data-toggle', 'tooltip');
$(this).attr('data-container', 'body');
$(this).attr('title', $(this).html());
if ($(this).html() == '&nbsp;') {
debugger;
}
}
$(this).html(FormatoNumeroIPP(ToDouble($(this).html()) / Divisor, ((Divisor == 1) ? 2 : 0)));
}
if (ToDouble($(this).html()) < 0) {
$(this).css("color", "red");
}
});
}
function FormatoNumeroIPP(Importe, Decimales) {
if (typeof Decimales === 'undefined') { Decimales = 2; }
if (isNaN(parseInt(Importe))) return "NaN";
var tmpNum = Importe;
tmpNum = tmpNum.toFixed(Decimales).replace(/./g, function (c, i, a) {
return i && c !== "." && !((a.length - i) % 3) ? ',' + c : c;
});
return tmpNum;
}
function EscondeRenglones(IdGV) {
$("#" + IdGV + " tbody .txtid4em").each(function (index) {
var Bandera = 0;
$(this).children("td").each(function (index2) {
if (index2 > 0) {
if ($(this).text() != '-') {
Bandera = 1;
}
Suma = ToDouble($(this).text())
}
})
if (Bandera == 0) {
$(this).hide();
}
});
}
function pageLoad(sender, e) {
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
});
}
function resizeMensual() {
var width = $('.truncatenames div').width() - 5;
$('.truncatenames .truncate').css("width", width);
}
function resizeAnual() {
}
function resizetables() {
resizeMensual();
resizeAnual();
}
jQuery(document).ready(function () {
$(window).resize(function () {
resizetables();
});
resizetables();
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(function (s, e) {
});
prm.add_endRequest(function (s, e) {
});
Sys.Application.add_load(function (s, e) {
resizetables();
});
});
var tipo = 'mes';
$('body').on('click', 'table .chart', function (e) {
var thisobj = $(this);
tipo = 'mes';
$('#HdfValuesPorcentaje').val(thisobj.data('porcentaje'));
$('#HdfValues').val(thisobj.data('value'))
//$('#HdfTitulos').val()
$('#Mgraficas').modal();
GColumna();
});
$('body').on('click', 'table .chartanio', function (e) {
var thisobj = $(this);
tipo = 'anio';
$('#HdfValuesPorcentaje').val(thisobj.data('porcentaje'));
$('#HdfValues').val(thisobj.data('value'))
//$('#HdfTitulos').val()
$('#Mgraficas').modal();
GColumna();
});
function GColumna() {
$('.gselected').removeClass('gselected');
$('.gc').addClass('gselected');
var datos = $('#HdfValues').val().split(',');
var titulos = [];
if (tipo == 'mes') {
titulos = $('#HdfTitulos').val().split(',');
} else {
titulos = $('#HdfTitulosA').val().split(',');
}
graficarColumna(datos, titulos)
}
function GCLineas() {
$('.gselected').removeClass('gselected');
$('.gl').addClass('gselected');
var datos = $('#HdfValues').val().split(',');
var titulos = [];
if (tipo == 'mes') {
titulos = $('#HdfTitulos').val().split(',');
} else {
titulos = $('#HdfTitulosA').val().split(',');
}
graficarLinea(datos, titulos)
}
function GPastel() {
$('.gselected').removeClass('gselected');
$('.gp').addClass('gselected');
var datos = $('#HdfValues').val().split(',');
var titulos = [];
if (tipo == 'mes') {
titulos = $('#HdfTitulos').val().split(',');
} else {
titulos = $('#HdfTitulosA').val().split(',');
}
graficarPie(datos, titulos)
}
function graficarColumnaS(datos, Titulos) {
var seriedata = [];
for (var i = 0; i < datos.length; i++) {
// Iterate over numeric indexes from 0 to 5, as everyone expects.
datos[i] = Number(datos[i]);
var obj = [];
obj.name = Titulos[i];
obj.data = [Number(datos[i]), ];
seriedata.push(obj);
}
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: ''
},
subtitle: {
text: ''
},
xAxis: {
categories: Titulos
},
yAxis: {
min: 0,
title: {
text: ''
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y:.1f} </b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series:
[{
type: 'column',
colorByPoint: true,
data: datos,
showInLegend: false
}]
});
}
function graficarColumna(datos, Titulos) {
var seriedata = [];
for (var i = 0; i < datos.length; i++) {
// Iterate over numeric indexes from 0 to 5, as everyone expects.
var obj = [];
obj.name = Titulos[i];
obj.data = [Number(datos[i]), ];
seriedata.push(obj);
}
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: ''
},
subtitle: {
text: ''
},
yAxis: {
min: 0,
title: {
text: ''
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y:.1f} </b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: seriedata
});
}
function graficarLinea(datos, Titulos) {
var seriedata = [];
for (var i = 0; i < datos.length; i++) {
// Iterate over numeric indexes from 0 to 5, as everyone expects.
datos[i] = Number(datos[i]);
var obj = [];
obj.name = Titulos[i];
obj.data = [Number(datos[i])];
seriedata.push(obj);
}
$('#container').highcharts({
chart: {
type: 'line'
},
title: {
text: ''
},
subtitle: {
text: ''
},
xAxis: {
categories: Titulos,
crosshair: true
},
yAxis: {
min: 0,
title: {
text: ''
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y:.1f} </b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [{
name: " - ",
data: datos
}]
});
}
function graficarPie(datos, Titulos, selected) {
var seriedata = [];
for (var i = 0; i < datos.length; i++) {
// Iterate over numeric indexes from 0 to 5, as everyone expects.
var obj = {};
obj.name = Titulos[i];
obj.y = Number(datos[i]);
if (i == selected) {
obj.sliced = true;
obj.selected = true;
}
seriedata.push(obj);
}
$('#container').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: ''
},
subtitle: {
text: ''
},
yAxis: {
min: 0,
title: {
text: ''
}
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
},
connectorColor: 'silver'
}
}
},
series: [{ name: 'Pastel', data: seriedata }]
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,356 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Contabilidad_RepBalanceGeneralVertical
Inherits ClsPaginas
#Region " PROPIEDADES "
Public Property EjercicioMin As Integer
Get
Return ViewState("EjercicioMin").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("EjercicioMin") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
DdlEjercicio.SelectedValueExist(Now.Year.ToString)
InicializaValores()
End If
End Sub
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
CargaCombos()
CargaDatos()
End Sub
Private Sub CargaCombos()
Dim Conta As New ClsContabilidad
If Conta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = Conta.DtResultados
EjercicioMin = Conta.DtResultados.MIN("Ejercicio").ToEntero
Else
DdlEjercicio.DataSource = Nothing
End If
Conta.Dispose()
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValueExist(Now.Year.ToString)
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyecto.SelectedValue = "-1"
DdlPeriodo.SelectedValue = Now.Month.ToString
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnCargaAsignados_Click(sender As Object, e As EventArgs) Handles BtnCargaDatos.Click
CargaDatos()
End Sub
Protected Sub Tab_ActiveTabChanged(sender As Object, e As EventArgs)
If Tab.ActiveTabIndex = 2 Then
' DdlEjercicio.SelectedValueExist(EjercicioMin.ToString)
End If
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim Conta As New ClsContabilidad
Dim IdGV = ""
If Tab.ActiveTabIndex = 0 Then
IdGV = GvVertical.ClientID
If Conta.GetBalanceGeneralVertical(DdlEjercicio.SelectedValue.ToEntero, DdlPeriodo.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
GvVertical.DataSource = Conta.DtResultados
Else
GvVertical.DataSource = Nothing
End If
GvVertical.DataBind()
UpNormal.Update()
ElseIf Tab.ActiveTabIndex = 1 Then
IdGV = GvMensual2.ClientID
If Conta.GetBalanceGeneralMensualVertical(DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
GvMensual2.DataSource = Conta.DtResultados
Else
GvMensual2.DataSource = Nothing
End If
HdfTitulos.Value = "Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre"
GvMensual2.DataBind()
UpMensual.Update()
ElseIf Tab.ActiveTabIndex = 2 Then
IdGV = GvAnual.ClientID
If Conta.GetBalanceGeneralAnualVertical(DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0)
GvAnual.DataSource = Conta.DSResultados.Tables(1)
Dim Index = 1
For Index = 1 To GvAnual.Columns.Count - 1
GvAnual.Columns(Index).Visible = False
Next Index
Index = 1
Dim titulos As New StringBuilder
For Each Dr As DataRow In DtHeaders.Rows
GvAnual.Columns(Index).Visible = True
CType(GvAnual.Columns(Index), BoundField).DataField = $"Ejercicio{Dr("Ejercicio").ToString}"
GvAnual.Columns(Index).HeaderText = Dr("Ejercicio").ToString
titulos.Append($"{IIf(Index = 1, "", ",")}{Dr("Ejercicio").ToString}")
GvAnual.Columns(Index + 1).Visible = True
CType(GvAnual.Columns(Index + 1), BoundField).DataField = $"Ejercicio{Dr("Ejercicio").ToString}Porcentaje"
GvAnual.Columns(Index + 1).HeaderText = "%"
Index += 2
Next
HdfTitulos.Value = titulos.ToString
HdfTitulosA.Value = titulos.ToString
GvAnual.DataBind()
Index = 1
Dim IndexRow As Integer = 0
For Each row As DataRow In Conta.DSResultados.Tables(1).Rows
Dim valores As New StringBuilder
Dim Porcentajes As New StringBuilder
Dim prefix As String = ""
For Each Dr As DataRow In DtHeaders.Rows
valores.Append($"{prefix}{row($"Ejercicio{Dr("Ejercicio").ToString}")}")
Porcentajes.Append($"{prefix}{row($"Ejercicio{Dr("Ejercicio").ToString}Porcentaje")}")
Index += 2
prefix = ","
Next
Dim lbl As Label = GvAnual.Rows(IndexRow).FCLabel("lblchart")
lbl.Attributes.Add("data-value", valores.ToString)
lbl.Attributes.Add("data-porcentaje", Porcentajes.ToString)
IndexRow += 1
Next
UpAnual.Update()
Else
GvAnual.DataSource = Nothing
End If
End If
Dim Script = ""
If DdlTipo.SelectedValue.ToEntero > 0 Then
Script = $"LimpiaCeros({DdlDivisor.SelectedValue});EscondeRenglones('{IdGV}');"
Else
Script = $"LimpiaCeros({DdlDivisor.SelectedValue});"
End If
RegistraScript(Script)
UPModal.Update()
UpFiltros.Update()
Conta.Dispose()
End Sub
#End Region
#Region " GV ROW DATABOUND "
Protected Sub GvVertical_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvVertical.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'GENERAL
If e.Row.DBCampo("Clasificacion").ToString = "A" Then
e.Row.CssClass = "Totales"
e.Row.Cells(1).Text = ""
e.Row.Cells(2).Text = ""
End If
'CABECERA
If e.Row.DBCampo("CtaMayor").ToString = "3" Then
e.Row.Style.Add("font-weight", "bold")
e.Row.Style.Add("text-indent", "2em")
e.Row.Cells(1).Text = ""
e.Row.Cells(2).Text = ""
End If
'NORMAL
If e.Row.DBCampo("CtaMayor").ToString = "1" Then
e.Row.Style.Add("text-indent", "4em")
e.Row.CssClass = "txtid4em"
End If
'TOTAL
If e.Row.DBCampo("CtaMayor").ToString = "99" Then
e.Row.Style.Add("font-weight", "bold")
e.Row.Style.Add("font-style", "italic")
e.Row.Style.Add("text-indent", "2em")
e.Row.Cells(2).Text = "100%"
End If
'SUMA
If e.Row.DBCampo("Clasificacion").ToString = "Z" Then
e.Row.Style.Add("background-color", "#DDD")
e.Row.Style.Add("font-weight", "bold")
e.Row.Style.Add("font-style", "italic")
e.Row.Cells(2).Text = "100%"
End If
End If
End Sub
Protected Sub GvMensual1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMensual2.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim lbl As Control = e.Row.FindControl("lblchart")
Dim cssclass As String = ""
e.Row.Attributes.Add("style", "height:28px;")
'TOTAL
If e.Row.DBCampo("CtaMayor").ToString = "99" Then
e.Row.Style.Add("font-weight", "bold")
e.Row.Style.Add("font-style", "italic")
If Not IsNothing(lbl) Then
cssclass = "txtid2em"
End If
For Index = 2 To GvMensual2.Columns.Count - 1 Step 2
e.Row.Cells(Index).Text = "100%"
Next Index
End If
'SUMNA
If e.Row.DBCampo("Clasificacion").ToString = "Z" Then
e.Row.Style.Add("background-color", "#DDD")
e.Row.Style.Add("font-weight", "bold")
e.Row.Style.Add("font-style", "italic")
For Index = 2 To GvMensual2.Columns.Count - 1 Step 2
e.Row.Cells(Index).Text = "100%"
Next Index
End If
'NORMAL
If Not IsNothing(lbl) Then
If e.Row.DBCampo("CtaMayor").ToString = "1" Then
cssclass = "txtid4em"
lbl.Visible = True
DirectCast(lbl, Label).Attributes.Add("data-value",
String.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11}",
e.Row.DBCampo("Enero"),
e.Row.DBCampo("Febrero"),
e.Row.DBCampo("Marzo"),
e.Row.DBCampo("Abril"),
e.Row.DBCampo("Mayo"),
e.Row.DBCampo("Junio"),
e.Row.DBCampo("Julio"),
e.Row.DBCampo("Agosto"),
e.Row.DBCampo("Septiembre"),
e.Row.DBCampo("Octubre"),
e.Row.DBCampo("Noviembre"),
e.Row.DBCampo("Diciembre")))
DirectCast(lbl, Label).Attributes.Add("data-porcentaje",
String.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11}",
e.Row.DBCampo("EneroPorcentaje"),
e.Row.DBCampo("FebreroPorcentaje"),
e.Row.DBCampo("MarzoPorcentaje"),
e.Row.DBCampo("AbrilPorcentaje"),
e.Row.DBCampo("MayoPorcentaje"),
e.Row.DBCampo("JunioPorcentaje"),
e.Row.DBCampo("JulioPorcentaje"),
e.Row.DBCampo("AgostoPorcentaje"),
e.Row.DBCampo("SeptiembrePorcentaje"),
e.Row.DBCampo("OctubrePorcentaje"),
e.Row.DBCampo("NoviembrePorcentaje"),
e.Row.DBCampo("DiciembrePorcentaje")))
End If
End If
'CABECERA
If e.Row.DBCampo("CtaMayor").ToString = "3" Then
e.Row.Style.Add("font-weight", "bold")
cssclass = "txtid2em"
For Index = 1 To GvMensual2.Columns.Count - 1
e.Row.Cells(Index).Text = ""
Next Index
End If
'GENERAL
e.Row.CssClass = cssclass
If e.Row.DBCampo("Clasificacion").ToString = "A" Then
e.Row.CssClass = "Totales " & cssclass
For Index = 1 To GvMensual2.Columns.Count - 1
e.Row.Cells(Index).Text = ""
Next Index
End If
End If
End Sub
Protected Sub GvAnual_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvAnual.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'LIGA SOLO EN DETALLE POR CAMPO CVECUENTA - TEMPORAL
If e.Row.DBCampo("CtaMayor").ToString = "1" Then
e.Row.FCHyperLink("HLNombre").NavigateUrl = $"/Contabilidad2/RepAnexoCatalogoAnual.aspx?C={e.Row.DBCampo("CveCuenta")}&E={DdlEjercicio.SelectedValue}&S={DdlSubProyecto.SelectedValue}&D={DdlDivisor.SelectedValue}&V=1"
End If
'GENERAL
If e.Row.DBCampo("Clasificacion").ToString = "A" Then
e.Row.CssClass = "Totales"
For Index = 1 To GvAnual.Columns.Count - 1
e.Row.Cells(Index).Text = ""
Next Index
End If
'CABECERA
If e.Row.DBCampo("CtaMayor").ToString = "3" Then
e.Row.Style.Add("font-weight", "bold")
e.Row.CssClass = "txtid2em"
Dim Index = 0
For Index = 1 To GvAnual.Columns.Count - 1
e.Row.Cells(Index).Text = ""
Next Index
End If
'NORMAL
If e.Row.DBCampo("CtaMayor").ToString = "1" Then
e.Row.Style.Add("text-indent", "4em")
e.Row.CssClass = "txtid4em"
End If
'TOTAL
If e.Row.DBCampo("CtaMayor").ToString = "99" Then
e.Row.Style.Add("font-weight", "bold")
e.Row.Style.Add("font-style", "italic")
e.Row.CssClass = "txtid2em"
Dim Index = 0
For Index = 2 To GvAnual.Columns.Count - 1 Step 2
e.Row.Cells(Index).Text = "100%"
Next Index
End If
'SUMA
If e.Row.DBCampo("Clasificacion").ToString = "Z" Then
e.Row.Style.Add("background-color", "#DDD")
e.Row.Style.Add("font-weight", "bold")
e.Row.Style.Add("font-style", "italic")
Dim Index = 0
For Index = 2 To GvAnual.Columns.Count - 1 Step 2
e.Row.Cells(Index).Text = "100%"
Next Index
End If
End If
End Sub
#End Region
End Class

View File

@@ -0,0 +1,165 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepBalanzaComprobacion.aspx.vb" Inherits="Contabilidad2_RepBalanzaComprobacion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />&nbsp; &nbsp;--%>
</li>
<li>
<asp:LinkButton ID="BtnImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
<%--<asp:ImageButton ID="BtnImprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" Visible="true" /> &nbsp;--%>
</li>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
Balanza de Comprobación
<asp:Label runat="server" ID="LbTitulo"></asp:Label>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" CssClass="btn btn-default" runat="server" Text="Consultar" Width="100px" OnClick="BtnConsultar_Click" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Fecha Inicio:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaDel" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioDel" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton></span>
<ajax:MaskedEditExtender ID="MEEFechaDel" runat="server" TargetControlID="TxtFechaDel" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioDel" runat="server" TargetControlID="TxtFechaDel" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<label class="col-md-1 truncate">Fecha Fin:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAl" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioAl" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton></span>
<ajax:MaskedEditExtender ID="MEEFechaAl" runat="server" TargetControlID="TxtFechaAl" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioAl" runat="server" TargetControlID="TxtFechaAl" PopupButtonID="ImgCalendarioAl" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<label class="col-md-1 truncate">Cuentas:</label>
<div class="col-md-2">
<asp:DropDownList CssClass="form-control input-sm" runat="server" ID="DdlTipoCuentas" Width="150px">
<asp:ListItem Text="Todas" Value="1" />
<asp:ListItem Text="Con Movimientos" Value="2" />
<asp:ListItem Text="Saldo Actual no igual a cero" Value="3" />
<asp:ListItem Text="Con Movimientos y saldo no igual a cero" Value="4" />
<asp:ListItem Text="Con Movimientos o saldo no igual a cero " Value="5" />
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2" runat="server" id="tdTipoReporte" visible="true">
<div class="row">
<label class="col-md-3 truncate">Tipo:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm" runat="server">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementarias" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementarias" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" CssClass="table table-advance table-striped table-hover Widthall" runat="server" GridLines="None" EmptyDataText="No se encontraron cuentas con los parametros establecidos." AutoGenerateColumns="False" OnRowDataBound="GvIngresos_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Cuenta" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbCodigo" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="180" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="320" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<table width="100%">
<tr>
<td colspan="2">Saldos Iniciales</td>
</tr>
<tr>
<td>Deudor</td>
<td>Acreedor</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LbSaldoInicial" Style="white-space: pre;" runat="server" Text='<%# Eval("SaldoInicial", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="120" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Cargos">
<ItemTemplate>
<asp:Label ID="LbCargos" runat="server" Text='<%# Eval("Cargos", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="120" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Abonos">
<ItemTemplate>
<asp:Label ID="LbAbonos" runat="server" Text='<%# Eval("Abonos", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="120" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<table width="100%">
<tr>
<td colspan="2">Saldos Actuales</td>
</tr>
<tr>
<td>Deudor</td>
<td>Acreedor</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HLSaldoActual" Style="white-space: pre;" runat="server" Text='<%# Eval("SaldoActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<asp:Label ID="LbSaldoActual" Style="white-space: pre;" runat="server"></asp:Label>
</ItemTemplate>
<ItemStyle Width="120" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<HeaderStyle Font-Bold="true" HorizontalAlign="Center" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

View File

@@ -0,0 +1,245 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Contabilidad2_RepBalanzaComprobacion
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("IdCuenta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("IdCuenta") = value
End Set
End Property
Private Property ModoImpresion As Boolean
Get
ModoImpresion = CType(ViewState("ModoImpresion"), Boolean)
End Get
Set(value As Boolean)
ViewState("ModoImpresion") = 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
ModoImpresion = False
TxtFechaDel.Text = DateSerial(Year(Now), Month(Now), 1).ToShortDateString
TxtFechaAl.Text = Date.Now.ToShortDateString
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
FechaInicio = DateSerial(Year(FechaFin), Month(FechaFin), 1)
ErrorParametros = False
End If
'End If
End If
'DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
'DdlSubproyecto.DataBind()
If Not ErrorParametros Then
CargaDatos()
End If
Else
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
End If
End Sub
#Region "CARGA DATOS Y GRID"
Private Sub CargaDatos()
' Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
If ObjConta.GetBalanzaComprobacion(FechaInicio, FechaFin, DdlTipoCuentas.SelectedValue.ToEntero, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa, 0) Then
DtDatos = ObjConta.DtResultados
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del Anexo del Catálogo", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
CargaGrid()
End Sub
Private Sub CargaGrid()
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate)
FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate)
CargaDatos()
RegistraScript("Enable();")
End Sub
Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'If e.Row.DBCampo("Id").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") = "1" Or e.Row.DBCampo("CtaMayor") = "1" Then
e.Row.ControlStyle.Font.Bold = True
End If
'Acomoda Deudor y Acreedor
If e.Row.DBCampo("CveTipo") = "1" Then
e.Row.FCLabel("LbSaldoInicial").Text = String.Format("{0} ", e.Row.DBCampo("SaldoInicial").FormatoNumero)
e.Row.FCLabel("LbSaldoActual").Text = " "
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
'Total general
If e.Row.DBCampo("Id") = "" Then
'e.Row.Cells(2).HorizontalAlign = HorizontalAlign.NotSet
'Dim TotSaldoID, TotSaldoIA As Double
e.Row.ControlStyle.Font.Bold = True
e.Row.ControlStyle.Font.Size = 9
e.Row.ControlStyle.Height = 30
e.Row.FCLabel("LbNombre").Text = "Sumas Iguales"
e.Row.FCLabel("LbSaldoInicial").Text = String.Format("{0} <br/>{1}", e.Row.DBCampo("SaldoID").FormatoNumero, e.Row.DBCampo("SaldoIA").FormatoNumero)
e.Row.FCLabel("LbCargos").Text = e.Row.DBCampo("TotalCargos").FormatoNumero
e.Row.FCLabel("LbAbonos").Text = e.Row.DBCampo("TotalAbonos").FormatoNumero
e.Row.FCLabel("LbSaldoActual").Visible = True
e.Row.FCLabel("LbSaldoActual").Text = String.Format("{0} <br/>{1}", e.Row.DBCampo("SaldoAD").FormatoNumero, e.Row.DBCampo("SaldoAA").FormatoNumero)
Else
If ModoImpresion Then e.Row.Cells(5).Text = e.Row.FCHyperLink("HLSaldoActual").Text Else e.Row.FCHyperLink("HLSaldoActual").NavigateUrl = String.Format("/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}", e.Row.DBCampo("ID"), FechaInicio.ToShortDateString, FechaFin.ToShortDateString)
End If
End If
End Sub
Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs) Handles BtnImprimir.Click
ModoImpresion = True
CargaDatos()
ImprimirReporte()
'Using sw As New StringWriter()
' Using hw As New HtmlTextWriter(sw)
' Dim style As StringBuilder = New StringBuilder()
' style.Append("<style> ")
' style.Append(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory & "Styles\EstilosExcel.css"))
' style.Append(" </style> ")
' 'To Export all pages
' 'Gv.AllowPaging = False
' 'Gv.DataBind()
' Tbl.RenderControl(hw)
' Dim sr As New StringReader(sw.ToString())
' Dim pdfDoc As New Document(PageSize.A2, 10.0F, 10.0F, 10.0F, 0.0F)
' Dim htmlparser As New HTMLWorker(pdfDoc)
' PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
' pdfDoc.Open()
' htmlparser.Parse(sr)
' pdfDoc.Close()
' Response.ContentType = "application/pdf"
' Response.AddHeader("content-disposition", "attachment;filename=BalanzaComprobacion.pdf")
' Response.Cache.SetCacheability(HttpCacheability.NoCache)
' Response.Write(style.ToString)
' Response.Write(pdfDoc)
' Response.[End]()
' End Using
'End Using
End Sub
'No quitar porque no funciona el exporta PDF
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
' Verifies that the control is rendered
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
'GvDatos.ExportToExcel("BalanzaComprobacion")
ImprimirReporte("Excel")
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
'ubicacion del rdlc
Dim reportpath As String = "Contabilidad/Reportes/RepBalanzaComprobacion.rdlc"
'nombre del reporte
Dim fileName As String = "BalanzaComprobacion"
'parametros a enviar al reporte
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
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("pFechaIni", FechaInicio.ToString("dd/MM/yyyy")))
ImprimirPDF(reportpath, DtDatos, params, fileName, Formato)
End Sub
End Class

View File

@@ -0,0 +1,163 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepBalanzaComprobacionSAT.aspx.vb" Inherits="Contabilidad2_RepBalanzaComprobacion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />&nbsp; &nbsp;--%>
</li>
<li>
<asp:LinkButton ID="BtnImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
<%--<asp:ImageButton ID="BtnImprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" Visible="true" /> &nbsp;--%>
</li>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
Balanza de Comprobación
<asp:Label runat="server" ID="LbTitulo"></asp:Label>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" CssClass="btn btn-default" runat="server" Text="Consultar" Width="100px" OnClick="BtnConsultar_Click" />
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Fecha Inicio:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaDel" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioDel" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton></span>
<ajax:MaskedEditExtender ID="MEEFechaDel" runat="server" TargetControlID="TxtFechaDel" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioDel" runat="server" TargetControlID="TxtFechaDel" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<label class="col-md-1 truncate">Fecha Fin:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAl" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioAl" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton></span>
<ajax:MaskedEditExtender ID="MEEFechaAl" runat="server" TargetControlID="TxtFechaAl" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioAl" runat="server" TargetControlID="TxtFechaAl" PopupButtonID="ImgCalendarioAl" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<label class="col-md-1 truncate">Cuentas:</label>
<div class="col-md-2">
<asp:DropDownList CssClass="form-control input-sm" runat="server" ID="DdlTipoCuentas" Width="150px">
<asp:ListItem Text="Todas" Value="1" />
<asp:ListItem Text="Con Movimientos" Value="2" />
<asp:ListItem Text="Saldo Actual no igual a cero" Value="3" />
<asp:ListItem Text="Con Movimientos y saldo no igual a cero" Value="4" />
<asp:ListItem Text="Con Movimientos o saldo no igual a cero " Value="5" />
</asp:DropDownList>
</div>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2" runat="server" id="tdTipoReporte" visible="true">
<div class="row">
<label class="col-md-3 truncate">Tipo:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm" runat="server">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementarias" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementarias" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<table id="Tbl" runat="server" style="width: 1000px; float: left;">
<tr>
<td width="100%" padding="0">
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" CssClass="table table-advance table-striped table-hover Widthall" runat="server" GridLines="None" EmptyDataText="No se encontraron cuentas con los parametros establecidos." AutoGenerateColumns="False" OnRowDataBound="GvIngresos_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Cuenta" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbCodigo" runat="server" Text='<%# Eval("CodigoSAT")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="180" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("NombreSAT")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="320" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<table width="100%">
<tr>
<td colspan="2">Saldos Iniciales</td>
</tr>
<tr>
<td>Deudor</td>
<td>Acreedor</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LbSaldoInicial" Style="white-space: pre;" runat="server" Text='<%# Eval("SaldoInicial", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="120" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Cargos">
<ItemTemplate>
<asp:Label ID="LbCargos" runat="server" Text='<%# Eval("Cargos", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="120" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Abonos">
<ItemTemplate>
<asp:Label ID="LbAbonos" runat="server" Text='<%# Eval("Abonos", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="120" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<table width="100%">
<tr>
<td colspan="2">Saldos Actuales</td>
</tr>
<tr>
<td>Deudor</td>
<td>Acreedor</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HLSaldoActual" Style="white-space: pre;" runat="server" Text='<%# Eval("SaldoActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<asp:Label ID="LbSaldoActual" Style="white-space: pre;" runat="server"></asp:Label>
</ItemTemplate>
<ItemStyle Width="120" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<HeaderStyle Font-Bold="true" HorizontalAlign="Center" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Content>

View File

@@ -0,0 +1,244 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Contabilidad2_RepBalanzaComprobacion
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("IdCuenta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("IdCuenta") = value
End Set
End Property
Private Property ModoImpresion As Boolean
Get
ModoImpresion = CType(ViewState("ModoImpresion"), Boolean)
End Get
Set(value As Boolean)
ViewState("ModoImpresion") = 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
ModoImpresion = False
TxtFechaDel.Text = DateSerial(Year(Now), Month(Now), 1).ToShortDateString
TxtFechaAl.Text = Date.Now.ToShortDateString
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
FechaInicio = DateSerial(Year(FechaFin), Month(FechaFin), 1)
ErrorParametros = False
End If
'End If
End If
'DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
'DdlSubproyecto.DataBind()
If Not ErrorParametros Then
CargaDatos()
End If
Else
Dim ObjConta As New ClsContabilidad
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
End If
End Sub
#Region "CARGA DATOS Y GRID"
Private Sub CargaDatos()
' Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
If ObjConta.GetBalanzaComprobacion(FechaInicio, FechaFin, DdlTipoCuentas.SelectedValue.ToEntero, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa, 1) Then
DtDatos = ObjConta.DtResultados
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.DataBind()
UpDatos.Update()
End Sub
#End Region
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate)
FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate)
CargaDatos()
RegistraScript("Enable();")
End Sub
Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'If e.Row.DBCampo("Id").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") = "1" Or e.Row.DBCampo("CtaMayor") = "1" Then
' e.Row.ControlStyle.Font.Bold = True
'End If
'Acomoda Deudor y Acreedor
'If e.Row.DBCampo("CveTipo") = "1" Then
' e.Row.FCLabel("LbSaldoInicial").Text = String.Format("{0} ", e.Row.DBCampo("SaldoInicial").FormatoNumero)
' e.Row.FCLabel("LbSaldoActual").Text = " "
'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
'Total general
If e.Row.DBCampo("CodigoSAT") = "" Then
'e.Row.Cells(2).HorizontalAlign = HorizontalAlign.NotSet
'Dim TotSaldoID, TotSaldoIA As Double
e.Row.ControlStyle.Font.Bold = True
e.Row.ControlStyle.Font.Size = 9
e.Row.ControlStyle.Height = 30
e.Row.FCLabel("LbNombre").Text = "Sumas Iguales"
'e.Row.FCLabel("LbSaldoInicial").Text = String.Format("{0} <br/>{1}", e.Row.DBCampo("SaldoID").FormatoNumero, e.Row.DBCampo("SaldoIA").FormatoNumero)
'e.Row.FCLabel("LbCargos").Text = e.Row.DBCampo("TotalCargos").FormatoNumero
'e.Row.FCLabel("LbAbonos").Text = e.Row.DBCampo("TotalAbonos").FormatoNumero
e.Row.FCLabel("LbSaldoActual").Visible = True
'e.Row.FCLabel("LbSaldoActual").Text = String.Format("{0} <br/>{1}", e.Row.DBCampo("SaldoAD").FormatoNumero, e.Row.DBCampo("SaldoAA").FormatoNumero)
'Else
'If ModoImpresion Then e.Row.Cells(5).Text = e.Row.FCHyperLink("HLSaldoActual").Text Else e.Row.FCHyperLink("HLSaldoActual").NavigateUrl = String.Format("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("ID"), FechaFin.ToShortDateString)
End If
End If
End Sub
Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs) Handles BtnImprimir.Click
ModoImpresion = True
CargaDatos()
ImprimirReporte()
'Using sw As New StringWriter()
' Using hw As New HtmlTextWriter(sw)
' Dim style As StringBuilder = New StringBuilder()
' style.Append("<style> ")
' style.Append(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory & "Styles\EstilosExcel.css"))
' style.Append(" </style> ")
' 'To Export all pages
' 'Gv.AllowPaging = False
' 'Gv.DataBind()
' Tbl.RenderControl(hw)
' Dim sr As New StringReader(sw.ToString())
' Dim pdfDoc As New Document(PageSize.A2, 10.0F, 10.0F, 10.0F, 0.0F)
' Dim htmlparser As New HTMLWorker(pdfDoc)
' PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
' pdfDoc.Open()
' htmlparser.Parse(sr)
' pdfDoc.Close()
' Response.ContentType = "application/pdf"
' Response.AddHeader("content-disposition", "attachment;filename=BalanzaComprobacion.pdf")
' Response.Cache.SetCacheability(HttpCacheability.NoCache)
' Response.Write(style.ToString)
' Response.Write(pdfDoc)
' Response.[End]()
' End Using
'End Using
End Sub
'No quitar porque no funciona el exporta PDF
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
' Verifies that the control is rendered
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
'GvDatos.ExportToExcel("BalanzaComprobacion")
ImprimirReporte("Excel")
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
'ubicacion del rdlc
Dim reportpath As String = "Contabilidad/Reportes/RepBalanzaComprobacion.rdlc"
'nombre del reporte
Dim fileName As String = "BalanzaComprobacion"
'parametros a enviar al reporte
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
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("pFechaIni", FechaInicio.ToString("dd/MM/yyyy")))
ImprimirPDF(reportpath, DtDatos, params, fileName, Formato)
End Sub
End Class

View File

@@ -0,0 +1,141 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCambiosSituacionFinanciera.aspx.vb" Inherits="AC2_RepCambiosSituacionFinanciera" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Estado de Cambio de Situación Financiera
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="BtnImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>
<%--<img src="/Imagenes/separador02.gif" alt="" />&nbsp;
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />
&nbsp;<img src="/Imagenes/separador02.gif" alt="" />&nbsp;
<asp:ImageButton ID="BtnImprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" />&nbsp;--%>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<%-- <td width="90px">Fecha Inicio:</td>
<td width="120px">
<asp:TextBox ID="TxtFechaDel" Text="" runat="server" TabIndex="1" Width="70px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgCalendarioDel" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaDel" runat="server" TargetControlID="TxtFechaDel" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioDel" runat="server" TargetControlID="TxtFechaDel" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</td>
<td width="80px">Fecha Fin:</td>
<td width="120px">
<asp:TextBox ID="TxtFechaAl" Text="" runat="server" TabIndex="2" Width="70px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgCalendarioAl" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaAl" runat="server" TargetControlID="TxtFechaAl" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioAl" runat="server" TargetControlID="TxtFechaAl" PopupButtonID="ImgCalendarioAl" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</td>--%>
<label class="col-md-1 truncate" style="width: 90px;">Ejercicio:</label>
<div class="col-md-2" style="width: 125px;">
<asp:DropDownList ID="DdlEjercicio" runat="server" CssClass="select2me" DataTextField="Ejercicio" DataValueField="Ejercicio" Width="100px">
</asp:DropDownList> </div>
<div class="col-md-1 " style="text-align: right; font-size: 14px;"><span>Divisor:</span></div>
<div class="col-md-2 ">
<asp:DropDownList Font-Size="14px" runat="server" ID="DdlUnidad" Width="100%">
<asp:ListItem Text="1" Value="1" Selected="True" />
<asp:ListItem Text="1,000" Value="1000" />
<asp:ListItem Text="1,000,000" Value="1000000" />
</asp:DropDownList>
</div>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2" runat="server" id="tdTipoReporte" visible="true">
<div class="row">
<label class="col-md-3 truncate">Tipo:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm" runat="server">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementarias" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementarias" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
<%--PARA REPORTE--%>
<rvweb:ReportViewer ID="rvReporteador" Visible="false" runat="server" Width="100%" Height="600"></rvweb:ReportViewer>
<table id="Tbl" runat="server" style="float: left;">
<tr>
<td width="100%" padding="0">
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" CssClass="table table-advance table-hover tablenobottomborder" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvDatos_RowDataBound" ShowFooter="True">
<Columns>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<div id="Concepto" runat="server">
<asp:Literal ID="LtNombre" Text='<%# Eval("Nombre", "{0:N2}")%>' runat="server" />
</div>
</ItemTemplate>
<ItemStyle Width="500px" HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Origen">
<ItemTemplate>
<asp:Label ID="LbActual" Text='<%# If(Eval("TipoSaldo").ToString = "1", Eval("Saldo", "{0:N2}"), "0") %>' runat="server" />
</ItemTemplate>
<ItemStyle Width="100px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Aplicación">
<ItemTemplate>
<asp:Label ID="LbAnterior" Text='<%# If(Eval("TipoSaldo").ToString = "2", Eval("Saldo", "{0:N2}"), "0") %>' runat="server" />
</ItemTemplate>
<ItemStyle Width="100px" HorizontalAlign="Right" />
</asp:TemplateField>
<%-- <asp:BoundField DataField="Nombre" HeaderText="Cuenta" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="300px"/>
<asp:BoundField DataField="ImporteActual" DataFormatString="{0:N2}" HeaderText="ImporteActual" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px"/>
<asp:BoundField DataField="ImporteAnterior" DataFormatString="{0:N2}" HeaderText="ImporteAnterior" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px"/>--%>
</Columns>
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,265 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports System.IO
Imports Microsoft.Reporting.WebForms
Imports iTextSharp.text
Imports iTextSharp.text.html.simpleparser
Imports iTextSharp.text.pdf
Partial Class AC2_RepCambiosSituacionFinanciera
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 TotalActivoActual As Double
Get
TotalActivoActual = ViewState("TotalActivoActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActivoActual") = value
End Set
End Property
Private Property TotalActivoAnterior As Double
Get
TotalActivoAnterior = ViewState("TotalActivoAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActivoAnterior") = value
End Set
End Property
Private Property TotalPasivoActual As Double
Get
TotalPasivoActual = ViewState("TotalPasivoActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoActual") = value
End Set
End Property
Private Property TotalPasivoAnterior As Double
Get
TotalPasivoAnterior = ViewState("TotalPasivoAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoAnterior") = value
End Set
End Property
Private Property TotalPatrimonioActual As Double
Get
TotalPatrimonioActual = ViewState("TotalPatrimonioActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPatrimonioActual") = value
End Set
End Property
Private Property TotalPatrimonioAnterior As Double
Get
TotalPatrimonioAnterior = ViewState("TotalPatrimonioAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPatrimonioAnterior") = value
End Set
End Property
Private Property TotalPasivoPatrimonioActual As Double
Get
TotalPasivoPatrimonioActual = ViewState("TotalPasivoPatrimonioActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoPatrimonioActual") = value
End Set
End Property
Private Property TotalPasivoPatrimonioAnterior As Double
Get
TotalPasivoPatrimonioAnterior = ViewState("TotalPasivoPatrimonioAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoPatrimonioAnterior") = value
End Set
End Property
Private Property FechaInicioActual As Date
Get
FechaInicioActual = ViewState("FechaInicioActual").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicioActual") = value
End Set
End Property
Private Property FechaFinActual As Date
Get
FechaFinActual = ViewState("FechaFinActual").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFinActual") = value
End Set
End Property
Private Property FechaInicioAnterior As Date
Get
FechaInicioAnterior = ViewState("FechaInicioAnterior").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicioAnterior") = value
End Set
End Property
Private Property FechaFinAnterior As Date
Get
FechaFinAnterior = ViewState("FechaFinAnterior").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFinAnterior") = 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
'TxtFechaDel.Text = DateSerial(Year(Now), Month(Now), 1).ToShortDateString
'TxtFechaAl.Text = Date.Now.ToShortDateString
Dim Clsconta As New ClsContabilidad
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
If Clsconta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = Clsconta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
Clsconta.Dispose()
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValue = Now.Year.ToString
CargaDatos()
End If
End Sub
#Region "CARGA DATOS Y GRID"
Private Sub CargaDatos()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
Dim FechaInicio = String.Format("01/01/{0}", DdlEjercicio.SelectedValue).ToDate
Dim FechaFin = String.Format("31/12/{0}", DdlEjercicio.SelectedValue).ToDate
Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetCambioSituacionFinanciera(FechaInicio, FechaFin, DdlUnidad.SelectedValue.ToEntero, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatos = ObjConta.DtResultados
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del Estado de Cambio de Situación Financiera.", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
CargaGrid()
End Sub
Private Sub CargaGrid()
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
' GvDatos.Caption = String.Format("<div class='Titulos' style='width:100%; height:45px;'>{0}<br/>Estado de Cambios en la Situación Financiera<br/>Al {1}</div>", UsuarioActual.Empresa.Empresa, DdlEjercicio.SelectedValue)
End Sub
#End Region
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Level") = "1" Then
CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "font-weight: bold;")
e.Row.FCLiteral("LtNombre").Text = String.Format("<br/><br/>{0}", e.Row.DBCampo("Nombre"))
End If
If e.Row.DBCampo("Level") = "2" Then
CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "font-weight: bold;")
e.Row.FCLiteral("LtNombre").Text = String.Format("<br/>{0}{0}{0}{1}", "&nbsp;", e.Row.DBCampo("Nombre"))
End If
If e.Row.DBCampo("Level") = "1" Or e.Row.DBCampo("Level") = "2" Then
e.Row.FCLabel("LbActual").Font.Bold = True
e.Row.FCLabel("LbAnterior").Font.Bold = True
End If
If e.Row.DBCampo("Level") = "3" Then
'CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "margin-left:60px;")
e.Row.FCLiteral("LtNombre").Text = String.Format("{0}{0}{0}{0}{0}{0}{0}{0}{1}", "&nbsp;", e.Row.DBCampo("Nombre"))
End If
End If
End Sub
Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs) Handles BtnImprimir.Click
ImprimirReporte()
End Sub
'No quitar porque no funciona el exporta PDF
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
' Verifies that the control is rendered
End Sub
'Protected Sub GvDatos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowCreated
' If (e.Row.RowType = DataControlRowType.Header) Then
' Dim HeaderGrid As GridView = DirectCast(sender, GridView)
' Dim HeaderGridRow As GridViewRow = New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert)
' Dim HeaderCell As TableCell = New TableCell()
' HeaderCell.Text = String.Format("<div class='Titulos' style='width:100%; height:45px;'>{0}<br/>Estado de Cambios en la Situación Financiera<br/>Al {1}</div>", UsuarioActual.Empresa.Empresa, DdlEjercicio.SelectedValue)
' HeaderCell.ColumnSpan = GvDatos.Columns.Count
' HeaderCell.HorizontalAlign = HorizontalAlign.Center
' HeaderGridRow.Cells.Add(HeaderCell)
' GvDatos.Controls(0).Controls.AddAt(0, HeaderGridRow)
' End If
' If (e.Row.RowType = DataControlRowType.Footer) Then
' Dim HeaderGrid As GridView = DirectCast(sender, GridView)
' Dim HeaderGridRow As GridViewRow = New GridViewRow(0, 0, DataControlRowType.Footer, DataControlRowState.Insert)
' Dim HeaderCell As TableCell = New TableCell()
' HeaderCell.Text = "<table><tr> <td colspan='3' style='height:30px;'> <br/><br/><br/><br/></td></tr><tr><td >_________________________________<br/>C.P. Izelda Angulo Peraza</td><td style='width:75px'> </td><td > _________________________________<br/>Lic. Juan Fortino Leon Robinson</td></tr><tr><td>Subdirector de Contabilidad</td><td style='width:75px'> </td><td>Director General</td></table>"
' HeaderCell.ColumnSpan = GvDatos.Columns.Count
' HeaderCell.HorizontalAlign = HorizontalAlign.Center
' HeaderGridRow.Cells.Add(HeaderCell)
' e.Row.Cells.Clear()
' e.Row.Cells.Add(HeaderCell)
' End If
'End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
ImprimirReporte("Excel")
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
params.Add(New ReportParameter("pEjercicio", DdlEjercicio.SelectedValue.ToString))
params.Add(New ReportParameter("pFirma1", String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de Contabilidad", vbCrLf)))
params.Add(New ReportParameter("pFirma2", String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", vbCrLf)))
ImprimirPDF("AC/Reportes/RepCambiosSituacionFinanciera.rdlc", DtDatos, params, "EdoCambiosSituacionFinanciera", Formato)
End Sub
End Class

View File

@@ -0,0 +1,249 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoActividades.aspx.vb" Inherits="AC_RepEstadoActividades" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtTitulo" Text="Estado de Actividades" runat="server" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
<%--<img src="/Imagenes/separador02.gif" alt="" />&nbsp;
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />&nbsp;--%>
</li>
<li>
<asp:LinkButton ID="Imprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
<%-- <img src="/Imagenes/separador02.gif" alt="" />&nbsp;
<asp:ImageButton ID="Imprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px;" />&nbsp;--%>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<%--<asp:UpdatePanel runat="server" ID="UpFiltros" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline">
<<li>FechaInicio:
<asp:TextBox ID="TxtFechaInicio" runat="server" Width="70px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="imgFechaInicio" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaInicio" runat="server" TargetControlID="TxtFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaInicio" PopupButtonID="ImgFechaInicio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaInicio" runat="server" ControlToValidate="TxtFechaInicio" InitialValue="__/__/____" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Corte''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaInicio" Width="300px"></ajax:ValidatorCalloutExtender>
</li>
<li>FechaFin:
<asp:TextBox ID="TxtFechaFin" runat="server" Width="70px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="imgFechaFin" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaFin" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFechaFin" PopupButtonID="ImgFechaFin" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaFin" runat="server" ControlToValidate="TxtFechaFin" InitialValue="__/__/____" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Corte''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFin" Width="300px"></ajax:ValidatorCalloutExtender>
</li>
<li>Ejercicio:
<asp:DropDownList ID="DdlEjercicio" runat="server" Width="100px">
<asp:ListItem Text="2014" Value="2014"></asp:ListItem>
<asp:ListItem Text="2015" Value="2015"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Periodo:
<asp:DropDownList ID="DdlPeriodo" runat="server" Width="100px">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Firma:
<asp:CheckBox ID="ChkFirma" runat="server" />
</li>
</ul>
</div>
<div class="tools">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnConsultar" runat="server" Text="Filtrar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>--%>
<asp:UpdatePanel runat="server" ID="UpFiltros" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" Text="Consultar" CssClass="btn btn-primary" runat="server" OnClick="BtnConsultar_Click" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<ul class="list-inline text-size-12">
<li>Ejercicio:
</li>
<li>
<asp:DropDownList ID="DdlEjercicio" runat="server" CssClass="select2me" DataTextField="Ejercicio" DataValueField="Ejercicio" Width="100px">
</asp:DropDownList>
</li>
<li>Periodo:
</li>
<li>
<asp:DropDownList ID="DdlPeriodo" runat="server" Width="150px" CssClass="select2me">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</li>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<li runat="server" id="liTipoReporte" visible="false">Tipo:
<asp:DropDownList ID="DdlTipoReporte" runat="server" Width="150px">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementario" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementario" Value="3"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
<table style="width: 100%;" class="table table-striped table-advance table-hover">
<tr>
<td width="100%" padding="0">
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvIngresos" runat="server" AutoGenerateColumns="False" DataKeyNames="" OnRowDataBound="GvIngresos_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Font-Size="14px" Text="INGRESOS Y OTROS BENEFICIOS"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" Width="400px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Período Actual">
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeActual" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Período Acumulado">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeAcumulado" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvGastos" runat="server" AutoGenerateColumns="False" DataKeyNames="" OnRowDataBound="GvGastos_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Font-Size="14px" Text="GASTOS Y OTRAS PÉRDIDAS"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" Width="400px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Período Actual">
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeActual" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Período Acumulado">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeAcumulado" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
<asp:UpdatePanel ID="UPPTotal" runat="server">
<ContentTemplate>
<table class="table table-striped table-hover Widthall">
<tr>
<td align="center">
<h4>Resultados del Ejercicio:</h4>
</td>
<td width="30%" align="right">
<asp:Label runat="server" Font-Bold="true" ID="LbTotalActual"></asp:Label>
</td>
<td width="30%" align="right">
<asp:Label runat="server" Font-Bold="true" ID="LbTotalAnterior"></asp:Label>
</td>
<td width="12%" align="right">
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,325 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Drawing
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class AC_RepEstadoActividades
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 DtIngresos As DataTable
Get
DtIngresos = DirectCast(ViewState("DtIngresos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtIngresos") = value
End Set
End Property
Private Property DtGastos As DataTable
Get
DtGastos = DirectCast(ViewState("DtGastos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtGastos") = value
End Set
End Property
Private Property TotalActual As Double
Get
TotalActual = ViewState("TotalActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActual") = value
End Set
End Property
Private Property TotalAnterior As Double
Get
TotalAnterior = ViewState("TotalAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalAnterior") = value
End Set
End Property
Private Property FechaI As String
Get
Return ViewState("FechaI").ToString
End Get
Set(value As String)
ViewState("FechaI") = value
End Set
End Property
Private Property FechaF As String
Get
Return ViewState("FechaF").ToString
End Get
Set(value As String)
ViewState("FechaF") = value
End Set
End Property
Private Property ReporteComplementario As Boolean
Get
ReporteComplementario = CBool(ViewState("ReporteComplementario").ToString)
End Get
Set(value As Boolean)
ViewState("ReporteComplementario") = 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
ReporteComplementario = False
Else
ReporteComplementario = True
liTipoReporte.Visible = True
LtTitulo.Text = "Estado de Resultados"
End If
TotalActual = 0
TotalAnterior = 0
'TxtFechaInicio.Text = DateSerial(Year(Date.Now), 1, 1).ToShortDateString
'TxtFechaFin.Text = Date.Now.ToShortDateString
CargaEjercicios()
CargaDatos()
End If
End Sub
Private Sub CargaEjercicios()
'Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ClsConta As New ClsContabilidad
If ClsConta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = ClsConta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
ClsConta.Dispose()
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString)
If DdlEjercicio.Items.Count = 0 Then
DdlEjercicio.Items.Add(New ListItem(Now.Year.ToString, Now.Year.ToString))
End If
DdlPeriodo.SelectedValue = Now.Month.ToString
End Sub
Private Sub CargaDatos()
FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero 'If(ReporteComplementario, DdlTipoReporte.SelectedValue.ToEntero, 1)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
If ObjConta.GetEstadoActividades(FechaI.ToDate, FechaF.ToDate, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatos = ObjConta.DtResultados.FiltraParametros("(ImporteActual <> 0 OR ImporteAcumulado <> 0)")
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del Estado de Actividades", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
If DtDatos IsNot Nothing Then
CargaGrids()
SumaTotales()
End If
End Sub
Private Sub CargaGrids()
DtIngresos = DtDatos.FiltraParametros("Tipo ='H' ")
DtGastos = DtDatos.FiltraParametros("Tipo ='G' ")
Dim Row As DataRow = DtIngresos.NewRow
Dim TotalActual = 0.0, TotalAnterior = 0.0
If DtIngresos.Rows.Count > 0 Then
For Each dr As DataRow In DtIngresos.FiltraParametros("NOT CtaMayor in (3,4)").Rows
TotalActual += dr("ImporteActual").ToString.ToDouble
TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble
Next
Row.Item("Nombre") = "TOTAL INGRESOS "
Row.Item("ImporteActual") = TotalActual.ToString
Row.Item("PorcentajeActual") = "100.00"
Row.Item("ImporteAcumulado") = TotalAnterior.ToString
Row.Item("PorcentajeAcumulado") = "100.00"
Row.Item("CtaMayor") = -1
DtIngresos.Rows.Add(Row)
Else
Row.Item("Nombre") = "TOTAL INGRESOS "
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAcumulado") = "0.00"
Row.Item("CtaMayor") = -1
DtIngresos.Rows.Add(Row)
End If
Dim T1 = TotalActual, T2 = TotalAnterior
TotalActual = 0
TotalAnterior = 0
Row = DtGastos.NewRow
If DtGastos.Rows.Count > 0 Then
For Each dr As DataRow In DtGastos.FiltraParametros("NOT CtaMayor in (3,4)").Rows
TotalActual += dr("ImporteActual").ToString.ToDouble
TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble
Next
Row.Item("Nombre") = "TOTAL GASTOS"
Row.Item("ImporteActual") = TotalActual
Row.Item("PorcentajeActual") = If(T1 > 0, (TotalActual * 100 / T1).ToString, "0").FormatoNumero
Row.Item("ImporteAcumulado") = TotalAnterior.ToString
Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnterior * 100 / T2).ToString, "0").FormatoNumero
Row.Item("CtaMayor") = -1
DtGastos.Rows.Add(Row)
Else
Row.Item("Nombre") = "TOTAL GASTOS"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAcumulado") = "0.00"
Row.Item("CtaMayor") = -1
DtGastos.Rows.Add(Row)
End If
GvIngresos.DataSource = DtIngresos
GvIngresos.DataBind()
GvGastos.DataSource = DtGastos
GvGastos.DataBind()
UpDatos.Update()
End Sub
Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click
ImprimirReporte()
End Sub
Private Sub SumaTotales()
'Llena Lb´s Totales
LbTotalActual.Text = TotalActual.ToString.FormatoNumero
LbTotalAnterior.Text = TotalAnterior.ToString.FormatoNumero
LbTotalActual.ForeColor = If(TotalActual < 0, Drawing.Color.Red, Color.Black)
LbTotalAnterior.ForeColor = If(TotalAnterior < 0, Drawing.Color.Red, Color.Black)
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
TotalActual = 0
TotalAnterior = 0
CargaDatos()
End Sub
#Region "GV´S ROW DATA BOUND"
Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalAnterior += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
e.Row.ControlStyle.Font.Bold = True
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
'e.Row.CssClass = "SubTotales3"
e.Row.ControlStyle.Font.Bold = True
End If
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
End If
End Sub
Protected Sub GvGastos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalActual -= e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalAnterior -= e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
e.Row.ControlStyle.Font.Bold = True
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
'e.Row.CssClass = "SubTotales"
e.Row.ControlStyle.Font.Bold = True
End If
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&FI={2}&ER=1", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, e.Row.DBCampo("FechaInicial").ToDate.ToShortDateString)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
End If
End Sub
#End Region
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
ImprimirReporte("Excel")
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource
rds.Name = "DataSet1"
rds.Value = DtIngresos
Dim rds2 As New ReportDataSource
rds2.Name = "DataSet2"
rds2.Value = DtGastos
lrds.Add(rds)
lrds.Add(rds2)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("TotalActual", TotalActual.ToString))
params.Add(New ReportParameter("TotalAnterior", TotalAnterior.ToString))
params.Add(New ReportParameter("lbTotalActual", LbTotalActual.Text))
params.Add(New ReportParameter("lbTotalAnterior", LbTotalAnterior.Text))
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
params.Add(New ReportParameter("pFirma1", ""))
params.Add(New ReportParameter("pFirma2", ""))
params.Add(New ReportParameter("pFechaFin", String.Format("{0} al {1}", FechaI, FechaF)))
ImprimirPDF("AC/Reportes/RepEstadoActividades.rdlc", lrds, params, "EstadoActividades", Formato)
End Sub
End Class

View File

@@ -0,0 +1,254 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoActividadesSAT.aspx.vb" Inherits="AC_RepEstadoActividades" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtTitulo" Text="Estado de Actividades" runat="server" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
<%--<img src="/Imagenes/separador02.gif" alt="" />&nbsp;
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />&nbsp;--%>
</li>
<li>
<asp:LinkButton ID="Imprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
<%-- <img src="/Imagenes/separador02.gif" alt="" />&nbsp;
<asp:ImageButton ID="Imprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px;" />&nbsp;--%>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<%--<asp:UpdatePanel runat="server" ID="UpFiltros" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline">
<<li>FechaInicio:
<asp:TextBox ID="TxtFechaInicio" runat="server" Width="70px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="imgFechaInicio" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaInicio" runat="server" TargetControlID="TxtFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaInicio" PopupButtonID="ImgFechaInicio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaInicio" runat="server" ControlToValidate="TxtFechaInicio" InitialValue="__/__/____" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Corte''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaInicio" Width="300px"></ajax:ValidatorCalloutExtender>
</li>
<li>FechaFin:
<asp:TextBox ID="TxtFechaFin" runat="server" Width="70px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="imgFechaFin" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaFin" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFechaFin" PopupButtonID="ImgFechaFin" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaFin" runat="server" ControlToValidate="TxtFechaFin" InitialValue="__/__/____" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Corte''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFin" Width="300px"></ajax:ValidatorCalloutExtender>
</li>
<li>Ejercicio:
<asp:DropDownList ID="DdlEjercicio" runat="server" Width="100px">
<asp:ListItem Text="2014" Value="2014"></asp:ListItem>
<asp:ListItem Text="2015" Value="2015"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Periodo:
<asp:DropDownList ID="DdlPeriodo" runat="server" Width="100px">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Firma:
<asp:CheckBox ID="ChkFirma" runat="server" />
</li>
</ul>
</div>
<div class="tools">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnConsultar" runat="server" Text="Filtrar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>--%>
<asp:UpdatePanel runat="server" ID="UpFiltros" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" Text="Consultar" CssClass="btn btn-primary" runat="server" OnClick="BtnConsultar_Click" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<ul class="list-inline text-size-12">
<li>Ejercicio:
</li>
<li>
<asp:DropDownList ID="DdlEjercicio" runat="server" CssClass="select2me" DataTextField="Ejercicio" DataValueField="Ejercicio" Width="100px">
</asp:DropDownList>
</li>
<li>Periodo:
</li>
<li>
<asp:DropDownList ID="DdlPeriodo" runat="server" Width="150px" CssClass="select2me">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</li>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<li runat="server" id="liTipoReporte" visible="false">Tipo:
<asp:DropDownList ID="DdlTipoReporte" runat="server" Width="150px">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementario" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementario" Value="3"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Firma:
</li>
<li>
<asp:CheckBox CssClass="make-switchsd" ID="ChkFirma" runat="server" />
</li>
</ul>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
<table style="width: 100%;" class="table table-striped table-advance table-hover">
<tr>
<td width="100%" padding="0">
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvIngresos" runat="server" AutoGenerateColumns="False" DataKeyNames="" OnRowDataBound="GvIngresos_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Font-Size="14px" Text="INGRESOS Y OTROS BENEFICIOS"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" Width="400px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Período Actual">
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeActual" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Período Anterior">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeAcumulado" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvGastos" runat="server" AutoGenerateColumns="False" DataKeyNames="" OnRowDataBound="GvGastos_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Font-Size="14px" Text="GASTOS Y OTRAS PÉRDIDAS"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" Width="400px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Período Actual">
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeActual" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Período Anterior">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeAcumulado" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
<asp:UpdatePanel ID="UPPTotal" runat="server">
<ContentTemplate>
<table class="table table-striped table-hover Widthall">
<tr>
<td align="center">
<h4>Resultados del Ejercicio (Ahorro/Desahorro):</h4>
</td>
<td width="30%" align="right">
<asp:Label runat="server" Font-Bold="true" ID="LbTotalActual"></asp:Label>
</td>
<td width="30%" align="right">
<asp:Label runat="server" Font-Bold="true" ID="LbTotalAnterior"></asp:Label>
</td>
<td width="12%" align="right">
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,326 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Drawing
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class AC_RepEstadoActividades
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 DtIngresos As DataTable
Get
DtIngresos = DirectCast(ViewState("DtIngresos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtIngresos") = value
End Set
End Property
Private Property DtGastos As DataTable
Get
DtGastos = DirectCast(ViewState("DtGastos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtGastos") = value
End Set
End Property
Private Property TotalActual As Double
Get
TotalActual = ViewState("TotalActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActual") = value
End Set
End Property
Private Property TotalAnterior As Double
Get
TotalAnterior = ViewState("TotalAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalAnterior") = value
End Set
End Property
Private Property FechaI As String
Get
Return ViewState("FechaI").ToString
End Get
Set(value As String)
ViewState("FechaI") = value
End Set
End Property
Private Property FechaF As String
Get
Return ViewState("FechaF").ToString
End Get
Set(value As String)
ViewState("FechaF") = value
End Set
End Property
Private Property ReporteComplementario As Boolean
Get
ReporteComplementario = CBool(ViewState("ReporteComplementario").ToString)
End Get
Set(value As Boolean)
ViewState("ReporteComplementario") = 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
ReporteComplementario = False
Else
ReporteComplementario = True
liTipoReporte.Visible = True
LtTitulo.Text = "Estado de Resultados"
End If
TotalActual = 0
TotalAnterior = 0
'TxtFechaInicio.Text = DateSerial(Year(Date.Now), 1, 1).ToShortDateString
'TxtFechaFin.Text = Date.Now.ToShortDateString
CargaEjercicios()
CargaDatos()
End If
End Sub
Private Sub CargaEjercicios()
'Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ClsConta As New ClsContabilidad
If ClsConta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = ClsConta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
ClsConta.Dispose()
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString)
DdlPeriodo.SelectedValue = Now.Month.ToString
End Sub
Private Sub CargaDatos()
FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero 'If(ReporteComplementario, DdlTipoReporte.SelectedValue.ToEntero, 1)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
If ObjConta.GetEstadoActividades(FechaI.ToDate, FechaF.ToDate, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa, 1) Then
DtDatos = ObjConta.DtResultados '.FiltraParametros("(ImporteActual <> 0 OR ImporteAcumulado <> 0)")
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del Estado de Actividades", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
If DtDatos IsNot Nothing Then
CargaGrids()
SumaTotales()
End If
End Sub
Private Sub CargaGrids()
DtIngresos = DtDatos.FiltraParametros("CodigoSAT Like '4%'")
DtGastos = DtDatos.FiltraParametros("CodigoSAT not Like '4%'")
Dim Row As DataRow = DtIngresos.NewRow
TotalActual = 0.0
TotalAnterior = 0.0
If DtIngresos.Rows.Count > 0 Then
For Each dr As DataRow In DtIngresos.Rows '.FiltraParametros("CtaMayor = 3").Rows
TotalActual += dr("ImporteActual").ToString.ToDouble
TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble
Next
Row.Item("Nombre") = "TOTAL INGRESOS "
Row.Item("ImporteActual") = TotalActual.ToString
Row.Item("PorcentajeActual") = "100.00"
Row.Item("ImporteAcumulado") = TotalAnterior.ToString
Row.Item("PorcentajeAcumulado") = "100.00"
'Row.Item("CtaMayor") = -1
DtIngresos.Rows.Add(Row)
Else
Row.Item("Nombre") = "TOTAL INGRESOS "
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAcumulado") = "0.00"
' Row.Item("CtaMayor") = -1
DtIngresos.Rows.Add(Row)
End If
Dim T1 = TotalActual, T2 = TotalAnterior
TotalActual = 0
TotalAnterior = 0
Row = DtGastos.NewRow
If DtGastos.Rows.Count > 0 Then
For Each dr As DataRow In DtGastos.Rows '.FiltraParametros("CtaMayor = 3").Rows
TotalActual += dr("ImporteActual").ToString.ToDouble
TotalAnterior += dr("ImporteAcumulado").ToString.ToDouble
Next
Row.Item("Nombre") = "TOTAL GASTOS"
Row.Item("ImporteActual") = TotalActual
Row.Item("PorcentajeActual") = If(T1 > 0, (TotalActual * 100 / T1).ToString, "0").FormatoNumero
Row.Item("ImporteAcumulado") = TotalAnterior.ToString
Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnterior * 100 / T2).ToString, "0").FormatoNumero
'Row.Item("CtaMayor") = -1
DtGastos.Rows.Add(Row)
Else
Row.Item("Nombre") = "TOTAL GASTOS"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAcumulado") = "0.00"
'Row.Item("CtaMayor") = -1
DtGastos.Rows.Add(Row)
End If
TotalActual = TotalActual - T1
TotalAnterior = TotalAnterior - T2
GvIngresos.DataSource = DtIngresos
GvIngresos.DataBind()
GvGastos.DataSource = DtGastos
GvGastos.DataBind()
UpDatos.Update()
End Sub
Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click
ImprimirReporte()
End Sub
Private Sub SumaTotales()
'Llena Lb´s Totales
LbTotalActual.Text = TotalActual.ToString.FormatoNumero
LbTotalAnterior.Text = TotalAnterior.ToString.FormatoNumero
LbTotalActual.ForeColor = If(TotalActual < 0, Drawing.Color.Red, Color.Black)
LbTotalAnterior.ForeColor = If(TotalAnterior < 0, Drawing.Color.Red, Color.Black)
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
TotalActual = 0
TotalAnterior = 0
CargaDatos()
SumaTotales()
End Sub
#Region "GV´S ROW DATA BOUND"
Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
' TotalActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
' TotalAnterior += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble
' 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
' 'e.Row.ControlStyle.ForeColor = Drawing.Color.White
' e.Row.ControlStyle.Font.Bold = True
'ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
' 'e.Row.CssClass = "SubTotales3"
' e.Row.ControlStyle.Font.Bold = True
'End If
'If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
' e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
' e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
'End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
End If
End Sub
Protected Sub GvGastos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
' TotalActual -= e.Row.DBCampo("ImporteActual").ToString.ToDouble
' TotalAnterior -= e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble
' e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
' e.Row.ControlStyle.ForeColor = Drawing.Color.White
' e.Row.ControlStyle.Font.Bold = True
'ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
' e.Row.CssClass = "SubTotales"
' e.Row.ControlStyle.Font.Bold = True
'End If
'If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
' e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
' e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
'End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
End If
End Sub
#End Region
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
ImprimirReporte("Excel")
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource
rds.Name = "DataSet1"
rds.Value = DtIngresos
Dim rds2 As New ReportDataSource
rds2.Name = "DataSet2"
rds2.Value = DtGastos
lrds.Add(rds)
lrds.Add(rds2)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("TotalActual", TotalActual.ToString))
params.Add(New ReportParameter("TotalAnterior", TotalAnterior.ToString))
params.Add(New ReportParameter("lbTotalActual", LbTotalActual.Text))
params.Add(New ReportParameter("lbTotalAnterior", LbTotalAnterior.Text))
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
params.Add(New ReportParameter("pFirma1", If(ChkFirma.Checked, String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de Contabilidad", vbCrLf), "")))
params.Add(New ReportParameter("pFirma2", If(ChkFirma.Checked, String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", vbCrLf), "")))
params.Add(New ReportParameter("pFechaFin", String.Format("{0} al {1}", FechaI, FechaF)))
ImprimirPDF("AC/Reportes/RepEstadoActividades.rdlc", lrds, params, "EstadoActividades", Formato)
End Sub
End Class

View File

@@ -0,0 +1,563 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoResultados.aspx.vb" Inherits="Contabilidad2_RepEstadoResultados" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="CSS" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="E" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function pageLoad() {
$(document).ready(function () {
gridviewScrollMensual();
gridviewScrollAnual();
});
function gridviewScrollMensual() {
var Tam = TamañoVentana();
var Alto = Tam.height - 250;
$('#<%=GvDatosMensual.ClientID%>').gridviewScroll({
width: 995,
height: Alto,
freezesize: 1,
headerrowcount: 1
});
}
function gridviewScrollAnual() {
var Tam = TamañoVentana();
var Alto = Tam.height - 250;
$('#<%=GvDatosAnual.ClientID%>').gridviewScroll({
width: 995,
height: Alto,
freezesize: 1,
headerrowcount: 1
});
}
}
</script>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpFiltros" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" CssClass="btn btn-default" Text="Consultar" runat="server" OnClick="BtnConsultar_Click" />
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1" style="width: 60px;">Ejercicio:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlEjercicio" DataTextField="Ejercicio" DataValueField="Ejercicio" CssClass="form-control input-sm" runat="server" Width="70px">
</asp:DropDownList>
</div>
<div class="col-md-2" runat="server" id="TdPeriodo" visible="false">
<div class="row">
<label class="col-md-3 truncate" style="padding-right:2px;">Periodo:</label>
<div class="col-md-7">
<asp:DropDownList ID="DdlPeriodo" CssClass="form-control input-sm" runat="server">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2" runat="server" id="Div1" visible="true">
<div class="row">
<label class="col-md-3 truncate">Tipo:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm" runat="server">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementarias" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementarias" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<div class="col-md-2" runat="server" id="TdSubTotales" visible="false">
<div class="row">
<label class="col-md-4 truncate" style="padding-right:2px;">SubTotales:</label>
<div class="col-md-8">
<asp:DropDownList ID="DdlSubtotales" CssClass="form-control input-sm" runat="server">
<asp:ListItem Text="Sin Subtotales" Value="1"></asp:ListItem>
<asp:ListItem Text="Trimestral" Value="2"></asp:ListItem>
<asp:ListItem Text="Cuatrimestral" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel runat="server">
<ContentTemplate>
<ajax:TabContainer runat="server" ID="TabContainer" AutoPostBack="true" OnActiveTabChanged="TabContainer_ActiveTabChanged">
<%--NORMAL--%>
<ajax:TabPanel HeaderText="Estado de Resultados" ID="TabNormal" runat="server">
<ContentTemplate>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<table style="width: 100%;" class="table">
<tr>
<td width="100%" padding="0">
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvIngresos" runat="server" AutoGenerateColumns="False" DataKeyNames="" OnRowDataBound="GvIngresos_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Font-Size="14px" Text="INGRESOS Y OTROS BENEFICIOS"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" Width="400px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Período Actual">
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeActual" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Período Acumulado">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeAcumulado" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle> <RowStyle CssClass="Texto" /> <AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvGastos" runat="server" AutoGenerateColumns="False" DataKeyNames="" OnRowDataBound="GvGastos_RowDataBound" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Font-Size="14px" Text="GASTOS Y OTRAS PÉRDIDAS"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" Width="400px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Período Actual">
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeActual" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Período Acumulado">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeAcumulado" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle> <RowStyle CssClass="Texto" /> <AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
<asp:UpdatePanel ID="UpdatePanel3" runat="server" Visible="false">
<ContentTemplate>
<table style="width: 90%;" class="table table-striped table-advance table-hover">
<tr>
<td align="center">
<h3>Resultados del Ejercicio (Ahorro/Desahorro):</h3>
</td>
<td width="120px" align="right">
<asp:Label runat="server" Font-Bold="true" ID="LbTotalActual"></asp:Label>
</td>
<td width="120px" align="right">
<asp:Label runat="server" Font-Bold="true" ID="LbTotalAnterior"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<%--MENSUAL--%>
<ajax:TabPanel HeaderText="Estado de Resultados Mensual" ID="TabMensual" runat="server">
<ContentTemplate>
<asp:UpdatePanel ID="UpDatosMensual" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosMensual" CssClass="table table-advance table-striped table-hover Widthall" runat="server" AutoGenerateColumns="False" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="400" HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Enero">
<ItemTemplate>
<asp:HyperLink ID="HLEnero" runat="server" Text='<%# Eval("Enero", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeEnero" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Febrero">
<ItemTemplate>
<asp:HyperLink ID="HLFebrero" runat="server" Text='<%# Eval("Febrero", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeFebrero" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Marzo">
<ItemTemplate>
<asp:HyperLink ID="HLMarzo" runat="server" Text='<%# Eval("Marzo", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeMarzo" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Subtotal 1er Trimestre">
<ItemTemplate>
<asp:HyperLink ID="HLTrimestral1" runat="server" Text='<%# Eval("Trimestral1", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeTrimestral1" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Abril">
<ItemTemplate>
<asp:HyperLink ID="HLAbril" runat="server" Text='<%# Eval("Abril", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeAbril" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Subtotal 1er Cuatrimestre">
<ItemTemplate>
<asp:HyperLink ID="HLCuatrimestral1" runat="server" Text='<%# Eval("Cuatrimestral1", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeCuatrimestral1" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Mayo">
<ItemTemplate>
<asp:HyperLink ID="HLMayo" runat="server" Text='<%# Eval("Mayo", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeMayo" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Junio">
<ItemTemplate>
<asp:HyperLink ID="HLJunio" runat="server" Text='<%# Eval("Junio", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeJunio" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Subtotal 2do Trimestre">
<ItemTemplate>
<asp:HyperLink ID="HLTrimestral2" runat="server" Text='<%# Eval("Trimestral2", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeTrimestral2" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Julio">
<ItemTemplate>
<asp:HyperLink ID="HLJulio" runat="server" Text='<%# Eval("Julio", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeJulio" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Agosto">
<ItemTemplate>
<asp:HyperLink ID="HLAgosto" runat="server" Text='<%# Eval("Agosto", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeAgosto" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Subtotal 2do Cuatrimestre">
<ItemTemplate>
<asp:HyperLink ID="HLCuatrimestral2" runat="server" Text='<%# Eval("Cuatrimestral2", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeCuatrimestral2" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Septiembre">
<ItemTemplate>
<asp:HyperLink ID="HLSeptiembre" runat="server" Text='<%# Eval("Septiembre", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeSeptiembre" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Subtotal 3er Trimestre">
<ItemTemplate>
<asp:HyperLink ID="HLTrimestral3" runat="server" Text='<%# Eval("Trimestral3", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeTrimestral3" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Octubre">
<ItemTemplate>
<asp:HyperLink ID="HLOctubre" runat="server" Text='<%# Eval("Octubre", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeOctubre" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Noviembre">
<ItemTemplate>
<asp:HyperLink ID="HLNoviembre" runat="server" Text='<%# Eval("Noviembre", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeNoviembre" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Diciembre">
<ItemTemplate>
<asp:HyperLink ID="HLDiciembre" runat="server" Text='<%# Eval("Diciembre", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeDiciembre" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Subtotal 4to Trimestre">
<ItemTemplate>
<asp:HyperLink ID="HLTrimestral4" runat="server" Text='<%# Eval("Trimestral4", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeTrimestral4" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Subtotal 3er Cuatrimestre">
<ItemTemplate>
<asp:HyperLink ID="HLCuatrimestral3" runat="server" Text='<%# Eval("Cuatrimestral3", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeCuatrimestral3" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<%--ANUAL--%>
<ajax:TabPanel HeaderText="Estado de Resultados Anual" ID="TabAnual" runat="server">
<ContentTemplate>
<asp:UpdatePanel ID="UpDatosAnual" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosAnual" CssClass="table table-advance table-striped table-hover Widthall" runat="server" AutoGenerateColumns="False" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="400" HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ano1" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno1" runat="server" Text='<%# Eval("Ano1", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno1" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano2" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno2" runat="server" Text='<%# Eval("Ano2", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno2" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano3" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno3" runat="server" Text='<%# Eval("Ano3", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno3" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano4" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno4" runat="server" Text='<%# Eval("Ano4", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno4" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano5" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno5" runat="server" Text='<%# Eval("Ano5", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno5" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano6" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno6" runat="server" Text='<%# Eval("Ano6", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno6" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano7" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno7" runat="server" Text='<%# Eval("Ano7", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno7" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano8" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno8" runat="server" Text='<%# Eval("Ano8", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno8" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano9" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno9" runat="server" Text='<%# Eval("Ano9", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno9" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano10" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno10" runat="server" Text='<%# Eval("Ano10", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno10" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano11" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno11" runat="server" Text='<%# Eval("Ano11", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno11" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano12" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno12" runat="server" Text='<%# Eval("Ano12", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno12" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano13" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno13" runat="server" Text='<%# Eval("Ano13", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno13" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano14" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno14" runat="server" Text='<%# Eval("Ano14", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno14" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano15" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno15" runat="server" Text='<%# Eval("Ano15", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno15" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano16" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno16" runat="server" Text='<%# Eval("Ano16", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno16" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano17" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno17" runat="server" Text='<%# Eval("Ano17", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno17" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano18" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno18" runat="server" Text='<%# Eval("Ano18", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno18" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano19" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno19" runat="server" Text='<%# Eval("Ano19", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno19" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Ano20" Visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAno20" runat="server" Text='<%# Eval("Ano20", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField Visible="false" HeaderText="%" DataField="PorcentajeAno20" DataFormatString="{0:N2}" ItemStyle-Width="100px" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

View File

@@ -0,0 +1,660 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Contabilidad2_RepEstadoResultados
Inherits ClsPaginas
#Region " PROPIEDADES NORMAL "
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 DtIngresos As DataTable
Get
DtIngresos = DirectCast(ViewState("DtIngresos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtIngresos") = value
End Set
End Property
Private Property DtGastos As DataTable
Get
DtGastos = DirectCast(ViewState("DtGastos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtGastos") = value
End Set
End Property
Private Property TotalActual As Double
Get
TotalActual = ViewState("TotalActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActual") = value
End Set
End Property
Private Property TotalAnterior As Double
Get
TotalAnterior = ViewState("TotalAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalAnterior") = value
End Set
End Property
Private Property FechaI As String
Get
Return ViewState("FechaI").ToString
End Get
Set(value As String)
ViewState("FechaI") = value
End Set
End Property
Private Property FechaF As String
Get
Return ViewState("FechaF").ToString
End Get
Set(value As String)
ViewState("FechaF") = value
End Set
End Property
Private Property ReporteComplementario As Boolean
Get
ReporteComplementario = CBool(ViewState("ReporteComplementario").ToString)
End Get
Set(value As Boolean)
ViewState("ReporteComplementario") = value
End Set
End Property
#End Region
#Region " PROPIEDADES MENSUAL "
Private Property DtDatosMensual As DataTable
Get
DtDatosMensual = DirectCast(ViewState("DtDatosMensual"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatosMensual") = value
End Set
End Property
#End Region
#Region " PROPIEDADES ANUAL "
Private Property DtDatosAnual As DataTable
Get
DtDatosAnual = DirectCast(ViewState("DtDatosAnual"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatosAnual") = value
End Set
End Property
Private Property Anos As Integer
Get
Anos = ViewState("Anos").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("Anos") = value
End Set
End Property
#End Region
#Region " PROPIEDADES"
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
'tdTipoReporte.Visible = True
TipoReporte = 1
CargaDatosGenerales()
DdlEjercicio.SelectedValue = Now.Year.ToString
Anos = 0
'Normal
TotalActual = 0
TotalAnterior = 0
DdlPeriodo.SelectedValue = Now.Month.ToString
TabContainer_ActiveTabChanged(TabContainer, EventArgs.Empty)
End If
End Sub
Private Sub CargaDatosGenerales()
'Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ClsConta As New ClsContabilidad
If ClsConta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = ClsConta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
ClsConta.Dispose()
DdlEjercicio.DataBind()
End Sub
#Region " NORMAL "
Private Sub CargaDatos()
FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
Dim ObjConta As New ClsContabilidad
If ObjConta.GetEstadoActividades(FechaI.ToDate, FechaF.ToDate, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatos = ObjConta.DtResultados.FiltraParametros("(ImporteActual <> 0 OR ImporteAcumulado <> 0)")
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del Estado de Actividades", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
If DtDatos IsNot Nothing Then
CargaGrids()
SumaTotales()
End If
End Sub
Private Sub CargaGrids()
DtIngresos = DtDatos.FiltraParametros("Orden Like '0004%' OR Tipo = 'H'")
DtGastos = DtDatos.FiltraParametros("Orden Like '0005%' OR Tipo = 'G'")
Dim Row As DataRow = DtIngresos.NewRow
Dim TotalActualLocal = 0.0, TotalAnteriorLocal = 0.0
If DtIngresos.Rows.Count > 0 Then
For Each dr As DataRow In DtIngresos.FiltraParametros("CtaMayor = 1").Rows
TotalActualLocal += dr("ImporteActual").ToString.ToDouble
TotalAnteriorLocal += dr("ImporteAcumulado").ToString.ToDouble
Next
Row.Item("Nombre") = "TOTAL INGRESOS "
Row.Item("ImporteActual") = TotalActualLocal.ToString
Row.Item("PorcentajeActual") = "100"
Row.Item("ImporteAcumulado") = TotalAnteriorLocal.ToString
Row.Item("PorcentajeAcumulado") = "100"
Row.Item("CtaMayor") = -1
DtIngresos.Rows.Add(Row)
Else
Row.Item("Nombre") = "TOTAL INGRESOS "
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAcumulado") = "0.00"
Row.Item("CtaMayor") = -1
DtIngresos.Rows.Add(Row)
End If
Dim T1 = TotalActualLocal, T2 = TotalAnteriorLocal
TotalActual = TotalActualLocal
TotalAnterior = TotalAnteriorLocal
TotalActualLocal = 0
TotalAnteriorLocal = 0
Row = DtGastos.NewRow
If DtGastos.Rows.Count > 0 Then
For Each dr As DataRow In DtGastos.FiltraParametros("CtaMayor = 1").Rows
TotalActualLocal += dr("ImporteActual").ToString.ToDouble
TotalAnteriorLocal += dr("ImporteAcumulado").ToString.ToDouble
Next
Row.Item("Nombre") = "TOTAL GASTOS"
Row.Item("ImporteActual") = TotalActualLocal
Row.Item("PorcentajeActual") = If(T1 > 0, (TotalActualLocal * 100 / T1).ToString, "0").FormatoNumero
Row.Item("ImporteAcumulado") = TotalAnteriorLocal.ToString
Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnteriorLocal * 100 / T2).ToString, "0").FormatoNumero
Row.Item("CtaMayor") = -1
DtGastos.Rows.Add(Row)
Else
Row.Item("Nombre") = "TOTAL GASTOS"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAcumulado") = "0.00"
Row.Item("CtaMayor") = -1
DtGastos.Rows.Add(Row)
End If
TotalActual -= TotalActualLocal
TotalAnterior -= TotalAnteriorLocal
'INSERTA UTILIDAD
Row = DtGastos.NewRow
Row.Item("Nombre") = "Utilidad (o Pérdida)"
Row.Item("ImporteActual") = TotalActual
Row.Item("PorcentajeActual") = If(T1 > 0, (TotalActual * 100 / T1).ToString, "0").FormatoNumero
Row.Item("ImporteAcumulado") = TotalAnterior.ToString
Row.Item("PorcentajeAcumulado") = If(T2 > 0, (TotalAnterior * 100 / T2).ToString, "0").FormatoNumero
Row.Item("CtaMayor") = -2
DtGastos.Rows.Add(Row)
GvIngresos.DataSource = DtIngresos
GvIngresos.DataBind()
GvGastos.DataSource = DtGastos
GvGastos.DataBind()
UpDatos.Update()
End Sub
Private Sub SumaTotales()
'Llena Lb´s Totales
LbTotalActual.Text = TotalActual.ToString.FormatoNumero
LbTotalAnterior.Text = TotalAnterior.ToString.FormatoNumero
LbTotalActual.ForeColor = If(TotalActual < 0, Drawing.Color.Red, Drawing.Color.Black)
LbTotalAnterior.ForeColor = If(TotalAnterior < 0, Drawing.Color.Red, Drawing.Color.Black)
End Sub
#Region "GV´S ROW DATA BOUND"
Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
'METODO ANTERIOR
'TotalActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
'TotalAnterior += e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
e.Row.ControlStyle.Font.Bold = True
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
'e.Row.CssClass = "SubTotales3"
e.Row.ControlStyle.Font.Bold = True
End If
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&CM=1&CveSubProyecto={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&CM=1&CveSubProyecto={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, DdlSubproyecto.SelectedValue)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
End If
End Sub
Protected Sub GvGastos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
'METODO ANTERIOR
'TotalActual -= e.Row.DBCampo("ImporteActual").ToString.ToDouble
'TotalAnterior -= e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
e.Row.ControlStyle.Font.Bold = True
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = -2 Then
'e.Row.CssClass = "SubTotales"
e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
End If
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
'e.Row.CssClass = "SubTotales"
e.Row.ControlStyle.Font.Bold = True
End If
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&CM=1&CveSubProyecto={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&CM=1&CveSubProyecto={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, DdlSubproyecto.SelectedValue)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
End If
End Sub
#End Region
#End Region
#Region " MENSUAL "
Private Sub CargaDatosMensual()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetEstadoResultadosMensual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatosMensual = ObjConta.DtResultados
Else
DtDatosMensual = Nothing
Alert("Ocurrio un error al cargar los datos del estado de resultados", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
EscondeSubtotales()
If DtDatosMensual IsNot Nothing Then
CargaGridMensual()
End If
End Sub
Private Sub EscondeSubtotales()
'Esconde Trimestral
GvDatosMensual.Columns(7).Visible = False
GvDatosMensual.Columns(8).Visible = False
GvDatosMensual.Columns(17).Visible = False
GvDatosMensual.Columns(18).Visible = False
GvDatosMensual.Columns(27).Visible = False
GvDatosMensual.Columns(28).Visible = False
GvDatosMensual.Columns(35).Visible = False
GvDatosMensual.Columns(36).Visible = False
'Esconde Cuatrimestral
GvDatosMensual.Columns(11).Visible = False
GvDatosMensual.Columns(12).Visible = False
GvDatosMensual.Columns(23).Visible = False
GvDatosMensual.Columns(24).Visible = False
GvDatosMensual.Columns(37).Visible = False
GvDatosMensual.Columns(38).Visible = False
If DdlSubtotales.SelectedValue = "2" Then
GvDatosMensual.Columns(7).Visible = True
GvDatosMensual.Columns(8).Visible = True
GvDatosMensual.Columns(17).Visible = True
GvDatosMensual.Columns(18).Visible = True
GvDatosMensual.Columns(27).Visible = True
GvDatosMensual.Columns(28).Visible = True
GvDatosMensual.Columns(35).Visible = True
GvDatosMensual.Columns(36).Visible = True
ElseIf DdlSubtotales.SelectedValue = "3" Then
GvDatosMensual.Columns(11).Visible = True
GvDatosMensual.Columns(12).Visible = True
GvDatosMensual.Columns(23).Visible = True
GvDatosMensual.Columns(24).Visible = True
GvDatosMensual.Columns(37).Visible = True
GvDatosMensual.Columns(38).Visible = True
End If
End Sub
Private Sub CargaGridMensual()
GvDatosMensual.DataSource = DtDatosMensual
GvDatosMensual.DataBind()
UpDatosMensual.Update()
End Sub
Protected Sub GvDatosMensual_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosMensual.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("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/01/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLFebrero").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/02/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLMarzo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/03/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLAbril").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/04/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLMayo").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/05/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLJunio").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/06/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLJulio").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/07/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLAgosto").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/08/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLSeptiembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("09/01/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLOctubre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/10/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLNoviembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/11/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLDiciembre").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/12/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLTrimestral1").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/01/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/03/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLTrimestral2").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/04/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/06/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLTrimestral3").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/07/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/09/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLTrimestral4").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/10/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/12/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLCuatrimestral1").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/01/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/04/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLCuatrimestral2").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/05/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/08/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
e.Row.FCHyperLink("HLCuatrimestral3").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CM=1&CveSubProyecto={3}", e.Row.DBCampo("CveCuenta"), String.Format("01/09/{0}", DdlEjercicio.SelectedValue.ToString), String.Format("01/12/{0}", DdlEjercicio.SelectedValue.ToString).ToDate.LastDayOfMonth.ToShortDateString, TipoReporte, DdlSubproyecto.SelectedValue)
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
#End Region
#Region " ANUAL "
Private Sub CargaDatosAnual()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetEstadoResultadosAnual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatosAnual = ObjConta.DtResultados
Else
DtDatosAnual = Nothing
Alert("Ocurrio un error al cargar los datos del balance general anual", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
Anos = (Year(Date.Now) - DdlEjercicio.SelectedValue.ToEntero) + 1
'Esconde todo
For index = 1 To 40 Step 2
GvDatosAnual.Columns(index).Visible = False
GvDatosAnual.Columns(index + 1).Visible = False
Next
Dim i = 0
For index = 1 To Anos * 2 Step 2
GvDatosAnual.Columns(index).Visible = True
GvDatosAnual.Columns(index + 1).Visible = True
GvDatosAnual.Columns(index).HeaderText = (DdlEjercicio.SelectedValue.ToEntero + i).ToString
i = i + 1
Next
If DtDatosAnual IsNot Nothing Then
CargaGridAnual()
End If
End Sub
Private Sub CargaGridAnual()
GvDatosAnual.DataSource = DtDatosAnual
GvDatosAnual.DataBind()
UpDatosAnual.Update()
End Sub
Protected Sub GvDatosAnual_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosAnual.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 4 Then
For index = 1 To Anos
e.Row.FCHyperLink("HLAno" + index.ToString).Text = ""
e.Row.Cells(index + index).Text = ""
Next
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;")
e.Row.FCLabel("LbNombre").Font.Italic = True
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
For index = 1 To Anos
e.Row.FCHyperLink("HLAno" + index.ToString).NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}&CM=1&CveSubProyecto={4}", e.Row.DBCampo("CveCuenta"), String.Format("01/01/{0}", (DdlEjercicio.SelectedValue.ToEntero + index - 1).ToString), String.Format("31/12/{0}", (DdlEjercicio.SelectedValue.ToEntero + index - 1).ToString), TipoReporte, DdlSubproyecto.SelectedValue)
Next
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").Attributes.Add("style", "padding-left: 10px;")
e.Row.FCLabel("LbNombre").Font.Italic = True
End If
'SUMAS
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 6 Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
End If
End Sub
#End Region
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
'Nota:
' 0 = Normal
' 1 = Mensual
' 2 = Anual
If TabContainer.ActiveTabIndex = 0 Then
CargaDatos()
ElseIf TabContainer.ActiveTabIndex = 1 Then
CargaDatosMensual()
ElseIf TabContainer.ActiveTabIndex = 2 Then
CargaDatosAnual()
End If
End Sub
Protected Sub TabContainer_ActiveTabChanged(sender As Object, e As EventArgs)
'Nota:
' 0 = Normal
' 1 = Mensual
' 2 = Anual
'Esconde Todo de lo variable de Filtros
TdSubTotales.Visible = False
TdPeriodo.Visible = False
If TabContainer.ActiveTabIndex = 0 Then
TdPeriodo.Visible = True
ElseIf TabContainer.ActiveTabIndex = 1 Then
TdSubTotales.Visible = True
ElseIf TabContainer.ActiveTabIndex = 2 Then
End If
UpFiltros.Update()
BtnConsultar_Click(BtnConsultar, EventArgs.Empty)
End Sub
End Class

View File

@@ -0,0 +1,150 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepFlujoEfectivo.aspx.vb" Inherits="AC2_RepFlujoEfectivo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Estado de Flujo de Efectivo
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="BtnImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>
<%--<img src="/Imagenes/separador02.gif" alt="" />&nbsp;--%>
<%--<img src="/Imagenes/separador02.gif" alt="" />&nbsp;
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />&nbsp;
<img src="/Imagenes/separador02.gif" alt="" />&nbsp;
<asp:ImageButton ID="BtnImprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" />&nbsp;--%>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<div class="col-md-1 "><span>Fecha Inicio:</span></div>
<div class="col-md-1 ">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100% !important; padding: 0px;">
<asp:TextBox Width="80px" ID="TxtFechaDel" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioDel" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaDel" runat="server" TargetControlID="TxtFechaDel" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioDel" runat="server" TargetControlID="TxtFechaDel" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<div class="col-md-1 "><span>Fecha Fin:</span></div>
<div class="col-md-1 ">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100% !important; padding: 0px;">
<asp:TextBox Width="80px" ID="TxtFechaAl" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioAl" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaAl" runat="server" TargetControlID="TxtFechaAl" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioAl" runat="server" TargetControlID="TxtFechaAl" PopupButtonID="ImgCalendarioAl" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<div class="col-md-1 "><span>Divisor:</span></div>
<div class="col-md-1 ">
<asp:DropDownList runat="server" ID="DdlUnidad" CssClass="form-control input-sm">
<asp:ListItem Text="1" Value="1" Selected="True" />
<asp:ListItem Text="1,000" Value="1000" />
<asp:ListItem Text="1,000,000" Value="1000000" />
</asp:DropDownList>
</div>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2" runat="server" id="tdTipoReporte" visible="true">
<div class="row">
<label class="col-md-3 truncate">Tipo:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm" runat="server">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementarias" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementarias" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<table id="Tbl" runat="server" style="width: 100%; float: left;">
<tr>
<td width="100%" padding="0">
<br />
<br />
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" CssClass="table table-advance table-hover tablenobottomborder" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvDatos_RowDataBound" ShowFooter="True">
<Columns>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<div id="Concepto" runat="server">
<asp:Literal ID="LtNombre" Text='<%# Eval("Nombre", "{0:N2}")%>' runat="server" />
</div>
</ItemTemplate>
<ItemStyle Width="500px" HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbActual" Text='<%# Eval("ImporteActual", "{0:N2}")%>' runat="server" />
</ItemTemplate>
<ItemStyle Width="100px" HorizontalAlign="Right" />
<HeaderTemplate>
<asp:Label ID="LbPeriodoActual" runat="server" />
</HeaderTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbAnterior" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' runat="server" />
</ItemTemplate>
<ItemStyle Width="100px" HorizontalAlign="Right" />
<HeaderTemplate>
<asp:Label ID="LbPeriodoAnterior" runat="server" />
</HeaderTemplate>
</asp:TemplateField>
<%-- <asp:BoundField DataField="Nombre" HeaderText="Cuenta" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="300px"/>
<asp:BoundField DataField="ImporteActual" DataFormatString="{0:N2}" HeaderText="ImporteActual" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px"/>
<asp:BoundField DataField="ImporteAnterior" DataFormatString="{0:N2}" HeaderText="ImporteAnterior" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px"/>--%>
</Columns>
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,229 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports System.IO
Imports iTextSharp.text
Imports iTextSharp.text.html.simpleparser
Imports iTextSharp.text.pdf
Partial Class AC2_RepFlujoEfectivo
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 TotalActual As Double
Get
TotalActual = ViewState("TotalActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActual") = value
End Set
End Property
Private Property TotalAnterior As Double
Get
TotalAnterior = ViewState("TotalAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalAnterior") = value
End Set
End Property
Private Property FechaAl As String
Get
FechaAl = ViewState("FechaAl").ToString
End Get
Set(value As String)
ViewState("FechaAl") = 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
TxtFechaDel.Text = DateSerial(Year(Now), Month(Now), 1).ToShortDateString
TxtFechaAl.Text = Date.Now.ToShortDateString
CargaDatos()
End If
End Sub
#Region "CARGA DATOS Y GRID"
Private Sub CargaDatos()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
Dim FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate)
Dim FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate)
FechaAl = TxtFechaAl.Text
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
If ObjConta.GetFlujoEfectivo(FechaInicio, FechaFin, DdlUnidad.SelectedValue.ToEntero, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatos = ObjConta.DtResultados
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del Estado de Flujo de Efectivo", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
'OBTENEMOS TOTALES NETOS DE OPERACIONES PARA INSERTAR DIRECTO
If DtDatos IsNot Nothing Then
TotalActual = DtDatos.FiltraParametros("Codigo = '000040000000000000'").Rows(0)("ImporteActual").ToString.ToDouble - DtDatos.FiltraParametros("Codigo = '000050000000000000'").Rows(0)("ImporteActual").ToString.ToDouble
TotalAnterior = DtDatos.FiltraParametros("Codigo = '000040000000000000'").Rows(0)("ImporteAnterior").ToString.ToDouble - DtDatos.FiltraParametros("Codigo = '000050000000000000'").Rows(0)("ImporteAnterior").ToString.ToDouble
End If
CargaGrid()
End Sub
Private Sub CargaGrid()
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
' GvDatos.Caption = String.Format("<div class='Titulos' style='width:100%; height:45px;'>{0}<br/>Estado de Flujo de Efectivo<br/>Al {1}</div>", UsuarioActual.Empresa.Empresa, TxtFechaAl.Text)
End Sub
#End Region
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'PARA PONER AÑO EN HEADER
If e.Row.RowIndex = 0 Then
GvDatos.HeaderRow.FCLabel("LbPeriodoActual").Text = e.Row.DBCampo("Actual")
GvDatos.HeaderRow.FCLabel("LbPeriodoAnterior").Text = e.Row.DBCampo("Anterior")
End If
'TITULO DE BLOQUE (CABECERAS Y TOTALES)
If e.Row.DBCampo("Level") = "-1" Then
CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "margin-top:20px; ")
e.Row.Font.Bold = True
'CABCERA
If e.Row.DBCampo("CveCuenta") = "12" Then
e.Row.FCLabel("LbActual").Text = ""
e.Row.FCLabel("LbAnterior").Text = ""
End If
'TOTAL OPERACIONES
If e.Row.DBCampo("CveCuenta") = "123" Then
e.Row.FCLabel("LbActual").Text = TotalActual.ToString.FormatoNumero
e.Row.FCLabel("LbAnterior").Text = TotalAnterior.ToString.FormatoNumero
End If
End If
'ORIGEN Y APLICACION
If e.Row.DBCampo("Level") = "0" Then
CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "margin-left:30px; margin-top:15px")
e.Row.Font.Bold = True
End If
'PAPAS
If e.Row.DBCampo("Level") = "2" Then
CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "margin-left: 60px; margin-top:5px;")
End If
'HIJOS
If e.Row.DBCampo("Level") = "3" Then
CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "margin-left:90px;")
End If
'INGRESOS -> ORIGEN
If e.Row.DBCampo("Codigo").ToString.Substring(0, 5) = "00004" Then e.Row.FCLiteral("LtNombre").Text = "ORIGEN"
'GASTOS -> APLICACION
If e.Row.DBCampo("Codigo").ToString.Substring(0, 5) = "00005" Then e.Row.FCLiteral("LtNombre").Text = "APLICACION"
'ACTIVIDADES DE OPERACION
If e.Row.DBCampo("Sup").ToString <> "" Then
If e.Row.DBCampo("ImporteAnterior").ToString.ToDecimal = 0 Then
e.Row.FCLabel("LbAnterior").Text = ""
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDecimal = 0 Then
e.Row.FCLabel("LbActual").Text = ""
End If
End If
End If
End Sub
Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs) Handles BtnImprimir.Click
ImprimirReporte()
End Sub
'No quitar porque no funciona el exporta PDF
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
' Verifies that the control is rendered
End Sub
'Protected Sub GvDatos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowCreated
' If (e.Row.RowType = DataControlRowType.Header) Then
' Dim HeaderGrid As GridView = DirectCast(sender, GridView)
' Dim HeaderGridRow As GridViewRow = New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert)
' Dim HeaderCell As TableCell = New TableCell()
' HeaderCell.Text = String.Format("<div class='Titulos' style='width:100%; height:45px;'>{0}<br/>Estado de Flujo de Efectivo<br/>Al {1}</div>", UsuarioActual.Empresa.Empresa, FechaAl)
' HeaderCell.ColumnSpan = GvDatos.Columns.Count
' HeaderCell.HorizontalAlign = HorizontalAlign.Center
' HeaderGridRow.Cells.Add(HeaderCell)
' GvDatos.Controls(0).Controls.AddAt(0, HeaderGridRow)
' End If
' If (e.Row.RowType = DataControlRowType.Footer) Then
' Dim HeaderGrid As GridView = DirectCast(sender, GridView)
' Dim HeaderGridRow As GridViewRow = New GridViewRow(0, 0, DataControlRowType.Footer, DataControlRowState.Insert)
' Dim HeaderCell As TableCell = New TableCell()
' HeaderCell.Text = "<table><tr> <td colspan='3' style='height:30px;'> <br/><br/><br/><br/></td></tr><tr><td >_________________________________<br/>C.P. Izelda Angulo Peraza</td><td style='width:75px'> </td><td > _________________________________<br/>Lic. Juan Fortino Leon Robinson</td></tr><tr><td>Subdirector de Contabilidad</td><td style='width:75px'> </td><td>Director General</td></table>"
' HeaderCell.ColumnSpan = GvDatos.Columns.Count
' HeaderCell.HorizontalAlign = HorizontalAlign.Center
' HeaderGridRow.Cells.Add(HeaderCell)
' e.Row.Cells.Clear()
' e.Row.Cells.Add(HeaderCell)
' End If
'End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
'GvDatos.ExportToExcel("ReporteFlujoEfectivo" & Now.ToShortDateString)
ImprimirReporte("Excel")
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
params.Add(New ReportParameter("pAl", FechaAl))
params.Add(New ReportParameter("pTotalActual", TotalActual.ToString.FormatoNumero))
params.Add(New ReportParameter("pTotalAnterior", TotalAnterior.ToString.FormatoNumero))
params.Add(New ReportParameter("pFirma1", String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de Contabilidad", vbCrLf)))
params.Add(New ReportParameter("pFirma2", String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", vbCrLf)))
ImprimirPDF("AC/Reportes/RepFlujoEfectivo.rdlc", DtDatos, params, "EdoFlujoEfectivo", Formato)
End Sub
End Class

View File

@@ -0,0 +1,324 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepMovimientosAuxiliaresCatalogo.aspx.vb" Inherits="Conta_RepMovimientosAuxiliaresCatalogo" EnableEventValidation="false" %>
<asp:Content ContentPlaceHolderID="Css" runat="server">
<style>
.truncate {
width: 300px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Generar EXCEL</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="Imprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
Movimientos Auxiliares del Catálogo
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" CssClass="btn btn-default" Text="Consultar" Width="100px" OnClick="BtnConsultar_Click" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1" style="width: 80px; padding-right: 2px;">Fecha Inicio:</label>
<div class="col-md-2" style="width: 110px;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaDel" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioDel" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaDel" runat="server" TargetControlID="TxtFechaDel" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioDel" runat="server" TargetControlID="TxtFechaDel" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaDel" runat="server" ControlToValidate="TxtFechaDel" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha2Del" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaDel" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1" style="width: 75px; padding-right: 2px;">Fecha Fin:</label>
<div class="col-md-2" style="width: 110px;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAl" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioAl" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaAl" runat="server" TargetControlID="TxtFechaAl" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioAl" runat="server" TargetControlID="TxtFechaAl" PopupButtonID="ImgCalendarioAl" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaAl" runat="server" ControlToValidate="TxtFechaAl" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha2Al" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaAl" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1" style="display:none;">Tipo de Cuentas:</label>
<div class="col-md-1" style="display:none;">
<asp:DropDownList ID="DdlTipoCuentas" CssClass="form-control input-sm" runat="server" DataTextField="Nombre" DataValueField="CveCuenta" TabIndex="4" AutoPostBack="true" ClientIDMode="Static">
</asp:DropDownList>
</div>
<label class="col-md-1" style="width: 60px;">Cuenta:</label>
<div class="col-md-4">
<%-- <asp:HiddenField ID="HdnCveCuenta" runat="server" ClientIDMode="Static" />
<asp:TextBox ID="TxtCuenta" CssClass="form-control-input" runat="server" ClientIDMode="Static" Enabled="false" TabIndex="5" onclick="this.setSelectionRange(0, this.value.length)" Width="100"></asp:TextBox>--%>
<asp:DropDownList ID="DdlCuentas" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="CveCuenta" CssClass="form-control input-sm select2me" Enabled="false">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
<label class="col-md-1">Moneda:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlMoneda" CssClass="form-control input-sm" runat="server" DataTextField="Moneda" DataValueField="CveMoneda" TabIndex="5" ClientIDMode="Static" Width="70px">
</asp:DropDownList>
</div>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Width="100px">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2" runat="server" id="tdTipoReporte" visible="true">
<div class="row">
<label class="col-md-3">Tipo:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm" runat="server" Width="100px">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementarias" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementarias" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="text-right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server" style="margin-left: 15px; margin-right: 15px;">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" CssClass="table table-smallpadding table-hover table-striped ScrollAD mysmallbtn Widthall" data-heighterror="375" data-freezecols="0" data-freezerows="-1"
ShowHeader="True" ShowHeaderWhenEmpty="true" AllowPaging="False" ShowFooter="False" GridLines="None" EmptyDataText="No se encontrarios movimientos." AutoGenerateColumns="False" DataKeyNames="" OnRowDataBound="GvDatos_RowDataBound">
<Columns>
<asp:TemplateField ControlStyle-CssClass="Widthall">
<HeaderTemplate>
<table width="100%">
<tr>
<td colspan="3"><font size="2">Cuenta</font></td>
<td colspan="1"><font size="2">Nombre</font></td>
<td colspan="3"></td>
<td><font size="2">Saldo Inicial</font></td>
</tr>
<tr>
<td width="60px" align="center">Fecha</td>
<td width="60px" align="center">Tipo</td>
<td width="60px" align="center">Número</td>
<td width="300px" align="left">Concepto</td>
<td width="100px" align="center">Referencia</td>
<td width="100px" align="center">Cargos</td>
<td width="100px" align="center">Abonos</td>
<td width="100px" align="center">Saldo</td>
</tr>
</table>
<%--<hr />--%>
</HeaderTemplate>
<%-- <HeaderStyle />--%>
<ItemTemplate>
<table width="100%" border="0" style="border-spacing: 0px;">
<tr runat="server" id="tr1">
<td colspan="3" align="left" width="180px">
<asp:Label ID="LbCuenta" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</td>
<td colspan="1" align="left" width="300px">
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</td>
<td colspan="2" width="200px"></td>
<td style="font-weight: normal;" align="right" width="100px">Saldo Inicial:
</td>
<td style="font-weight: normal;" align="right" width="100px">
<asp:Label ID="LbSaldoInicial" runat="server" Text='<%# Eval("SaldoInicial", "{0:N2}")%>'></asp:Label>
</td>
</tr>
<tr runat="server" id="tr2">
<td width="60px" style="border: 0px;" align="center">
<asp:Literal ID="LbFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Literal>
</td>
<td width="60px" style="border: 0px;" align="center">
<asp:Literal ID="LbTipo" runat="server" Text='<%# Eval("TipoPoliza")%>'></asp:Literal>
</td>
<td width="60px" style="border: 0px;" align="center">
<asp:HyperLink ID="HLPoliza" runat="server" Text='<%# Eval("Folio")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbNumero" runat="server" Text='<%# Eval("Folio")%>'></asp:Label>--%>
</td>
<td width="300px" align="left">
<div class="truncate" style="width: 300px;">
<asp:Label ID="LbConcepto" runat="server" CssClass="truncate" Text='<%# Eval("Concepto")%>' title='<%# Eval("Concepto")%>' ></asp:Label>
</div>
</td>
<td width="100px">
<asp:Label ID="LbReferencia" runat="server" Text='<%# Eval("Referencia")%>'></asp:Label>
</td>
<td width="100px" align="right">
<asp:Label ID="LbCargos" runat="server"></asp:Label>
</td>
<td width="100px" align="right">
<asp:Label ID="LbAbonos" runat="server"></asp:Label>
</td>
<td width="100px" align="right">
<asp:Label ID="LbSaldo" runat="server"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
<ItemStyle />
</asp:TemplateField>
</Columns>
<HeaderStyle Font-Bold="true" HorizontalAlign="Center" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
<%-- function pageLoad(sender, args) {
}
$(function () {
//Genero las cuentas en el arreglo
var ArrCuentas = [<%= WSCuentas()%>];
$("#TxtCuenta").autocomplete({
minLength: 0,
source: ArrCuentas,
focus: function (event, ui) {
$("#TxtCuenta").val(ui.item.label);
$("#HdnCveCuenta").val(ui.item.value);
return false;
},
select: function (event, ui) {
$("#TxtCuenta").val(ui.item.label);
$("#HdnCveCuenta").val(ui.item.value);
//$("#project-description").html(ui.item.desc);
//$("#project-icon").attr("src", "images/" + ui.item.icon);
return false;
}
})
//.autocomplete("instance")._renderItem = function (ul, item) {
// return $("<li>")
// .append("<a>" + item.label + "</a>")
// .appendTo(ul);
//};
});
// Al presionar cualquier tecla en cualquier campo de texto, ejectuamos la siguiente funcion
$('input[type=text]').on('keydown', function (e) {
// Si la tecla ENTER es presionada...
if (e.keyCode === 13) {
var currentTabIndex = $(this).attr('tabindex'); // Obtenemos el número del tabindex del campo actual
var nextTabIndex = parseInt(currentTabIndex) + 1; // Le sumamos 1
var nextField = $('[tabindex=' + nextTabIndex + ']'); // Obtenemos (si existe) el siguiente elemento que usando nextTabIndex
if (nextField.length > 0) { // Si se encontró un elemento:
nextField.focus(); // Hacerle focus / seleccionarlo
nextField.select();
e.preventDefault(); // Ignorar el funcionamiento predeterminado (enviar el formulario)
}
}
});
// Al presionar cualquier tecla en cualquier campo de texto, ejectuamos la siguiente funcion
$('select').on('keydown', function (e) {
// Si la tecla ENTER es presionada...
if (e.keyCode === 13) {
var currentTabIndex = $(this).attr('tabindex'); // Obtenemos el número del tabindex del campo actual
var nextTabIndex = parseInt(currentTabIndex) + 1; // Le sumamos 1
var nextField = $('[tabindex=' + nextTabIndex + ']'); // Obtenemos (si existe) el siguiente elemento que usando nextTabIndex
if (nextField.length > 0) { // Si se encontró un elemento:
nextField.focus(); // Hacerle focus / seleccionarlo
nextField.select();
e.preventDefault(); // Ignorar el funcionamiento predeterminado (enviar el formulario)
}
}
});
$('#Buscar').keyup(function () {
var texto = $('#Buscar').val();
$('#<%=GvDatos.ClientID%> > tbody > tr').css({ 'display': 'none' });
$("#<%=GvDatos.ClientID%> > tbody > tr:contains('" + texto + "')").css({ 'display': '' });
$('#<%=GvDatos.ClientID%> > tbody > tr:nth-child(1)').css({ 'display': 'none' });
});--%>
//function Enable() {
// var Producto = $get("DdlTipoCuentas").value;
// if (Producto == "-2") {
// document.getElementById("TxtCuenta").disabled = false;
// //document.getElementById("TxtCuenta").focus();
// //alert(Producto);
// }
// else {
// document.getElementById("TxtCuenta").value = " ";
// document.getElementById("TxtCuenta").disabled = true;
// }
//}
</script>
</asp:Content>

View File

@@ -0,0 +1,484 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Conta_RepMovimientosAuxiliaresCatalogo
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 DtTotales As DataTable
Get
DtTotales = DirectCast(ViewState("DtTotales"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtTotales") = 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 CveSubProyecto As String
' Get
' CveSubProyecto = ViewState("CveSubProyecto").ToString
' End Get
' Set(value As String)
' ViewState("CveSubProyecto") = value
' End Set
'End Property
Private Property IdCuenta As Integer
Get
IdCuenta = ViewState("IdCuenta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("IdCuenta") = value
End Set
End Property
Private Property TotalPadre As Boolean
Get
TotalPadre = CBool(ViewState("TotalPadre"))
End Get
Set(value As Boolean)
ViewState("TotalPadre") = 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 TipoReporte As String
Get
TipoReporte = ViewState("TP").ToString
End Get
Set(value As String)
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
CargaTipoCuentas()
'TxtCuenta.Enabled = False
DdlMoneda.DataSource = GlobalDTMonedas
'DdlMoneda.Dispose()
DdlMoneda.DataBind()
TxtFechaDel.Text = Now.FirstDayOfMonth.ToShortDateString
TxtFechaAl.Text = Now.LastDayOfMonth.ToShortDateString
If Request("CveCuenta") IsNot Nothing AndAlso IsNumeric(Request("CveCuenta")) AndAlso Request("CveCuenta").ToEntero > 0 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
'HdnCveCuenta.Value = IdCuenta.ToString
FechaFin = Request("FF").ToDate
TxtFechaAl.Text = FechaFin.ToShortDateString
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
TxtFechaDel.Text = FechaInicio.ToShortDateString
Else
FechaInicio = DateSerial(Year(FechaFin), Month(FechaFin), 1)
TxtFechaDel.Text = FechaInicio.ToShortDateString
End If
'If Request("CveSubProyecto") IsNot Nothing Then
' If IsNumeric(Request("CveSubProyecto")) Then
' CveSubProyecto = Request("CveSubProyecto").ToString
' End If
'End If
ErrorParametros = False
If Request("TP") IsNot Nothing AndAlso IsNumeric(Request("TP")) AndAlso Request("TP").ToEntero > 0 Then
TipoReporte = Request("TP").ToString
' DdlTipoReporte.SelectedValue = TipoReporte.ToString
End If
''If DdlTipoCuentas.Items.FindByValue(IdCuenta.ToString) IsNot Nothing Then
'' DdlTipoCuentas.SelectedValue = IdCuenta.ToString
''Else
'' DdlTipoCuentas.SelectedValue = "-2"
'' TxtCuenta.Enabled = True
'' If DTCuentas.FiltraParametros(String.Format("Cvecuenta = {0}", IdCuenta)).Rows.Count > 0 Then
'' TxtCuenta.Text = DTCuentas.FiltraParametros(String.Format("CveCuenta = {0}", IdCuenta)).Rows(0)("Codigo").ToString
'' End If
''End If
End If
End If
If Not ErrorParametros Then
TotalPadre = True
TipoReporte = "1"
CargaDatos()
End If
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
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
' Imprimir_click(sender, e)
'RegistraScript("Enable();")
End Sub
#Region "C A R G A - D A T O S"
Public Function WSCuentas() As String
Dim Str As New StringBuilder
Dim i As Integer = 0
Dim dt As DataTable = DTCuentas
For Each dr As DataRow In dt.Rows
i += 1
Str.AppendFormat("{{value:""{0}"",label:""{1}""}}{2}", dr("CveCuenta"), dr("Codigo").ToString.Replace("""", ""), If(i < dt.Rows.Count, ",", ""))
Next
Return Str.ToString
End Function
Private Sub CargaTipoCuentas()
' Dim ObjTipoCuenta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjTipoCuenta As New ClsContabilidad '(UsuarioActual.Empresa)
Dim strGlobal As String = ""
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
If ObjTipoCuenta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa, 1, -1) Then
Dim dr As DataRow = ObjTipoCuenta.DtResultados.FiltroPrimero("Codigo IN ('_GLOBAL')")
If dr IsNot Nothing Then strGlobal = dr.Item(0).ToString
DTCuentas = ObjTipoCuenta.DtResultados
DdlTipoCuentas.DataSource = ObjTipoCuenta.DtResultados.FiltraParametros("Codigo IN ('_ACTIVO', '_BPASIVO', '_CAPITAL', '_CUADRE', '_ESTADISTICAS', '_ORDEN', '_RACREEDOR', '_RDEUDOR', '_UTILIDAD')")
End If
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.SelectedIndex = 1
DdlCuentas.Enabled = True
If ObjTipoCuenta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
DdlCuentas.DataSource = ObjTipoCuenta.DtResultados
End If
ObjTipoCuenta.Dispose()
DdlCuentas.DataBind()
End Sub
Private Sub CargaDatos()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
TipoReporte = DdlTipoReporte.SelectedValue.ToString
If TipoReporte = "1" And DdlCuentas.SelectedValue.ToEntero < 0 Then
Alert("No ha seleccionado cuenta, Favor de especificar una", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
IdCuenta = DdlCuentas.SelectedValue.ToEntero
Dim ObjConta As New ClsContabilidad
If ObjConta.GetMovimientosAuxiliaresCatalogo(IdCuenta, FechaInicio, FechaFin, DdlMoneda.SelectedValue.ToEntero, CveSubProyecto, UsuarioActual.CveEmpresa, TipoReporte) Then
DtDatos = ObjConta.DtResultados
DtTotales = DtDatos.Clone
'InsertaTotales()
CargaGrid()
Else
DtDatos = Nothing
End If
ObjConta.Dispose()
End Sub
#End Region
Private Sub InsertaTotales()
Dim i = 0
Dim Aumento = 0
Dim Row As DataRow
Dim Row2 As DataRow
'Llena DtTotales
For Each dr As DataRow In DtDatos.Rows
If dr("Concepto").ToString = "" Then
Row = DtTotales.NewRow
Row("CveCuenta") = -1
Row("CargosMovto") = If(DdlMoneda.SelectedValue = "1", dr("Cargos"), dr("CargosME"))
Row("AbonosMovto") = If(DdlMoneda.SelectedValue = "1", dr("Abonos"), dr("AbonosME"))
Row("Saldo") = dr("SaldoActual")
Row("CtaMayor") = dr("CtaMayor")
Row("Concepto") = String.Format("Total {0}:", dr("Nombre"))
Row("Nombre") = dr("Nombre")
DtTotales.Rows.Add(Row)
Row("Clasificacion") = i
End If
i += 1
Next
'Inserta Totales en DtDatos
For Each dr As DataRow In DtTotales.Rows
i = 0
If dr("CtaMayor").ToString = "1" Then
DtDatos.ImportRow(dr)
End If
If dr("CtaMayor").ToString = "2" Then
For index = dr("Clasificacion").ToString.ToEntero + Aumento To DtDatos.Rows.Count
If DtDatos.Rows(index)("Nombre").ToString <> dr("Nombre").ToString Then
i = index
Exit For
End If
Next
Row2 = DtDatos.NewRow
Row2.ItemArray = dr.ItemArray
DtDatos.Rows.InsertAt(Row2, i + Aumento)
Aumento += 1
End If
Next
End Sub
#Region "G R I D - GV DATOS"
Private Sub CargaGrid()
GvDatos.DataSource = DtDatos
'GvDatos.Dispose()
GvDatos.DataBind()
UpDatos.Update()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Concepto") = "" Then
e.Row.ControlStyle.Font.Bold = True
e.Row.ControlStyle.Height = 35
'Cuando es Titulo
If e.Row.DBCampo("SaldoActual") = "" Then
CType(e.Row.FindControl("tr2"), HtmlTableRow).Visible = False
'Cuando Es Total
Else
CType(e.Row.FindControl("tr1"), HtmlTableRow).Visible = False
'Anterior para TotalPadre
'If e.Row.DBCampo("CtaMayor").ToString = "2" And (e.Row.DBCampo("Nivel3").ToString <> "" Xor e.Row.DBCampo("Orden").ToString.Length = 18) Then
' e.Row.FCLabel("LbReferencia").Text = "Total:"
'Else
' e.Row.FCLabel("LbConcepto").Text = String.Format("Total {0}:", e.Row.DBCampo("Nombre").ToString)
'End If
If TotalPadre Then
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Width = "1px"
'CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells.Remove(CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3))
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Align = "Right"
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Width = "400px"
If e.Row.RowIndex + 1 = DtDatos.Rows.Count Then
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(4).Attributes.Add("style", "border-top: 1px solid black;")
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(5).Attributes.Add("style", "border-top: 1px solid black;")
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(6).Attributes.Add("style", "border-top: 1px solid black;")
End If
e.Row.FCLabel("LbReferencia").Text = String.Format("Total {0}:", e.Row.DBCampo("Nombre").ToString)
Else
TotalPadre = True
e.Row.FCLabel("LbReferencia").Font.Bold = False
e.Row.FCLabel("LbReferencia").Text = "Total:"
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(4).Align = "Right"
End If
'e.Row.FCLabel("LbReferencia").Text = String.Format("Total {0}:", If(e.Row.DBCampo("CtaMayor").ToString = "2", "", e.Row.DBCampo("Nombre").ToString))
e.Row.FCLabel("LbCargos").Text = e.Row.DBCampo("Cargos").ToString.FormatoNumero(If(DdlMoneda.SelectedValue = "1", 2, 4))
e.Row.FCLabel("LbAbonos").Text = e.Row.DBCampo("Abonos").ToString.FormatoNumero(If(DdlMoneda.SelectedValue = "1", 2, 4))
e.Row.FCLabel("LbSaldo").Text = e.Row.DBCampo("SaldoActual").ToString.FormatoNumero(If(DdlMoneda.SelectedValue = "1", 2, 4))
End If
Else
TotalPadre = False
e.Row.ControlStyle.Font.Bold = False
CType(e.Row.FindControl("tr1"), HtmlTableRow).Visible = False
e.Row.FCHyperLink("HLPoliza").NavigateUrl = String.Format("/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}", e.Row.DBCampo("CvePoliza"))
If e.Row.DBCampo("CargosMovto").ToDouble <> 0 Then e.Row.FCLabel("LbCargos").Text = e.Row.DBCampo("CargosMovto").ToString.FormatoNumero(If(DdlMoneda.SelectedValue = "1", 2, 4))
If e.Row.DBCampo("AbonosMovto").ToDouble <> 0 Then e.Row.FCLabel("LbAbonos").Text = e.Row.DBCampo("AbonosMovto").ToString.FormatoNumero(If(DdlMoneda.SelectedValue = "1", 2, 4))
If e.Row.DBCampo("Saldo").ToDouble <> 0 Then e.Row.FCLabel("LbSaldo").Text = e.Row.DBCampo("Saldo").ToString.FormatoNumero(If(DdlMoneda.SelectedValue = "1", 2, 4))
End If
'COLOREA NEGATIVOS
If e.Row.FCLabel("LbCargos").Text.ToDouble < 0 Then
e.Row.FCLabel("LbCargos").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbCargos").ForeColor = Drawing.Color.Black
End If
If e.Row.FCLabel("LbAbonos").Text.ToDouble < 0 Then
e.Row.FCLabel("LbAbonos").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbAbonos").ForeColor = Drawing.Color.Black
End If
If e.Row.FCLabel("LbSaldo").Text.ToDouble < 0 Then
e.Row.FCLabel("LbSaldo").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbSaldo").ForeColor = Drawing.Color.Black
End If
If e.Row.FCLabel("LbSaldoInicial").Text.ToDouble < 0 Then
e.Row.FCLabel("LbSaldoInicial").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbSaldoInicial").ForeColor = Drawing.Color.Black
End If
End If
End Sub
#End Region
Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.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)
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
'If ObjConta.GetAnexoCatalogo(IdCuenta, FechaInicio, FechaFin) Then
'DtDatos = ObjConta.DtResultados
DtDatos = DtDatos
ImprimirReporte()
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
ImprimirReporte("Excel")
'Dim htmlTabe As New HtmlTable
'Dim RutaLogo As String = $"{UsuarioActual.Empresa.Ruta}Logo.png"
'Dim strinLiteral As String = ""
'Dim EncabezadoLiteral As New LiteralControl
'If System.IO.File.Exists(RutaLogo) Then
' RutaLogo = $"http://{Request.Url.Host }/Empresas/{UsuarioActual.CveEmpresa}/Logo.png"
' strinLiteral = $"<table style='width:{ GvDatos.Width }px'><tr>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'><img width='200px' height='150px' style='max-height:150px!important;max-width:200px!important' src='{RutaLogo}' /> </td>
' <td colspan='3' style='width:70%;height:150px; text-align:center; vertical-align:middle;font-weight: bold; display: block;'><p><span>{UsuarioActual.Empresa.Empresa} </span><br><span> Movimientos Auxiliares del Catálogo<p></td>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'> Fecha:{Now.ToString("dd/MM/yyyy")}</td>
' </tr>
' <tr>
' <td style='text-align:left;' colspan='6'>
' <b>Filtros Cuenta:</b> {DdlCuentas.SelectedItem.Text} <b>Fecha inicio: </b>{ TxtFechaDel.Text} <b>Fecha Fin:</b> {TxtFechaAl.Text}
' <td>
' </tr>
' </table>"
'Else
' strinLiteral = $"<table style='width:{ GvDatos.Width }px'><tr>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'> </td>
' <td colspan='3' style='width:70%;height:150px; text-align:center; vertical-align:middle;font-weight: bold; display: block;'><p><span>{UsuarioActual.Empresa.Empresa} </span><br><span> Movimientos Auxiliares del Catálogo<p></td>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'> Fecha:{Now.ToString("dd/MM/yyyy")}</td>
' </tr>
' <tr>
' <td style='text-align:left;' colspan='9'>
' <b>Filtros Cuenta:</b> {DdlCuentas.SelectedItem.Text} <b>Fecha inicio: </b>{ TxtFechaDel.Text} <b>Fecha Fin:</b> {TxtFechaAl.Text}
' <td>
' <tr>
' </table>"
'End If
'EncabezadoLiteral.Text = strinLiteral
'GvDatos.ExportToExcel($"MovimientosAuxiliares_{Now.ToString("yyyyMMddmmss")}", Encabezado2:=EncabezadoLiteral)
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
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("CveMoneda", DdlMoneda.SelectedValue))
ImprimirPDF("Contabilidad2/Reportes/RepMovimientosAuxiliaresCatalogo.rdlc", DtDatos, params, "MovimientosAuxiliares", Formato)
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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,360 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Contabilidad2_RepOrigenAplicacion
Inherits ClsPaginas
#Region " PROPIEDADES NORMAL "
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
#End Region
#Region " PROPIEDADES ANUAL "
Private Property DtDatosAnual As DataTable
Get
DtDatosAnual = DirectCast(ViewState("DtDatosAnual"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatosAnual") = value
End Set
End Property
Private Property Anos As Integer
Get
Anos = ViewState("Anos").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("Anos") = value
End Set
End Property
#End Region
#Region " PROPIEDADES "
Private Property TipoReporte As Integer
Get
TipoReporte = ViewState("TipoReporte").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("TipoReporte") = value
End Set
End Property
Private Property DtDatosMensual As DataTable
Get
DtDatosMensual = DirectCast(ViewState("DtDatosMensual"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatosMensual") = 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
'Normal
TxtFechaDel.Text = DateSerial(Year(Now), Month(Now), 1).ToShortDateString
TxtFechaAl.Text = Date.Now.ToShortDateString
'Anual
Anos = 0
Dim ClsConta As New ClsContabilidad
If ClsConta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = ClsConta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
DdlEjercicio.SelectedValue = Now.Year.ToString
TabContainer_ActiveTabChanged(TabContainer, EventArgs.Empty)
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
'Nota:
' 0 = Normal
' 1 = Mensual
' 2 = Anual
If TabContainer.ActiveTabIndex = 0 Then
CargaDatos()
ElseIf TabContainer.ActiveTabIndex = 1 Then
CargaDatosMensual()
ElseIf TabContainer.ActiveTabIndex = 2 Then
CargaDatosAnual()
End If
End Sub
Protected Sub TabContainer_ActiveTabChanged(sender As Object, e As EventArgs)
'Nota:
' 0 = Normal
' 1 = Mensual
' 2 = Anual
'Esconde Todo de lo variable de Filtros
TdSubTotales.Visible = False
TdEjercicio.Visible = False
TdFI.Visible = False
TdFF.Visible = False
If TabContainer.ActiveTabIndex = 0 Then
TdFI.Visible = True
TdFF.Visible = True
ElseIf TabContainer.ActiveTabIndex = 1 Then
TdEjercicio.Visible = True
TdSubTotales.Visible = True
ElseIf TabContainer.ActiveTabIndex = 2 Then
TdEjercicio.Visible = True
End If
UpFiltros.Update()
BtnConsultar_Click(BtnConsultar, EventArgs.Empty)
End Sub
#Region " NORMAL "
Private Sub CargaDatos()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
' Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, "0"c), Anio)
' Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
Dim FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate)
Dim FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate)
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
Dim FechaI = String.Format("{0}/{1}/{2}", FechaInicio.Day, FechaInicio.Month, FechaInicio.Year)
Dim FechaF = String.Format("{0}/{1}/{2}", FechaFin.Day, FechaFin.Month, FechaFin.Year)
If ObjConta.GetOrigenAplicacion(FechaI, FechaF, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatos = ObjConta.DtResultados
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos de origen y aplicación", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
If DtDatos IsNot Nothing Then
CargaGrid()
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
''Titulo y Sumatoria de cambios
'If e.Row.DBCampo("Orden3").ToString.ToEntero = 10 Or e.Row.DBCampo("Orden3").ToString.ToEntero = 30 Then
' e.Row.FCLabel("LbNombre").Font.Bold = True
'End If
''CUENTAS
'If e.Row.DBCampo("Orden3").ToString.ToEntero = 20 Then
' e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 20px;")
'End If
'TOTAL
If e.Row.DBCampo("Nombre").ToString.Trim = "" Then
e.Row.Attributes.Add("style", "border-top: 1px solid; margin-top:10px;")
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.FCLabel("LbNombre").Font.Italic = True
e.Row.FCLabel("LbNombre").Text = "TOTAL"
End If
End If
End Sub
#End Region
#Region " MENSUAL "
Private Sub CargaDatosMensual()
''Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetOrigenAplicacionMensual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatosMensual = ObjConta.DtResultados
Else
DtDatosMensual = Nothing
Alert("Ocurrio un error al cargar los datos del estado de origen y aplicación de recursos", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
EscondeSubtotales()
If DtDatosMensual IsNot Nothing Then
CargaGridMensual()
End If
End Sub
Private Sub EscondeSubtotales()
'Esconde Trimestral
GvDatosMensual.Columns(4).Visible = False
GvDatosMensual.Columns(9).Visible = False
GvDatosMensual.Columns(14).Visible = False
GvDatosMensual.Columns(18).Visible = False
'Esconde Cuatrimestral
GvDatosMensual.Columns(6).Visible = False
GvDatosMensual.Columns(12).Visible = False
GvDatosMensual.Columns(19).Visible = False
If DdlSubtotales.SelectedValue = "2" Then
GvDatosMensual.Columns(4).Visible = True
GvDatosMensual.Columns(9).Visible = True
GvDatosMensual.Columns(14).Visible = True
GvDatosMensual.Columns(18).Visible = True
ElseIf DdlSubtotales.SelectedValue = "3" Then
GvDatosMensual.Columns(6).Visible = True
GvDatosMensual.Columns(12).Visible = True
GvDatosMensual.Columns(19).Visible = True
End If
End Sub
Private Sub CargaGridMensual()
GvDatosMensual.DataSource = DtDatosMensual
GvDatosMensual.DataBind()
UpDatosMensual.Update()
End Sub
Protected Sub GvDatosMensual_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosMensual.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'AGRUPADOR DE CUENTAS
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 2 Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
'CUENTAS
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 1 Then
e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 20px;")
End If
'TOTALES
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
e.Row.Attributes.Add("style", "border-top: 1px solid;")
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.FCLabel("LbNombre").Font.Italic = True
End If
End If
End Sub
#End Region
#Region " ANUAL "
Private Sub CargaDatosAnual()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
Anos = (Year(Date.Now) - DdlEjercicio.SelectedValue.ToEntero) + 1
If ObjConta.GetOrigenAplicacionAnual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatosAnual = ObjConta.DtResultados
Else
DtDatosAnual = Nothing
Alert("Ocurrio un error al cargar los datos del estado de origen y aplicación de recursos", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
If DtDatosAnual IsNot Nothing Then
CargaGridAnual()
End If
'Esconde todo
For index = 1 To 12
GvDatosAnual.Columns(index).Visible = False
Next
For index = 1 To Anos
GvDatosAnual.Columns(index).Visible = True
GvDatosAnual.HeaderRow.FCLabel("LbAno" + index.ToString).Text = (DdlEjercicio.SelectedValue.ToEntero + index - 1).ToString
Next
End Sub
Private Sub CargaGridAnual()
GvDatosAnual.DataSource = DtDatosAnual
GvDatosAnual.DataBind()
UpDatosAnual.Update()
End Sub
Protected Sub GvDatosAnual_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosAnual.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'AGRUPADOR DE CUENTAS
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 2 Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
'CUENTAS
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 1 Then
e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 20px;")
End If
'TOTALES
If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
e.Row.Attributes.Add("style", "border-top: 1px solid;")
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.FCLabel("LbNombre").Font.Italic = True
End If
End If
End Sub
#End Region
End Class

View File

@@ -0,0 +1,593 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepSituacionFinanciera.aspx.vb" Inherits="AC2_SituacionFinanciera" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtTitulo" Text="Estado de Situación Financiera" runat="server" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />&nbsp;--%>
</li>
<li>
<asp:LinkButton ID="Imprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
<%--<asp:ImageButton ID="Imprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" />&nbsp;--%>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpFiltros" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" CssClass="btn btn-default" Text="Consultar" runat="server" OnClick="BtnConsultar_Click" />
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a><%--class="expand"--%>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1 truncate" style="width: 90px;">Ejercicio:</label>
<div class="col-md-2" style="width: 125px;">
<asp:DropDownList ID="DdlEjercicio" runat="server" CssClass="select2me" DataTextField="Ejercicio" DataValueField="Ejercicio" Width="100px">
</asp:DropDownList>
</div>
<label class="col-md-1 truncate" style="width: 90px;">Periodo:</label>
<div class="col-md-2" style="width: 130px;">
<asp:DropDownList ID="DdlPeriodo" runat="server" Width="100px" CssClass="select2me">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubproyecto" runat="server" Width="150px" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" >
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<div class="col-md-3" runat="server" id="tdTipoReporte" visible="true">
<label class="col-md-1 truncate">Tipo:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTipoReporte" runat="server" Width="130px" CssClass="form-control input-sm">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementario" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementario" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<label class="col-md-1 truncate">Con Firma:</label>
<div class="col-md-1">
<asp:CheckBox ID="ChkFirma" CssClass="make-switchsd" data-size="small" runat="server" />
</div>
<label class="col-md-1 truncate">Nivel 2:</label>
<div class="col-md-1">
<asp:CheckBox ID="ChkNivel" CssClass="make-switchsd" data-size="small" runat="server" />
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<rvweb:ReportViewer ID="rvReporteador" Visible="false" runat="server" Width="100%" Height="600"></rvweb:ReportViewer>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<table style="width: 100%; float: left; margin-right: 20px;">
<tr>
<td width="100%" padding="0">
<center>
<h3>ACTIVO</h3>
<asp:UpdatePanel ID="UpActivo" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvActivo" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvActivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="ACTIVO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvActivoNoCirculante" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvActivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="ACTIVO NO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvActivoDiferido" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvActivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="ACTIVO DIFERIDO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</center>
</td>
</tr>
</table>
</div>
<div class="col-md-6">
<table style="width: 100%; float: left;">
<tr>
<td width="100%">
<center>
<h3>PASIVO</h3>
<asp:UpdatePanel ID="UpPasivo" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvPasivo" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPasivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PASIVO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPasivoNoCirculante" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPasivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PASIVO NO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPasivoDiferido" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPasivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PASIVO DIFERIDO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</center>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<table style="max-width: 550px; width: 90%;">
<tr>
<td width="275px" align="center">
<h4>Total del Pasivo:</h4>
</td>
<td width="100px" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoActual"></asp:Label>
</td>
<td runat="server" id="TdTotalPasivo" width="100px" align="right" visible="false">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoAnterior"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>
<center>
<h3>
<asp:Literal Text="CAPITAL" ID="LtlTituloHacienda" runat="server" />
</h3>
<asp:UpdatePanel ID="UpPatrimonio" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvPatrimonio" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PATRIMONIO CONTRIBUIDO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<asp:GridView ID="GvUtilidad" ShowHeader="false" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPatrimonioGenerado" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PATRIMONIO GENERADO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPatrimonioActualizacion" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="EXCESO O INSUFICIENCIA DE ACTUALIZACION"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField visible="false">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</center>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<table style="max-width: 550px; width: 90%;">
<tr>
<td width="50%" style="text-align: center;">
<h4>
<asp:Literal ID="LtlTotalHacienda" Text="Total Capital:" runat="server" />
</h4>
</td>
<td width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPatrimonioActual"></asp:Label>
</td>
<td runat="server" id="TdTotalPatrimonio" width="25%" align="right" visible="false">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPatrimonioAnterior"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="col-md-12">
<br />
</div>
</div>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<center>
<table style="max-width: 550px; width: 90%;">
<tr>
<td width="50%" style="text-align: center;">
<h4>Total del Activo:</h4>
</td>
<td width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalActivoActual"></asp:Label>
</td>
<td runat="server" id="TdTotalActivoAnterior" width="25%" align="right" visible="false">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalActivoAnterior"></asp:Label>
</td>
</tr>
</table>
</center>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-6">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<center>
<table style="max-width: 550px; width: 90%;">
<tr>
<td style="text-align: center; width: 50%;">
<h4>
<asp:Literal ID="LtlTotalPasivoPatrimonio" Text="Total del Pasivo y Capital:" runat="server" />
</h4>
</td>
<td width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoPatrimonioActual"></asp:Label>
</td>
<td runat="server" id="TdTotalPasivoAnterior" width="25%" align="right" visible="false">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoPatrimonioAnterior"></asp:Label>
</td>
</tr>
</table>
</center>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:Label runat="server" ID="LbDescuadre" ForeColor="Red" Font-Bold="false" Font-Size="Small"></asp:Label>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,600 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class AC2_SituacionFinanciera
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 TotalActivoActual As Double
Get
TotalActivoActual = ViewState("TotalActivoActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActivoActual") = value
End Set
End Property
Private Property TotalActivoAnterior As Double
Get
TotalActivoAnterior = ViewState("TotalActivoAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActivoAnterior") = value
End Set
End Property
Private Property TotalPasivoActual As Double
Get
TotalPasivoActual = ViewState("TotalPasivoActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoActual") = value
End Set
End Property
Private Property TotalPasivoAnterior As Double
Get
TotalPasivoAnterior = ViewState("TotalPasivoAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoAnterior") = value
End Set
End Property
Private Property TotalPatrimonioActual As Double
Get
TotalPatrimonioActual = ViewState("TotalPatrimonioActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPatrimonioActual") = value
End Set
End Property
Private Property TotalPatrimonioAnterior As Double
Get
TotalPatrimonioAnterior = ViewState("TotalPatrimonioAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPatrimonioAnterior") = value
End Set
End Property
Private Property TotalPasivoPatrimonioActual As Double
Get
TotalPasivoPatrimonioActual = ViewState("TotalPasivoPatrimonioActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoPatrimonioActual") = value
End Set
End Property
Private Property TotalPasivoPatrimonioAnterior As Double
Get
TotalPasivoPatrimonioAnterior = ViewState("TotalPasivoPatrimonioAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoPatrimonioAnterior") = value
End Set
End Property
Private Property FechaInicioActual As Date
Get
FechaInicioActual = ViewState("FechaInicioActual").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicioActual") = value
End Set
End Property
Private Property FechaFinActual As Date
Get
FechaFinActual = ViewState("FechaFinActual").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFinActual") = value
End Set
End Property
Private Property FechaInicioAnterior As Date
Get
FechaInicioAnterior = ViewState("FechaInicioAnterior").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicioAnterior") = value
End Set
End Property
Private Property FechaFinAnterior As Date
Get
FechaFinAnterior = ViewState("FechaFinAnterior").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFinAnterior") = 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
LtTitulo.Text = "Balance General"
End If
TotalActivoActual = 0
TotalActivoAnterior = 0
TotalPasivoActual = 0
TotalPasivoAnterior = 0
TotalPatrimonioActual = 0
TotalPatrimonioAnterior = 0
TotalPasivoPatrimonioActual = 0
TotalPasivoPatrimonioAnterior = 0
'TxtFechaInicio.Text = DateSerial(Year(Date.Now), 1, 1).ToShortDateString
'TxtFechaFin.Text = Date.Now.ToShortDateString
CargaEjercicios()
'CargaDatos()
End If
End Sub
Private Sub CargaEjercicios()
'Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim Clsconta As New ClsContabilidad
If Clsconta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = Clsconta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
Clsconta.Dispose()
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValue = Now.Year.ToString
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
'DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString)
DdlPeriodo.SelectedValue = Now.Month.ToString
End Sub
Private Sub CargaDatos()
''Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
Dim FechaF = FechaI.ToDate.LastDayOfMonth.ToShortDateString
TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
GvActivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue
GvActivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString
GvPasivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue
GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetSituacionFinanciera("01/01/1900".ToDate, FechaF.ToDate, UsuarioActual.CveEmpresa, CveSubProyecto, TipoReporte) Then
DtDatos = ObjConta.DtResultados
CargaGrids()
If GvPatrimonio.HeaderRow IsNot Nothing Then
GvPatrimonio.HeaderRow.FCLabel("LbTitulo").Text = "CAPITAL CONTABLE"
End If
SumaTotales()
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del estado de situación financiera", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
End Sub
Private Sub CargaGrids()
If Not ChkNivel.Checked Then
DtDatos = DtDatos.FiltraParametros("Level < 3")
End If
Dim DtActivoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND TipoCuenta=1")
Dim DtActivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND TipoCuenta=2 ")
Dim DtActivoDiferido = DtDatos.FiltraParametros(" TipoCuenta=9 ")
' Dim DtActivoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND Orden LIKE '%/00011%' ")
' Dim DtActivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND Orden LIKE '%/00012%' ")
Dim Row As DataRow = DtActivoCirculante.NewRow
If DtActivoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO CIRCULANTE"
Row.Item("ImporteActual") = DtActivoCirculante.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtActivoCirculante.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtActivoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtActivoCirculante.Rows.Add(Row)
Row = DtActivoNoCirculante.NewRow
If DtActivoNoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO NO CIRCULANTE"
Row.Item("ImporteActual") = DtActivoNoCirculante.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtActivoNoCirculante.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtActivoNoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO NO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtActivoNoCirculante.Rows.Add(Row)
Row = DtActivoDiferido.NewRow
If DtActivoDiferido.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO DIFERIDO"
Row.Item("ImporteActual") = DtActivoDiferido.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtActivoDiferido.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtActivoDiferido.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO DIFERIDO"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtActivoDiferido.Rows.Add(Row)
GvActivo.DataSource = DtActivoCirculante
GvActivo.DataBind()
GvActivoNoCirculante.DataSource = DtActivoNoCirculante
GvActivoNoCirculante.DataBind()
GvActivoDiferido.DataSource = DtActivoDiferido
GvActivoDiferido.DataBind()
UpActivo.Update()
'PASIVO
Dim DtPasivoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND TipoCuenta=3")
Dim DtPasivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND TipoCuenta=4")
'Dim DtPasivoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND Orden LIKE '%/00021%' ")
'Dim DtPasivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND Orden LIKE '%/00022%' ")
Row = DtPasivoCirculante.NewRow
If DtPasivoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO CIRCULANTE"
Row.Item("ImporteActual") = DtPasivoCirculante.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPasivoCirculante.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtPasivoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPasivoCirculante.Rows.Add(Row)
Row = DtPasivoNoCirculante.NewRow
If DtPasivoNoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO NO CIRCULANTE"
Row.Item("ImporteActual") = DtPasivoNoCirculante.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPasivoNoCirculante.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtPasivoNoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO NO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPasivoNoCirculante.Rows.Add(Row)
GvPasivo.DataSource = DtPasivoCirculante
GvPasivo.DataBind()
GvPasivoNoCirculante.DataSource = DtPasivoNoCirculante
GvPasivoNoCirculante.DataBind()
UpPasivo.Update()
'PATRIMONIO
Dim DtPatrimonioContribuido = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta in (5,6,8,7)")
Dim DtPatrimonioGenerado = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta in (6,8)")
Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta=7")
Dim DtUtilidad = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta=5")
'Dim DtPatrimonioContribuido = DtDatos.FiltraParametros("Tipo in ('F') AND Orden LIKE '%/00031%' ")
'Dim DtPatrimonioGenerado = DtDatos.FiltraParametros("Tipo in ('F') AND Orden LIKE '%/00032%' ")
'Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros("Tipo in ('F') AND Orden LIKE '%/00033%' ")
Row = DtPatrimonioContribuido.NewRow
If DtPatrimonioContribuido.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL CAPITAL"
Row.Item("ImporteActual") = DtPatrimonioContribuido.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPatrimonioContribuido.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtPatrimonioContribuido.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL CAPITAL"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPatrimonioContribuido.Rows.Add(Row)
''Row = DtPatrimonioGenerado.NewRow
''If DtPatrimonioGenerado.Rows.Count > 0 Then
'' Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PATRIMONIO GENERADO"
'' 'El id = 87 es el id de la cuenta "RESULTADOS DEL EJERCICIO:(AHORRO/DESAHORRO)"
'' Row.Item("ImporteActual") = DtPatrimonioGenerado.SUM("ImporteActual").ToString
'' Row.Item("ImporteAnterior") = DtPatrimonioGenerado.SUM("ImporteAnterior").ToString
'' Row.Item("CtaMayor") = -1
'' 'DtPatrimonioGenerado.Rows.RemoveAt(0)
''Else
'' Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PATRIMONIO GENERADO"
'' Row.Item("ImporteActual") = "0.00"
'' Row.Item("ImporteAnterior") = "0.00"
'' Row.Item("CtaMayor") = -1
''End If
''DtPatrimonioGenerado.Rows.Add(Row)
''Row = DtPatrimonioActualizacion.NewRow
''If DtPatrimonioActualizacion.Rows.Count > 0 Then
'' Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION"
'' Row.Item("ImporteActual") = DtPatrimonioActualizacion.SUM("ImporteActual").ToString
'' Row.Item("ImporteAnterior") = DtPatrimonioActualizacion.SUM("ImporteAnterior").ToString
'' Row.Item("CtaMayor") = -1
'' 'DtPatrimonioActualizacion.Rows.RemoveAt(0)
''Else
'' Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION"
'' Row.Item("ImporteActual") = "0.00"
'' Row.Item("ImporteAnterior") = "0.00"
'' Row.Item("CtaMayor") = -1
''End If
''DtPatrimonioActualizacion.Rows.Add(Row)
GvPatrimonio.DataSource = DtPatrimonioContribuido
GvPatrimonio.DataBind()
'GvPatrimonioGenerado.DataSource = DtPatrimonioGenerado
'GvPatrimonioGenerado.DataBind()
'GvPatrimonioActualizacion.DataSource = DtPatrimonioActualizacion
'GvPatrimonioActualizacion.DataBind()
'GvUtilidad.DataSource = DtUtilidad
'GvUtilidad.DataBind()
UpPatrimonio.Update()
End Sub
Private Sub SumaTotales()
TotalPasivoPatrimonioActual = TotalPasivoActual + TotalPatrimonioActual
TotalPasivoPatrimonioAnterior = TotalPasivoAnterior + TotalPatrimonioAnterior
'Llena Lb´s Totales
LbTotalActivoActual.Text = TotalActivoActual.ToString.FormatoNumero
LbTotalActivoAnterior.Text = TotalActivoAnterior.ToString.FormatoNumero
LbTotalPasivoActual.Text = TotalPasivoActual.ToString.FormatoNumero
LbTotalPasivoAnterior.Text = TotalPasivoAnterior.ToString.FormatoNumero
LbTotalPatrimonioActual.Text = TotalPatrimonioActual.ToString.FormatoNumero
LbTotalPatrimonioAnterior.Text = TotalPatrimonioAnterior.ToString.FormatoNumero
LbTotalPasivoPatrimonioActual.Text = TotalPasivoPatrimonioActual.ToString.FormatoNumero
LbTotalPasivoPatrimonioAnterior.Text = TotalPasivoPatrimonioAnterior.ToString.FormatoNumero
Dim Descuadre = False
'COLOREA ROJO SI NO CUADRAN TOTALES
If Math.Round(TotalActivoActual, 2) <> Math.Round(TotalPasivoPatrimonioActual, 2) Then
LbTotalActivoActual.ForeColor = Drawing.Color.Red
LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Red
Descuadre = True
Else
LbTotalActivoActual.ForeColor = Drawing.Color.Black
LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Black
End If
'If Math.Round(TotalActivoAnterior, 2) <> Math.Round(TotalPasivoPatrimonioAnterior, 2) Then
' LbTotalActivoAnterior.ForeColor = Drawing.Color.Red
' LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Red
' Descuadre = True
'Else
' LbTotalActivoAnterior.ForeColor = Drawing.Color.Black
' LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Black
'End If
If Descuadre Then
LbDescuadre.Text = "Las sumas de los totales están descuadradas."
Else
LbDescuadre.Text = ""
End If
End Sub
Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
'Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
'Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
'If ObjConta.GetSituacionFinanciera("01/01/2000".ToDate, FechaF.ToDate, DdlTipoReporte.SelectedValue.ToEntero) Then
' DtDatos = ObjConta.DtResultados
' 'If ChkFirma.Checked = True Then
' ' Dim Row As DataRow = DtDatos.NewRow
' ' Row.Item("Nombre") = String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de contabilidad", "")
' ' Row.Item("Sup") = String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", "")
' ' Row.Item("ImporteActual") = "0"
' ' Row.Item("ImporteAnterior") = "0"
' ' Row.Item("Tipo") = "Firma"
' ' DtDatos.Rows.Add(Row)
' 'End If
'End If
'ObjConta.Dispose()
ImprimirReporte()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
TotalActivoActual = 0
TotalActivoAnterior = 0
TotalPasivoActual = 0
TotalPasivoAnterior = 0
TotalPatrimonioActual = 0
TotalPatrimonioAnterior = 0
TotalPasivoPatrimonioActual = 0
TotalPasivoPatrimonioAnterior = 0
CargaDatos()
End Sub
#Region "GV´S ROW DATA BOUND"
Protected Sub GvActivo_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalActivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalActivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;")
Else
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("Level").ToString = "2" Then
e.Row.FCLabel("LbNombre").Text = String.Format("&nbsp;&nbsp;&nbsp;{0}", e.Row.DBCampo("Nombre").ToString)
ElseIf e.Row.DBCampo("Level").ToString = "1" Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
End If
End Sub
Protected Sub GvPasivo_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'Totales
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalPasivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalPasivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;")
'Cuentas
Else
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
End If
'Colorea NEGATIVOS
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("Level").ToString = "2" Then
e.Row.FCLabel("LbNombre").Text = String.Format("&nbsp;&nbsp;&nbsp;{0}", e.Row.DBCampo("Nombre").ToString)
ElseIf e.Row.DBCampo("Level").ToString = "1" Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
End If
End Sub
Protected Sub GvPatrimonio_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalPatrimonioActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalPatrimonioAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;")
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
'e.Row.ControlStyle.Font.Bold = True
ElseIf e.Row.DBCampo("CveCuenta") <> "55276" Then
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("Level").ToString = "2" Then
e.Row.FCLabel("LbNombre").Text = String.Format("&nbsp;&nbsp;&nbsp;{0}", e.Row.DBCampo("Nombre").ToString)
ElseIf e.Row.DBCampo("Level").ToString = "1" Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
End If
End Sub
#End Region
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
ImprimirReporte("Excel")
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
'nombre del archivo a generar
Dim fileName As String = "EdoSituacionFinanciera"
'ubicacion del rdlc
Dim reportpath As String = "Contabilidad2/Reportes/RepSituacionFinanciera.rdlc"
'parametros a enviar al reporte
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
params.Add(New ReportParameter("pFirma1", If(ChkFirma.Checked, String.Format("{0}", vbCrLf), "")))
params.Add(New ReportParameter("pFirma2", If(ChkFirma.Checked, String.Format("{0}l", vbCrLf), "")))
params.Add(New ReportParameter("pFechaFin", FechaF))
ImprimirPDF(reportpath, DtDatos, params, fileName, Formato)
End Sub
End Class

View File

@@ -0,0 +1,600 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class AC2_SituacionFinanciera
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 TotalActivoActual As Double
Get
TotalActivoActual = ViewState("TotalActivoActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActivoActual") = value
End Set
End Property
Private Property TotalActivoAnterior As Double
Get
TotalActivoAnterior = ViewState("TotalActivoAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActivoAnterior") = value
End Set
End Property
Private Property TotalPasivoActual As Double
Get
TotalPasivoActual = ViewState("TotalPasivoActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoActual") = value
End Set
End Property
Private Property TotalPasivoAnterior As Double
Get
TotalPasivoAnterior = ViewState("TotalPasivoAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoAnterior") = value
End Set
End Property
Private Property TotalPatrimonioActual As Double
Get
TotalPatrimonioActual = ViewState("TotalPatrimonioActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPatrimonioActual") = value
End Set
End Property
Private Property TotalPatrimonioAnterior As Double
Get
TotalPatrimonioAnterior = ViewState("TotalPatrimonioAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPatrimonioAnterior") = value
End Set
End Property
Private Property TotalPasivoPatrimonioActual As Double
Get
TotalPasivoPatrimonioActual = ViewState("TotalPasivoPatrimonioActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoPatrimonioActual") = value
End Set
End Property
Private Property TotalPasivoPatrimonioAnterior As Double
Get
TotalPasivoPatrimonioAnterior = ViewState("TotalPasivoPatrimonioAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoPatrimonioAnterior") = value
End Set
End Property
Private Property FechaInicioActual As Date
Get
FechaInicioActual = ViewState("FechaInicioActual").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicioActual") = value
End Set
End Property
Private Property FechaFinActual As Date
Get
FechaFinActual = ViewState("FechaFinActual").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFinActual") = value
End Set
End Property
Private Property FechaInicioAnterior As Date
Get
FechaInicioAnterior = ViewState("FechaInicioAnterior").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicioAnterior") = value
End Set
End Property
Private Property FechaFinAnterior As Date
Get
FechaFinAnterior = ViewState("FechaFinAnterior").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFinAnterior") = 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
LtTitulo.Text = "Balance General"
End If
TotalActivoActual = 0
TotalActivoAnterior = 0
TotalPasivoActual = 0
TotalPasivoAnterior = 0
TotalPatrimonioActual = 0
TotalPatrimonioAnterior = 0
TotalPasivoPatrimonioActual = 0
TotalPasivoPatrimonioAnterior = 0
'TxtFechaInicio.Text = DateSerial(Year(Date.Now), 1, 1).ToShortDateString
'TxtFechaFin.Text = Date.Now.ToShortDateString
CargaEjercicios()
'CargaDatos()
End If
End Sub
Private Sub CargaEjercicios()
'Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim Clsconta As New ClsContabilidad
If Clsconta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = Clsconta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
Clsconta.Dispose()
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValue = Now.Year.ToString
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
'DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString)
DdlPeriodo.SelectedValue = Now.Month.ToString
End Sub
Private Sub CargaDatos()
''Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
Dim FechaF = FechaI.ToDate.LastDayOfMonth.ToShortDateString
TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
GvActivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue
GvActivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString
GvPasivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue
GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetSituacionFinanciera("01/01/1900".ToDate, FechaF.ToDate, UsuarioActual.CveEmpresa, CveSubProyecto, TipoReporte) Then
DtDatos = ObjConta.DtResultados
CargaGrids()
If GvPatrimonio.HeaderRow IsNot Nothing Then
GvPatrimonio.HeaderRow.FCLabel("LbTitulo").Text = "CAPITAL CONTABLE"
End If
SumaTotales()
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del estado de situación financiera", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
End Sub
Private Sub CargaGrids()
If Not ChkNivel.Checked Then
DtDatos = DtDatos.FiltraParametros("Level < 3")
End If
Dim DtActivoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND TipoCuenta=1")
Dim DtActivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND TipoCuenta=2 ")
Dim DtActivoDiferido = DtDatos.FiltraParametros(" TipoCuenta=9 ")
' Dim DtActivoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND Orden LIKE '%/00011%' ")
' Dim DtActivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND Orden LIKE '%/00012%' ")
Dim Row As DataRow = DtActivoCirculante.NewRow
If DtActivoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO CIRCULANTE"
Row.Item("ImporteActual") = DtActivoCirculante.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtActivoCirculante.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtActivoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtActivoCirculante.Rows.Add(Row)
Row = DtActivoNoCirculante.NewRow
If DtActivoNoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO NO CIRCULANTE"
Row.Item("ImporteActual") = DtActivoNoCirculante.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtActivoNoCirculante.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtActivoNoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO NO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtActivoNoCirculante.Rows.Add(Row)
Row = DtActivoDiferido.NewRow
If DtActivoDiferido.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO DIFERIDO"
Row.Item("ImporteActual") = DtActivoDiferido.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtActivoDiferido.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtActivoDiferido.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO DIFERIDO"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtActivoDiferido.Rows.Add(Row)
GvActivo.DataSource = DtActivoCirculante
GvActivo.DataBind()
GvActivoNoCirculante.DataSource = DtActivoNoCirculante
GvActivoNoCirculante.DataBind()
GvActivoDiferido.DataSource = DtActivoDiferido
GvActivoDiferido.DataBind()
UpActivo.Update()
'PASIVO
Dim DtPasivoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND TipoCuenta=3")
Dim DtPasivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND TipoCuenta=4")
'Dim DtPasivoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND Orden LIKE '%/00021%' ")
'Dim DtPasivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND Orden LIKE '%/00022%' ")
Row = DtPasivoCirculante.NewRow
If DtPasivoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO CIRCULANTE"
Row.Item("ImporteActual") = DtPasivoCirculante.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPasivoCirculante.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtPasivoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPasivoCirculante.Rows.Add(Row)
Row = DtPasivoNoCirculante.NewRow
If DtPasivoNoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO NO CIRCULANTE"
Row.Item("ImporteActual") = DtPasivoNoCirculante.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPasivoNoCirculante.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtPasivoNoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO NO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPasivoNoCirculante.Rows.Add(Row)
GvPasivo.DataSource = DtPasivoCirculante
GvPasivo.DataBind()
GvPasivoNoCirculante.DataSource = DtPasivoNoCirculante
GvPasivoNoCirculante.DataBind()
UpPasivo.Update()
'PATRIMONIO
Dim DtPatrimonioContribuido = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta in (5,6,8,7)")
Dim DtPatrimonioGenerado = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta in (6,8)")
Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta=7")
Dim DtUtilidad = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta=5")
'Dim DtPatrimonioContribuido = DtDatos.FiltraParametros("Tipo in ('F') AND Orden LIKE '%/00031%' ")
'Dim DtPatrimonioGenerado = DtDatos.FiltraParametros("Tipo in ('F') AND Orden LIKE '%/00032%' ")
'Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros("Tipo in ('F') AND Orden LIKE '%/00033%' ")
Row = DtPatrimonioContribuido.NewRow
If DtPatrimonioContribuido.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL CAPITAL"
Row.Item("ImporteActual") = DtPatrimonioContribuido.SUM("ImporteActual").ToString
Row.Item("ImporteAnterior") = DtPatrimonioContribuido.SUM("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtPatrimonioContribuido.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL CAPITAL"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPatrimonioContribuido.Rows.Add(Row)
''Row = DtPatrimonioGenerado.NewRow
''If DtPatrimonioGenerado.Rows.Count > 0 Then
'' Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PATRIMONIO GENERADO"
'' 'El id = 87 es el id de la cuenta "RESULTADOS DEL EJERCICIO:(AHORRO/DESAHORRO)"
'' Row.Item("ImporteActual") = DtPatrimonioGenerado.SUM("ImporteActual").ToString
'' Row.Item("ImporteAnterior") = DtPatrimonioGenerado.SUM("ImporteAnterior").ToString
'' Row.Item("CtaMayor") = -1
'' 'DtPatrimonioGenerado.Rows.RemoveAt(0)
''Else
'' Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PATRIMONIO GENERADO"
'' Row.Item("ImporteActual") = "0.00"
'' Row.Item("ImporteAnterior") = "0.00"
'' Row.Item("CtaMayor") = -1
''End If
''DtPatrimonioGenerado.Rows.Add(Row)
''Row = DtPatrimonioActualizacion.NewRow
''If DtPatrimonioActualizacion.Rows.Count > 0 Then
'' Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION"
'' Row.Item("ImporteActual") = DtPatrimonioActualizacion.SUM("ImporteActual").ToString
'' Row.Item("ImporteAnterior") = DtPatrimonioActualizacion.SUM("ImporteAnterior").ToString
'' Row.Item("CtaMayor") = -1
'' 'DtPatrimonioActualizacion.Rows.RemoveAt(0)
''Else
'' Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION"
'' Row.Item("ImporteActual") = "0.00"
'' Row.Item("ImporteAnterior") = "0.00"
'' Row.Item("CtaMayor") = -1
''End If
''DtPatrimonioActualizacion.Rows.Add(Row)
GvPatrimonio.DataSource = DtPatrimonioContribuido
GvPatrimonio.DataBind()
'GvPatrimonioGenerado.DataSource = DtPatrimonioGenerado
'GvPatrimonioGenerado.DataBind()
'GvPatrimonioActualizacion.DataSource = DtPatrimonioActualizacion
'GvPatrimonioActualizacion.DataBind()
'GvUtilidad.DataSource = DtUtilidad
'GvUtilidad.DataBind()
UpPatrimonio.Update()
End Sub
Private Sub SumaTotales()
TotalPasivoPatrimonioActual = TotalPasivoActual + TotalPatrimonioActual
TotalPasivoPatrimonioAnterior = TotalPasivoAnterior + TotalPatrimonioAnterior
'Llena Lb´s Totales
LbTotalActivoActual.Text = TotalActivoActual.ToString.FormatoNumero
LbTotalActivoAnterior.Text = TotalActivoAnterior.ToString.FormatoNumero
LbTotalPasivoActual.Text = TotalPasivoActual.ToString.FormatoNumero
LbTotalPasivoAnterior.Text = TotalPasivoAnterior.ToString.FormatoNumero
LbTotalPatrimonioActual.Text = TotalPatrimonioActual.ToString.FormatoNumero
LbTotalPatrimonioAnterior.Text = TotalPatrimonioAnterior.ToString.FormatoNumero
LbTotalPasivoPatrimonioActual.Text = TotalPasivoPatrimonioActual.ToString.FormatoNumero
LbTotalPasivoPatrimonioAnterior.Text = TotalPasivoPatrimonioAnterior.ToString.FormatoNumero
Dim Descuadre = False
'COLOREA ROJO SI NO CUADRAN TOTALES
If Math.Round(TotalActivoActual, 2) <> Math.Round(TotalPasivoPatrimonioActual, 2) Then
LbTotalActivoActual.ForeColor = Drawing.Color.Red
LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Red
Descuadre = True
Else
LbTotalActivoActual.ForeColor = Drawing.Color.Black
LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Black
End If
'If Math.Round(TotalActivoAnterior, 2) <> Math.Round(TotalPasivoPatrimonioAnterior, 2) Then
' LbTotalActivoAnterior.ForeColor = Drawing.Color.Red
' LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Red
' Descuadre = True
'Else
' LbTotalActivoAnterior.ForeColor = Drawing.Color.Black
' LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Black
'End If
If Descuadre Then
LbDescuadre.Text = "Las sumas de los totales están descuadradas."
Else
LbDescuadre.Text = ""
End If
End Sub
Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
'Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
'Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
'If ObjConta.GetSituacionFinanciera("01/01/2000".ToDate, FechaF.ToDate, DdlTipoReporte.SelectedValue.ToEntero) Then
' DtDatos = ObjConta.DtResultados
' 'If ChkFirma.Checked = True Then
' ' Dim Row As DataRow = DtDatos.NewRow
' ' Row.Item("Nombre") = String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de contabilidad", "")
' ' Row.Item("Sup") = String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", "")
' ' Row.Item("ImporteActual") = "0"
' ' Row.Item("ImporteAnterior") = "0"
' ' Row.Item("Tipo") = "Firma"
' ' DtDatos.Rows.Add(Row)
' 'End If
'End If
'ObjConta.Dispose()
ImprimirReporte()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
TotalActivoActual = 0
TotalActivoAnterior = 0
TotalPasivoActual = 0
TotalPasivoAnterior = 0
TotalPatrimonioActual = 0
TotalPatrimonioAnterior = 0
TotalPasivoPatrimonioActual = 0
TotalPasivoPatrimonioAnterior = 0
CargaDatos()
End Sub
#Region "GV´S ROW DATA BOUND"
Protected Sub GvActivo_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalActivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalActivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;")
Else
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("Level").ToString = "2" Then
e.Row.FCLabel("LbNombre").Text = String.Format("&nbsp;&nbsp;&nbsp;{0}", e.Row.DBCampo("Nombre").ToString)
ElseIf e.Row.DBCampo("Level").ToString = "1" Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
End If
End Sub
Protected Sub GvPasivo_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'Totales
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalPasivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalPasivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;")
'Cuentas
Else
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
End If
'Colorea NEGATIVOS
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("Level").ToString = "2" Then
e.Row.FCLabel("LbNombre").Text = String.Format("&nbsp;&nbsp;&nbsp;{0}", e.Row.DBCampo("Nombre").ToString)
ElseIf e.Row.DBCampo("Level").ToString = "1" Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
End If
End Sub
Protected Sub GvPatrimonio_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalPatrimonioActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalPatrimonioAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;")
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
'e.Row.ControlStyle.Font.Bold = True
ElseIf e.Row.DBCampo("CveCuenta") <> "55276" Then
e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("Level").ToString = "2" Then
e.Row.FCLabel("LbNombre").Text = String.Format("&nbsp;&nbsp;&nbsp;{0}", e.Row.DBCampo("Nombre").ToString)
ElseIf e.Row.DBCampo("Level").ToString = "1" Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
End If
End Sub
#End Region
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
ImprimirReporte("Excel")
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
'nombre del archivo a generar
Dim fileName As String = "EdoSituacionFinanciera"
'ubicacion del rdlc
Dim reportpath As String = "AC/Reportes/RepSituacionFinanciera.rdlc"
'parametros a enviar al reporte
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
params.Add(New ReportParameter("pFirma1", If(ChkFirma.Checked, String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de Contabilidad", vbCrLf), "")))
params.Add(New ReportParameter("pFirma2", If(ChkFirma.Checked, String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", vbCrLf), "")))
params.Add(New ReportParameter("pFechaFin", FechaF))
ImprimirPDF(reportpath, DtDatos, params, fileName, Formato)
End Sub
End Class

View File

@@ -0,0 +1,692 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepSituacionFinancieraSAT.aspx.vb" Inherits="AC2_SituacionFinanciera" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtTitulo" Text="Estado de Situación Financiera" runat="server" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />&nbsp;--%>
</li>
<li>
<asp:LinkButton ID="Imprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
<%--<asp:ImageButton ID="Imprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" />&nbsp;--%>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpFiltros" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" CssClass="btn btn-default" Text="Consultar" runat="server" OnClick="BtnConsultar_Click" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1 truncate" style="width: 90px;">Ejercicio:</label>
<div class="col-md-2" style="width: 125px;">
<asp:DropDownList ID="DdlEjercicio" runat="server" CssClass="select2me" DataTextField="Ejercicio" DataValueField="Ejercicio" Width="100px">
</asp:DropDownList>
</div>
<label class="col-md-1 truncate" style="width: 90px;">Periodo:</label>
<div class="col-md-2" style="width: 130px;">
<asp:DropDownList ID="DdlPeriodo" runat="server" Width="100px" CssClass="select2me">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" >
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-3" runat="server" id="tdTipoReporte" visible="true">
<div class="row">
<label class="col-md-3 truncate">Tipo:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlTipoReporte" runat="server" Width="130px" CssClass="form-control input-sm">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementario" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementario" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<label class="col-md-1 truncate">Con Firma:</label>
<div class="col-md-1">
<asp:CheckBox ID="ChkFirma" CssClass="make-switchsd" data-size="small" runat="server" />
</div>
<label class="col-md-1 truncate">Nivel 2:</label>
<div class="col-md-1">
<asp:CheckBox ID="ChkNivel" CssClass="make-switchsd" data-size="small" runat="server" />
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<rvweb:ReportViewer ID="rvReporteador" Visible="false" runat="server" Width="100%" Height="600"></rvweb:ReportViewer>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<table style="width: 100%; float: left; margin-right: 20px;">
<tr>
<td width="100%" padding="0">
<center>
<h3>ACTIVO</h3>
<asp:UpdatePanel ID="UpActivo" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvActivo" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvActivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="5%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="Label2" runat="server" Style="padding-left: 20px;" Text="CODIGO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="ACTIVO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvActivoNoCirculante" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvActivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="5%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Style="padding-left: 20px;" Text="CODIGO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="ACTIVO NO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvActivoDiferido" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvActivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="5%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="Label6" runat="server" Style="padding-left: 20px;" Text="CODIGO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="ACTIVO DIFERIDO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</center>
</td>
</tr>
</table>
</div>
<div class="col-md-6">
<table style="width: 100%; float: left;">
<tr>
<td width="100%">
<center>
<h3>PASIVO</h3>
<asp:UpdatePanel ID="UpPasivo" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvPasivo" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPasivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="5%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="Label8" runat="server" Style="padding-left: 20px;" Text="CODIGO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PASIVO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPasivoNoCirculante" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPasivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label9" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="5%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="Label10" runat="server" Style="padding-left: 20px;" Text="CODIGO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PASIVO NO CIRCULANTE"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPasivoDiferido" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPasivo_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label11" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="5%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="Label12" runat="server" Style="padding-left: 20px;" Text="CODIGO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PASIVO DIFERIDO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</center>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<table style="max-width: 550px; width: 90%;">
<tr>
<td width="275px" align="center">
<h4>Total del Pasivo:</h4>
</td>
<td width="100px" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoActual"></asp:Label>
</td>
<td runat="server" id="TdTotalPasivo" width="100px" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoAnterior"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>
<center>
<h3>
<asp:Literal Text="HACIENDA PÚBLICA/PATRIMONIO" ID="LtlTituloHacienda" runat="server" />
</h3>
<asp:UpdatePanel ID="UpPatrimonio" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvPatrimonio" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label13" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="5%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="Label14" runat="server" Style="padding-left: 20px;" Text="CODIGO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PATRIMONIO CONTRIBUIDO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<asp:GridView ID="GvUtilidad" ShowHeader="false" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label15" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="5%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="Label16" runat="server" Style="padding-left: 20px;" Text="CODIGO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPatrimonioGenerado" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label17" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="5%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="Label18" runat="server" Style="padding-left: 20px;" Text="CODIGO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="PATRIMONIO GENERADO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="25%" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
<br />
<asp:GridView ID="GvPatrimonioActualizacion" Style="max-width: 550px;" Width="90%" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvPatrimonio_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label19" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="5%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="Label20" runat="server" Style="padding-left: 20px;" Text="CODIGO"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="50%" HorizontalAlign="Left" />
<HeaderTemplate>
<asp:Label ID="LbTitulo" runat="server" Style="padding-left: 20px;" Text="EXCESO O INSUFICIENCIA DE ACTUALIZACION"></asp:Label>
</HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
<%--<asp:Label ID="LbAnterior" runat="server" Text='<%# Eval("ImporteAnterior", "{0:N2}")%>'></asp:Label>--%>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="TitulosChico"></HeaderStyle>--%>
<RowStyle CssClass="Texto" />
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</center>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<table style="max-width: 550px; width: 90%;">
<tr>
<td width="50%" style="text-align: center;">
<h4>
<asp:Literal ID="LtlTotalHacienda" Text="Total Hacienda Pública/Patrimonio:" runat="server" />
</h4>
</td>
<td width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPatrimonioActual"></asp:Label>
</td>
<td runat="server" id="TdTotalPatrimonio" width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPatrimonioAnterior"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="col-md-12">
<br />
</div>
</div>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<center>
<table style="max-width: 550px; width: 90%;">
<tr>
<td width="50%" style="text-align: center;">
<h4>Total del Activo:</h4>
</td>
<td width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalActivoActual"></asp:Label>
</td>
<td runat="server" id="TdTotalActivoAnterior" width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalActivoAnterior"></asp:Label>
</td>
</tr>
</table>
</center>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-6">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<center>
<table style="max-width: 550px; width: 90%;">
<tr>
<td style="text-align: center; width: 50%;">
<h4>
<asp:Literal ID="LtlTotalPasivoPatrimonio" Text="Total del Pasivo y Patrimonio:" runat="server" />
</h4>
</td>
<td width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoPatrimonioActual"></asp:Label>
</td>
<td runat="server" id="TdTotalPasivoAnterior" width="25%" align="right">
<asp:Label Font-Bold="true" runat="server" ID="LbTotalPasivoPatrimonioAnterior"></asp:Label>
</td>
</tr>
</table>
</center>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:Label runat="server" ID="LbDescuadre" ForeColor="Red" Font-Bold="false" Font-Size="Small"></asp:Label>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,598 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class AC2_SituacionFinanciera
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 TotalActivoActual As Double
Get
TotalActivoActual = ViewState("TotalActivoActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActivoActual") = value
End Set
End Property
Private Property TotalActivoAnterior As Double
Get
TotalActivoAnterior = ViewState("TotalActivoAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActivoAnterior") = value
End Set
End Property
Private Property TotalPasivoActual As Double
Get
TotalPasivoActual = ViewState("TotalPasivoActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoActual") = value
End Set
End Property
Private Property TotalPasivoAnterior As Double
Get
TotalPasivoAnterior = ViewState("TotalPasivoAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoAnterior") = value
End Set
End Property
Private Property TotalPatrimonioActual As Double
Get
TotalPatrimonioActual = ViewState("TotalPatrimonioActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPatrimonioActual") = value
End Set
End Property
Private Property TotalPatrimonioAnterior As Double
Get
TotalPatrimonioAnterior = ViewState("TotalPatrimonioAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPatrimonioAnterior") = value
End Set
End Property
Private Property TotalPasivoPatrimonioActual As Double
Get
TotalPasivoPatrimonioActual = ViewState("TotalPasivoPatrimonioActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoPatrimonioActual") = value
End Set
End Property
Private Property TotalPasivoPatrimonioAnterior As Double
Get
TotalPasivoPatrimonioAnterior = ViewState("TotalPasivoPatrimonioAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalPasivoPatrimonioAnterior") = value
End Set
End Property
Private Property FechaInicioActual As Date
Get
FechaInicioActual = ViewState("FechaInicioActual").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicioActual") = value
End Set
End Property
Private Property FechaFinActual As Date
Get
FechaFinActual = ViewState("FechaFinActual").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFinActual") = value
End Set
End Property
Private Property FechaInicioAnterior As Date
Get
FechaInicioAnterior = ViewState("FechaInicioAnterior").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicioAnterior") = value
End Set
End Property
Private Property FechaFinAnterior As Date
Get
FechaFinAnterior = ViewState("FechaFinAnterior").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFinAnterior") = 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
LtTitulo.Text = "Balance General"
End If
TotalActivoActual = 0
TotalActivoAnterior = 0
TotalPasivoActual = 0
TotalPasivoAnterior = 0
TotalPatrimonioActual = 0
TotalPatrimonioAnterior = 0
TotalPasivoPatrimonioActual = 0
TotalPasivoPatrimonioAnterior = 0
'TxtFechaInicio.Text = DateSerial(Year(Date.Now), 1, 1).ToShortDateString
'TxtFechaFin.Text = Date.Now.ToShortDateString
CargaEjercicios()
CargaDatos()
End If
End Sub
Private Sub CargaEjercicios()
'Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim Clsconta As New ClsContabilidad
If Clsconta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = Clsconta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
ClsConta.Dispose()
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValue = Now.Year.ToString
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
'DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString)
DdlPeriodo.SelectedValue = Now.Month.ToString
End Sub
Private Sub CargaDatos()
''Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
Dim FechaF = FechaI.ToDate.LastDayOfMonth.ToShortDateString
TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
GvActivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue
GvActivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString
GvPasivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue
GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetSituacionFinanciera("01/01/1900".ToDate, FechaF.ToDate, UsuarioActual.CveEmpresa, CveSubProyecto, TipoReporte, 1) Then
DtDatos = ObjConta.DtResultados
CargaGrids()
SumaTotales()
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del estado de situación financiera", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
End Sub
Private Sub CargaGrids()
'If Not ChkNivel.Checked Then
' DtDatos = DtDatos.FiltraParametros("Level < 3")
'End If
Dim ImporteActual As Double
Dim ImporteAnterior As Double
Dim DtActivoCirculante = DtDatos.FiltraParametros("TipoCuenta=1")
Dim DtActivoNoCirculante = DtDatos.FiltraParametros("TipoCuenta=2 ")
ImporteActual = DtActivoCirculante.SUM("ImporteActual")
ImporteAnterior = DtActivoCirculante.SUM("ImporteAnterior")
' Dim DtActivoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND Orden LIKE '%/00011%' ")
' Dim DtActivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('A','B','C') AND Orden LIKE '%/00012%' ")
Dim Row As DataRow = DtActivoCirculante.NewRow
If DtActivoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO CIRCULANTE"
Row.Item("ImporteActual") = ImporteActual
Row.Item("ImporteAnterior") = ImporteAnterior
Row.Item("CtaMayor") = -1
'DtActivoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtActivoCirculante.Rows.Add(Row)
ImporteActual = DtActivoNoCirculante.SUM("ImporteActual")
ImporteAnterior = DtActivoNoCirculante.SUM("ImporteAnterior")
Row = DtActivoNoCirculante.NewRow
If DtActivoNoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO NO CIRCULANTE"
Row.Item("ImporteActual") = ImporteActual
Row.Item("ImporteAnterior") = ImporteAnterior
Row.Item("CtaMayor") = -1
'DtActivoNoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL ACTIVO NO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtActivoNoCirculante.Rows.Add(Row)
GvActivo.DataSource = DtActivoCirculante
GvActivo.DataBind()
GvActivoNoCirculante.DataSource = DtActivoNoCirculante
GvActivoNoCirculante.DataBind()
UpActivo.Update()
'PASIVO
Dim DtPasivoCirculante = DtDatos.FiltraParametros("TipoCuenta=3")
Dim DtPasivoNoCirculante = DtDatos.FiltraParametros("TipoCuenta=4")
'Dim DtPasivoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND Orden LIKE '%/00021%' ")
'Dim DtPasivoNoCirculante = DtDatos.FiltraParametros("Tipo in ('D') AND Orden LIKE '%/00022%' ")
ImporteActual = DtPasivoCirculante.SUM("ImporteActual")
ImporteAnterior = DtPasivoCirculante.SUM("ImporteAnterior")
Row = DtPasivoCirculante.NewRow
If DtPasivoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO CIRCULANTE"
Row.Item("ImporteActual") = ImporteActual
Row.Item("ImporteAnterior") = ImporteAnterior
Row.Item("CtaMayor") = -1
'DtPasivoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPasivoCirculante.Rows.Add(Row)
ImporteActual = DtPasivoNoCirculante.SUM("ImporteActual")
ImporteAnterior = DtPasivoNoCirculante.SUM("ImporteAnterior")
Row = DtPasivoNoCirculante.NewRow
If DtPasivoNoCirculante.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO NO CIRCULANTE"
Row.Item("ImporteActual") = ImporteActual
Row.Item("ImporteAnterior") = ImporteAnterior
Row.Item("CtaMayor") = -1
'DtPasivoNoCirculante.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PASIVO NO CIRCULANTE"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPasivoNoCirculante.Rows.Add(Row)
GvPasivo.DataSource = DtPasivoCirculante
GvPasivo.DataBind()
GvPasivoNoCirculante.DataSource = DtPasivoNoCirculante
GvPasivoNoCirculante.DataBind()
UpPasivo.Update()
'PATRIMONIO
Dim DtPatrimonioContribuido = DtDatos.FiltraParametros("TipoCuenta=5")
Dim DtPatrimonioGenerado = DtDatos.FiltraParametros("TipoCuenta in (6,8)")
Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros("TipoCuenta=7")
'Dim DtPatrimonioContribuido = DtDatos.FiltraParametros("Tipo in ('F') AND Orden LIKE '%/00031%' ")
'Dim DtPatrimonioGenerado = DtDatos.FiltraParametros("Tipo in ('F') AND Orden LIKE '%/00032%' ")
'Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros("Tipo in ('F') AND Orden LIKE '%/00033%' ")
ImporteActual = DtPatrimonioContribuido.SUM("ImporteActual")
ImporteAnterior = DtPatrimonioContribuido.SUM("ImporteAnterior")
Row = DtPatrimonioContribuido.NewRow
If DtPatrimonioContribuido.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PATRIMONIO CONTRIBUIDO"
Row.Item("ImporteActual") = ImporteActual 'DtPatrimonioContribuido.Rows(0)("ImporteActual").ToString
Row.Item("ImporteAnterior") = ImporteAnterior 'DtPatrimonioContribuido.Rows(0)("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtPatrimonioContribuido.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PATRIMONIO CONTRIBUIDO"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPatrimonioContribuido.Rows.Add(Row)
Row = DtPatrimonioGenerado.NewRow
ImporteActual = 0
ImporteAnterior = 0
If DtPatrimonioGenerado.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PATRIMONIO GENERADO"
'El id = 87 es el id de la cuenta "RESULTADOS DEL EJERCICIO:(AHORRO/DESAHORRO)"
If DtPatrimonioGenerado.FiltraParametros("TipoCuenta=8").Rows.Count > 0 Then
Row.Item("ImporteActual") = ImporteActual '(DtPatrimonioGenerado.Rows(0)("ImporteActual").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero("TipoCuenta=8")("ImporteActual").ToString.ToDouble).ToString
Row.Item("ImporteAnterior") = ImporteAnterior '(DtPatrimonioGenerado.Rows(0)("ImporteAnterior").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero("TipoCuenta=8")("ImporteAnterior").ToString.ToDouble).ToString
Else
Row.Item("ImporteActual") = ImporteActual
Row.Item("ImporteAnterior") = ImporteAnterior
End If
Row.Item("CtaMayor") = -1
'DtPatrimonioGenerado.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL PATRIMONIO GENERADO"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPatrimonioGenerado.Rows.Add(Row)
Row = DtPatrimonioActualizacion.NewRow
If DtPatrimonioActualizacion.Rows.Count > 0 Then
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION"
Row.Item("ImporteActual") = "-1" ' DtPatrimonioActualizacion.Rows(0)("ImporteActual").ToString
Row.Item("ImporteAnterior") = "-2" 'DtPatrimonioActualizacion.Rows(0)("ImporteAnterior").ToString
Row.Item("CtaMayor") = -1
'DtPatrimonioActualizacion.Rows.RemoveAt(0)
Else
Row.Item("Nombre") = "&nbsp;&nbsp;&nbsp;TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION"
Row.Item("ImporteActual") = "0.00"
Row.Item("ImporteAnterior") = "0.00"
Row.Item("CtaMayor") = -1
End If
DtPatrimonioActualizacion.Rows.Add(Row)
GvPatrimonio.DataSource = DtPatrimonioContribuido
GvPatrimonio.DataBind()
GvPatrimonioGenerado.DataSource = DtPatrimonioGenerado
GvPatrimonioGenerado.DataBind()
GvPatrimonioActualizacion.DataSource = DtPatrimonioActualizacion
GvPatrimonioActualizacion.DataBind()
UpPatrimonio.Update()
End Sub
Private Sub SumaTotales()
TotalPasivoPatrimonioActual = TotalPasivoActual + TotalPatrimonioActual
TotalPasivoPatrimonioAnterior = TotalPasivoAnterior + TotalPatrimonioAnterior
'Llena Lb´s Totales
LbTotalActivoActual.Text = TotalActivoActual.ToString.FormatoNumero
LbTotalActivoAnterior.Text = TotalActivoAnterior.ToString.FormatoNumero
LbTotalPasivoActual.Text = TotalPasivoActual.ToString.FormatoNumero
LbTotalPasivoAnterior.Text = TotalPasivoAnterior.ToString.FormatoNumero
LbTotalPatrimonioActual.Text = TotalPatrimonioActual.ToString.FormatoNumero
LbTotalPatrimonioAnterior.Text = TotalPatrimonioAnterior.ToString.FormatoNumero
LbTotalPasivoPatrimonioActual.Text = TotalPasivoPatrimonioActual.ToString.FormatoNumero
LbTotalPasivoPatrimonioAnterior.Text = TotalPasivoPatrimonioAnterior.ToString.FormatoNumero
Dim Descuadre = False
'COLOREA ROJO SI NO CUADRAN TOTALES
If TotalActivoActual <> TotalPasivoPatrimonioActual Then
LbTotalActivoActual.ForeColor = Drawing.Color.Red
LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Red
Descuadre = True
Else
LbTotalActivoActual.ForeColor = Drawing.Color.Black
LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Black
End If
If TotalActivoAnterior <> TotalPasivoPatrimonioAnterior Then
LbTotalActivoAnterior.ForeColor = Drawing.Color.Red
LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Red
Descuadre = True
Else
LbTotalActivoAnterior.ForeColor = Drawing.Color.Black
LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Black
End If
If Descuadre Then
LbDescuadre.Text = "Las sumas de los totales están descuadradas."
Else
LbDescuadre.Text = ""
End If
End Sub
Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
'Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
'Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
'If ObjConta.GetSituacionFinanciera("01/01/2000".ToDate, FechaF.ToDate, DdlTipoReporte.SelectedValue.ToEntero) Then
' DtDatos = ObjConta.DtResultados
' 'If ChkFirma.Checked = True Then
' ' Dim Row As DataRow = DtDatos.NewRow
' ' Row.Item("Nombre") = String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de contabilidad", "")
' ' Row.Item("Sup") = String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", "")
' ' Row.Item("ImporteActual") = "0"
' ' Row.Item("ImporteAnterior") = "0"
' ' Row.Item("Tipo") = "Firma"
' ' DtDatos.Rows.Add(Row)
' 'End If
'End If
'ObjConta.Dispose()
ImprimirReporte()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
TotalActivoActual = 0
TotalActivoAnterior = 0
TotalPasivoActual = 0
TotalPasivoAnterior = 0
TotalPatrimonioActual = 0
TotalPatrimonioAnterior = 0
TotalPasivoPatrimonioActual = 0
TotalPasivoPatrimonioAnterior = 0
CargaDatos()
End Sub
#Region "GV´S ROW DATA BOUND"
Protected Sub GvActivo_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalActivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalActivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;")
Else
' e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte)
' e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCLabel("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCLabel("HLAnterior").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("Level").ToString = "2" Then
e.Row.FCLabel("LbNombre").Text = String.Format("&nbsp;&nbsp;&nbsp;{0}", e.Row.DBCampo("Nombre").ToString)
ElseIf e.Row.DBCampo("Level").ToString = "1" Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
End If
End Sub
Protected Sub GvPasivo_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'Totales
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalPasivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalPasivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;")
'Cuentas
Else
'e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
'e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
End If
'Colorea NEGATIVOS
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCLabel("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCLabel("HLAnterior").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("Level").ToString = "2" Then
e.Row.FCLabel("LbNombre").Text = String.Format("&nbsp;&nbsp;&nbsp;{0}", e.Row.DBCampo("Nombre").ToString)
ElseIf e.Row.DBCampo("Level").ToString = "1" Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
End If
End Sub
Protected Sub GvPatrimonio_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then
TotalPatrimonioActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble
TotalPatrimonioAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble
e.Row.FCLabel("LbNombre").Font.Italic = True
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;")
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
'e.Row.ControlStyle.Font.Bold = True
Else
' e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
' e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
e.Row.FCLabel("HLActual").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then
e.Row.FCLabel("HLAnterior").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("Level").ToString = "2" Then
e.Row.FCLabel("LbNombre").Text = String.Format("&nbsp;&nbsp;&nbsp;{0}", e.Row.DBCampo("Nombre").ToString)
ElseIf e.Row.DBCampo("Level").ToString = "1" Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
End If
End Sub
#End Region
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
ImprimirReporte("Excel")
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
'nombre del archivo a generar
Dim fileName As String = "EdoSituacionFinanciera"
'ubicacion del rdlc
Dim reportpath As String = "AC/Reportes/RepSituacionFinanciera.rdlc"
'parametros a enviar al reporte
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
params.Add(New ReportParameter("pFirma1", If(ChkFirma.Checked, String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de Contabilidad", vbCrLf), "")))
params.Add(New ReportParameter("pFirma2", If(ChkFirma.Checked, String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", vbCrLf), "")))
params.Add(New ReportParameter("pFechaFin", FechaF))
ImprimirPDF(reportpath, If(ChkNivel.Checked, DtDatos, DtDatos.FiltraParametros("Level < 2")), params, fileName, Formato)
End Sub
End Class

View File

@@ -0,0 +1,148 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepVariacionHaciendaPublica.aspx.vb" Inherits="AC_RepVariacionHaciendaPublica" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Estado de Variación de Hacienda Pública
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i>Exporta Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="BtnImprimir" runat="server" ><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />&nbsp;
<asp:ImageButton ID="BtnImprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" />&nbsp;--%>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-default" OnClick="BtnConsultar_Click" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1">Fecha Inicio:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaDel" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioDel" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaDel" runat="server" TargetControlID="TxtFechaDel" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioDel" runat="server" TargetControlID="TxtFechaDel" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
<label class="col-md-1 truncate">Fecha Fin:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAl" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioAl" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaAl" runat="server" TargetControlID="TxtFechaAl" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioAl" runat="server" TargetControlID="TxtFechaAl" PopupButtonID="ImgCalendarioAl" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
<div class="col-md-3 ">
<label class"col-md-1" style="width: 80px;">SubProyecto: </label>
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Width="250px" >
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2" runat="server" id="tdTipoReporte" visible="true">
<div class="row">
<label class="col-md-3 truncate">Tipo:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlTipoReporte" runat="server" Width="130px" CssClass="form-control input-sm">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementario" Value="2"></asp:ListItem>
<asp:ListItem Text="Complementario" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<table id="Tbl" runat="server" style="width: 100%; float: left;">
<tr>
<td width="100%" padding="0">
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" CssClass="table table-striped table-hover Widthall" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="" OnRowDataBound="GvDatos_RowDataBound" ShowFooter="True">
<Columns>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<div id="Concepto" runat="server">
<asp:Literal ID="LtNombre" Text='<%# Eval("Concepto")%>' runat="server" />
</div>
</ItemTemplate>
<ItemStyle Width="500px" HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Hacienda Pública <br/> Patrimonio Contribuido">
<ItemTemplate>
<asp:Label ID="Contribuido" Text='<%# Eval("Contribuido", "{0:N2}")%>' runat="server" />
</ItemTemplate>
<ItemStyle Width="90px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Hacienda Pública <br/> Patrimonio Generado de Ejercicios Anteriores">
<ItemTemplate>
<asp:Label ID="GeneradoAnteriores" Text='<%# Eval("GeneradoAnteriores", "{0:N2}")%>' runat="server" />
</ItemTemplate>
<ItemStyle Width="90px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Hacienda Pública <br/> Patrimonio Generado del Ejercicio">
<ItemTemplate>
<asp:Label ID="GeneradoActual" Text='<%# Eval("GeneradoActual", "{0:N2}")%>' runat="server" />
</ItemTemplate>
<ItemStyle Width="90px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ajustes por Cambios de Valor">
<ItemTemplate>
<asp:Label ID="Ajustes" Text='<%# Eval("Ajustes", "{0:N2}")%>' runat="server" />
</ItemTemplate>
<ItemStyle Width="90px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="TOTAL">
<ItemTemplate>
<asp:Label ID="Total" Text='<%# Eval("Total", "{0:N2}")%>' runat="server" />
</ItemTemplate>
<ItemStyle Width="90px" HorizontalAlign="Right" />
</asp:TemplateField>
<%-- <asp:BoundField DataField="Nombre" HeaderText="Cuenta" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="300px"/>
<asp:BoundField DataField="ImporteActual" DataFormatString="{0:N2}" HeaderText="ImporteActual" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px"/>
<asp:BoundField DataField="ImporteAnterior" DataFormatString="{0:N2}" HeaderText="ImporteAnterior" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px"/>--%>
</Columns>
<%--<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<br />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,397 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports System.IO
Imports iTextSharp.text
Imports iTextSharp.text.html.simpleparser
Imports iTextSharp.text.pdf
Imports Microsoft.Reporting.WebForms
Partial Class AC_RepVariacionHaciendaPublica
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property DtTemp As DataTable
Get
DtTemp = DirectCast(ViewState("DtTemp"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtTemp") = value
End Set
End Property
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 TotalActual As Double
Get
TotalActual = ViewState("TotalActual").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalActual") = value
End Set
End Property
Private Property TotalAnterior As Double
Get
TotalAnterior = ViewState("TotalAnterior").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TotalAnterior") = value
End Set
End Property
Private Property FechaDel As String
Get
FechaDel = ViewState("FechaDel").ToString
End Get
Set(value As String)
ViewState("FechaDel") = value
End Set
End Property
Private Property FechaAl As String
Get
FechaAl = ViewState("FechaAl").ToString
End Get
Set(value As String)
ViewState("FechaAl") = 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
TxtFechaDel.Text = DateSerial(Year(Now), Month(Now), 1).ToShortDateString
TxtFechaAl.Text = Date.Now.ToShortDateString
CargaDatos()
End If
End Sub
#Region "CARGA DATOS Y GRID"
Private Sub CargaDatos()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
Dim FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate)
Dim FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate)
FechaDel = TxtFechaDel.Text
FechaAl = TxtFechaAl.Text
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
If ObjConta.GetVariacionHaciendaPublica(FechaInicio, FechaFin, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtTemp = ObjConta.DtResultados
Else
DtTemp = Nothing
Alert("Ocurrio un error al cargar los datos del Estado de Variación de Hacienda Pública", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then
CreaDT()
End If
'GvDatos.Caption = String.Format("<div class='Titulos' style='width:100%; height:45px;'>{0}<br/>Estado de Variación de Hacienda Pública<br/>Del {1} Al {2}</div>", UsuarioActual.Empresa.Empresa, TxtFechaDel.Text, TxtFechaAl.Text)
'CargaGrid()
End Sub
Private Sub CreaDT()
DtDatos = New DataTable
'COLUMNAS DEL REPORTE (GRID)
DtDatos.Columns.Add("Concepto", GetType(String))
DtDatos.Columns.Add("Contribuido", GetType(String))
DtDatos.Columns.Add("GeneradoAnteriores", GetType(String))
DtDatos.Columns.Add("GeneradoActual", GetType(String))
DtDatos.Columns.Add("Ajustes", GetType(String))
DtDatos.Columns.Add("Total", GetType(String))
'DATOS QUE OCUPAMOS PARA LLENAR GRID
DtDatos.Columns.Add("Nivel", GetType(String))
DtDatos.Columns.Add("ImporteActual", GetType(String))
DtDatos.Columns.Add("ImporteAnterior", GetType(String))
DtDatos.Columns.Add("ResultadoActual", GetType(String))
DtDatos.Columns.Add("ResultadoAnterior", GetType(String))
LlenaDT()
End Sub
Private Sub LlenaDT()
Dim Total1, Total2, Total3, Total4, Total5 As New Double
Dim Row As DataRow = Nothing
Row = DtDatos.NewRow
Row("Nivel") = "0"
Row("Concepto") = String.Format("RECTIFICACIONES DE RESULTADOS DE EJERCICIOS ANTERIORES", Year(TxtFechaDel.Text.ToDate) - 1)
DtDatos.Rows.Add(Row)
'LLENAMOS PRIMERA PARTE, AÑO ANTERIOR - PARTE 1 (PT1)
For Each dr As DataRow In DtTemp.Rows
Row = DtDatos.NewRow
'DETALLES
Row("Concepto") = dr("Nombre")
If dr("Sup").ToString = "PATRIMONIO CONTRIBUIDO" Then
Row("Contribuido") = If(dr("ImporteAnterior").ToString.ToDouble <> 0, dr("ImporteAnterior").ToString.FormatoNumero, "")
Total1 += dr("ImporteAnterior").ToString.ToDouble
End If
If dr("Sup").ToString = "PATRIMONIO GENERADO" Then
Row("GeneradoAnteriores") = If(dr("ImporteAnterior").ToString.ToDouble <> 0, dr("ImporteAnterior").ToString.FormatoNumero, "")
Total2 += dr("ImporteAnterior").ToString.ToDouble
End If
'CAMPOS VACIOS POR MIENTRAS
Row("GeneradoActual") = ""
Row("Ajustes") = ""
Row("Total") = If(dr("ImporteAnterior").ToString.ToDouble <> 0, dr("ImporteAnterior").ToString.FormatoNumero, "")
Total5 += Row("Total").ToString.ToDouble
Row("Nivel") = "1"
'CASOS ESPECIALES
If dr("CtaMayor").ToString = "3" Then
'CAMBIOS NOMBRE - PATRIMONIO CONTRIBUIDO
If dr("Codigo").ToString.Substring(0, 5) = "00031" Then
Row("Concepto") = String.Format("PATRIMONIO NETO INICIAL AJUSTADO DEL EJERCICIO {0}", dr("Anterior"))
End If
'CAMBIOS NOMBRE - PATRIMONIO GENERADO
If dr("Codigo").ToString.Substring(0, 5) = "00032" Then
Row("Concepto") = String.Format("VARIACIONES DE LA HACIENDA PUBLICA/PATRIMONIO NETO DEL EJERCICIO {0}", dr("Anterior"))
End If
Row("Nivel") = "0"
End If
DtDatos.Rows.Add(Row)
Next
Row = DtDatos.NewRow
Row("Nivel") = "0"
Row("Concepto") = String.Format("HACIENDA PUBLICA/PATRIMONIO NETO FINAL DEL EJERCICIO", Year(TxtFechaDel.Text.ToDate) - 1)
Row("Contribuido") = Total1.ToString.FormatoNumero
Row("GeneradoAnteriores") = Total2.ToString.FormatoNumero
Row("GeneradoActual") = Total3.ToString.FormatoNumero
Row("Ajustes") = Total4.ToString.FormatoNumero
Row("Total") = (Total1 + Total2 + Total3 + Total4).ToString.FormatoNumero
DtDatos.Rows.Add(Row)
'LLENAMOS SEGUNDA PARTE, AÑO ACTUAL - PARTE 2 (PT2)
For Each dr As DataRow In DtTemp.Rows
Row = DtDatos.NewRow
'DETALLES
Row("Concepto") = dr("Nombre")
If dr("Sup").ToString = "PATRIMONIO CONTRIBUIDO" Then
Row("Contribuido") = If(dr("ImporteActual").ToString.ToDouble <> 0, dr("ImporteActual").ToString.FormatoNumero, "")
Total1 += dr("ImporteActual").ToString.ToDouble
End If
If dr("Sup").ToString = "PATRIMONIO GENERADO" Then
If dr("Codigo").ToString.Substring(0, 5) = "00321" Then
Row("GeneradoActual") = If(dr("ResultadoActual").ToString.ToDouble <> 0, dr("ResultadoActual").ToString.FormatoNumero, "")
Total3 += dr("ResultadoActual").ToString.ToDouble
Row("Total") = If(dr("ResultadoActual").ToString.ToDouble <> 0, dr("ResultadoActual").ToString.FormatoNumero, "")
Else
Row("GeneradoActual") = If(dr("ImporteActual").ToString.ToDouble <> 0, dr("ImporteActual").ToString.FormatoNumero, "")
Total3 += dr("ImporteActual").ToString.ToDouble
Row("Total") = If(dr("ImporteActual").ToString.ToDouble <> 0, dr("ImporteActual").ToString.FormatoNumero, "")
End If
End If
'CAMPOS VACIOS POR MIENTRAS
Row("GeneradoAnteriores") = ""
Row("Ajustes") = ""
Total5 += Row("Total").ToString.ToDouble
Row("Nivel") = "1"
'CASOS ESPECIALES
If dr("CtaMayor").ToString = "3" Then
'CAMBIOS NOMBRE - PATRIMONIO CONTRIBUIDO
If dr("Codigo").ToString.Substring(0, 5) = "00031" Then
Row("Concepto") = String.Format("CAMBIOS EN LA HACIENDA PUBLICA/PATRIMONIO NETO DEL EJERCICIO {0}", dr("Actual"))
End If
'CAMBIOS NOMBRE - PATRIMONIO GENERADO
If dr("Codigo").ToString.Substring(0, 5) = "00032" Then
Row("Concepto") = String.Format("VARIACIONES DE LA HACIENDA PUBLICA/PATRIMONIO NETO DEL EJERCICIO {0}", dr("Actual"))
End If
Row("Nivel") = "0"
End If
DtDatos.Rows.Add(Row)
Next
Row = DtDatos.NewRow
Row("Nivel") = "0"
Row("Concepto") = String.Format("SALDO NETO EN LA HACIENDA PUBLICA/PATRIMONIO ", Year(TxtFechaDel.Text.ToDate))
Row("Contribuido") = Total1.ToString.FormatoNumero
Row("GeneradoAnteriores") = Total2.ToString.FormatoNumero
Row("GeneradoActual") = Total3.ToString.FormatoNumero
Row("Ajustes") = Total4.ToString.FormatoNumero
Row("Total") = (Total1 + Total2 + Total3 + Total4).ToString.FormatoNumero
DtDatos.Rows.Add(Row)
CargaGrid()
End Sub
Private Sub CargaGrid()
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Nivel") = "0" Then
e.Row.Font.Bold = True
CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "margin-top:15px;")
Else
CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "margin-left: 20px; margin-top:5px;")
End If
End If
End Sub
Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs) Handles BtnImprimir.Click
ImprimirReporte() 'Descarga reporte en PDF
'Using sw As New StringWriter()
' Using hw As New HtmlTextWriter(sw)
' Dim style As StringBuilder = New StringBuilder()
' style.Append("<style> ")
' style.Append(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory & "Styles\EstilosExcel.css"))
' style.Append(" </style> ")
' 'To Export all pages
' 'Gv.AllowPaging = False
' 'Gv.DataBind()
' Tbl.RenderControl(hw)
' Dim sr As New StringReader(sw.ToString())
' Dim pdfDoc As New Document(PageSize.A2, 10.0F, 10.0F, 10.0F, 0.0F)
' Dim htmlparser As New HTMLWorker(pdfDoc)
' PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
' pdfDoc.Open()
' htmlparser.Parse(sr)
' pdfDoc.Close()
' Response.ContentType = "application/pdf"
' Response.AddHeader("content-disposition", "attachment;filename=FlujoDeEfectivo.pdf")
' Response.Cache.SetCacheability(HttpCacheability.NoCache)
' Response.Write(style.ToString)
' Response.Write(pdfDoc)
' Response.[End]()
' End Using
'End Using
End Sub
'No quitar porque no funciona el exporta PDF
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
' Verifies that the control is rendered
End Sub
'Protected Sub GvDatos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowCreated
' If (e.Row.RowType = DataControlRowType.Header) Then
' Dim HeaderGrid As GridView = DirectCast(sender, GridView)
' Dim HeaderGridRow As GridViewRow = New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert)
' Dim HeaderCell As TableCell = New TableCell()
' HeaderCell.Text = String.Format("<div class='Titulos' style='width:100%; height:45px;'>{0}<br/>Estado de Variación de Hacienda Pública<br/>Del {1} Al {2}</div>", UsuarioActual.Empresa.Empresa, TxtFechaDel.Text, TxtFechaAl.Text)
' HeaderCell.ColumnSpan = GvDatos.Columns.Count
' HeaderCell.HorizontalAlign = HorizontalAlign.Center
' HeaderGridRow.Cells.Add(HeaderCell)
' GvDatos.Controls(0).Controls.AddAt(0, HeaderGridRow)
' End If
' If (e.Row.RowType = DataControlRowType.Footer) Then
' Dim HeaderGrid As GridView = DirectCast(sender, GridView)
' Dim HeaderGridRow As GridViewRow = New GridViewRow(0, 0, DataControlRowType.Footer, DataControlRowState.Insert)
' Dim HeaderCell As TableCell = New TableCell()
' HeaderCell.Text = "<table><tr> <td colspan='3' style='height:30px;'> <br/><br/><br/><br/></td></tr><tr><td >_________________________________<br/>C.P. Izelda Angulo Peraza</td><td style='width:75px'> </td><td > _________________________________<br/>Lic. Juan Fortino Leon Robinson</td></tr><tr><td>Subdirector de Contabilidad</td><td style='width:75px'> </td><td>Director General</td></table>"
' HeaderCell.ColumnSpan = GvDatos.Columns.Count
' HeaderCell.HorizontalAlign = HorizontalAlign.Center
' HeaderGridRow.Cells.Add(HeaderCell)
' e.Row.Cells.Clear()
' e.Row.Cells.Add(HeaderCell)
' End If
'End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
'GvDatos.ExportToExcel("123456" & Now.ToShortDateString)
ImprimirReporte("Excel") 'Descarga reporte en Excel
End Sub
'Descarga reporte en PDF o Excel
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
'ubicacion del rdlc
Dim reportpath As String = "AC/Reportes/VariacionHaciendaPublica.rdlc"
Dim fileName As String = "EdoVariacionHaciendaPublica"
'parametros a enviar al reporte
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
params.Add(New ReportParameter("pFechaIni", TxtFechaDel.Text))
params.Add(New ReportParameter("pFechaFin", TxtFechaAl.Text))
params.Add(New ReportParameter("pFirma1", String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de Contabilidad", vbCrLf)))
params.Add(New ReportParameter("pFirma2", String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", vbCrLf)))
ImprimirPDF(reportpath, DtDatos, params, fileName, Formato)
'MasterReporteador.Visible = True
End Sub
End Class

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
Contabilidad2/vssver2.scc Normal file

Binary file not shown.