personalizar PU Promedio
This commit is contained in:
@@ -57,7 +57,7 @@
|
|||||||
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
|
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
<label class="col-md-2" style="width: 80px;">SubProyecto: </label>
|
<label class="col-md-2" style="width: 80px; display:none;">SubProyecto: </label>
|
||||||
<div class="col-md-2 ">
|
<div class="col-md-2 ">
|
||||||
<asp:DropDownList ID="DdlSubproyecto" runat="server" Width="150px" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" >
|
<asp:DropDownList ID="DdlSubproyecto" runat="server" Width="150px" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" >
|
||||||
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||||
|
|||||||
@@ -14,9 +14,9 @@
|
|||||||
<li>
|
<li>
|
||||||
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar Columnas</asp:HyperLink>
|
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar Columnas</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<%-- <li>
|
||||||
<asp:LinkButton ID="Lnkcompuxlsinventarios" OnClick="Lnkcompuxlsinventarios_Click" runat="server"><i class="fa fa-ad-excel"></i> Generar Inventarios HP</asp:LinkButton>
|
<asp:LinkButton ID="Lnkcompuxlsinventarios" OnClick="Lnkcompuxlsinventarios_Click" runat="server"><i class="fa fa-ad-excel"></i> Generar Inventarios HP</asp:LinkButton>
|
||||||
</li>
|
</li>--%>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content4" ContentPlaceHolderID="Css" runat="Server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="Css" runat="Server">
|
||||||
<style>
|
<style>
|
||||||
@@ -275,6 +275,7 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:BoundField Visible="false" DataField="FechaCompra" HeaderText="Última Compra" DataFormatString="{0:d}" ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Right"/>
|
<asp:BoundField Visible="false" DataField="FechaCompra" HeaderText="Última Compra" DataFormatString="{0:d}" ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Right"/>
|
||||||
<asp:BoundField Visible="false" DataField="FechaVenta" HeaderText="Última Venta" DataFormatString="{0:d}" ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Right"/>
|
<asp:BoundField Visible="false" DataField="FechaVenta" HeaderText="Última Venta" DataFormatString="{0:d}" ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Right"/>
|
||||||
|
<asp:BoundField Visible="false" DataField="PUPromedio" HeaderText="PU Promedio" DataFormatString="{0:N2}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right"/>
|
||||||
|
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
@@ -327,16 +328,6 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
|
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div id="DivPersonalizar" class="modal fade" role="dialog">
|
<div id="DivPersonalizar" class="modal fade" role="dialog">
|
||||||
@@ -367,14 +358,15 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkFechaUltimaCompra" runat="server" Text="Fecha Última Compra" />
|
<asp:CheckBox ID="ChkFechaUltimaCompra" runat="server" Text="Fecha Última Compra" />
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: left;">
|
<td style="text-align: left;">
|
||||||
<asp:CheckBox ID="ChkFechaUltimaVenta" runat="server" Text="Fecha Última Venta" />
|
<asp:CheckBox ID="ChkFechaUltimaVenta" runat="server" Text="Fecha Última Venta" />
|
||||||
</td>
|
</td>
|
||||||
|
<td style="text-align: left;">
|
||||||
|
<asp:CheckBox ID="ChkPUPromedio" runat="server" Text="PU Promedio" />
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ Partial Class Inventarios_ReporteEntradasSalidas
|
|||||||
End If
|
End If
|
||||||
CargaPermisos()
|
CargaPermisos()
|
||||||
CargaGvBitacora()
|
CargaGvBitacora()
|
||||||
Lnkcompuxlsinventarios.Visible = UsuarioActual.CveEmpresa = 72
|
' Lnkcompuxlsinventarios.Visible = UsuarioActual.CveEmpresa = 72
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -320,42 +320,21 @@ Partial Class Inventarios_ReporteEntradasSalidas
|
|||||||
e.Row.FCLabel("lbSalidaImp").Text = If(e.Row.DBCampo("SalidaImp").ToString().ToDecimal = 0, "-", e.Row.DBCampo("SalidaImp").ToDouble.ToString("N2"))
|
e.Row.FCLabel("lbSalidaImp").Text = If(e.Row.DBCampo("SalidaImp").ToString().ToDecimal = 0, "-", e.Row.DBCampo("SalidaImp").ToDouble.ToString("N2"))
|
||||||
e.Row.FCLabel("lbSaldoF2").Text = If(e.Row.DBCampo("SaldoFImp").ToString().ToDecimal = 0, "-", e.Row.DBCampo("SaldoFImp").ToDouble.ToString("N2"))
|
e.Row.FCLabel("lbSaldoF2").Text = If(e.Row.DBCampo("SaldoFImp").ToString().ToDecimal = 0, "-", e.Row.DBCampo("SaldoFImp").ToDouble.ToString("N2"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'0,1,4
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'Protected Sub gv_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles Gv.RowDataBound
|
|
||||||
' If e.Row.RowType = DataControlRowType.DataRow Then
|
|
||||||
' If e.Row.DBCampo("CvePS").ToEntero = -1 Then
|
|
||||||
|
|
||||||
' e.Row.Cells(3).Text = ""
|
|
||||||
' e.Row.Cells(4).Text = ""
|
|
||||||
' e.Row.Cells(5).Text = ""
|
|
||||||
' e.Row.CssClass = "SubTotales"
|
|
||||||
' e.Row.Height = 22
|
|
||||||
|
|
||||||
' End If
|
|
||||||
' End If
|
|
||||||
'End Sub
|
|
||||||
|
|
||||||
#Region "MARCA"
|
#Region "MARCA"
|
||||||
Protected Sub CargarMarcas()
|
Protected Sub CargarMarcas()
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(130) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(130) = "1" Then
|
||||||
DivMarca.Visible = True
|
DivMarca.Visible = True
|
||||||
|
'Dim ObjMarcas As New ClsProductosServicios
|
||||||
Dim ObjMarcas As New ClsProductosServicios
|
'ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
|
||||||
ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
|
DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||||
DdlMarca.DataSource = ObjMarcas.DtResultados
|
' ObjMarcas.Dispose()
|
||||||
ObjMarcas.Dispose()
|
|
||||||
DdlMarca.DataBind()
|
DdlMarca.DataBind()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -448,6 +427,7 @@ Partial Class Inventarios_ReporteEntradasSalidas
|
|||||||
|
|
||||||
GvM.Columns(16).Visible = ChkFechaUltimaCompra.Checked
|
GvM.Columns(16).Visible = ChkFechaUltimaCompra.Checked
|
||||||
GvM.Columns(17).Visible = ChkFechaUltimaVenta.Checked
|
GvM.Columns(17).Visible = ChkFechaUltimaVenta.Checked
|
||||||
|
GvM.Columns(18).Visible = ChkPUPromedio.Checked
|
||||||
|
|
||||||
'GvM.Columns(4).Visible = ChkSeccionAlmacen.Checked
|
'GvM.Columns(4).Visible = ChkSeccionAlmacen.Checked
|
||||||
If ChkSeccionAlmacen.Checked OrElse ChkCodigoBarras.Checked OrElse ChkCodigoAlterno.Checked Then
|
If ChkSeccionAlmacen.Checked OrElse ChkCodigoBarras.Checked OrElse ChkCodigoAlterno.Checked Then
|
||||||
@@ -547,233 +527,234 @@ Partial Class Inventarios_ReporteEntradasSalidas
|
|||||||
UpBitacora.Update()
|
UpBitacora.Update()
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
Protected Sub Lnkcompuxlsinventarios_Click(sender As Object, e As EventArgs)
|
'Protected Sub Lnkcompuxlsinventarios_Click(sender As Object, e As EventArgs)
|
||||||
Dim continuar = True
|
' Dim continuar = True
|
||||||
Try
|
' Try
|
||||||
|
|
||||||
Dim wb As New ClosedXML.Excel.XLWorkbook()
|
' Dim wb As New ClosedXML.Excel.XLWorkbook()
|
||||||
Dim libro As ClosedXML.Excel.IXLWorksheet = wb.AddWorksheet("Reporte de inventarios")
|
' Dim libro As ClosedXML.Excel.IXLWorksheet = wb.AddWorksheet("Reporte de inventarios")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim Fila As Integer = 0
|
' Dim Fila As Integer = 0
|
||||||
libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 2, 7)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(217, 225, 242))
|
' libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 2, 7)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(217, 225, 242))
|
||||||
libro.Range(libro.Cell(Fila + 3, 1), libro.Cell(Fila + 3, 7)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
|
' libro.Range(libro.Cell(Fila + 3, 1), libro.Cell(Fila + 3, 7)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
|
||||||
libro.Cell(Fila + 3, 5).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(166, 166, 166))
|
' libro.Cell(Fila + 3, 5).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(166, 166, 166))
|
||||||
libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 7)).Style.Border.InsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
' libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 7)).Style.Border.InsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 7)).Style.Border.OutsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
' libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 7)).Style.Border.OutsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
libro.Column(1).Width = 34.43
|
' libro.Column(1).Width = 34.43
|
||||||
libro.Cell(Fila + 1, 1).Value = "TIPO DO REGISTRO"
|
' libro.Cell(Fila + 1, 1).Value = "TIPO DO REGISTRO"
|
||||||
libro.Cell(Fila + 2, 1).Value = "RECORD Type"
|
' libro.Cell(Fila + 2, 1).Value = "RECORD Type"
|
||||||
libro.Cell(Fila + 3, 1).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 3, 1).Value = "OBLIGATORIO"
|
||||||
|
|
||||||
libro.Column(2).Width = 24
|
' libro.Column(2).Width = 24
|
||||||
libro.Cell(Fila + 1, 2).Value = "Codigo del Partner"
|
' libro.Cell(Fila + 1, 2).Value = "Codigo del Partner"
|
||||||
libro.Cell(Fila + 2, 2).Value = "Reporter_id "
|
' libro.Cell(Fila + 2, 2).Value = "Reporter_id "
|
||||||
libro.Cell(Fila + 3, 2).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 3, 2).Value = "OBLIGATORIO"
|
||||||
|
|
||||||
libro.Column(3).Width = 28.71
|
' libro.Column(3).Width = 28.71
|
||||||
libro.Cell(Fila + 1, 3).Value = "Nombre de la Empresa"
|
' libro.Cell(Fila + 1, 3).Value = "Nombre de la Empresa"
|
||||||
libro.Cell(Fila + 2, 3).Value = "Reporter Company Name"
|
' libro.Cell(Fila + 2, 3).Value = "Reporter Company Name"
|
||||||
libro.Cell(Fila + 3, 3).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 3, 3).Value = "OBLIGATORIO"
|
||||||
|
|
||||||
libro.Column(4).Width = 23.57
|
' libro.Column(4).Width = 23.57
|
||||||
libro.Cell(Fila + 1, 4).Value = "CÓDIGO DEL PAÍS"
|
' libro.Cell(Fila + 1, 4).Value = "CÓDIGO DEL PAÍS"
|
||||||
libro.Cell(Fila + 2, 4).Value = "COUNTRY CD"
|
' libro.Cell(Fila + 2, 4).Value = "COUNTRY CD"
|
||||||
libro.Cell(Fila + 3, 4).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 3, 4).Value = "OBLIGATORIO"
|
||||||
|
|
||||||
libro.Column(5).Width = 17.57
|
' libro.Column(5).Width = 17.57
|
||||||
libro.Cell(Fila + 1, 5).Value = "Ubicación"
|
' libro.Cell(Fila + 1, 5).Value = "Ubicación"
|
||||||
libro.Cell(Fila + 2, 5).Value = "LOCATION"
|
' libro.Cell(Fila + 2, 5).Value = "LOCATION"
|
||||||
libro.Cell(Fila + 3, 5).Value = "OPCIONAL"
|
' libro.Cell(Fila + 3, 5).Value = "OPCIONAL"
|
||||||
|
|
||||||
libro.Column(6).Width = 35.29
|
' libro.Column(6).Width = 35.29
|
||||||
libro.Cell(Fila + 1, 6).Value = "FECHA DEL INVENTARIO"
|
' libro.Cell(Fila + 1, 6).Value = "FECHA DEL INVENTARIO"
|
||||||
libro.Cell(Fila + 2, 6).Value = "Period End Date"
|
' libro.Cell(Fila + 2, 6).Value = "Period End Date"
|
||||||
libro.Cell(Fila + 3, 6).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 3, 6).Value = "OBLIGATORIO"
|
||||||
|
|
||||||
libro.Column(7).Width = 23.43
|
' libro.Column(7).Width = 23.43
|
||||||
libro.Cell(Fila + 1, 7).Value = "REENVIO"
|
' libro.Cell(Fila + 1, 7).Value = "REENVIO"
|
||||||
libro.Cell(Fila + 2, 7).Value = "RESUBMIT"
|
' libro.Cell(Fila + 2, 7).Value = "RESUBMIT"
|
||||||
libro.Cell(Fila + 3, 7).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 3, 7).Value = "OBLIGATORIO"
|
||||||
|
|
||||||
libro.Column(8).Width = 29.29
|
' libro.Column(8).Width = 29.29
|
||||||
libro.Column(9).Width = 25
|
' libro.Column(9).Width = 25
|
||||||
libro.Column(10).Width = 18.14
|
' libro.Column(10).Width = 18.14
|
||||||
libro.Column(11).Width = 32.71
|
' libro.Column(11).Width = 32.71
|
||||||
libro.Column(12).Width = 13.57
|
' libro.Column(12).Width = 13.57
|
||||||
libro.Column(13).Width = 13
|
' libro.Column(13).Width = 13
|
||||||
libro.Column(14).Width = 32
|
' libro.Column(14).Width = 32
|
||||||
libro.Column(15).Width = 12.71
|
' libro.Column(15).Width = 12.71
|
||||||
libro.Column(16).Width = 13
|
' libro.Column(16).Width = 13
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Fila = Fila + 3
|
' Fila = Fila + 3
|
||||||
|
|
||||||
libro.Cell(Fila + 1, 1).Value = "IH"
|
' libro.Cell(Fila + 1, 1).Value = "IH"
|
||||||
libro.Cell(Fila + 1, 2).Value = "10245068"
|
' libro.Cell(Fila + 1, 2).Value = "10245068"
|
||||||
libro.Cell(Fila + 1, 3).Value = "COMPUPROVEEDORES SA DE CV"
|
' libro.Cell(Fila + 1, 3).Value = "COMPUPROVEEDORES SA DE CV"
|
||||||
libro.Cell(Fila + 1, 4).Value = "MX"
|
' libro.Cell(Fila + 1, 4).Value = "MX"
|
||||||
libro.Cell(Fila + 1, 5).Value = ""
|
' libro.Cell(Fila + 1, 5).Value = ""
|
||||||
libro.Cell(Fila + 1, 6).Value = String.Format("{0:yyyyMMdd}", TxtFechaF.Text.ToDate())
|
' libro.Cell(Fila + 1, 6).Value = String.Format("{0:yyyyMMdd}", TxtFechaF.Text.ToDate())
|
||||||
libro.Cell(Fila + 1, 7).Value = "N"
|
' libro.Cell(Fila + 1, 7).Value = "N"
|
||||||
|
|
||||||
|
|
||||||
Fila = Fila + 1
|
' Fila = Fila + 1
|
||||||
libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 2, 16)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(217, 225, 242))
|
' libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 2, 16)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(217, 225, 242))
|
||||||
libro.Range(libro.Cell(Fila + 3, 1), libro.Cell(Fila + 3, 16)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
|
' libro.Range(libro.Cell(Fila + 3, 1), libro.Cell(Fila + 3, 16)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
|
||||||
libro.Range(libro.Cell(Fila + 3, 3), libro.Cell(Fila + 3, 15)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(166, 166, 166))
|
' libro.Range(libro.Cell(Fila + 3, 3), libro.Cell(Fila + 3, 15)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(166, 166, 166))
|
||||||
libro.Cell(Fila + 3, 7).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
|
' libro.Cell(Fila + 3, 7).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
|
||||||
libro.Cell(Fila + 3, 10).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
|
' libro.Cell(Fila + 3, 10).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
|
||||||
libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 16)).Style.Border.InsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
' libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 16)).Style.Border.InsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 16)).Style.Border.OutsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
' libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 16)).Style.Border.OutsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
libro.Cell(Fila + 1, 1).Value = "TIPO DO REGISTRO"
|
' libro.Cell(Fila + 1, 1).Value = "TIPO DO REGISTRO"
|
||||||
libro.Cell(Fila + 1, 2).Value = "NÚMERO DEL PRODUCTO"
|
' libro.Cell(Fila + 1, 2).Value = "NÚMERO DEL PRODUCTO"
|
||||||
libro.Cell(Fila + 1, 3).Value = "OPCION DEL PRODUCTO"
|
' libro.Cell(Fila + 1, 3).Value = "OPCION DEL PRODUCTO"
|
||||||
libro.Cell(Fila + 1, 4).Value = "UPC"
|
' libro.Cell(Fila + 1, 4).Value = "UPC"
|
||||||
libro.Cell(Fila + 1, 5).Value = "CODIGO SKU"
|
' libro.Cell(Fila + 1, 5).Value = "CODIGO SKU"
|
||||||
libro.Cell(Fila + 1, 6).Value = "ORDENES DE COMPRAS EN ABIERTO "
|
' libro.Cell(Fila + 1, 6).Value = "ORDENES DE COMPRAS EN ABIERTO "
|
||||||
libro.Cell(Fila + 1, 7).Value = "INVENTARIO DISPONIBLE"
|
' libro.Cell(Fila + 1, 7).Value = "INVENTARIO DISPONIBLE"
|
||||||
libro.Cell(Fila + 1, 8).Value = "DEVOLUCIONES"
|
' libro.Cell(Fila + 1, 8).Value = "DEVOLUCIONES"
|
||||||
libro.Cell(Fila + 1, 9).Value = "INVENTARIO RESERVADO"
|
' libro.Cell(Fila + 1, 9).Value = "INVENTARIO RESERVADO"
|
||||||
libro.Cell(Fila + 1, 10).Value = "INVENTARIO TOTAL"
|
' libro.Cell(Fila + 1, 10).Value = "INVENTARIO TOTAL"
|
||||||
libro.Cell(Fila + 1, 11).Value = "EN TRANSITO"
|
' libro.Cell(Fila + 1, 11).Value = "EN TRANSITO"
|
||||||
libro.Cell(Fila + 1, 12).Value = "VALOR UNITARIO DEL PRODUCTO HP"
|
' libro.Cell(Fila + 1, 12).Value = "VALOR UNITARIO DEL PRODUCTO HP"
|
||||||
libro.Cell(Fila + 1, 13).Value = "VALOR TOTAL DEL INVENTARIO"
|
' libro.Cell(Fila + 1, 13).Value = "VALOR TOTAL DEL INVENTARIO"
|
||||||
libro.Cell(Fila + 1, 14).Value = "NOMBRE DE LA TIENDA"
|
' libro.Cell(Fila + 1, 14).Value = "NOMBRE DE LA TIENDA"
|
||||||
libro.Cell(Fila + 1, 15).Value = "Codigo de la tienda"
|
' libro.Cell(Fila + 1, 15).Value = "Codigo de la tienda"
|
||||||
libro.Cell(Fila + 1, 16).Value = "MONEDA"
|
' libro.Cell(Fila + 1, 16).Value = "MONEDA"
|
||||||
|
|
||||||
Fila = Fila + 1
|
' Fila = Fila + 1
|
||||||
libro.Cell(Fila + 1, 1).Value = "RECORD TYPE "
|
' libro.Cell(Fila + 1, 1).Value = "RECORD TYPE "
|
||||||
libro.Cell(Fila + 1, 2).Value = "Partner Reported Product ID"
|
' libro.Cell(Fila + 1, 2).Value = "Partner Reported Product ID"
|
||||||
libro.Cell(Fila + 1, 3).Value = "PROD_OPTION"
|
' libro.Cell(Fila + 1, 3).Value = "PROD_OPTION"
|
||||||
libro.Cell(Fila + 1, 4).Value = "UPC"
|
' libro.Cell(Fila + 1, 4).Value = "UPC"
|
||||||
libro.Cell(Fila + 1, 5).Value = "Reseller product number "
|
' libro.Cell(Fila + 1, 5).Value = "Reseller product number "
|
||||||
libro.Cell(Fila + 1, 6).Value = "Quantity on Order"
|
' libro.Cell(Fila + 1, 6).Value = "Quantity on Order"
|
||||||
libro.Cell(Fila + 1, 7).Value = "Quantity on Hand"
|
' libro.Cell(Fila + 1, 7).Value = "Quantity on Hand"
|
||||||
libro.Cell(Fila + 1, 8).Value = "Quantity in stock allocated to be returned to supplier"
|
' libro.Cell(Fila + 1, 8).Value = "Quantity in stock allocated to be returned to supplier"
|
||||||
libro.Cell(Fila + 1, 9).Value = "Reserved Inventory"
|
' libro.Cell(Fila + 1, 9).Value = "Reserved Inventory"
|
||||||
libro.Cell(Fila + 1, 10).Value = "Quantity avail. for sale"
|
' libro.Cell(Fila + 1, 10).Value = "Quantity avail. for sale"
|
||||||
libro.Cell(Fila + 1, 11).Value = "Quantity in float (In transit between partner warehouses)"
|
' libro.Cell(Fila + 1, 11).Value = "Quantity in float (In transit between partner warehouses)"
|
||||||
libro.Cell(Fila + 1, 12).Value = "INVENTORY UNIT VALUE"
|
' libro.Cell(Fila + 1, 12).Value = "INVENTORY UNIT VALUE"
|
||||||
libro.Cell(Fila + 1, 13).Value = "INVENTORY VALUATION"
|
' libro.Cell(Fila + 1, 13).Value = "INVENTORY VALUATION"
|
||||||
libro.Cell(Fila + 1, 14).Value = "Sell from name (For retailers, ""Store Name / Site Name"")"
|
' libro.Cell(Fila + 1, 14).Value = "Sell from name (For retailers, ""Store Name / Site Name"")"
|
||||||
libro.Cell(Fila + 1, 15).Value = "Sell From Location ID"
|
' libro.Cell(Fila + 1, 15).Value = "Sell From Location ID"
|
||||||
libro.Cell(Fila + 1, 16).Value = "CURRENCY"
|
' libro.Cell(Fila + 1, 16).Value = "CURRENCY"
|
||||||
|
|
||||||
Fila = Fila + 1
|
' Fila = Fila + 1
|
||||||
libro.Cell(Fila + 1, 1).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 1, 1).Value = "OBLIGATORIO"
|
||||||
libro.Cell(Fila + 1, 2).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 1, 2).Value = "OBLIGATORIO"
|
||||||
libro.Cell(Fila + 1, 3).Value = "OPCIONAL"
|
' libro.Cell(Fila + 1, 3).Value = "OPCIONAL"
|
||||||
libro.Cell(Fila + 1, 4).Value = "OPCIONAL"
|
' libro.Cell(Fila + 1, 4).Value = "OPCIONAL"
|
||||||
libro.Cell(Fila + 1, 5).Value = "OPCIONAL"
|
' libro.Cell(Fila + 1, 5).Value = "OPCIONAL"
|
||||||
libro.Cell(Fila + 1, 6).Value = "OPCIONAL"
|
' libro.Cell(Fila + 1, 6).Value = "OPCIONAL"
|
||||||
libro.Cell(Fila + 1, 7).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 1, 7).Value = "OBLIGATORIO"
|
||||||
libro.Cell(Fila + 1, 8).Value = "OPCIONAL"
|
' libro.Cell(Fila + 1, 8).Value = "OPCIONAL"
|
||||||
libro.Cell(Fila + 1, 9).Value = "OPCIONAL"
|
' libro.Cell(Fila + 1, 9).Value = "OPCIONAL"
|
||||||
libro.Cell(Fila + 1, 10).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 1, 10).Value = "OBLIGATORIO"
|
||||||
libro.Cell(Fila + 1, 11).Value = "OPCIONAL"
|
' libro.Cell(Fila + 1, 11).Value = "OPCIONAL"
|
||||||
libro.Cell(Fila + 1, 12).Value = "OPCIONAL"
|
' libro.Cell(Fila + 1, 12).Value = "OPCIONAL"
|
||||||
libro.Cell(Fila + 1, 13).Value = "OPCIONAL"
|
' libro.Cell(Fila + 1, 13).Value = "OPCIONAL"
|
||||||
libro.Cell(Fila + 1, 14).Value = "OPCIONAL"
|
' libro.Cell(Fila + 1, 14).Value = "OPCIONAL"
|
||||||
libro.Cell(Fila + 1, 15).Value = "OPCIONAL"
|
' libro.Cell(Fila + 1, 15).Value = "OPCIONAL"
|
||||||
libro.Cell(Fila + 1, 16).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 1, 16).Value = "OBLIGATORIO"
|
||||||
|
|
||||||
|
|
||||||
If Not IsNothing(dt) AndAlso dt.Rows.Count > 0 Then
|
' If Not IsNothing(dt) AndAlso dt.Rows.Count > 0 Then
|
||||||
|
|
||||||
For Each row As DataRow In dt.Select("CvePS>0 AND SaldoFCant >0")
|
' For Each row As DataRow In dt.Select("CvePS>0 AND SaldoFCant >0")
|
||||||
|
|
||||||
Fila = Fila + 1
|
' Fila = Fila + 1
|
||||||
libro.Cell(Fila + 1, 1).Value = "ID" ' "TIPO DO REGISTRO"
|
' libro.Cell(Fila + 1, 1).Value = "ID" ' "TIPO DO REGISTRO"
|
||||||
libro.Cell(Fila + 1, 2).Value = String.Format("'{0}", row("Codigo")) ' "NÚMERO DEL PRODUCTO"
|
' libro.Cell(Fila + 1, 2).Value = String.Format("'{0}", row("Codigo")) ' "NÚMERO DEL PRODUCTO"
|
||||||
libro.Cell(Fila + 1, 3).Value = "" ' "OPCION DEL PRODUCTO"
|
' libro.Cell(Fila + 1, 3).Value = "" ' "OPCION DEL PRODUCTO"
|
||||||
libro.Cell(Fila + 1, 4).Value = "" ' "UPC"
|
' libro.Cell(Fila + 1, 4).Value = "" ' "UPC"
|
||||||
libro.Cell(Fila + 1, 5).Value = "" ' "CODIGO SKU"
|
' libro.Cell(Fila + 1, 5).Value = "" ' "CODIGO SKU"
|
||||||
libro.Cell(Fila + 1, 6).Value = "" ' "ORDENES DE COMPRAS EN ABIERTO "
|
' libro.Cell(Fila + 1, 6).Value = "" ' "ORDENES DE COMPRAS EN ABIERTO "
|
||||||
libro.Cell(Fila + 1, 7).Value = String.Format("{0}", row("SaldoFCant")) ' "INVENTARIO DISPONIBLE"
|
' libro.Cell(Fila + 1, 7).Value = String.Format("{0}", row("SaldoFCant")) ' "INVENTARIO DISPONIBLE"
|
||||||
'libro.Cell(Fila + 1, 7).Style.NumberFormat.Format = "N2"
|
' 'libro.Cell(Fila + 1, 7).Style.NumberFormat.Format = "N2"
|
||||||
libro.Cell(Fila + 1, 8).Value = "" ' "DEVOLUCIONES"
|
' libro.Cell(Fila + 1, 8).Value = "" ' "DEVOLUCIONES"
|
||||||
libro.Cell(Fila + 1, 9).Value = "" ' "INVENTARIO RESERVADO"
|
' libro.Cell(Fila + 1, 9).Value = "" ' "INVENTARIO RESERVADO"
|
||||||
libro.Cell(Fila + 1, 10).Value = String.Format("{0}", row("SaldoFCant")) ' "INVENTARIO TOTAL"
|
' libro.Cell(Fila + 1, 10).Value = String.Format("{0}", row("SaldoFCant")) ' "INVENTARIO TOTAL"
|
||||||
'libro.Cell(Fila + 1, 10).Style.NumberFormat.Format = "$ #,##0.00"
|
' 'libro.Cell(Fila + 1, 10).Style.NumberFormat.Format = "$ #,##0.00"
|
||||||
libro.Cell(Fila + 1, 11).Value = "" ' "EN TRANSITO"
|
' libro.Cell(Fila + 1, 11).Value = "" ' "EN TRANSITO"
|
||||||
libro.Cell(Fila + 1, 12).Value = "" ' "VALOR UNITARIO DEL PRODUCTO HP"
|
' libro.Cell(Fila + 1, 12).Value = "" ' "VALOR UNITARIO DEL PRODUCTO HP"
|
||||||
libro.Cell(Fila + 1, 13).Value = "" ' "VALOR TOTAL DEL INVENTARIO"
|
' libro.Cell(Fila + 1, 13).Value = "" ' "VALOR TOTAL DEL INVENTARIO"
|
||||||
libro.Cell(Fila + 1, 14).Value = "" ' "NOMBRE DE LA TIENDA"
|
' libro.Cell(Fila + 1, 14).Value = "" ' "NOMBRE DE LA TIENDA"
|
||||||
libro.Cell(Fila + 1, 15).Value = "" ' "Codigo de la tienda"
|
' libro.Cell(Fila + 1, 15).Value = "" ' "Codigo de la tienda"
|
||||||
libro.Cell(Fila + 1, 16).Value = "MXN" ' "MONEDA"
|
' libro.Cell(Fila + 1, 16).Value = "MXN" ' "MONEDA"
|
||||||
Next
|
' Next
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
Fila = Fila + 1
|
' Fila = Fila + 1
|
||||||
libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 2, 4)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(217, 225, 242))
|
' libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 2, 4)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(217, 225, 242))
|
||||||
libro.Range(libro.Cell(Fila + 3, 1), libro.Cell(Fila + 3, 4)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
|
' libro.Range(libro.Cell(Fila + 3, 1), libro.Cell(Fila + 3, 4)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
|
||||||
libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 4)).Style.Border.InsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
' libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 4)).Style.Border.InsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 4)).Style.Border.OutsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
' libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 4)).Style.Border.OutsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
|
||||||
libro.Cell(Fila + 1, 1).Value = "TIPO DEL REGISTRO"
|
' libro.Cell(Fila + 1, 1).Value = "TIPO DEL REGISTRO"
|
||||||
libro.Cell(Fila + 1, 2).Value = "TOTAL DE REGISTROS"
|
' libro.Cell(Fila + 1, 2).Value = "TOTAL DE REGISTROS"
|
||||||
libro.Cell(Fila + 1, 3).Value = "Suma del Inventario Disponible"
|
' libro.Cell(Fila + 1, 3).Value = "Suma del Inventario Disponible"
|
||||||
libro.Cell(Fila + 1, 4).Value = "Suma del Inventario Total"
|
' libro.Cell(Fila + 1, 4).Value = "Suma del Inventario Total"
|
||||||
|
|
||||||
Fila = Fila + 1
|
' Fila = Fila + 1
|
||||||
libro.Cell(Fila + 1, 1).Value = "RECORD TYPE"
|
' libro.Cell(Fila + 1, 1).Value = "RECORD TYPE"
|
||||||
libro.Cell(Fila + 1, 2).Value = "COUNT OF RECORDS"
|
' libro.Cell(Fila + 1, 2).Value = "COUNT OF RECORDS"
|
||||||
libro.Cell(Fila + 1, 3).Value = "SUM OF “"On Hand”""
|
' libro.Cell(Fila + 1, 3).Value = "SUM OF “"On Hand”""
|
||||||
libro.Cell(Fila + 1, 4).Value = "SUM OF “"Total Inventory"”"
|
' libro.Cell(Fila + 1, 4).Value = "SUM OF “"Total Inventory"”"
|
||||||
|
|
||||||
|
|
||||||
Fila = Fila + 1
|
' Fila = Fila + 1
|
||||||
libro.Cell(Fila + 1, 1).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 1, 1).Value = "OBLIGATORIO"
|
||||||
libro.Cell(Fila + 1, 2).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 1, 2).Value = "OBLIGATORIO"
|
||||||
libro.Cell(Fila + 1, 3).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 1, 3).Value = "OBLIGATORIO"
|
||||||
libro.Cell(Fila + 1, 4).Value = "OBLIGATORIO"
|
' libro.Cell(Fila + 1, 4).Value = "OBLIGATORIO"
|
||||||
|
|
||||||
Dim Codigo As Double = 0
|
' Dim Codigo As Double = 0
|
||||||
Dim SaldoFCant As Double = 0
|
' Dim SaldoFCant As Double = 0
|
||||||
Dim SaldoFImp As Double = 0
|
' Dim SaldoFImp As Double = 0
|
||||||
If Not IsNothing(dt) AndAlso dt.Rows.Count > 0 Then
|
' If Not IsNothing(dt) AndAlso dt.Rows.Count > 0 Then
|
||||||
Codigo = dt.COUNT("Codigo", "CvePS>0")
|
' Codigo = dt.COUNT("Codigo", "CvePS>0")
|
||||||
SaldoFCant = dt.SUM("SaldoFCant", "CvePS>0")
|
' SaldoFCant = dt.SUM("SaldoFCant", "CvePS>0")
|
||||||
SaldoFImp = dt.SUM("SaldoFImp", "CvePS>0")
|
' SaldoFImp = dt.SUM("SaldoFImp", "CvePS>0")
|
||||||
End If
|
' End If
|
||||||
Fila = Fila + 1
|
' Fila = Fila + 1
|
||||||
libro.Cell(Fila + 1, 1).Value = "IT"
|
' libro.Cell(Fila + 1, 1).Value = "IT"
|
||||||
libro.Cell(Fila + 1, 2).Value = String.Format("{0}", Codigo)
|
' libro.Cell(Fila + 1, 2).Value = String.Format("{0}", Codigo)
|
||||||
'libro.Cell(Fila + 1, 2).Style.NumberFormat.Format = "N2"
|
' 'libro.Cell(Fila + 1, 2).Style.NumberFormat.Format = "N2"
|
||||||
libro.Cell(Fila + 1, 3).Value = String.Format("{0}", SaldoFCant)
|
' libro.Cell(Fila + 1, 3).Value = String.Format("{0}", SaldoFCant)
|
||||||
'libro.Cell(Fila + 1, 3).Style.NumberFormat.Format = "N2"
|
' 'libro.Cell(Fila + 1, 3).Style.NumberFormat.Format = "N2"
|
||||||
libro.Cell(Fila + 1, 4).Value = String.Format("{0}", SaldoFCant)
|
' libro.Cell(Fila + 1, 4).Value = String.Format("{0}", SaldoFCant)
|
||||||
'libro.Cell(Fila + 1, 4).Style.NumberFormat.Format = "$ #,##0.00"
|
' 'libro.Cell(Fila + 1, 4).Style.NumberFormat.Format = "$ #,##0.00"
|
||||||
|
|
||||||
|
|
||||||
''Guarda streem y descarga
|
' ''Guarda streem y descarga
|
||||||
Dim fs As Stream = New MemoryStream()
|
' Dim fs As Stream = New MemoryStream()
|
||||||
wb.SaveAs(fs)
|
' wb.SaveAs(fs)
|
||||||
fs.Position = 0
|
' fs.Position = 0
|
||||||
Dim memoryStream As New MemoryStream()
|
' Dim memoryStream As New MemoryStream()
|
||||||
Using input As Stream = fs
|
' Using input As Stream = fs
|
||||||
input.CopyTo(memoryStream)
|
' input.CopyTo(memoryStream)
|
||||||
End Using
|
' End Using
|
||||||
memoryStream.Position = 0
|
' memoryStream.Position = 0
|
||||||
|
|
||||||
Response.Clear()
|
' Response.Clear()
|
||||||
Response.Buffer = True
|
' Response.Buffer = True
|
||||||
|
|
||||||
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
' Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
Response.AddHeader("content-disposition", String.Format("attachment;filename={0}.xlsx", "Reporte de Inventarios HP"))
|
' Response.AddHeader("content-disposition", String.Format("attachment;filename={0}.xlsx", "Reporte de Inventarios HP"))
|
||||||
Response.BinaryWrite(memoryStream.ToArray())
|
' Response.BinaryWrite(memoryStream.ToArray())
|
||||||
Response.End()
|
' Response.End()
|
||||||
|
|
||||||
''endGuarda streem y descarga
|
' ''endGuarda streem y descarga
|
||||||
Catch
|
' Catch
|
||||||
|
|
||||||
|
' continuar = False
|
||||||
|
' End Try
|
||||||
|
' If Not continuar Then
|
||||||
|
' Alert("Ocurrió un error al gener el excel", TipoMensaje.MsgAdvertencia)
|
||||||
|
' End If
|
||||||
|
'End Sub
|
||||||
|
|
||||||
continuar = False
|
|
||||||
End Try
|
|
||||||
If Not continuar Then
|
|
||||||
Alert("Ocurrió un error al gener el excel", TipoMensaje.MsgAdvertencia)
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user