cambios en SeccionesAlmacen,Serie,Lote,Caducidad
This commit is contained in:
@@ -334,7 +334,7 @@ Partial Class Compras_EvaluacionProveedor
|
||||
'ObjCarta.Guardar(PathDestino)
|
||||
ObjCarta.GuardarStreamPDF()
|
||||
archivoCarta.ArchivoBinario = ObjCarta.GetBytesDocumento()
|
||||
|
||||
|
||||
Dim fileinfo As New FileInfo(PathDestino)
|
||||
Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority) & "/temp/" & fileinfo.Name
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@ Partial Class Inventarios_CatSeccionesAlmacenes
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjSeccion As New ClsInventarios
|
||||
If ObjSeccion.GetSeccionesAlmacenes(-1) Then
|
||||
If ObjSeccion.GetSeccionesAlmacenes(-1, -1) Then
|
||||
ViewState("DTSeccionesAlmacenes") = ObjSeccion.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTSeccionAlmacen(-1) = ObjSeccion.DtResultados
|
||||
GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) = ObjSeccion.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
@@ -62,7 +62,7 @@ Partial Class Inventarios_CatSeccionesAlmacenes
|
||||
Alert("La Seccion se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
|
||||
ViewState("DTSeccionesAlmacenes") = ObjSeccion.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTSeccionAlmacen(-1) = ObjSeccion.DtResultados
|
||||
GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) = ObjSeccion.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
@@ -108,7 +108,7 @@ Partial Class Inventarios_CatSeccionesAlmacenes
|
||||
DdlAlmacen.SelectedIndex = 0
|
||||
Alert("La Seccion se actualizo correctamente.", TipoMensaje.MsgInformacion)
|
||||
ViewState("DTSeccionesAlmacenes") = ObjSeccion.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTSeccionAlmacen(-1) = ObjSeccion.DtResultados
|
||||
GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) = ObjSeccion.DtResultados
|
||||
End If
|
||||
|
||||
ObjSeccion.Dispose()
|
||||
@@ -134,7 +134,7 @@ Partial Class Inventarios_CatSeccionesAlmacenes
|
||||
If ObjSeccion.RemoveSeccion(GvRow.DataKey("CveSeccion").ToString.ToEntero) Then
|
||||
Alert("La Seccion se elimino correctamente.", TipoMensaje.MsgInformacion)
|
||||
ViewState("DTSeccionesAlmacenes") = ObjSeccion.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTSeccionAlmacen(-1) = ObjSeccion.DtResultados
|
||||
GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) = ObjSeccion.DtResultados
|
||||
End If
|
||||
ObjSeccion.Dispose()
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="KardexSeccionAlmacen.aspx.vb" Inherits="Inventarios_KardexSeccionAlmacen" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Kardex Secciones de Almacen
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</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">
|
||||
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label class="col-md-1 ">Producto/Servicio:</label>
|
||||
<div class="col-md-2">
|
||||
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" style="width: 100%;" CssClass=" DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
</div>
|
||||
<label class="col-md-1 ">Almacen:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlAlmacen" runat="server" AppendDataBoundItems="true" DataTextField="Almacen" DataValueField="CveAlmacen" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 ">Sección Almacen:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" runat="server" AppendDataBoundItems="true" DataTextField="Seccion" DataValueField="CveSeccion" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true"
|
||||
EmptyDataText="No se han encontrado datos con los filtros seleccionados"
|
||||
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
|
||||
DataKeyNames="Existencia,CveAlmacenSeccion,AlmacenSeccion,CvePS,CveAlmacen,CveSubProyecto,CveUM,SerieLote" >
|
||||
<Columns>
|
||||
<asp:BoundField DataField="AlmacenSeccion" ItemStyle-HorizontalAlign="Left" HeaderText="Sección Almacen" />
|
||||
<asp:BoundField DataField="SerieLote" ItemStyle-HorizontalAlign="Left" HeaderText="SerieLote" />
|
||||
<asp:BoundField DataField="Existencia" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia" DataFormatString="{0:N2}" />
|
||||
<asp:TemplateField HeaderText="Traspaso" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton data-toggle="tooltip" title="Sección Almacen" ID="LnkSeccionAlmacen" OnClick="LnkSeccionAlmacen_Click" CssClass="btn btn-circle btn-xs green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%--SECCION DE ALMACEN--%>
|
||||
<div id="DModalSeccionAlmacen" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalSeccionAlmacen" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlSeccionAlmacen" Text="Sección Almacen" runat="server"> </asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCantidadSeccion" CssClass="form-control" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvCantidadSeccion" runat="server" ControlToValidate="TxtCantidadSeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VcoCantidadSeccion" runat="server" HighlightCssClass="vco" TargetControlID="RfvCantidadSeccion"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RangeValidator ID="RVTxtCantidad" runat="server" ControlToValidate="TxtCantidadSeccion" MinimumValue="0" MaximumValue="1" Type="Double" Text="<b><span style='text-decoration: underline'>ERROR:</span></b><br />No cuenta con la cantidad suficiente." ValidationGroup="VgmSeccion" />
|
||||
<label for="<%= TxtCantidadSeccion.ClientID.ToString()%>">Cantidad:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8" runat="server" id="DivSeccionAlmacenDestino" >
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlSeccionAlmacenDestino" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Seccion" DataValueField="CveSeccion">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvSeccionAlmacenDestino" runat="server" ControlToValidate="DdlSeccionAlmacenDestino" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sección Almacen Destino''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceSeccionAlmacenDestino" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacenDestino"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= DdlSeccionAlmacenDestino.ClientID.ToString()%>">Sección Almacen Destino:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:LinkButton ID="LnkAddSeccionAlmacen" data-toggle="tooltip" CssClass="btn btn-default btn-circle btn-xs " OnClick="LnkAddSeccionAlmacen_Click" data-placement="top" ToolTip="Agregar Sección Almacen" runat="server" ValidationGroup="VgmSeccion"><i class="fa fa-plus" style="color:black" aria-hidden="true"></i></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvSeccion" runat="server" GridLines="None" ShowHeaderWhenEmpty="true"
|
||||
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true"
|
||||
AutoGenerateColumns="False" EmptyDataText="No se han agregado datos"
|
||||
DataKeyNames="Consec">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="CantidadSeccionAlmacen" HeaderText="Cantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.##}" />
|
||||
<asp:BoundField DataField="SeccionAlmacenOrigen" HeaderText="Sección Almacen Origen" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="SeccionAlmacenDestino" HeaderText="Sección Almacen Destino" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEliminarSeccion" runat="server" OnClick="LnkEliminarSeccion_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la sección?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnTraspasar" OnClick="BtnTraspasar_Click" runat="server" Text="Traspasar" CssClass="btn btn-primary" ValidationGroup="VgmTraspasar" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,337 +0,0 @@
|
||||
Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Linq
|
||||
Imports System.Web
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports Extensiones
|
||||
Partial Class Inventarios_KardexSeccionAlmacen
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
|
||||
Private Property DtSeccionAlmacen As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtSeccionAlmacen"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtSeccionAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CantidadTotal As Decimal
|
||||
Get
|
||||
Return CType(ViewState("CantidadTotal"), Decimal)
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("CantidadTotal") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CvePS As Integer
|
||||
Get
|
||||
Return CType(ViewState("CvePS"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePS") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveSeccionAlmacenOrigen As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveSeccionAlmacenOrigen"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveSeccionAlmacenOrigen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property SeccionAlmacenOrigen As String
|
||||
Get
|
||||
Return CType(ViewState("SeccionAlmacenOrigen"), String)
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("SeccionAlmacenOrigen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveAlmacen As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveAlmacen"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveUM As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveUM"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveUM") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveSubProyecto As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveSubProyecto"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveSubProyecto") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property SerieLote As String
|
||||
Get
|
||||
Return CType(ViewState("SerieLote"), String)
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("SerieLote") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
InicializaValores()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "CARGAS"
|
||||
|
||||
Private Sub InicializaValores()
|
||||
CantidadTotal = 0
|
||||
SeccionAlmacenOrigen = ""
|
||||
CvePS = 0
|
||||
CveAlmacen = 0
|
||||
CveSeccionAlmacenOrigen = 0
|
||||
CveSubProyecto = 0
|
||||
CveUM = 0
|
||||
SerieLote = ""
|
||||
|
||||
CreaDtSeccionAlmacen()
|
||||
CargaDdlAlmacen()
|
||||
CargaPS()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPS()
|
||||
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
|
||||
DdlPS.SelectedText = "Seleccione"
|
||||
DdlPS.SelectedValue = "-1"
|
||||
Else
|
||||
DdlPS.ddl.Items.Clear()
|
||||
DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
DdlPS.ddl.DataBind()
|
||||
DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlAlmacen()
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlAlmacen.DataBind()
|
||||
|
||||
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSeccionAlmacen.DataBind()
|
||||
|
||||
DdlSeccionAlmacenDestino.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlSeccionAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlSeccionAlmacenDestino.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
If Not DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que seleccionar un producto/servicio.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que seleccionar un alamacen.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
If ObjInv.GetKardexSeccionAlmacen(DdlPS.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjInv.DtResultados
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "SECCION ALMACEN"
|
||||
Private Sub CreaDtSeccionAlmacen()
|
||||
DtSeccionAlmacen = New DataTable
|
||||
DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
|
||||
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenOrigen", GetType(Integer))
|
||||
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenDestino", GetType(Integer))
|
||||
DtSeccionAlmacen.Columns.Add("SeccionAlmacenOrigen", GetType(String))
|
||||
DtSeccionAlmacen.Columns.Add("SeccionAlmacenDestino", GetType(String))
|
||||
DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
DtSeccionAlmacen.Rows.Clear()
|
||||
CantidadTotal = gvRow.DataKey("Existencia").ToDecimal
|
||||
CveSeccionAlmacenOrigen = gvRow.DataKey("CveAlmacenSeccion").ToEntero
|
||||
SeccionAlmacenOrigen = gvRow.DataKey("AlmacenSeccion").ToString
|
||||
CvePS = gvRow.DataKey("CvePS").ToEntero
|
||||
SerieLote = gvRow.DataKey("SerieLote").ToString
|
||||
CveAlmacen = gvRow.DataKey("CveAlmacen").ToEntero
|
||||
CveUM = gvRow.DataKey("CveUM").ToEntero
|
||||
CveSubProyecto = gvRow.DataKey("CveSubProyecto").ToEntero
|
||||
RegistraScript("$('#DModalSeccionAlmacen').modal()")
|
||||
CargaSeccionAlmacen()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
Dim CantidadDisponible As Decimal = 0
|
||||
If ObjInv.GetMovimientosDetalleSeccionesAlmacen(CveSeccionAlmacenOrigen, CveAlmacen, CvePS, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||
CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
|
||||
CantidadDisponible -= DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen")
|
||||
|
||||
If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
|
||||
Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Row As DataRow = Nothing
|
||||
DtSeccionAlmacen.AcceptChanges()
|
||||
Row = DtSeccionAlmacen.NewRow
|
||||
Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
|
||||
Row("CveSeccionAlmacenOrigen") = CveSeccionAlmacenOrigen
|
||||
Row("SeccionAlmacenOrigen") = SeccionAlmacenOrigen
|
||||
Row("CveSeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedValue.ToEntero
|
||||
Row("SeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedItem.Text
|
||||
Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
|
||||
DtSeccionAlmacen.Rows.Add(Row)
|
||||
DtSeccionAlmacen.AcceptChanges()
|
||||
CargaSeccionAlmacen()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
Dim Index As Integer = 0
|
||||
For Each Dr As DataRow In DtSeccionAlmacen.Rows
|
||||
If Dr("Consec").ToString.ToEntero = gvRow.DataKey("Consec").ToEntero() Then
|
||||
Exit For
|
||||
End If
|
||||
Index += 1
|
||||
Next
|
||||
DtSeccionAlmacen.Rows.RemoveAt(Index)
|
||||
DtSeccionAlmacen.AcceptChanges()
|
||||
CargaSeccionAlmacen()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSeccionAlmacen()
|
||||
Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen")
|
||||
GvSeccion.DataSource = DtSeccionAlmacen
|
||||
GvSeccion.DataBind()
|
||||
|
||||
TxtCantidadSeccion.Text = ""
|
||||
DdlSeccionAlmacenDestino.SelectedIndex = 0
|
||||
Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
|
||||
If CantidadRestante = 0 Then
|
||||
RVTxtCantidad.MaximumValue = "1"
|
||||
TxtCantidadSeccion.Enabled = False
|
||||
Else
|
||||
RVTxtCantidad.MaximumValue = CantidadRestante.ToString
|
||||
TxtCantidadSeccion.Enabled = True
|
||||
End If
|
||||
|
||||
UpModalSeccionAlmacen.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnTraspasar_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjInv As New ClsInventarios
|
||||
ObjInv.IniciaTransacSQL()
|
||||
Dim TieneError As Boolean = False
|
||||
Dim MensajeError As String = ""
|
||||
|
||||
'SALIDA
|
||||
Dim CveMovimientoSalida As Integer = ObjInv.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, CveSubProyecto, -1, CveAlmacenDestino:=CveAlmacen)
|
||||
|
||||
If CveMovimientoSalida <= 0 Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al guardar el movimiento de salida. Por favor vuelva a intentar."
|
||||
End If
|
||||
|
||||
Dim Cantidad As Decimal = DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen")
|
||||
|
||||
If Not ObjInv.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, 0, -1, SerieLote:=SerieLote) Then
|
||||
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
|
||||
TieneError = True
|
||||
Else
|
||||
If ObjInv.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
|
||||
For Each Dr2 As DataRow In DtSeccionAlmacen.Rows
|
||||
If Not ObjInv.AddMovimientosDetalleSeccionesAlmacen(ObjInv.CveMovimientoDetalle, Dr2("CveSeccionAlmacenOrigen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
'ENTRADA
|
||||
If Not TieneError Then
|
||||
Dim CveMovimientoEntrada As Integer = ObjInv.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, CveSubProyecto, -1, CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
|
||||
If CveMovimientoEntrada <= 0 Then
|
||||
MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar."
|
||||
TieneError = True
|
||||
Else
|
||||
If ObjInv.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInv.DtResultados.Rows
|
||||
If Not ObjInv.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
Else
|
||||
If ObjInv.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
|
||||
For Each Dr2 As DataRow In DtSeccionAlmacen.Rows
|
||||
If Not ObjInv.AddMovimientosDetalleSeccionesAlmacen(ObjInv.CveMovimientoDetalle, Dr2("CveSeccionAlmacenDestino").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
ObjInv.Commit()
|
||||
Alert("El traspaso se ha hecho correctamente")
|
||||
CargaDatos()
|
||||
RegistraScript("$('#DModalSeccionAlmacen').modal('hide')")
|
||||
Else
|
||||
ObjInv.RollBack()
|
||||
Alert(MensajeError, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
18654
Ventas/Clientes.aspx.vb
18654
Ventas/Clientes.aspx.vb
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user