Cambios en reporte de utilidades

This commit is contained in:
Raul Pimienta
2019-08-27 09:51:06 -07:00
parent c3a3c602ef
commit 913afba332
4 changed files with 102 additions and 27 deletions

View File

@@ -233,7 +233,7 @@
<tr>
<td id="dvInv" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 42%; 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: 25%; border-style: solid;"><b>Costo</b></td>
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 40%; font-size: 14px;"><b>Utilidad/Pérdida</b></td>
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 42%; font-size: 14px;"><b>Utilidad/Pérdida</b></td>
</tr>
</table>
</div>
@@ -287,7 +287,7 @@
</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>

View File

@@ -180,7 +180,9 @@ Partial Class Ventas_RepVentasUtilidad
e.Row.BackColor = ColorTranslator.FromHtml("#95A5A6")
End If
If Not e.Row.RowIndex = 0 AndAlso e.Row.DBCampo("CveVenta") <> "" Then
If Not e.Row.RowIndex = 0 AndAlso e.Row.DBCampo("SubTotal").ToDecimal = 0 AndAlso e.Row.DBCampo("CveVenta").ToEntero > 0 Then
e.Row.CssClass = "danger"
ElseIf Not e.Row.RowIndex = 0 AndAlso e.Row.DBCampo("CveVenta") <> "" Then
e.Row.Cells(0).BackColor = ColorTranslator.FromHtml("#e9e9e9")
e.Row.Cells(1).BackColor = ColorTranslator.FromHtml("#e9e9e9")
e.Row.Cells(2).BackColor = ColorTranslator.FromHtml("#e9e9e9")

View File

@@ -4,7 +4,7 @@
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
<style>
.gvFull tr td:nth-child(4) {
/*.gvFull tr td:nth-child(4) {
display: none;
}
@@ -18,7 +18,7 @@
.gvFull tr th:nth-child(7) {
display: none;
}
}*/
.Widthall {
@@ -64,7 +64,8 @@
.white a {
color: white !important;
}
.select2 .select2-selection__rendered {
.select2 .select2-selection__rendered {
line-height: 1;
color: #111;
}
@@ -279,6 +280,48 @@
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpBonificacion" runat="server" UpdateMode="Conditional" class="col-md-4">
<ContentTemplate>
<div class="portlet smmallpadding light bordered" id="Div2" runat="server">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase"><a id="A2" runat="server" class="Texto">Bonificación </a></span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="expand"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="padding-top: 0px; margin-top: -5px;">
<div class="form-body">
<asp:GridView ID="GvBonificacion" runat="server" CssClass="table table-striped table-hover Widthall"
AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText=""
GridLines="None" DataKeyNames="CveVenta,Serie,Folio,SerieFolio,FolioFiscal,TipoDocto,CveConceptoContable,Importe">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>Factura</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplFactura" runat="server" Target="_blank" CssClass="Texto" Text='<%# Eval("SerieFolio") %>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="TipoDocto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Fecha" DataField="FechaAplicado" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Total" DataField="SubTotal" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Anticipo/NC/IxC" DataField="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Mon" DataField="Moneda" ItemStyle-HorizontalAlign="Center" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDetallesCosto" runat="server" UpdateMode="Conditional" class="col-md-4">
<ContentTemplate>
<div class="portlet smmallpadding light bordered" id="Div1" runat="server">
@@ -320,7 +363,7 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpIndicador" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivUtilidad" visible="False" runat="server" class="col-md-3">
@@ -371,10 +414,10 @@
<ContentTemplate>
<div id="dvCa" style="width:100%;top:40px">
<table id="dTable" class="correcto table Widthall Titulos"><tr>
<td id="Td1" runat="server" class="dataTables_scrollHead" style="text-align:center!important; font-size:14px; width:30%;"><b>Producto</b></td>
<td id="dvInv" runat="server" class="dataTables_scrollHead" style="text-align:center!important; font-size:14px; width:25%; border-left-color: white!important;border-style: solid;border-right-color: white!important;"><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:18%;border-style: solid;"><b>Costo</b></td>
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align:center!important;width: 35%;font-size:14px; "><b>Utilidad/Pérdida</b></td>
<td id="Td1" runat="server" class="dataTables_scrollHead" style="text-align:center!important; font-size:14px; width:25%;"><b>Producto</b></td>
<td id="dvInv" runat="server" class="dataTables_scrollHead" style="text-align:center!important; font-size:14px; width:30%; border-left-color: white!important;border-style: solid;border-right-color: white!important;"><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:15%;border-style: solid;"><b>Costo</b></td>
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align:center!important;width: 15%;font-size:14px; "><b>Utilidad/Pérdida</b></td>
</tr></table>
</div>
</ContentTemplate>
@@ -383,51 +426,72 @@
<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" ToolTip="Listado de Ventas" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
<asp:GridView ID="GvDatos" runat="server" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas Utilidad con los filtros especificados" ToolTip="Listado de Ventas" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Cant." ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<asp:BoundField HeaderText="TipoDocto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Cant." ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LbCantVenta" runat="server" Text='<%# If(Eval("CantVta").ToString() = "0", "-", Eval("CantVta", "{0:#,###.00}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Código" ItemStyle-Width="10%">
<asp:TemplateField HeaderText="Código" >
<ItemTemplate>
<asp:Label ID="LbCodigo" runat="server" Text='<%# If(Eval("Codigo").ToString() = "0", "-", Eval("Codigo", "{0:#,###.##}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PS" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left">
<asp:TemplateField HeaderText="PS" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LbPS" runat="server" Text='<%# If(Eval("PS").ToString() = "0", "-", Eval("PS", "{0:#,###.##}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="5%" DataNavigateUrlFields="CveVenta" DataTextField="SerieFolio" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveVenta" DataTextField="SerieFolio" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
<asp:TemplateField HeaderText="P.U" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
<asp:TemplateField HeaderText="P.U" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LbPU1" runat="server" Text='<%# If(Eval("PUVta").ToString() = "0", "-", Eval("PUVta", "{0:#,###.00}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
<asp:TemplateField HeaderText="SubTotal" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LbTotal1" runat="server" Text='<%# If(Eval("TotalVta").ToString() = "0", "-", Eval("TotalVta", "{0:#,###.00}")) %>'></asp:Label>
<asp:Label ID="LbSubTotal" runat="server" Text='<%# If(Eval("SubTotal").ToString() = "0", "-", Eval("SubTotal", "{0:#,###.00}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Descuento" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LbDescuento" runat="server" Text='<%# If(Eval("Descuento").ToString() = "0", "-", Eval("Descuento", "{0:#,###.00}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Bonificacion" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LbBonificacion" runat="server" Text='<%# If(Eval("Bonificacion").ToString() = "0", "-", Eval("Bonificacion", "{0:#,###.00}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SubTotal2" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LbSubTotal2" runat="server" Text='<%# If(Eval("SubTotal2").ToString() = "0", "-", Eval("SubTotal2", "{0:#,###.00}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="5%" DataNavigateUrlFields="CveMovimiento" DataTextField="FolioMovto" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"/>
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveMovimiento" DataTextField="FolioMovto" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"/>
<asp:TemplateField HeaderText="P.U " ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
<asp:TemplateField HeaderText="P.U " ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LbPUs" runat="server" Text='<%# If(Eval("PUInv").ToString() = "0", "-", Eval("PUInv", "{0:#,###.##}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LbTotal" runat="server" Text='<%# If(Eval("TotalInv").ToString() = "0", "-", Eval("TotalInv", "{0:#,###.00}")) %>'></asp:Label>
</ItemTemplate>
@@ -437,25 +501,25 @@
<asp:TemplateField HeaderText="Utilidad" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Right">
<asp:TemplateField HeaderText="Utilidad" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LbUt" runat="server" Text='<%# If(Eval("Utilidad").ToString() = "0", "-", Eval("Utilidad", "{0:#,###.00}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="%" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Right">
<asp:TemplateField HeaderText="%" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LbPorUtilidad" runat="server" Text='<%# If(Eval("PorUtilidad").ToString() = "0", "-", Eval("PorUtilidad", "{0:#,###.00}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Pérdida" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Right">
<asp:TemplateField HeaderText="Pérdida" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LbPerdida" runat="server" Text='<%# If(Eval("Perdida").ToString() = "0", "-", Eval("Perdida", "{0:#,###.00}")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="%" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Right">
<asp:TemplateField HeaderText="%" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LbPorPerdida" runat="server" Text='<%# If(Eval("PorPerdida").ToString() = "0", "-", Eval("PorPerdida", "{0:#,###.00}")) %>'></asp:Label>
</ItemTemplate>

View File

@@ -196,7 +196,14 @@ Partial Class Ventas_RepVentasUtilidadDetalle
LblPorUtilidad.Text = ((ObjVentas.Utilidad - ObjVentas.Perdida) / ObjVentas.SubTotalVenta * 100).ToString("N2")
LblPerdida.Text = "$" + (ObjVentas.Perdida - ObjVentas.Utilidad).ToString("N2")
LblPorPerdida.Text = ((ObjVentas.Perdida - ObjVentas.Utilidad) / ObjVentas.SubTotalVenta * 100).ToString("N2")
If ObjVentas.GetVentasAntNC(CveVenta, -1) Then
GvBonificacion.DataSource = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
GvBonificacion.DataBind()
If ObjVentas.SubTotalVenta <> ObjVentas.SubTotalVentaDolares Then
LbSubTotalDolares.Visible = True
@@ -220,10 +227,12 @@ Partial Class Ventas_RepVentasUtilidadDetalle
End If
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Or e.Row.DBCampo("CveVentaDetalle") = "" Then
If e.Row.DBCampo("CveVentaDetalle") = "" AndAlso e.Row.DBCampo("CveVenta") = "" Then
e.Row.CssClass = "Totales"
Else
'e.Row.Cells(0).BackColor = ColorTranslator.FromHtml("#e9e9e9")