221 lines
11 KiB
Plaintext
221 lines
11 KiB
Plaintext
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepRazonesFinancieras.aspx.vb" Inherits="Finanzas_RepRazonesFinancieras" %>
|
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
|
</asp:Content>
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
|
<style>
|
|
#div_Grafica{
|
|
width:100%;
|
|
height:400px;
|
|
}
|
|
</style>
|
|
</asp:Content>
|
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
|
Razones Financieras
|
|
</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:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
|
|
<ContentTemplate>
|
|
<div class="btn-group pull-right btn-separete">
|
|
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" Width="95" class="btn btn-fit-height btnopaco" OnClick="BtnConsultar_Click" />
|
|
</div>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
</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">
|
|
<a href="javascript:;" class="expand"></a>
|
|
</div>
|
|
<div class="titlefiltros caption">
|
|
<div class="row">
|
|
<label class="col-md-1 truncate">Tipo:</label>
|
|
<div class="col-md-2">
|
|
<asp:DropDownList ID="DdlRazones" runat="server" DataTextField="RazonFinanciera" DataValueField="Codigo" Class=" form-control input-inline input-small input-sm">
|
|
</asp:DropDownList>
|
|
</div>
|
|
<label class="col-md-1 truncate">Centro de Costo</label>
|
|
<div class="col-md-2">
|
|
<asp:DropDownList ID="DdlSubproyectos" CssClass="form-control select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" ></asp:DropDownList>
|
|
</div>
|
|
<label class="col-md-1 truncate">Escala</label>
|
|
<div class="col-md-1">
|
|
<asp:DropDownList ID="DdlEscala" runat="server" CssClass="form-control select2me" Width="70px" >
|
|
<asp:ListItem Value="1" Text="Unidad"></asp:ListItem>
|
|
<asp:ListItem Value="1000" Text="Miles" Selected="True"></asp:ListItem>
|
|
<asp:ListItem Value="1000000" Text="Millones"></asp:ListItem>
|
|
</asp:DropDownList>
|
|
</div>
|
|
<label class="col-md-1 truncate">Periodo</label>
|
|
<div class="col-md-3">
|
|
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="form-control select2me" Width="100px" >
|
|
<asp:ListItem Value="M" Text="Mensual" Selected="True"></asp:ListItem>
|
|
<asp:ListItem Value="B" Text="Bimestral"></asp:ListItem>
|
|
<asp:ListItem Value="T" Text="Trimestral"></asp:ListItem>
|
|
<asp:ListItem Value="C" Text="Cuatrimentral"></asp:ListItem>
|
|
<asp:ListItem Value="S" Text="Semestral"></asp:ListItem>
|
|
<asp:ListItem Value="A" Text="Anual"></asp:ListItem>
|
|
</asp:DropDownList>
|
|
Gráfica
|
|
<asp:DropDownList ID="DdlGrafica" runat="server" CssClass="form-control select2me" Width="70px" >
|
|
<asp:ListItem Value="L" Text="Lineas" Selected="True"></asp:ListItem>
|
|
<asp:ListItem Value="B" Text="Barras"></asp:ListItem>
|
|
<asp:ListItem Value="S" Text="Stacked"></asp:ListItem>
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="portlet-body">
|
|
<div class="row">
|
|
|
|
Titulos <asp:TextBox ID="TxtTitulo" runat="server" Width="200px" CssClass="input-sm"></asp:TextBox>
|
|
|
|
<div class="col-md-1 truncate">Fecha Inicio</div>
|
|
<div class="col-md-2 col-sm-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" CausesValidation="true" 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">Fecha Fin</div>
|
|
<div class="col-md-2 col-sm-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" CausesValidation="true" 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>
|
|
<label class="col-md-1 truncate">Muestra valores</label>
|
|
<div class="col-md-2">
|
|
<asp:CheckBox ID="ChkMuestraValores" runat="server" Checked="true" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
|
|
|
|
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
|
|
<ContentTemplate>
|
|
<div id="div_Grafica" ></div>
|
|
|
|
<asp:GridView ID="GVDatos" CssClass="Widthall table table-striped tablita" GridLines="none" runat="server" OnRowDataBound="GVDatos_RowDataBound"></asp:GridView>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
|
|
</asp:Content>
|
|
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
|
<script>
|
|
|
|
function LimpiaCeros(Divisor) {
|
|
debugger;
|
|
|
|
$('.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());
|
|
}
|
|
$(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 recargatabla() {
|
|
if ($('.tablita').data('cargada') == 1) {
|
|
} else {
|
|
$('.tablita').data('cargada', '1');
|
|
$('table.tablita tr').each(function (index) {
|
|
if (index > 0) {
|
|
$($(this).find('td')).each(function (index2) {
|
|
if (index2 > 0) {
|
|
$(this).html('<span data-toggle="tooltip" title="' + $(this).html() + '">' + addCommas($(this).html()) + '</span>');
|
|
}
|
|
});
|
|
} else {
|
|
$($(this).find('th')).each(function (index2) {
|
|
if (index2 = 0) {
|
|
$(this).html('');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
function addCommas(nStr) {
|
|
nStr += '';
|
|
var x = nStr.split('.');
|
|
var x1 = x[0];
|
|
var x2 = x.length > 1 ? '.' + x[1] : '';
|
|
var rgx = /(\d+)(\d{3})/;
|
|
while (rgx.test(x1)) {
|
|
x1 = x1.replace(rgx, '$1' + ',' + '$2');
|
|
}
|
|
var retorno = x1 + x2;
|
|
if (retorno == 'NaN') {
|
|
retorno = nStr;
|
|
}
|
|
return retorno;
|
|
}
|
|
|
|
function filldata() {
|
|
CargaGrafica();
|
|
recargatabla();
|
|
}
|
|
|
|
jQuery(document).ready(function () {
|
|
Sys.Application.add_load(function (s, e) {
|
|
filldata()
|
|
});
|
|
filldata()
|
|
});
|
|
</script>
|
|
</asp:Content>
|
|
|