Files
SIG/Ventas/RepVentasUtilidad.aspx
rrene 059a99953f cambios en filtro de Categoría en
repentradassalidas
reputilidadventas
2022-01-05 22:17:15 -07:00

345 lines
24 KiB
Plaintext

<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepVentasUtilidad.aspx.vb" Inherits="Ventas_RepVentasUtilidad" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a {
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
.white a{
color: white !important;
}
.select2 .select2-selection__rendered {
line-height: 1;
color: #111;
}
.select2 .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 20px;
user-select: none;
-webkit-user-select: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
margin-top: 10px;
}
.select2-selection__rendered {
margin-top: 0px;
height: 25px;
}
.select2-selection {
margin-top: 0px;
height: 31px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: none;
outline: 0;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Utilidad o Pérdida sobre Ventas
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li>
</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">
<%--<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />--%>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="PFiltro" class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT smalltitle " style="">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<div class="col-md-1 truncate">
Sucursal:
</div>
<div class="col-md-2 ">
<%-- <asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>--%>
<asp:ListBox ID="DdlSubProyecto" SelectionMode="Multiple" data-text="Todas" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
</div>
<div class="col-md-1 truncate">
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: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" 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="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1 truncate">
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: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" 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="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none;">
<div class="row">
<div class="col-md-1 truncate">
Cliente:
</div>
<div class="col-md-2 ">
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;">
</ADS:Dropdownlost>
</div>
<div class="col-md-1 truncate">
Vendedor:
</div>
<div class="col-md-2 ">
<%-- <asp:DropDownList ID="DdlVendedor" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>--%>
<asp:ListBox ID="DdlVendedor" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
</div>
<div class="col-md-1 truncate">Categoría</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlCategoria" CssClass="form-control input-sm select2me" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlCategoria_SelectedIndexChanged" Width="100%" DataTextField="Categoria" DataValueField="CveCategoria"></asp:DropDownList>
</div>
<div class="col-md-1 truncate">
Clasificación:
</div>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" OnSelectedIndexChanged="DdlClasificacion_SelectedIndexChanged" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate">
P.S.:
</div>
<div class="col-md-2">
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
</div>
<div class="col-md-1 truncate">
Marca:
</div>
<div class="col-md-2">
<asp:Dropdownlist runat="server" ID="DdlMarcas" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%" DataTextField="Marca" DataValueField="CveMarca" />
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpIndicador" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" >
<div id="DivNeto" runat="server" class="col-md-offset-4 col-md-3">
<div id="DivClaseNeto" runat="server" class="dashboard-stat dashboard-stat-v2 green">
<div class="visual"><i class="fa fa-bar-chart-o" '=""></i></div>
<div class="details"><div class="number"><asp:Label ID="LblNombreNeto" runat="server"></asp:Label></div>
<div class="desc"><label id="LblNetoIndicador" runat="server" class="indicadortipo2 col-md-6 tooltips" data-original-title="Neto">
<asp:Label ID="LblNeto" runat="server"></asp:Label></label>
<label id="LblPorNetoIndicador" runat="server" class="indicadortipo2 col-md-6 tooltips" data-original-title="Porcentaje">
<asp:Label ID="LblPorNeto" runat="server" Text=""></asp:Label>&nbsp;%</label>
</div>
</div>
</div>
</div>
<div class="col-md-5" align="right" style="margin-top:85px;">
<input type="text" id="TxtBuscar" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscar','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscar','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<br />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpEncabezado" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="dvCa" style="width: 100%; top: 40px">
<table id="dTable" class="correcto table Widthall Titulos">
<tr>
<td id="dvInv" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 37%; font-size: 14px;"><b>Venta</b></td>
<td id="dvVen" runat="server" class="dataTables_scrollHead" style="text-align: center!important; font-size: 14px; border-right-color: white!important; border-left-color: white!important; width: 22%; border-style: solid;"><b>Costo</b></td>
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 46%; font-size: 14px;"><b>Utilidad/Pérdida</b></td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas Utilidad con los filtros especificados" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
<Columns>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Serie Folio" DataTextField="SerieFolio" DataTextFormatString="{0}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Fecha" DataTextField="FechaVenta" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Right" HeaderText="SubTotal" DataTextField="SubTotal" DataTextFormatString="{0:N}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Right" HeaderText="Descuento" DataTextField="Descuento" DataTextFormatString="{0:N}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Right" HeaderText="Bonificacion" DataTextField="Bonificacion" DataTextFormatString="{0:N}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Right" HeaderText="SubTotal2" DataTextField="SubTotal2" DataTextFormatString="{0:N}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField Text="Ir" DataNavigateUrlFields="CveVenta" ItemStyle-Width="2.5%" ItemStyle-HorizontalAlign="Center" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Folio" ItemStyle-CssClass="Texto" DataTextField="FolioMovto" DataTextFormatString="{0}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Fecha" DataTextField="FechaMovto" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
<asp:TemplateField HeaderText="Costo" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%">
<ItemTemplate>
<asp:HyperLink ID="HLCosto" runat="server" Text='<%# If(Eval("Costo").ToString() = "0", "-", Eval("Costo", "{0:#,##0.00}")) %>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField Text="Ir" DataNavigateUrlFields="CveMovimiento" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="2.5%" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" />
<asp:TemplateField HeaderText="$ Neto" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink ID="HlNeto" runat="server" Text='<%# If(Eval("Neto").ToString() = "0", "-", Eval("Neto", "{0:#,##0.00}")) %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="% Neto" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink ID="HlPorNeto" runat="server" Text='<%# If(Eval("PorNeto").ToString() = "0", "-", Eval("PorNeto", "{0:#,##0.00}%")) %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Utilidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink ID="HlGanancia" runat="server" Text='<%# If(Eval("Utilidad").ToString() = "0", "-", Eval("Utilidad", "{0:#,##0.00}")) %>'> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink ID="HlPorGanancia" runat="server" Text='<%# If(Eval("PorUtilidad").ToString() = "0", "-", Eval("PorUtilidad", "{0:#,##0.00}%")) %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Pérdida" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink ID="HlPerdida" runat="server" Text='<%# If(Eval("Perdida").ToString() = "0", "-", Eval("Perdida", "{0:#,##0.00}")) %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:HyperLink ID="HlPorPerdida" runat="server" Text='<%# If(Eval("PorPerdida").ToString() = "0", "-", Eval("PorPerdida", "{0:#,##0.00}%")) %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="% Rentabilidad" DataTextFormatString="{0:N}" DataTextField="Rentabilidad" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script src="/aspnet_client/system_web/4_0_30319/crystalreportviewers/js/crviewer/crv.js" type="text/javascript"></script>
<script type="text/javascript">
function OrdenarGV() {
var Tam = TamañoVentana();
var Alto = Tam.height - 270;
if (Alto < 100) {
Alto = 100;
}
$('#C_GvDatos').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false,
ordering: false
});
$('#C_GvDatos').parent().parent().children().first().css("position", "static");
}
</script>
</asp:Content>