Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIndicadorResumen.aspx.vb" Inherits="General_RepIndicadorResumen" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
|
||||
<%-- <li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Exportar</asp:LinkButton>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportarPDF" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Exportar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<%--<li>
|
||||
<asp:LinkButton ID="LnkExportarExcel" runat="server"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Exportar Excel</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
|
||||
@@ -33,7 +36,7 @@
|
||||
}
|
||||
div[id^=chartdiv] {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
height: 400px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
@@ -41,7 +44,6 @@
|
||||
Reporte de Resumen de Indicadores
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<%--Tabla con los campos para filtrar--%>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
@@ -78,8 +80,9 @@
|
||||
<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 class="col-md-1 truncate" style="text-align: right!important; margin-left: 20px">SubProyecto</div>
|
||||
<div class="col-md-1 truncate" style="text-align: right!important; margin-left: 20px">
|
||||
<asp:Label runat="server" ID="lblSubProyecto">SubProyecto:</asp:Label>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-sm select2me" runat="server" Width="150px" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
|
||||
</asp:DropDownList>
|
||||
@@ -93,16 +96,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<%--<div class="row">
|
||||
<div class="col-md-6"></div>
|
||||
<div class="col-md-6 amChartsAttribution">
|
||||
<a href="http://www.amcharts.com/" class="amChartsLegend" id="amChartsAttribution">JS charts by amCharts</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>--%>
|
||||
<asp:UpdatePanel ID="UPPMov" runat="server" RenderMode="Inline" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPTablaVxP" runat="server" class="portlet light xspadding bordered " align="left" UpdateMode="Conditional">
|
||||
@@ -122,12 +123,13 @@
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<asp:GridView ID="GvVxP" runat="server" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD Widthall" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Gpo" HeaderText="Prod/Serv" ItemStyle-Width="300px" />
|
||||
<asp:BoundField DataFormatString="{0:n}" DataField="Cantidad" ItemStyle-CssClass="margenbound" HeaderText="Cantidad" />
|
||||
<asp:BoundField DataFormatString="{0:n}" DataField="SubTotal" ItemStyle-CssClass="margenbound" HeaderText="SubTotal" />
|
||||
<asp:BoundField DataFormatString="{0:c}" DataField="SubTotal" ItemStyle-CssClass="margenbound" HeaderText="SubTotal" />
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
@@ -161,12 +163,207 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPTablaCxP192" runat="server" class="portlet light xspadding bordered " align="left" UpdateMode="Conditional">
|
||||
<asp:UpdatePanel ID="UPTablaCompProductores" runat="server" class="portlet light xspadding bordered " align="left" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span8" runat="server" class="caption-subject bold uppercase">Compras por Productos - Proveedor Productor</span>
|
||||
<span id="Span8" runat="server" class="caption-subject bold uppercase">Compras Productores</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<asp:GridView ID="GvCompProductores" runat="server" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD Widthall " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="RazonSocial" HeaderText="Proveedor" />
|
||||
<asp:BoundField DataFormatString="{0:n}" DataField="Cantidad" ItemStyle-CssClass="margenbound" HeaderText="Cantidad(kg)" />
|
||||
<asp:BoundField DataFormatString="{0:c}" DataField="SubTotal" ItemStyle-CssClass="margenbound" HeaderText="Importe" />
|
||||
<asp:BoundField DataFormatString="{0:c}" DataField="PUPromedioKG" ItemStyle-CssClass="margenbound" HeaderText="Promedio/kg" />
|
||||
<asp:BoundField DataFormatString="{0:c}" DataField="Saldo" ItemStyle-CssClass="margenbound" HeaderText="Saldo" />
|
||||
<asp:BoundField DataFormatString="{0:c}" DataField="Abonado" ItemStyle-CssClass="margenbound" HeaderText="Abonado" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPGraficaCompProductores" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span9" runat="server" class="caption-subject bold uppercase">Compras Productores - Gráfica por Cantidad(Kg) </span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<div id="chartdiv_compproductores"></div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPTablaCompAcreed" runat="server" class="portlet light xspadding bordered " align="left" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span1" runat="server" class="caption-subject bold uppercase">Gastos </span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<asp:GridView ID="GvCompAcreed" runat="server" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD Widthall " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificación" ItemStyle-Width="300px" />
|
||||
<asp:BoundField DataFormatString="{0:n}" DataField="Cantidad" ItemStyle-CssClass="margenbound" HeaderText="Cantidad" />
|
||||
<asp:BoundField DataFormatString="{0:c}" DataField="SubTotal" ItemStyle-CssClass="margenbound" HeaderText="Importe" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPGraficaCompAcreed" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span2" runat="server" class="caption-subject bold uppercase">Compras por clasificación - Gráfica </span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<div id="chartdiv_compacreed"></div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPTablaCxC" runat="server" class="portlet light xspadding bordered " align="left" style="" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span3" runat="server" class="caption-subject bold uppercase">Cuentas por cobrar</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<asp:GridView ID="GvCxC" runat="server" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD Widthall " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="RazonSocial" HeaderText="Cliente" />
|
||||
<asp:BoundField DataFormatString="{0:c}" DataField="Saldo" ItemStyle-CssClass="margenbound" HeaderText="Saldo" />
|
||||
<asp:BoundField DataFormatString="{0:c}" DataField="Recuperado" ItemStyle-CssClass="margenbound" HeaderText="Recuperado" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPGraficaCxC" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span5" runat="server" class="caption-subject bold uppercase">Cuentas por cobrar - Gráfica Saldo VS Recuperado</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<div id="chartdiv_cxc"></div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPGraficaCxCRec" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span10" runat="server" class="caption-subject bold uppercase">Cuentas por cobrar - Gráfica Recuperado</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<div id="chartdiv_cxcrec"></div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPTablaCxP192" runat="server" class="portlet light xspadding bordered " align="left" style="" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span11" runat="server" class="caption-subject bold uppercase">Cuentas por Pagar productores</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
@@ -178,12 +375,11 @@
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<asp:GridView ID="GvCxP192" runat="server" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD Widthall " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Gpo" HeaderText="Prod/Serv" ItemStyle-Width="300px" />
|
||||
<asp:BoundField DataFormatString="{0:n}" DataField="Cantidad" ItemStyle-CssClass="margenbound" HeaderText="Cantidad" />
|
||||
<asp:BoundField DataFormatString="{0:n}" DataField="SubTotal" ItemStyle-CssClass="margenbound" HeaderText="SubTotal" />
|
||||
<asp:BoundField DataField="RazonSocial" HeaderText="Proveedor" />
|
||||
<asp:BoundField DataFormatString="{0:c}" DataField="Saldo" ItemStyle-CssClass="margenbound" HeaderText="Saldo" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
@@ -197,7 +393,7 @@
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span9" runat="server" class="caption-subject bold uppercase">Compras por Productos - Proveedor Productor - Gráfica </span>
|
||||
<span id="Span12" runat="server" class="caption-subject bold uppercase">Cuentas por Pagar productores - Gráfica </span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
@@ -217,12 +413,12 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPTablaCxP" runat="server" class="portlet light xspadding bordered " align="left" UpdateMode="Conditional">
|
||||
<asp:UpdatePanel ID="UPTablaCxP" runat="server" class="portlet light xspadding bordered " align="left" style="" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span1" runat="server" class="caption-subject bold uppercase">Compras por Productos </span>
|
||||
<span id="Span6" runat="server" class="caption-subject bold uppercase">Cuentas por Pagar no productores</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
@@ -234,12 +430,11 @@
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<asp:GridView ID="GvCxP" runat="server" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD Widthall " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Gpo" HeaderText="Prod/Serv" ItemStyle-Width="300px" />
|
||||
<asp:BoundField DataFormatString="{0:n}" DataField="Cantidad" ItemStyle-CssClass="margenbound" HeaderText="Cantidad" />
|
||||
<asp:BoundField DataFormatString="{0:n}" DataField="SubTotal" ItemStyle-CssClass="margenbound" HeaderText="SubTotal" />
|
||||
<asp:BoundField DataField="RazonSocial" HeaderText="Proveedor" />
|
||||
<asp:BoundField DataFormatString="{0:c}" DataField="Saldo" ItemStyle-CssClass="margenbound" HeaderText="Saldo" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
@@ -253,7 +448,7 @@
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span2" runat="server" class="caption-subject bold uppercase">Compras por Productos - Gráfica </span>
|
||||
<span id="Span7" runat="server" class="caption-subject bold uppercase">Cuentas por Pagar no productores - Gráfica </span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
@@ -271,116 +466,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPTablaCCxC" runat="server" class="portlet light xspadding bordered " align="left" style="" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span3" runat="server" class="caption-subject bold uppercase">Cuentas por cobrar por Cliente </span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<asp:GridView ID="GvCCxC" runat="server" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Gpo" HeaderText="Cliente" />
|
||||
<asp:BoundField DataFormatString="{0:n}" DataField="Saldo" ItemStyle-CssClass="margenbound" HeaderText="Saldo" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPGraficaCCxC" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span5" runat="server" class="caption-subject bold uppercase">Cuentas por cobrar por Cliente - Gráfica </span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<div id="chartdiv_ccxc"></div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPTablaCPxP" runat="server" class="portlet light xspadding bordered " align="left" style="" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span6" runat="server" class="caption-subject bold uppercase">Cuentas por pagar por Proveedor </span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<asp:GridView ID="GvCPxP" runat="server" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Gpo" HeaderText="Cliente" />
|
||||
<asp:BoundField DataFormatString="{0:n}" DataField="Saldo" ItemStyle-CssClass="margenbound" HeaderText="Saldo" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPGraficaCPxP" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span id="Span7" runat="server" class="caption-subject bold uppercase">Cuentas por pagar por Proveedor - Gráfica </span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<div id="chartdiv_cpxp"></div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:AsyncPostBackTrigger ControlID="btnConsultar" EventName="Click" />
|
||||
@@ -393,88 +478,145 @@
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<%--<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>--%>
|
||||
<%--<script src="https://code.highcharts.com/modules/data.js"></script>--%>
|
||||
|
||||
<script>
|
||||
|
||||
function CargaGraficasPastel(json) {
|
||||
Highcharts.setOptions({
|
||||
lang: {
|
||||
thousandsSep: ',',
|
||||
decimalPoint: '.'
|
||||
},
|
||||
colors: ["#FF0F00", "#FF6600", "#FF9E01", "#FCD202", "#F8FF01", "#B0DE09", "#04D215", "#0D8ECF", "#0D52D1", "#2A0CD0", "#8A0CCF", "#CD0D74", "#754DEB", "#DDDDDD", "#999999", "#333333"]
|
||||
});
|
||||
|
||||
function CargaGraficas(json) {
|
||||
|
||||
// Configuración genérica para todas las gráficas
|
||||
const chartconfig = {
|
||||
"hideCredits": true,
|
||||
"type": "pie",
|
||||
"theme": "light",
|
||||
"dataProvider": [], // se sobrescribe con la sección indicada del JSON en makeChart
|
||||
"valueField": "Valor",
|
||||
"titleField": "Texto",
|
||||
//"legend": {
|
||||
// "valueLabels": {
|
||||
// "text": "{value.value}"
|
||||
// }
|
||||
chart: {
|
||||
marginRight: 50
|
||||
},
|
||||
title: {
|
||||
text: undefined,
|
||||
align: 'left'
|
||||
},
|
||||
legend: {
|
||||
enabled: false
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category'
|
||||
},
|
||||
yAxis: {
|
||||
//min: 0,
|
||||
opposite: true,
|
||||
tickPixelInterval: 150,
|
||||
title: {
|
||||
text: null
|
||||
},
|
||||
stackLabels: {
|
||||
enabled: true,
|
||||
formatter: function () {
|
||||
return Highcharts.numberFormat(this.total, 2, null, ',');
|
||||
}
|
||||
},
|
||||
// labels: {
|
||||
// style: {
|
||||
// color: 'red'
|
||||
// },
|
||||
// formatter: function () {
|
||||
// return Highcharts.numberFormat(this.value, null, null, ',');
|
||||
// }
|
||||
// }
|
||||
},
|
||||
//tooltip: {
|
||||
// formatter: function (tooltip) {
|
||||
// var tooltiptext = tooltip.defaultFormatter.call(this, tooltip);
|
||||
// //var isCurrency = /^(\d|-)?(\d|,)*\.?\d*$/.test(/<b>(.*?)<\/b>/.exec(tooltiptext));
|
||||
// //if (isCurrency) {
|
||||
// // tooltiptext = tooltiptext.replace("<b>", "<b>$");
|
||||
// //}
|
||||
// tooltiptext = tooltiptext.replace("</b>", " " + this.point.unit + "</b>");
|
||||
// console.log(tooltiptext)
|
||||
// return tooltiptext
|
||||
// },
|
||||
// //footerFormat: '{point.key}'
|
||||
//},
|
||||
"outlineAlpha": 0.4,
|
||||
"depth3D": 0,
|
||||
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]% [[Moneda]])</span>",
|
||||
"angle": 0,
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
plotOptions: {
|
||||
series: {
|
||||
animation: true,
|
||||
groupPadding: 0,
|
||||
pointPadding: 0.1,
|
||||
borderWidth: 0,
|
||||
colorByPoint: true,
|
||||
//dataSorting: {
|
||||
// enabled: true,
|
||||
// matchByName: true
|
||||
//},
|
||||
stacking: 'normal',
|
||||
type: 'bar',
|
||||
dataLabels: {
|
||||
enabled: false,
|
||||
// format: '${y}'
|
||||
// formatter: function () {
|
||||
// var defaultlabel = Highcharts.getOptions().plotOptions[this.point.series.type].dataLabels.formatter.call(this);
|
||||
// var isCurrency = /^(\d|-)?(\d|,)*\.?\d*$/.test(defaultlabel);
|
||||
// return isCurrency ? "$" + defaultlabel : defaultlabel;
|
||||
// }
|
||||
// formatter: function () {
|
||||
// return this.total;
|
||||
// },
|
||||
},
|
||||
animation: {
|
||||
duration: 750
|
||||
}
|
||||
},
|
||||
pie: {
|
||||
dataLabels: {
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'bar',
|
||||
keys: ['name', 'y', 'unit'],
|
||||
data: undefined
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// document.querySelectorAll('div[id^=chartdiv]').forEach((chartdiv) => {
|
||||
// AmCharts.makeChart(chartdiv, chartconfig);
|
||||
// });
|
||||
//AmCharts.makeChart("chartdiv_vxp", { ...chartconfig, type: "serial", dataProvider: json["VxP"] }); // Ventas x Producto
|
||||
|
||||
AmCharts.makeChart("chartdiv_vxp", { ...chartconfig, dataProvider: json["VxP"] }); // Ventas x Producto
|
||||
AmCharts.makeChart("chartdiv_cxp", { ...chartconfig, dataProvider: json["CxP"] }); // Compras x Producto TipoProveedor 1
|
||||
AmCharts.makeChart("chartdiv_cxp192", { ...chartconfig, dataProvider: json["CxP192"] }); // Compras x Producto ProveedorClasificacion 192
|
||||
AmCharts.makeChart("chartdiv_ccxc", { ...chartconfig, dataProvider: json["CCxC"] }); // Cuentas por Cobrar x Cliente
|
||||
AmCharts.makeChart("chartdiv_cpxp", { ...chartconfig, dataProvider: json["CPxP"] }); // Cuentas por Pagar x Proveedor
|
||||
$('#' + "chartdiv_vxp").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["VxP"]) }] })
|
||||
$('#' + "chartdiv_compproductores").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], type: 'pie', data: customAccessor(json["CompProductores"]) }] })
|
||||
$('#' + "chartdiv_compacreed").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CompAcreed"]) }] })
|
||||
$('#' + "chartdiv_cxp192").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxP192"]) }] })
|
||||
$('#' + "chartdiv_cxp").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxP"]) }] })
|
||||
$('#' + "chartdiv_cxc").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxC"]) }, { type: 'line', data: customAccessor(json["CxCR"]) }] })
|
||||
|
||||
function customAccessor(data) {
|
||||
const newData = [];
|
||||
data.forEach(function (point, index) {
|
||||
if (point.Texto == "Otros") {
|
||||
newData.push({name:point.Texto, y:point.Valor, unit:point.Unidad, color:'#000000'});
|
||||
} else {
|
||||
newData.push([point.Texto, point.Valor, point.Unidad]);
|
||||
}
|
||||
});
|
||||
//newData.sort(function (a, b) {
|
||||
// return a[0] > b[0] ? 1 : -1;
|
||||
//});
|
||||
console.log(JSON.stringify(newData))
|
||||
return newData;
|
||||
}
|
||||
|
||||
document.getElementById('amChartsAttribution').style.visibility = 'visible';
|
||||
}
|
||||
/*
|
||||
function CargaGraficasBarras(json) {
|
||||
|
||||
var chart = AmCharts.makeChart("chartdiv2", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"dataProvider": json,
|
||||
"startDuration": 2,
|
||||
"valueAxes": [{
|
||||
"position": "left",
|
||||
"title": "Ventas"
|
||||
}],
|
||||
"graphs": [{
|
||||
"balloonText": "[[category]]: <b>[[value]]</b> [[Moneda]]",
|
||||
"colorField": "Color",
|
||||
"fillAlphas": 1,
|
||||
"lineAlpha": 0.1,
|
||||
"type": "column",
|
||||
"valueField": "Valor"
|
||||
}],
|
||||
"depth3D": 20,
|
||||
"angle": 30,
|
||||
"chartCursor": {
|
||||
"categoryBalloonEnabled": false,
|
||||
"cursorAlpha": 0,
|
||||
"zoomable": false
|
||||
},
|
||||
"categoryField": "Texto",
|
||||
"categoryAxis": {
|
||||
"gridPosition": "start",
|
||||
"labelRotation": 90
|
||||
},
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
});
|
||||
}*/
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -1,223 +1,125 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports MoreLinq
|
||||
|
||||
Partial Class General_RepIndicadorResumen
|
||||
Inherits ClsPaginas
|
||||
#Region "propiedades"
|
||||
|
||||
Private Property VxP As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("VxP") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("VxP"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("VxP") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CxP As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("CxP") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("CxP"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("CxP") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CxP192 As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("CxP192") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("CxP192"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("CxP192") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CCxC As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("CCxC") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("CCxC"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("CCxC") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CPxP As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("CPxP") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("CPxP"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("CPxP") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#If False Then
|
||||
Private Property DtColor As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("DtColor") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DtColor"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtColor") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaCombos()
|
||||
|
||||
'Carga SubProyectos
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, lblSubProyecto)
|
||||
TxtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
|
||||
TxtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||
|
||||
CreaDataTableColor()
|
||||
'CreaDataTableColor()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles btnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim ObjCompras As New ClsCompras
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
Dim ObjMovtos As New ClsMovimientos
|
||||
Dim ObjCitrus As New ClsCGame
|
||||
|
||||
If ObjVentas.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), MinFecha, MaxFecha, -1,
|
||||
-1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=1) Then
|
||||
VxP = ObjVentas.DtResultados
|
||||
GvVxP.DataSource = VxP
|
||||
Else
|
||||
GvVxP.DataSource = Nothing
|
||||
VxP = Nothing
|
||||
-1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:="Ing", TipoCambio:=1) Then
|
||||
GvVxP.DataSource = ObjVentas.DtResultados.FiltraParametros("", "CveMoneda,SubTotal DESC")
|
||||
End If
|
||||
|
||||
If ObjCompras.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), -1, -1, -1,
|
||||
UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveProveedorClasificacion:=192) Then
|
||||
CxP192 = ObjCompras.DtResultados
|
||||
GvCxP192.DataSource = CxP192
|
||||
Else
|
||||
GvCxP192.DataSource = Nothing
|
||||
CxP192 = Nothing
|
||||
End If
|
||||
|
||||
If ObjCompras.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), -1, -1, -1,
|
||||
UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveTipoProveedor:=1) Then
|
||||
CxP = ObjCompras.DtResultados
|
||||
GvCxP.DataSource = CxP
|
||||
Else
|
||||
GvCxP.DataSource = Nothing
|
||||
CxP = Nothing
|
||||
End If
|
||||
|
||||
Dim FechaCorte As String = $"31/12/{Now.Year}"
|
||||
|
||||
If ObjMovtos.GetCxC(TxtFechaI.Text, TxtFechaF.Text, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, -1, 1, -1,
|
||||
"-1", "-1", "-1", FechaCorte:=FechaCorte.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
|
||||
|
||||
CCxC = ObjMovtos.DtResultados
|
||||
GvCCxC.DataSource = CCxC
|
||||
Else
|
||||
GvCCxC.DataSource = Nothing
|
||||
CCxC = Nothing
|
||||
End If
|
||||
|
||||
If ObjMovtos.GetCxP(TxtFechaI.Text, TxtFechaF.Text, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, -1, 1, -1,
|
||||
"-1", "-1", "-1", FechaCorte:=FechaCorte.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
|
||||
|
||||
CPxP = ObjMovtos.DtResultados
|
||||
GvCPxP.DataSource = CPxP
|
||||
Else
|
||||
GvCPxP.DataSource = Nothing
|
||||
CPxP = Nothing
|
||||
If ObjCitrus.GetIndicadores(UsuarioActual.CveEmpresa, TxtFechaI.Text, TxtFechaF.Text, UsuarioActual.CveUsuario, DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
'Compras Productores
|
||||
GvCompProductores.DataSource = ObjCitrus.DTSetResultados.Tables(0).FiltraParametros("", "RazonSocial DESC")
|
||||
'CxP Productores
|
||||
GvCxP192.DataSource = ObjCitrus.DTSetResultados.Tables(1).FiltraParametros("", "CveMoneda,Saldo DESC")
|
||||
'CxP NO productores
|
||||
GvCxP.DataSource = ObjCitrus.DTSetResultados.Tables(2).FiltraParametros("", "CveMoneda,Saldo DESC")
|
||||
'Gastos (Compras acreedores)
|
||||
GvCompAcreed.DataSource = ObjCitrus.DTSetResultados.Tables(3).FiltraParametros("", "CveMoneda,SubTotal DESC")
|
||||
'Cuentas x Cobrar
|
||||
GvCxC.DataSource = ObjCitrus.DTSetResultados.Tables(4).FiltraParametros("", "CveMoneda,Saldo DESC")
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
ObjCompras.Dispose()
|
||||
ObjMovtos.Dispose()
|
||||
ObjCitrus.Dispose()
|
||||
|
||||
GvVxP.DataBind()
|
||||
GvCompProductores.DataBind()
|
||||
GvCompAcreed.DataBind()
|
||||
GvCxP192.DataBind()
|
||||
GvCxP.DataBind()
|
||||
GvCCxC.DataBind()
|
||||
GvCPxP.DataBind()
|
||||
GvCxC.DataBind()
|
||||
If GvCxC.DataSource IsNot Nothing Then
|
||||
GvCxC.HeaderRow.Cells(1).Text = "<a href=""/CxC/RepCxC.aspx"" target=""_blank"">Saldo</a>"
|
||||
GvCxC.HeaderRow.Cells(2).Text = "<a href=""/Ventas/RepRecuperacion.aspx"" target=""_blank"">Recuperado</a>"
|
||||
End If
|
||||
|
||||
' Mostrar gráficos solo si hay datos en su respectiva tabla
|
||||
'Mostrar gráficos solo si hay datos en su respectiva tabla
|
||||
If GvVxP.Rows.Count > 0 Then
|
||||
UPGraficaVxP.Visible = True
|
||||
Else
|
||||
UPGraficaVxP.Visible = False
|
||||
End If
|
||||
If GvCxP.Rows.Count > 0 Then
|
||||
UPGraficaCxP.Visible = True
|
||||
If GvCompProductores.Rows.Count > 0 Then
|
||||
UPGraficaCompProductores.Visible = True
|
||||
Else
|
||||
UPGraficaCxP.Visible = False
|
||||
UPGraficaCompProductores.Visible = False
|
||||
End If
|
||||
If GvCompAcreed.Rows.Count > 0 Then
|
||||
UPGraficaCompAcreed.Visible = True
|
||||
Else
|
||||
UPGraficaCompAcreed.Visible = False
|
||||
End If
|
||||
If GvCxC.Rows.Count > 0 Then
|
||||
UPGraficaCxC.Visible = True
|
||||
'UPGraficaCxCRec.Visible = True
|
||||
Else
|
||||
UPGraficaCxC.Visible = False
|
||||
'UPGraficaCxCRec.Visible = False
|
||||
End If
|
||||
If GvCxP192.Rows.Count > 0 Then
|
||||
UPGraficaCxP192.Visible = True
|
||||
Else
|
||||
UPGraficaCxP192.Visible = False
|
||||
End If
|
||||
If GvCCxC.Rows.Count > 0 Then
|
||||
UPGraficaCCxC.Visible = True
|
||||
If GvCxP.Rows.Count > 0 Then
|
||||
UPGraficaCxP.Visible = True
|
||||
Else
|
||||
UPGraficaCCxC.Visible = False
|
||||
End If
|
||||
If GvCPxP.Rows.Count > 0 Then
|
||||
UPGraficaCPxP.Visible = True
|
||||
Else
|
||||
UPGraficaCPxP.Visible = False
|
||||
UPGraficaCxP.Visible = False
|
||||
End If
|
||||
|
||||
' Si no había datos en ninguna tabla no cargar función de gráficos
|
||||
If (GvVxP.Rows.Count = 0 AndAlso GvCxP.Rows.Count = 0 AndAlso GvCxP192.Rows.Count = 0 AndAlso GvCCxC.Rows.Count = 0 AndAlso GvCPxP.Rows.Count = 0) Then Exit Sub
|
||||
GraficasPastel()
|
||||
'GraficasBarras()
|
||||
'Si no había datos en ninguna tabla no cargar función de gráficos
|
||||
If GvVxP.Rows.Count = 0 _
|
||||
AndAlso GvCompProductores.Rows.Count = 0 _
|
||||
AndAlso GvCompAcreed.Rows.Count = 0 _
|
||||
AndAlso GvCxC.Rows.Count = 0 _
|
||||
AndAlso GvCxP192.Rows.Count = 0 _
|
||||
AndAlso GvCxP.Rows.Count = 0 _
|
||||
Then Exit Sub
|
||||
|
||||
Graficas()
|
||||
End Sub
|
||||
Protected Sub GvVxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvVxP.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
@@ -226,260 +128,278 @@ Partial Class General_RepIndicadorResumen
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvCxP192_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxP192.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CveProveedor") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvCxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxP.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("Orden") = "" Then
|
||||
If e.Row.DBCampo("CveProveedor") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvCCxC_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCCxC.RowDataBound
|
||||
Protected Sub GvComprasAcreed_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompAcreed.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("Orden") = "" Then
|
||||
If e.Row.DBCampo("CveClasificacion") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvCPxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCPxP.RowDataBound
|
||||
Protected Sub GvCxC_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxC.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("Orden") = "" Then
|
||||
If e.Row.DBCampo("CveCliente") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
#If False Then
|
||||
Private Sub CreaDataTableColor()
|
||||
DtColor = New DataTable
|
||||
DtColor.Columns.Add("Color")
|
||||
Dim RowColor As DataRow = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#FF0F00"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#FF6600"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#FF9E01"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#FCD202"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#F8FF01"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#B0DE09"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#04D215"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#0D8ECF"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#0D52D1"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#2A0CD0"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#8A0CCF"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#CD0D74"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#754DEB"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#DDDDDD"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#999999"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#333333"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#000000"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
DtColor.Rows.Add("#FF0F00")
|
||||
DtColor.Rows.Add("#FF6600")
|
||||
DtColor.Rows.Add("#FF9E01")
|
||||
DtColor.Rows.Add("#FCD202")
|
||||
DtColor.Rows.Add("#F8FF01")
|
||||
DtColor.Rows.Add("#B0DE09")
|
||||
DtColor.Rows.Add("#04D215")
|
||||
DtColor.Rows.Add("#0D8ECF")
|
||||
DtColor.Rows.Add("#0D52D1")
|
||||
DtColor.Rows.Add("#2A0CD0")
|
||||
DtColor.Rows.Add("#8A0CCF")
|
||||
DtColor.Rows.Add("#CD0D74")
|
||||
DtColor.Rows.Add("#754DEB")
|
||||
DtColor.Rows.Add("#DDDDDD")
|
||||
DtColor.Rows.Add("#999999")
|
||||
DtColor.Rows.Add("#333333")
|
||||
DtColor.Rows.Add("#000000")
|
||||
End Sub
|
||||
#End If
|
||||
|
||||
Private Sub GraficasPastel()
|
||||
Private Sub Graficas()
|
||||
|
||||
Dim DtVxP, DtCxP, DtCxP192, DtCCxC, DtCPxP As New DataTable
|
||||
Dim RowColorIndex As Integer = 0
|
||||
Dim DtVxP, DtCxP192, DtCxP, DtCompProductores, DtCompAcreed, DtCxC, DtCxCR As New DataTable
|
||||
'Dim RowColorIndex As Integer = 0
|
||||
|
||||
'Ventas x Producto
|
||||
DtVxP.Reset()
|
||||
DtVxP.Columns.Add("Texto")
|
||||
DtVxP.Columns.Add("Valor")
|
||||
DtVxP.Columns.Add("Color")
|
||||
DtVxP.Columns.Add("Moneda")
|
||||
RowColorIndex = 0
|
||||
For Each Dr As DataRow In VxP.Rows
|
||||
'DtVxP.Columns.Add("Color")
|
||||
DtVxP.Columns.Add("Unidad")
|
||||
'RowColorIndex = 0
|
||||
For Each Dr As DataRow In CType(GvVxP.DataSource, DataTable).FiltraParametros("", "SubTotalMN DESC").Rows
|
||||
If Not Dr("Orden").ToString = "" Then
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = DtVxP.NewRow()
|
||||
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
|
||||
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||
Row("Moneda") = Dr("Moneda").ToString
|
||||
Dim Row = DtVxP.NewRow()
|
||||
Row("Texto") = Dr("GPO").ToString
|
||||
Row("Valor") = Dr("SubTotalMN").ToString.FormatoNumero
|
||||
Row("Unidad") = "MXN" '$"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||
DtVxP.Rows.Add(Row)
|
||||
RowColorIndex += 1
|
||||
If RowColorIndex = 17 Then
|
||||
RowColorIndex = 0
|
||||
End If
|
||||
'RowColorIndex += 1
|
||||
'If RowColorIndex = 17 Then
|
||||
' RowColorIndex = 0
|
||||
'End If
|
||||
End If
|
||||
Next
|
||||
Dim query_vxp = From s In DtVxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
||||
Dim vxp = From s In DtVxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_vxp = vxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = g.Key,
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
}).ToDataTable
|
||||
Dim top_vxp = From s In group_vxp.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim resto_vxp = From s In group_vxp.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_resto_vxp = resto_vxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = "Otros",
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
})
|
||||
Dim query_vxp = top_vxp.Union(group_resto_vxp)
|
||||
'Dim query_vxp = top_vxp.Concat(From e In resto_vxp Group e By e.Texto Into gpo = Group)
|
||||
'Dim group_resto_vxp = From e In resto_vxp Group e By e.Texto Into gpo = Group
|
||||
'Dim group_resto_vxp = resto_vxp.GroupBy(Function(e) New With {Key e.Texto, Key e.Valor, Key e.Color, Key e.Unidad}).ToList()
|
||||
|
||||
'Compras x Producto TipoProveedor=1
|
||||
DtCxP.Reset()
|
||||
DtCxP.Columns.Add("Texto")
|
||||
DtCxP.Columns.Add("Valor")
|
||||
DtCxP.Columns.Add("Color")
|
||||
DtCxP.Columns.Add("Moneda")
|
||||
RowColorIndex = 0
|
||||
For Each Dr As DataRow In CxP.Rows
|
||||
If Not Dr("Orden").ToString = "" Then
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = DtCxP.NewRow()
|
||||
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
|
||||
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||
Row("Moneda") = Dr("Moneda").ToString
|
||||
DtCxP.Rows.Add(Row)
|
||||
RowColorIndex += 1
|
||||
If RowColorIndex = 17 Then
|
||||
RowColorIndex = 0
|
||||
End If
|
||||
'Compras ProveedorClasificacion=192
|
||||
DtCompProductores.Reset()
|
||||
DtCompProductores.Columns.Add("Texto")
|
||||
DtCompProductores.Columns.Add("Valor")
|
||||
DtCompProductores.Columns.Add("Unidad")
|
||||
For Each Dr As DataRow In GvCompProductores.DataSource.Rows
|
||||
Dim Row = DtCompProductores.NewRow()
|
||||
Row("Texto") = Dr("RazonSocial").ToString
|
||||
Row("Valor") = Dr("Cantidad").ToString.FormatoNumero
|
||||
Row("Unidad") = "Kg"
|
||||
DtCompProductores.Rows.Add(Row)
|
||||
Next
|
||||
Dim comp_productores = From s In DtCompProductores.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_comp_productores = comp_productores.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = g.Key,
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
}).ToDataTable
|
||||
Dim top_comp_productores = From s In group_comp_productores.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim resto_comp_productores = From s In group_comp_productores.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_resto_comp_productores = resto_comp_productores.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = "Otros",
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
})
|
||||
Dim query_comp_productores = top_comp_productores.Union(group_resto_comp_productores)
|
||||
|
||||
'Compras TipoProveedor=1 Acreedores (Gastos)
|
||||
DtCompAcreed.Reset()
|
||||
DtCompAcreed.Columns.Add("Texto")
|
||||
DtCompAcreed.Columns.Add("Valor")
|
||||
DtCompAcreed.Columns.Add("Unidad")
|
||||
For Each Dr As DataRow In CType(GvCompAcreed.DataSource, DataTable).FiltraParametros("", "SubTotalMN DESC").Rows
|
||||
If Dr("CveClasificacion").ToString <> "" Then
|
||||
Dim Row = DtCompAcreed.NewRow()
|
||||
Row("Texto") = Dr("Clasificacion").ToString
|
||||
Row("Valor") = Dr("SubTotalMN").ToString.FormatoNumero
|
||||
Row("Unidad") = "MXN" 'Dr("Moneda").ToString
|
||||
DtCompAcreed.Rows.Add(Row)
|
||||
End If
|
||||
Next
|
||||
Dim query_cxp = From s In DtCxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
||||
Dim comp_acreed = From s In DtCompAcreed.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_comp_acreed = comp_acreed.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = g.Key,
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
}).ToDataTable
|
||||
Dim top_comp_acreed = From s In group_comp_acreed.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim resto_comp_acreed = From s In group_comp_acreed.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_resto_comp_acreed = resto_comp_acreed.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = "Otros",
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
})
|
||||
Dim query_comp_acreed = top_comp_acreed.Union(group_resto_comp_acreed)
|
||||
|
||||
'Compras x Producto ProveedorClasificacion=192
|
||||
'Cuentas por cobrar x Cliente -- Saldo
|
||||
DtCxC.Reset()
|
||||
DtCxC.Columns.Add("Texto")
|
||||
DtCxC.Columns.Add("Valor")
|
||||
DtCxC.Columns.Add("Unidad")
|
||||
For Each Dr As DataRow In CType(GvCxC.DataSource, DataTable).FiltraParametros("", "SaldoMN DESC").Rows
|
||||
If Not Dr("CveCliente").ToString = "" Then
|
||||
Dim Row = DtCxC.NewRow()
|
||||
Row("Texto") = Dr("RazonSocial").ToString
|
||||
Row("Valor") = Dr("SaldoMN").ToString.FormatoNumero
|
||||
Row("Unidad") = "MXN" '$"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||
DtCxC.Rows.Add(Row)
|
||||
End If
|
||||
Next
|
||||
Dim cxc = From s In DtCxC.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_cxc = cxc.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = g.Key,
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
}).ToDataTable
|
||||
Dim top_cxc = From s In group_cxc.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim resto_cxc = From s In group_cxc.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_resto_cxc = resto_cxc.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = "Otros",
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
})
|
||||
Dim query_cxc = top_cxc.Union(group_resto_cxc)
|
||||
'Alert(Newtonsoft.Json.JsonConvert.SerializeObject(CxC.Rows))
|
||||
|
||||
'Cuentas por cobrar x Cliente -- Recuperado
|
||||
DtCxCR.Reset()
|
||||
DtCxCR.Columns.Add("Texto")
|
||||
DtCxCR.Columns.Add("Valor")
|
||||
DtCxCR.Columns.Add("Unidad")
|
||||
For Each Dr As DataRow In CType(GvCxC.DataSource, DataTable).FiltraParametros("", "SaldoMN DESC").Rows
|
||||
If Not Dr("CveCliente").ToString = "" Then
|
||||
Dim Row = DtCxCR.NewRow()
|
||||
Row("Texto") = Dr("RazonSocial").ToString
|
||||
Row("Valor") = Dr("RecuperadoMN").ToString.FormatoNumero
|
||||
Row("Unidad") = "MXN" '$"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||
DtCxCR.Rows.Add(Row)
|
||||
End If
|
||||
Next
|
||||
Dim cxcr = From s In DtCxCR.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_cxcr = cxcr.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = g.Key,
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
}).ToDataTable
|
||||
Dim top_cxcr = From s In group_cxcr.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim resto_cxcr = From s In group_cxcr.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_resto_cxcr = resto_cxcr.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = "Otros",
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
})
|
||||
Dim query_cxcr = top_cxcr.Union(group_resto_cxcr)
|
||||
|
||||
'CxP proveedores
|
||||
DtCxP192.Reset()
|
||||
DtCxP192.Columns.Add("Texto")
|
||||
DtCxP192.Columns.Add("Valor")
|
||||
DtCxP192.Columns.Add("Color")
|
||||
DtCxP192.Columns.Add("Moneda")
|
||||
RowColorIndex = 0
|
||||
For Each Dr As DataRow In CxP192.Rows
|
||||
If Not Dr("Orden").ToString = "" Then
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = DtCxP192.NewRow()
|
||||
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
|
||||
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||
Row("Moneda") = Dr("Moneda").ToString
|
||||
DtCxP192.Columns.Add("Unidad")
|
||||
For Each Dr As DataRow In CType(GvCxP192.DataSource, DataTable).FiltraParametros("", "SaldoMN DESC").Rows
|
||||
If Not Dr("CveProveedor").ToString = "" Then
|
||||
Dim Row = DtCxP192.NewRow()
|
||||
Row("Texto") = Dr("RazonSocial").ToString
|
||||
Row("Valor") = Dr("SaldoMN").ToString.FormatoNumero
|
||||
Row("Unidad") = "MXN"
|
||||
DtCxP192.Rows.Add(Row)
|
||||
RowColorIndex += 1
|
||||
If RowColorIndex = 17 Then
|
||||
RowColorIndex = 0
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Dim query_cxp192 = From s In DtCxP192.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
||||
Dim cxp192 = From s In DtCxP192.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_cxp192 = cxp192.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = g.Key,
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
}).ToDataTable
|
||||
Dim top_cxp192 = From s In group_cxp192.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim resto_cxp192 = From s In group_cxp192.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_resto_cxp192 = resto_cxp192.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = "Otros",
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
})
|
||||
Dim query_cxp192 = top_cxp192.Union(group_resto_cxp192)
|
||||
|
||||
'Alert(Newtonsoft.Json.JsonConvert.SerializeObject(CCxC.Rows))
|
||||
|
||||
'Cuentas por cobrar x Cliente
|
||||
DtCCxC.Reset()
|
||||
DtCCxC.Columns.Add("Texto")
|
||||
DtCCxC.Columns.Add("Valor")
|
||||
DtCCxC.Columns.Add("Color")
|
||||
DtCCxC.Columns.Add("Moneda")
|
||||
RowColorIndex = 0
|
||||
For Each Dr As DataRow In CCxC.Rows
|
||||
If Not Dr("Orden").ToString = "" Then
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = DtCCxC.NewRow()
|
||||
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||
Row("Valor") = Dr("Saldo").ToString.FormatoNumero
|
||||
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||
Row("Moneda") = Dr("Moneda").ToString
|
||||
DtCCxC.Rows.Add(Row)
|
||||
RowColorIndex += 1
|
||||
If RowColorIndex = 17 Then
|
||||
RowColorIndex = 0
|
||||
End If
|
||||
'CxP NO proveedor
|
||||
DtCxP.Reset()
|
||||
DtCxP.Columns.Add("Texto")
|
||||
DtCxP.Columns.Add("Valor")
|
||||
DtCxP.Columns.Add("Unidad")
|
||||
For Each Dr As DataRow In CType(GvCxP.DataSource, DataTable).FiltraParametros("", "SaldoMN DESC").Rows
|
||||
If Not Dr("CveProveedor").ToString = "" Then
|
||||
Dim Row = DtCxP.NewRow()
|
||||
Row("Texto") = Dr("RazonSocial").ToString
|
||||
Row("Valor") = Dr("SaldoMN").ToString.FormatoNumero
|
||||
Row("Unidad") = "MXN"
|
||||
DtCxP.Rows.Add(Row)
|
||||
End If
|
||||
Next
|
||||
Dim query_ccxc = From s In DtCCxC.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
||||
Dim cxp = From s In DtCxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_cxp = cxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = g.Key,
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
}).ToDataTable
|
||||
Dim top_cxp = From s In group_cxp.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim resto_cxp = From s In group_cxp.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||
Dim group_resto_cxp = resto_cxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||
.Texto = "Otros",
|
||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||
.Unidad = "MXN"
|
||||
})
|
||||
Dim query_cxp = top_cxp.Union(group_resto_cxp)
|
||||
|
||||
'Cuentas por pagar x Proveedor
|
||||
DtCPxP.Reset()
|
||||
DtCPxP.Columns.Add("Texto")
|
||||
DtCPxP.Columns.Add("Valor")
|
||||
DtCPxP.Columns.Add("Color")
|
||||
DtCPxP.Columns.Add("Moneda")
|
||||
RowColorIndex = 0
|
||||
For Each Dr As DataRow In CPxP.Rows
|
||||
If Not Dr("Orden").ToString = "" Then
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = DtCPxP.NewRow()
|
||||
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||
Row("Valor") = Dr("Saldo").ToString.FormatoNumero
|
||||
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||
Row("Moneda") = Dr("Moneda").ToString
|
||||
DtCPxP.Rows.Add(Row)
|
||||
RowColorIndex += 1
|
||||
If RowColorIndex = 17 Then
|
||||
RowColorIndex = 0
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Dim query_cpxp = From s In DtCPxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
||||
|
||||
'Serializar datos agrupándolos en su respectivo DataTable, todos en un solo JSON
|
||||
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CxP = query_cxp, .CxP192 = query_cxp192, .CCxC = query_ccxc, .CPxP = query_cpxp})
|
||||
'Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CCxC = New String() {}})
|
||||
'Serializar datos agrupándolos por su respectivo DataTable, todos en un solo JSON
|
||||
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CompProductores = query_comp_productores, .CompAcreed = query_comp_acreed, .CxC = query_cxc, .CxCR = query_cxcr, .CxP192 = query_cxp192, .CxP = query_cxp})
|
||||
'Alert(json)
|
||||
RegistraScript($"CargaGraficasPastel({json})", "22")
|
||||
RegistraScript($"CargaGraficas({json})", "sdkp24223")
|
||||
UPPMov.Update()
|
||||
End Sub
|
||||
Private Sub GraficasBarras()
|
||||
'Dim Dt As New DataTable()
|
||||
'Dt.Columns.Add("Texto")
|
||||
'Dt.Columns.Add("Valor")
|
||||
'Dt.Columns.Add("Color")
|
||||
'Dt.Columns.Add("Moneda")
|
||||
'Dim RowColorIndex As Integer = 0
|
||||
'For Each Dr As DataRow In VxC.Rows
|
||||
' If Not Dr("Orden").ToString = "" Then
|
||||
' Dim Row As DataRow = Nothing
|
||||
' Row = Dt.NewRow()
|
||||
' Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||
' Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
|
||||
' Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||
' Row("Moneda") = Dr("Moneda").ToString
|
||||
' Dt.Rows.Add(Row)
|
||||
' RowColorIndex += 1
|
||||
' If RowColorIndex = 17 Then
|
||||
' RowColorIndex = 0
|
||||
' End If
|
||||
' End If
|
||||
'Next
|
||||
|
||||
'Dim query = From s In Dt.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
||||
'Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(query)
|
||||
'RegistraScript($"CargaGraficasBarras({json})", "22")
|
||||
'UPPMov.Update()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user