columnas de malestado y novendible

This commit is contained in:
Hector
2021-07-29 10:11:21 -07:00
parent 6ceaeaa15a
commit 89311bb4a2
2 changed files with 31 additions and 14 deletions

View File

@@ -369,9 +369,14 @@
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvIFD.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
<div style="display: inline-block;" id="SumFiltra"></div>
</div>
<asp:GridView ID="GvIFD" ClientIDMode="Static" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" GridLines="None" DataKeyNames="CveInventarioFisicoDetalle, CvePS, SerieLote, Lote, FechaCaducidad, Cantidad, CveUnidadMedida" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall">
<asp:GridView ID="GvIFD" ClientIDMode="Static" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" GridLines="None" DataKeyNames="CveInventarioFisicoDetalle, CvePS, SerieLote, Lote, FechaCaducidad, Cantidad, CveUnidadMedida, AplicaSerie, AplicaLote, AplicaCaducidad" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall">
<Columns>
<asp:BoundField HeaderText="Fecha" DataField="FechaInvFisico" DataFormatString="{0:g}"></asp:BoundField>
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal runat="server" ID="ltlFecha" Text='<%#Eval("FechaInvFisico")%>'></asp:Literal>
</ItemTemplate>
<HeaderStyle Width="160px"/>
</asp:TemplateField>
<asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
@@ -380,15 +385,15 @@
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" Visible="false" DataFormatString="{0:d}"></asp:BoundField>
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" AlternateText="Editar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
<asp:BoundField HeaderText="Mal Estado" DataField="MalEstado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
<asp:BoundField HeaderText="No Vendible" DataField="NoVendible" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
<asp:TemplateField HeaderText="Comandos" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" AlternateText="Editar" CssClass="btn btn-circle btn-xs green" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Estas seguro que desea eliminar el registro?" data-btn-ok-label="si" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"/>
</asp:TemplateField>
</Columns>
</asp:GridView>

View File

@@ -296,10 +296,14 @@ Partial Class Inventarios_InventarioFisicoDetalle
Dim Inventario As New ClsInventarios
If Inventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then
If Inventario.DtResultados.Rows.Count > 0 Then
GvIFD.Columns(1).Visible = Inventario.DtResultados.MAX("CodigoBarras") <> ""
GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen", "CveSeccionAlmacen IS NOT NULL").ToEntero > 0
GvIFD.Columns(5).Visible = Inventario.DtResultados.MAX("SerieLote") <> ""
GvIFD.Columns(6).Visible = Inventario.DtResultados.MAX("Lote") <> ""
GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad", "FechaCaducidad IS NOT NULL").ToDate > MinFecha
GvIFD.Columns(9).Visible = Inventario.DtResultados.MAX("MalEstado", "MalEstado IS NOT NULL").ToEntero > 0
GvIFD.Columns(10).Visible = Inventario.DtResultados.MAX("NoVendible", "NoVendible IS NOT NULL").ToEntero > 0
GvIFD.DataSource = Inventario.DtResultados '.AsEnumerable.OrderByDescending(Function(k) k!CveInventarioFisicoDetalle).Take(500).CopyToDataTable
Else
GvIFD.DataSource = Nothing
@@ -648,15 +652,19 @@ Partial Class Inventarios_InventarioFisicoDetalle
Private Sub LnkExcelUniverso_Click(sender As Object, e As EventArgs) Handles LnkExcelUniverso.Click
Dim IncluyePS, ExcluyePS, IncluyeClasificacion, ExcluyeClasificacion, IncluyeProveedor As New StringBuilder
Dim ObjInventario As New ClsInventarios
Dim DtPS As DataTable
If ObjInventario.GetInventarioFisicoUniversoProductos(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then
DtPS = ObjInventario.DtResultados.FiltraParametros("", "", {"Codigo", "PS", "Clasificacion", "RazonSocial"})
Else
Alert("Error al consultar la informacion")
End If
End If
Dim NombreArchivo As String
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim workbook As New ExcelFile()
Dim worksheet = workbook.Worksheets.Add("Productos")
worksheet.InsertDataTable(ObjInventario.DtResultados, New InsertDataTableOptions() With
worksheet.InsertDataTable(DtPS, New InsertDataTableOptions() With
{
.ColumnHeaders = True,
.StartRow = 0,
@@ -726,9 +734,13 @@ Partial Class Inventarios_InventarioFisicoDetalle
HfCvePS.Value = GvRow.DataKey("CvePS").ToString
HfCveUM.Value = GvRow.DataKey("CveUnidadMedida").ToString
TxtSerieLote.Text = GvRow.DataKey("SerieLote").ToString
TxtLoteEdit.Text = GvRow.DataKey("Lote").ToString
TxtFechaCaducida.Text = GvRow.DataKey("FechaCaducidad").ToString
TxtSerieLote.Text = If(Convert.ToBoolean(GvRow.DataKey("AplicaSerie").ToString), GvRow.DataKey("SerieLote").ToString, "")
TxtLoteEdit.Text = If(Convert.ToBoolean(GvRow.DataKey("AplicaLote").ToString), GvRow.DataKey("Lote").ToString, "")
TxtFechaCaducida.Text = If(Convert.ToBoolean(GvRow.DataKey("AplicaCaducidad").ToString), If(GvRow.DataKey("FechaCaducidad").ToString <> "", GvRow.DataKey("FechaCaducidad").ToString.ToDate.ToShortDateString, ""), "")
TxtSerieLote.Enabled = Convert.ToBoolean(GvRow.DataKey("AplicaSerie").ToString)
TxtLoteEdit.Enabled = Convert.ToBoolean(GvRow.DataKey("AplicaLote").ToString)
TxtFechaCaducida.Enabled = Convert.ToBoolean(GvRow.DataKey("AplicaCaducidad").ToString)
TxtCantidad.Text = GvRow.DataKey("Cantidad").ToString
UpEditarPS.Update()