This commit is contained in:
janeth arvizu
2019-08-27 10:50:19 -07:00
6 changed files with 214 additions and 76 deletions

View File

@@ -1103,6 +1103,7 @@ Partial Class Bancos_IE
If (Not VerificaComplementos(True)) And UsuarioActual.TienePermisoProceso(99) And ObjIE.CveEstatusIE <> 2 Then
BtnEditar.Visible = True
PermisoComplementoVigente = True
Else
BtnEditar.Visible = True
End If

View File

@@ -5,6 +5,8 @@ Imports System.Data
Imports Extensiones
Imports System.Xml
Imports Microsoft.Reporting.WebForms
Imports GemBox.Spreadsheet
Partial Class General_SaldosIniciales
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -25,44 +27,46 @@ Partial Class General_SaldosIniciales
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
Dim dt As New DataTable
Dim Conexion As Odbc.OdbcConnection = Nothing
' Conexion As Odbc.OdbcConnection = Nothing
Dim ErrorArchivo = False
Dim ErrorExcel = False
Dim strConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + Ruta + FileName + ";Extended Properties=""Excel 12.0 Xml;HDR=YES;IMEX=1;"""
Dim objDbFactory As Common.DbProviderFactory = Common.DbProviderFactories.GetFactory("System.Data.OleDb")
Dim objDbAdapter As Common.DbDataAdapter = objDbFactory.CreateDataAdapter()
Dim objDbConnection As Common.DbConnection = objDbFactory.CreateConnection()
objDbConnection.ConnectionString = strConnString
objDbConnection.Open()
Dim objSheetNames As DataTable = objDbConnection.GetSchema("Tables")
Dim HojaExcel As String = objSheetNames.FiltroPrimeroValor("TABLE_NAME")
Try
Select Case Tipo
Case "CSV"
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Access Text Driver (*.txt, *.csv)};Dbq=" + Ruta + ";Extensions=asc,csv,tab,txt;")
Conexion.Open()
Dim cmd = Conexion.CreateCommand()
cmd.CommandType = CommandType.Text
cmd.CommandText = $"SELECT * FROM [{FileName}]"
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
DataAdapter.Fill(dt)
Case "EXCEL"
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
Conexion.Open()
Dim cmd = Conexion.CreateCommand()
cmd.CommandType = CommandType.Text
cmd.CommandText = $"SELECT * FROM [{HojaExcel}]"
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
DataAdapter.Fill(dt)
Case Else
Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
Exit Sub
End Select
Catch ex As Exception
ErrorArchivo = True
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
End Try
Conexion.Close()
dt = ReadExcelFile(Ruta + FileName, True)
'Dim strConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + Ruta + FileName + ";Extended Properties=""Excel 12.0 Xml;HDR=YES;IMEX=1;"""
'Dim objDbFactory As Common.DbProviderFactory = Common.DbProviderFactories.GetFactory("System.Data.OleDb")
'Dim objDbAdapter As Common.DbDataAdapter = objDbFactory.CreateDataAdapter()
'Dim objDbConnection As Common.DbConnection = objDbFactory.CreateConnection()
'objDbConnection.ConnectionString = strConnString
'objDbConnection.Open()
'Dim objSheetNames As DataTable = objDbConnection.GetSchema("Tables")
'Dim HojaExcel As String = objSheetNames.FiltroPrimeroValor("TABLE_NAME")
'Try
' Select Case Tipo
' Case "CSV"
' Conexion = New Odbc.OdbcConnection("Driver={Microsoft Access Text Driver (*.txt, *.csv)};Dbq=" + Ruta + ";Extensions=asc,csv,tab,txt;")
' Conexion.Open()
' Dim cmd = Conexion.CreateCommand()
' cmd.CommandType = CommandType.Text
' cmd.CommandText = $"SELECT * FROM [{FileName}]"
' Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
' DataAdapter.Fill(dt)
' Case "EXCEL"
' Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
' Conexion.Open()
' Dim cmd = Conexion.CreateCommand()
' cmd.CommandType = CommandType.Text
' cmd.CommandText = $"SELECT * FROM [{HojaExcel}]"
' Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
' DataAdapter.Fill(dt)
' Case Else
' Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
' Exit Sub
' End Select
'Catch ex As Exception
' ErrorArchivo = True
' OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
'End Try
'Conexion.Close()
If Not ErrorArchivo Then
If RblFormato.SelectedValue = "1" Or RblFormato.SelectedValue = "2" Then
If Not dt.Columns(0).ColumnName = "Codigo" Then
@@ -1523,57 +1527,69 @@ Partial Class General_SaldosIniciales
ElseIf RblFormato.SelectedValue = "12" Then
Dim ObjMovimientos As New ClsInventarios
ObjMovimientos.IniciaTransacSQL()
Dim OcurrioError As Boolean = False
Dim ProductosServiciosRef As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
Dim AlmacenRef As DataTable = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
Dim contadorMovimientos As Integer = 0
Dim listadoMovimientos As String = ""
Dim mensajeError As String = ""
Try
For Each almacenSinRepetir As DataRow In dt.FiltraParametros("", DistinctColumns:={"Almacen"}).Rows
Dim almacenActual As String = almacenSinRepetir("Almacen").ToString
Dim CveAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero
'Dim CveAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero
Dim CveAlmacen As Integer = AlmacenRef.FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero
Dim movimientoCabecera As Integer = ObjMovimientos.AddMovimiento(CveAlmacen, 1, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
listadoMovimientos += $"movimiento con folio <a href='/Inventarios/EntradasSalidas.aspx?CveMovimiento={movimientoCabecera}' target='_blank' style='color:blue'>{ObjMovimientos.Folio}</a><br/>"
If CveAlmacen > 0 Then
contadorMovimientos += 1
For Each nuevaEntrada As DataRow In dt.FiltraParametros($"Almacen = '{almacenActual}'").Rows
Dim CvePS As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", $"Codigo = '{nuevaEntrada("CodigoPS")}'").ToEntero
Dim CveUM As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"Codigo = '{nuevaEntrada("CodigoPS")}'").ToEntero
Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS")}' AND CveEmpresa = {UsuarioActual.CveEmpresa}")
Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero
Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero
If CvePS > 0 Then
If CveUM > 0 Then
Dim Cantidad As Decimal = nuevaEntrada("Existencia").ToString.ToDecimal
Dim Valor As Decimal = nuevaEntrada("Valor").ToString.ToDecimal
If Not ObjMovimientos.AddMovimientoDetalle(movimientoCabecera, Cantidad, CveUM, CvePS, (Valor / Cantidad), -1, -1) Then
OcurrioError = True
mensajeError = "No se logró generar el detalle del movimiento"
Throw New Exception()
End If
Else
OcurrioError = True
mensajeError = $"La unidad de medida no se reconoce para el producto servicio:{nuevaEntrada("CodigoPS")}"
Throw New Exception()
End If
Else
OcurrioError = True
mensajeError = $"No se encontró el producto o servicio con código ""{nuevaEntrada("CodigoPS")}"""
Throw New Exception()
End If
Next
Else
OcurrioError = True
'alert amacén no existe
mensajeError = $"No se encontró el almacén con nombre ""{almacenActual}"""
Throw New Exception()
Exit For
End If
Next
Catch ex As Exception
OcurrioError = True
If mensajeError = "" Then
mensajeError = "Error técnico, informar a soporte"
End If
ObjMovimientos.RollBack()
End Try
If Not OcurrioError Then
If mensajeError = "" Then
ObjMovimientos.Commit()
Alert($"Se cargaron correctamente {contadorMovimientos} movimientos<br/><br/>{listadoMovimientos}")
Else
Alert("Ocurrió un error al cargar las existencias", TipoMensaje.MsgError)
Alert(mensajeError, TipoMensaje.MsgError)
ObjMovimientos.RollBack()
End If
ObjMovimientos.Dispose()
ProductosServiciosRef.Dispose()
AlmacenRef.Dispose()
End If
End If
@@ -1618,5 +1634,51 @@ Partial Class General_SaldosIniciales
End If
End Sub
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
Dim unnamed As Integer = 0
Dim cols As Integer
Dim columns As String()
Dim curRow As Integer = 0
Dim curCol As Integer = 0
Dim dataTable As DataTable = New DataTable()
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
If firstRowHasHeaders Then
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
Else
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
End If
curRow = 1
Else
dataTable.Columns.Add("Column " & (cols + 1))
End If
Next
While curRow < worksheet.Rows.Count
columns = New String(cols - 1) {}
For curCol = 0 To cols - 1
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
columns(curCol) = ""
Else
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
End If
Next
dataTable.Rows.Add(columns)
curRow += 1
End While
Return dataTable
End Function
End Class

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")