-- cambios Series,Lote,Caducidad
This commit is contained in:
@@ -222,7 +222,7 @@
|
||||
</table>
|
||||
|
||||
<div style="max-height: 300px; overflow-y: auto;">
|
||||
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,SerieLote,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,CveSeccionAlmacen,Lote,FechaCaducidad,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="25px" />
|
||||
<asp:TemplateField ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Right">
|
||||
@@ -234,7 +234,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="90px" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="500px" />
|
||||
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="90px" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="90px" />
|
||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
<ItemTemplate>
|
||||
ssss
|
||||
@@ -381,7 +381,7 @@
|
||||
<asp:UpdatePanel runat="server" ID="UpDatosDesapartado" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div style="max-height: 300px; overflow-y: auto;">
|
||||
<asp:GridView ID="GvDatosDesapartado" DataKeyNames="CvePS,CveUM,CveMovimientoDetalle,SerieLote,PU,Cantidad" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró mercancía apartada" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||
<asp:GridView ID="GvDatosDesapartado" DataKeyNames="CvePS,CveUM,CveMovimientoDetalle,CveSeccionAlmacen,Serie,PU,Cantidad" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró mercancía apartada" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Disponible" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
|
||||
@@ -393,7 +393,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="15%" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="35%" />
|
||||
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="SerieLote" ItemStyle-Width="20%" />
|
||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
<ItemTemplate>
|
||||
ssss
|
||||
|
||||
@@ -446,14 +446,14 @@ Partial Class Inventarios_Apartados
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional SerieLote As String = "-1") As Boolean
|
||||
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Boolean
|
||||
Dim Retorno = True
|
||||
|
||||
Dim Inv As New ClsInventarios
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote:=SerieLote)
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=Serie)
|
||||
Inv.Dispose()
|
||||
|
||||
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUnidadMedida} {If(SerieLote <> "-1", $" AND SerieLote = '{SerieLote}'", "")}") < 0 Then
|
||||
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUnidadMedida} {If(Serie <> "-1", $" AND Serie = '{Serie}'", "")}") < 0 Then
|
||||
If Existencia < 0 Then
|
||||
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
|
||||
@@ -541,12 +541,12 @@ Partial Class Inventarios_Apartados
|
||||
e.Row.FCTextBox("TxtCantidad2").Attributes.Add("onblur", String.Format("ValidaCantidad(this,{0})", e.Row.DBCampo("Cantidad")))
|
||||
End If
|
||||
|
||||
If If(e.Row.DBCampo("SerieLote").ToString = "", "-1", e.Row.DBCampo("SerieLote").ToString) <> "-1" Then
|
||||
If If(e.Row.DBCampo("Serie").ToString = "", "-1", e.Row.DBCampo("Serie").ToString) <> "-1" Then
|
||||
TxtnSerieLote.Visible = True
|
||||
ThSerieLote.Visible = True
|
||||
TdSerieLote.Visible = True
|
||||
GvDatos.Columns(4).Visible = True
|
||||
e.Row.Cells(4).Text = e.Row.DBCampo("SerieLote").ToString
|
||||
e.Row.Cells(4).Text = e.Row.DBCampo("Serie").ToString
|
||||
Else
|
||||
e.Row.Cells(4).Text = ""
|
||||
End If
|
||||
@@ -610,8 +610,8 @@ Partial Class Inventarios_Apartados
|
||||
If Not CargadoDeMov Then
|
||||
|
||||
For Each dr As DataRow In DtMovimientos.Rows
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote:=If(dr("SerieLote").ToString = "", "-1", dr("SerieLote").ToString))
|
||||
Existencia -= DtMovimientos.SUM("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("SerieLote").ToString <> "-1", $" AND SerieLote = '{dr("SerieLote").ToString}'", "")}")
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=If(dr("Serie").ToString = "", "-1", dr("Serie").ToString))
|
||||
Existencia -= DtMovimientos.SUM("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("Serie").ToString <> "-1", $" AND SerieLote = '{dr("SerieLote").ToString}'", "")}")
|
||||
'DtMovimientos.SUM("Cantidad", String.Format("CvePS = {0}", dr("CvePS").ToString.ToEntero))
|
||||
|
||||
If Existencia < 0 Then
|
||||
@@ -623,7 +623,7 @@ Partial Class Inventarios_Apartados
|
||||
Next
|
||||
Else
|
||||
For Each gvr As GridViewRow In GvDatos.Rows
|
||||
Existencia = ObjInventario.GetExistenciasPS(gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote:=If(gvr.DataKey("SerieLote").ToString = "", "-1", gvr.DataKey("SerieLote").ToString))
|
||||
Existencia = ObjInventario.GetExistenciasPS(gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=If(gvr.DataKey("Serie").ToString = "", "-1", gvr.DataKey("Serie").ToString))
|
||||
Existencia -= gvr.FCTextBox("TxtCantidad2").Text.ToEntero
|
||||
If Existencia < 0 Then
|
||||
ErrorExistencia = True
|
||||
@@ -666,7 +666,7 @@ Partial Class Inventarios_Apartados
|
||||
ErrorMovInv = True
|
||||
Else
|
||||
For Each Dr As DataRow In DtMovimientos.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
@@ -690,7 +690,7 @@ Partial Class Inventarios_Apartados
|
||||
Else
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.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, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
@@ -896,7 +896,7 @@ Partial Class Inventarios_Apartados
|
||||
Else
|
||||
For Each Gvr As GridViewRow In GvDatosDesapartado.Rows
|
||||
If Gvr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("SerieLote").ToString, CveMovimientoDetalleEntrada:=Gvr.DataKey("CveMovimientoDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("Serie").ToString, CveMovimientoDetalleEntrada:=Gvr.DataKey("CveMovimientoDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
@@ -918,7 +918,7 @@ Partial Class Inventarios_Apartados
|
||||
Else
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.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, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
|
||||
@@ -231,7 +231,7 @@ Partial Class Inventarios_ConsignacionesMaterial
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacen.SelectedIndexChanged
|
||||
DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero)
|
||||
DdlSeccion.DataBind()
|
||||
DdlSeccion.Items.Insert(0, New ListItem("Seleccione Sección.", "-1"))
|
||||
UPEncabezado.Update()
|
||||
|
||||
@@ -453,17 +453,18 @@
|
||||
<asp:TextBox ID="TxtLote" CssClass="form-control" runat="server" Visible="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
|
||||
<asp:TemplateField HeaderText="F.Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtCaducidad" Text='<%# Eval("Caducidad") %>' CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server" Visible="false"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtCaducidad" Text='<%# Eval("FechaCaducidad") %>' CssClass="form-control input-sm ADSMaskDate" Style="width: 78px" runat="server" Visible="false"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="false"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
|
||||
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
|
||||
</span>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -601,8 +601,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If Not DtDatos.Columns.Contains("CveSeccion") Then
|
||||
DtDatos.Columns.Add("CveSeccion", GetType(Integer))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("Caducidad") Then
|
||||
DtDatos.Columns.Add("Caducidad", GetType(Date))
|
||||
If Not DtDatos.Columns.Contains("FechaCaducidad") Then
|
||||
DtDatos.Columns.Add("FechaCaducidad", GetType(Date))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("Seleccionado") Then
|
||||
DtDatos.Columns.Add("Seleccionado", GetType(Boolean))
|
||||
@@ -611,9 +611,6 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double))
|
||||
End If
|
||||
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
Dr("Caducidad") = Now
|
||||
Next
|
||||
|
||||
'TxtFecha.Text = If(EsDevolucionVenta = 1, Now.ToShortDateString, DtDatos.Rows(0)("Fecha").ToString)
|
||||
End If
|
||||
@@ -1001,7 +998,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
If DtSerie.Rows.Count > 0 Then
|
||||
Dim Mensaje As New StringBuilder
|
||||
Mensaje.AppendFormat("Serie / Lote Recomendado: <b>{0}</b>", DtSerie.Rows(0)("Serie"))
|
||||
Mensaje.AppendFormat("Serie Recomendado: <b>{0}</b>", DtSerie.Rows(0)("Serie"))
|
||||
If AplicaCaducidad Then Mensaje.AppendFormat(", Caducicdad: <b>{0}</b>", DtSerie.Rows(0)("FechaCaducidad").ToString.ToDate.ToShortDateString)
|
||||
LbSerieRecomendado.Text = Mensaje.ToString 'String.Format("Serie / Lote Recomendado: <b>{0}</b>, Caducicdad: <b>{1}</b>", ObjInventarios.DtResultados.Rows(0)("SerieLote"), ObjInventarios.DtResultados.Rows(0)("FechaCaducidad").ToString.ToDate.ToShortDateString)
|
||||
Else
|
||||
@@ -1592,7 +1589,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
||||
DtDatos.Rows(Index)("CantidadGV") = gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
DtDatos.Rows(Index)("CveSeccion") = gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero
|
||||
DtDatos.Rows(Index)("Caducidad") = gvr.FCTextBox("TxtCaducidad").Text.ToDate
|
||||
DtDatos.Rows(Index)("FechaCaducidad") = gvr.FCTextBox("TxtCaducidad").Text.ToDate
|
||||
DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text
|
||||
End If
|
||||
Index += 1
|
||||
@@ -1651,10 +1648,10 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If CBool(Dr("AplicaSerie")) Then
|
||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" CveSeccionAlmacen=""{3}"" Serie=""{4}"" Lote=""{5}"" Caducidad=""{6}"" ></concepto>", Dr1("CvePS"), Dr1("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToShortDateString)
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" CveSeccionAlmacen=""{3}"" Serie=""{4}"" Lote=""{5}"" FechaCaducidad=""{6}"" ></concepto>", Dr1("CvePS"), Dr1("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("yyyy/MM/dd"))
|
||||
Next
|
||||
Else
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" CveSeccionAlmacen=""{3}"" Serie=""{4}"" Lote=""{5}"" Caducidad=""{6}"" ></concepto>", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), IfNull(Dr("CveSeccion"), -1), "-1", Lote, FechaCaducidad.ToShortDateString)
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" CveSeccionAlmacen=""{3}"" Serie=""{4}"" Lote=""{5}"" FechaCaducidad=""{6}"" ></concepto>", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), IfNull(Dr("CveSeccion"), -1), "-1", Lote, FechaCaducidad.ToString("yyyy/MM/dd"))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
@@ -1705,7 +1702,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Dr1("Serie").ToString, CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Dr1("Serie").ToString, CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
For Each Dr2 As DataRow In ObjInventario.DtResultados.FiltraParametros("CveAlmacen > 0 AND ExistenciaFinal > 0").Rows
|
||||
|
||||
'BUSCA SI EXISTE YA UN TRASPASO DEL ALMACEN DE APARTADO
|
||||
@@ -1734,7 +1731,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
CantidadPendiente = 1
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un Error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
@@ -1749,11 +1746,11 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If ErrorMovInv Then Exit For
|
||||
Next
|
||||
|
||||
ElseIf Dr("Inv_CveMetodoInventario").ToString = "6" Then
|
||||
ElseIf CBool(Dr("AplicaLote")) Then
|
||||
|
||||
DtDetalle = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Dr1("Lote").ToString, CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Dr1("Lote").ToString, CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
|
||||
CantidadSaldo = Dr("CantidadGV").ToString.ToDecimal
|
||||
|
||||
@@ -1784,7 +1781,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
CantidadPendiente = If(Dr1("Cantidad").ToString.ToDecimal > CantidadSaldo, CantidadSaldo, Dr1("Cantidad").ToString.ToDecimal)
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Lote:=Dr1("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Lote:=Dr1("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
@@ -1802,7 +1799,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
Else
|
||||
|
||||
If ObjInventario.GetExistenciasProducto(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
If ObjInventario.GetExistenciasProducto(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
|
||||
CantidadSaldo = Dr("CantidadGV").ToString.ToDecimal
|
||||
|
||||
@@ -1837,7 +1834,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0,
|
||||
Serie:=Dr("Serie").ToString,
|
||||
CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero,
|
||||
FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha),
|
||||
FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha),
|
||||
Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"),
|
||||
CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
@@ -1883,7 +1880,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
@@ -1981,7 +1978,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
@@ -2011,7 +2008,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND Serie = '{Dr1("Serie").ToString}'").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
@@ -2020,10 +2017,10 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
ElseIf DtDetalleLote.Rows.Count > 0 Then
|
||||
For Each Dr1 As DataRow In DtDetalleLote.Rows
|
||||
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
|
||||
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal
|
||||
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND Serie = '{Dr1("Serie").ToString}'").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
@@ -2034,7 +2031,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
@@ -2527,21 +2524,21 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
'VERIFICAR EXISTENCIA
|
||||
Dim StrXML As New StringBuilder
|
||||
Dim Lote As String = ""
|
||||
Dim FechaCaducidad As Date
|
||||
StrXML.Append("<conceptos>")
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString <> "", Dr("FechaCaducidad").ToString.ToDate, MinFecha)
|
||||
Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1")
|
||||
|
||||
If Dr("CantidadGV").ToString.ToDecimal > 0 Then
|
||||
If Dr("Inv_CveMetodoInventario").ToString = "5" Then
|
||||
If CBool(Dr("AplicaSerie")) Then
|
||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" Serie=""{3}"" ></concepto>", Dr1("CvePS"), Dr1("CveUM"), 1, Dr1("Serie"))
|
||||
Next
|
||||
ElseIf Dr("Inv_CveMetodoInventario").ToString = "6" Then
|
||||
DtDetalle = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" Serie=""{3}"" ></concepto>", Dr1("CvePS"), Dr1("CveUM"), DtDatosDetalleLote.SUM("Cantidad", $"Lote = '{Dr1("Lote").ToString}' "), Dr1("Lote"))
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" CveSeccionAlmacen=""{3}"" Serie=""{4}"" Lote=""{5}"" FechaCaducidad=""{6}"" ></concepto>", Dr1("CvePS"), Dr1("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("YYYY/MM/DD"))
|
||||
Next
|
||||
Else
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" Serie=""{3}"" ></concepto>", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), "-1")
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" CveSeccionAlmacen=""{3}"" Serie=""{4}"" Lote=""{5}"" FechaCaducidad=""{6}"" ></concepto>", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), IfNull(Dr("CveSeccion"), -1), "-1", Lote, FechaCaducidad.ToString("YYYY/MM/DD"))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
@@ -2581,7 +2578,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
||||
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
||||
If DtDetalle.Rows.Count > 0 Then 'SI FUE POR SERIELOTE
|
||||
If DtDetalle.Rows.Count > 0 Then 'SI FUE POR SERIE
|
||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
@@ -2875,7 +2872,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Row("CveSeccion") = GvDatos.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero
|
||||
End If
|
||||
If GvDatos.Rows(index2).FCTextBox("TxtCaducidad").Text <> "" Then
|
||||
Row("Caducidad") = GvDatos.Rows(index2).FCTextBox("TxtCaducidad").Text.ToDate
|
||||
Row("FechaCaducidad") = GvDatos.Rows(index2).FCTextBox("TxtCaducidad").Text.ToDate
|
||||
End If
|
||||
index2 += 1
|
||||
Next
|
||||
@@ -2934,8 +2931,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If Row("CveSeccion").ToString <> "" Then
|
||||
GvDatos.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue = Row("CveSeccion").ToString
|
||||
End If
|
||||
If Row("Caducidad").ToString <> "" Then
|
||||
GvDatos.Rows(index2).FCTextBox("TxtCaducidad").Text = Row("Caducidad").ToString.ToDate.ToShortDateString
|
||||
If Row("FechaCaducidad").ToString <> "" Then
|
||||
GvDatos.Rows(index2).FCTextBox("TxtCaducidad").Text = Row("FechaCaducidad").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
index2 += 1
|
||||
Next
|
||||
@@ -3022,7 +3019,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim Index = 1
|
||||
For Each Dr As DataRow In DtDatosSugerencias.Rows
|
||||
Dr("Consec") = Index
|
||||
'Dr("Caducidad") = Now
|
||||
|
||||
Index += 1
|
||||
Next
|
||||
|
||||
@@ -3032,7 +3029,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
GvSugerencias.Columns(2).Visible = DtDatosSugerencias.MAX("Seccion") <> ""
|
||||
GvSugerencias.Columns(3).Visible = DtDatosSugerencias.MAX("Serie") <> ""
|
||||
GvSugerencias.Columns(4).Visible = DtDatosSugerencias.MAX("Lote") <> ""
|
||||
GvSugerencias.Columns(5).Visible = DtDatosSugerencias.MAX("Caducidad") <> ""
|
||||
GvSugerencias.Columns(5).Visible = DtDatosSugerencias.MAX("FechaCaducidad") <> ""
|
||||
End If
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ Partial Class Inventarios_KardexAlmacen
|
||||
ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
'If Not UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 13, 66) Then
|
||||
' GvDatos.Columns(6).Visible = True ' SerieLote
|
||||
|
||||
' GvDatos.Columns(7).Visible = True ' FCaducidad
|
||||
'End If
|
||||
If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
|
||||
|
||||
@@ -222,9 +222,9 @@
|
||||
<asp:BoundField HeaderText="Cant. Disponible" DataField="CantidadDisponible2" ItemStyle-Width="15%" DataFormatString="{0:###,###,###,##0.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Producto/Servicio" DataField="CodigoPS" ItemStyle-Width="40%" />
|
||||
<asp:BoundField HeaderText="Unidad Medida" DataField="UnidadMedida" ItemStyle-Width="20%" />
|
||||
<asp:TemplateField HeaderText="SerieLote">
|
||||
<asp:TemplateField HeaderText="Serie">
|
||||
<ItemTemplate>
|
||||
<asp:Button Text="SerieLote" ID="BtnSerieLote" OnClick="BtnSerieLote_Click" CssClass="btn btn-xs btn-primary" runat="server" Style="float: left;" />
|
||||
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-xs btn-primary" runat="server" Style="float: left;" />
|
||||
<asp:LinkButton Text="<i class='fa fa-star'></i>" ID="BtnSeriePaquete" OnClick="BtnSeriePaquete_Click" CssClass="btn btn-xs btn-primary" runat="server" Visible="false" Style="float: left;" data-toggle="tooltip" title="Seleccionar como serie del paquete" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -484,9 +484,9 @@
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Producto/Servicio" DataField="CodigoPS" ItemStyle-Width="50%" />
|
||||
<asp:BoundField HeaderText="Unidad Medida" DataField="UnidadMedida" ItemStyle-Width="20%" />
|
||||
<asp:TemplateField HeaderText="SerieLote">
|
||||
<asp:TemplateField HeaderText="Serie">
|
||||
<ItemTemplate>
|
||||
<asp:Button Text="SerieLote" ID="BtnSerieLote" OnClick="BtnSerieLote_Click" CssClass="btn btn-xs btn-primary" runat="server" Style="float: left;" />
|
||||
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-xs btn-primary" runat="server" Style="float: left;" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
@@ -558,15 +558,15 @@
|
||||
<tr>
|
||||
<td width="80px">Serie/Lote:</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="TxtSerieLote" Width="300px" ClientIDMode="Static" />
|
||||
<asp:RequiredFieldValidator ID="RFVSerieLote" runat="server" ControlToValidate="TxtSerieLote" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie/Lote''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCESerieLote" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerieLote" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:TextBox runat="server" ID="TxtSerie" Width="300px" ClientIDMode="Static" />
|
||||
<asp:RequiredFieldValidator ID="RFVSerie" runat="server" ControlToValidate="TxtSerie" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie/Lote''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<code>
|
||||
<asp:Label ID="LbSerieLoteRecomendado" Text="Serie/Lote Recomendado: <b>PS2505</b>, Caducicdad: <b>25/04/2016</b>" runat="server" />
|
||||
<asp:Label ID="LbSerieRecomendado" Text="Serie/Lote Recomendado: <b>PS2505</b>, Caducicdad: <b>25/04/2016</b>" runat="server" />
|
||||
</code>
|
||||
</td>
|
||||
<td align="right">
|
||||
|
||||
@@ -470,13 +470,13 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
If Gvr.DataKey("Cantidad").ToString.ToDouble > 0 Then
|
||||
If Gvr.DataKey("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then
|
||||
For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows
|
||||
If Not ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenArmado.SelectedValue.ToEntero, FechaMovto:=Fecha.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=Dr("Serie").ToString, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) >= 1 Then
|
||||
If Not ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenArmado.SelectedValue.ToEntero, FechaMovto:=Fecha.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Dr("Serie").ToString, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) >= 1 Then
|
||||
MensajeError = String.Format("El Producto <b>{0}</b> con Serie: <b>{1}</b> no tiene existencia suficiente", Dr("PS"), Dr("Serie"))
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, SerieLote:=Dr("Serie").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, Serie:=Dr("Serie").ToString) Then
|
||||
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida. Por favor vuelva a intentar."
|
||||
TieneError = True
|
||||
Exit For
|
||||
@@ -520,7 +520,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
Dim DtSeriesComponentes As New DataTable
|
||||
For Each Gvr As GridViewRow In GvSeriesPaqueteArmado.Rows
|
||||
'AGREGA MOVTO DETALLE DE LA ENTRADA DEL PAQUETE
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, -1, SerieLote:=Gvr.FCTextBox("TxtSerie").Text.Trim) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, -1, Serie:=Gvr.FCTextBox("TxtSerie").Text.Trim) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada"
|
||||
Exit For
|
||||
@@ -577,7 +577,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
If CveTipoPS = 5 Then
|
||||
For Each Gvr As GridViewRow In GvSeriesPaqueteDesarmado.Rows
|
||||
'AGREGA MOVTO DETALLE DE LA SALIDA DEL PAQUETE
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, -1, SerieLote:=Gvr.DataKey("Serie").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, -1, Serie:=Gvr.DataKey("Serie").ToString) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida"
|
||||
Exit For
|
||||
@@ -611,7 +611,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
If Gvr.DataKey("Cantidad").ToString.ToDouble > 0 Then
|
||||
If Gvr.DataKey("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then
|
||||
For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, -1, SerieLote:=Dr("Serie").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, -1, Serie:=Dr("Serie").ToString) Then
|
||||
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada. Por favor vuelva a intentar."
|
||||
TieneError = True
|
||||
Exit For
|
||||
@@ -805,11 +805,11 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
Dim VariableCampoSerie = ""
|
||||
If TipoMovimiento = 1 Then
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.SerieLoteRecomendadoGet(CvePSSerieLote, UsuarioActual.CveEmpresa, If(TipoMovimiento = 1, CveAlmacenArmado, CveAlmacenDesarmado)) Then
|
||||
If ObjInventarios.SerieRecomendadoGet(CvePSSerieLote, UsuarioActual.CveEmpresa, If(TipoMovimiento = 1, CveAlmacenArmado, CveAlmacenDesarmado)) Then
|
||||
DtSerieLote = ObjInventarios.DtResultados
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
VariableCampoSerie = "SerieLote"
|
||||
VariableCampoSerie = "Serie"
|
||||
Else
|
||||
DtSerieLote = If(DtExistenciasDesarmado IsNot Nothing, DtExistenciasDesarmado.Copy, Nothing)
|
||||
VariableCampoSerie = "SeriePS"
|
||||
@@ -835,12 +835,12 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
If DtSerieLote.Rows.Count > 0 Then
|
||||
Dim Mensaje As New StringBuilder
|
||||
Mensaje.AppendFormat("Serie / Lote Recomendado: <b>{0}</b>", DtSerieLote.Rows(0)(VariableCampoSerie))
|
||||
LbSerieLoteRecomendado.Text = Mensaje.ToString 'String.Format("Serie / Lote Recomendado: <b>{0}</b>, Caducicdad: <b>{1}</b>", ObjInventarios.DtResultados.Rows(0)("SerieLote"), ObjInventarios.DtResultados.Rows(0)("FechaCaducidad").ToString.ToDate.ToShortDateString)
|
||||
LbSerieRecomendado.Text = Mensaje.ToString 'String.Format("Serie / Lote Recomendado: <b>{0}</b>, Caducicdad: <b>{1}</b>", ObjInventarios.DtResultados.Rows(0)("Serie"), ObjInventarios.DtResultados.Rows(0)("FechaCaducidad").ToString.ToDate.ToShortDateString)
|
||||
Else
|
||||
LbSerieLoteRecomendado.Text = "No se encontro ningun Serie/Lote."
|
||||
LbSerieRecomendado.Text = "No se encontro ningun Serie/Lote."
|
||||
End If
|
||||
Else
|
||||
LbSerieLoteRecomendado.Text = "No se encontro ningun Serie/Lote."
|
||||
LbSerieRecomendado.Text = "No se encontro ningun Serie/Lote."
|
||||
End If
|
||||
If DtSerieLote IsNot Nothing Then DtSerieLote.Dispose()
|
||||
UpSerie.Update()
|
||||
@@ -848,17 +848,17 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs)
|
||||
AgregaSerieLote(TxtSerieLote.Text.Trim, 1)
|
||||
AgregaSerieLote(TxtSerie.Text.Trim, 1)
|
||||
End Sub
|
||||
Private Sub AgregaSerieLote(SerieLote As String, Tipo As Integer)
|
||||
Private Sub AgregaSerieLote(Serie As String, Tipo As Integer)
|
||||
|
||||
If SerieLote.Trim = "" Then
|
||||
If Serie.Trim = "" Then
|
||||
Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Dim SeriesArreglo = SerieLote.Split(";"c)
|
||||
Dim SeriesArreglo = Serie.Split(";"c)
|
||||
|
||||
'VALIDACION DE SERIES DUPLICADAS
|
||||
Dim MensajeAlert As New StringBuilder
|
||||
@@ -897,7 +897,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
'VERIFICA EXISTENCIAS
|
||||
Dim Existencia = 0.0D
|
||||
If TipoMovimiento = 1 Then
|
||||
Existencia = ObjInventarios.GetExistenciasPS(CvePSSerieLote, CveUMSerieLote, UsuarioActual.CveEmpresa, DdlAlmacenArmado.SelectedValue.ToEntero, FechaMovto:=TxtFechaArmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=Serie, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente))
|
||||
Existencia = ObjInventarios.GetExistenciasPS(CvePSSerieLote, CveUMSerieLote, UsuarioActual.CveEmpresa, DdlAlmacenArmado.SelectedValue.ToEntero, FechaMovto:=TxtFechaArmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente))
|
||||
Else
|
||||
Existencia = If(DtExistenciasDesarmado Is Nothing, 0, DtExistenciasDesarmado.FiltraParametros($"CvePS={CvePSSerieLote} AND SeriePS='{Serie}'").Rows.Count.ToString.ToDecimal)
|
||||
End If
|
||||
@@ -931,7 +931,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
If Tipo = 1 Then
|
||||
TxtSerieLote.Text = ""
|
||||
TxtSerie.Text = ""
|
||||
End If
|
||||
|
||||
CargaSerie(2)
|
||||
@@ -988,20 +988,20 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnAgregarSerieDesarmado_Click(sender As Object, e As EventArgs)
|
||||
Dim SerieLote = TxtSerieDesarmado.Text.Trim
|
||||
Dim Serie = TxtSerieDesarmado.Text.Trim
|
||||
|
||||
'VERIFICA EXISTENCIAS
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimeroValor("CveUM").ToEntero
|
||||
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePaqueteDesarmado, CveUMTemp, UsuarioActual.CveEmpresa, CveAlmacenDesarmado, FechaMovto:=LbFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=SerieLote, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente))
|
||||
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePaqueteDesarmado, CveUMTemp, UsuarioActual.CveEmpresa, CveAlmacenDesarmado, FechaMovto:=LbFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente))
|
||||
|
||||
If Existencia < 1 Then
|
||||
Alert($"No hay existencia suficiente con la Serie definida <b>""{SerieLote}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay existencia suficiente con la Serie definida <b>""{Serie}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If ObjInventarios.GetPaqueteRelacionSeries(CvePaqueteDesarmado, SerieLote) Then
|
||||
If ObjInventarios.GetPaqueteRelacionSeries(CvePaqueteDesarmado, Serie) Then
|
||||
If DtExistenciasDesarmado Is Nothing Then
|
||||
DtExistenciasDesarmado = ObjInventarios.DtResultados.Copy
|
||||
Else
|
||||
|
||||
@@ -1612,7 +1612,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
|
||||
If TipoMovimiento = 2 Then
|
||||
If DtExistencias.SUM("Existencia", $"SerieLote = {Serie}") = 0 Then
|
||||
If DtExistencias.SUM("Existencia", $"Serie = {Serie}") = 0 Then
|
||||
MensajeSinExistencias.Append($"Serie: <b>{Serie}</b>. <br/>")
|
||||
Continue For
|
||||
End If
|
||||
@@ -2324,7 +2324,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
If Not ErrorMovInv AndAlso Dt IsNot Nothing Then
|
||||
For Each Dr As DataRow In Dt.FiltraParametros($"CveVenta={CveVenta}").Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaDirecta, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaDirecta, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -2385,12 +2385,12 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaActual, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaActual, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovtoEntradaActual, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovtoEntradaActual, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -458,7 +458,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
dt.Columns.Add("CostoIndirecto", Type.GetType("System.Double"))
|
||||
dt.Columns.Add("CodigoAF")
|
||||
dt.Columns.Add("CveAF")
|
||||
dt.Columns.Add("SerieLote", Type.GetType("System.String"))
|
||||
dt.Columns.Add("Serie", Type.GetType("System.String"))
|
||||
dt.Columns.Add("Lote", Type.GetType("System.String"))
|
||||
|
||||
dt.Columns.Add("Observaciones")
|
||||
@@ -860,9 +860,9 @@ Partial Class Inventarios_RecepcionUsados
|
||||
#End Region
|
||||
|
||||
#Region " AGREGAR - GUARDAR "
|
||||
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional SerieLote As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Double
|
||||
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Double
|
||||
Dim Inv As New ClsInventarios
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, -1, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), SerieLote:=SerieLote, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, -1, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
|
||||
Inv.Dispose()
|
||||
Return Existencia
|
||||
End Function
|
||||
@@ -884,7 +884,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End If
|
||||
|
||||
AddNew(DdlProducto2.SelectedValue.ToEntero, DdlProducto2.SelectedItem.Text, DdlUnidad.SelectedValue.ToEntero, DdlUnidad.SelectedItem.Text, txtCantidad.Text.ToDouble, PU,
|
||||
"", "-1", "-1", "-1", TxtObservacionesdetalle.Text, "", "", DdlAlmacen.SelectedValue.ToEntero, DdlAlmacen.SelectedItem.Text, "", HdnCveTamaño.Value.ToEntero)
|
||||
"", "-1", "-1", "-1", TxtObservacionesdetalle.Text, "", -1, "", "", HdnCveTamaño.Value.ToEntero)
|
||||
LimpiarAgregar()
|
||||
|
||||
txtCantidad.Text = ""
|
||||
@@ -901,8 +901,8 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, SerieLote As String, CodigoAF As String, Codigo As String,
|
||||
CveAF As String, Observaciones As String, Lote As String, Batch As String, CveSeccionAlmacen As Integer, SeccionAlmacen As String, Tamaño As String, CveTamaño As Integer)
|
||||
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, Serie As String, CodigoAF As String, Codigo As String,
|
||||
CveAF As String, Observaciones As String, Lote As String, CveSeccionAlmacen As Integer, SeccionAlmacen As String, Tamaño As String, CveTamaño As Integer)
|
||||
|
||||
'If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub
|
||||
|
||||
@@ -940,8 +940,8 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End If
|
||||
|
||||
'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
|
||||
If SerieLote <> "" And (SerieLote.ToUpper = dr("Codigo").ToString.ToUpper Or SerieLote.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then
|
||||
Alert($"La serie indicada <b>{SerieLote}</b> coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
If Serie <> "" And (Serie.ToUpper = dr("Codigo").ToString.ToUpper Or Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then
|
||||
Alert($"La serie indicada <b>{Serie}</b> coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -964,7 +964,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
registro.Item("CodigoAF") = CodigoAF
|
||||
registro.Item("Codigo") = Codigo
|
||||
registro.Item("CveAF") = CveAF
|
||||
registro.Item("SerieLote") = If(SerieLote <> "", SerieLote, "")
|
||||
registro.Item("Serie") = If(Serie <> "", Serie, "")
|
||||
registro.Item("Lote") = If(Lote <> "", Lote, "")
|
||||
registro.Item("Observaciones") = Observaciones
|
||||
|
||||
@@ -1000,7 +1000,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
DtMovimientos.Rows(IndexDTUsado)("CodigoAF") = CodigoAF
|
||||
DtMovimientos.Rows(IndexDTUsado)("Codigo") = Codigo
|
||||
DtMovimientos.Rows(IndexDTUsado)("CveAF") = CveAF
|
||||
DtMovimientos.Rows(IndexDTUsado)("SerieLote") = If(SerieLote <> "", SerieLote, "")
|
||||
DtMovimientos.Rows(IndexDTUsado)("Serie") = If(Serie <> "", Serie, "")
|
||||
DtMovimientos.Rows(IndexDTUsado)("Lote") = If(Lote <> "", Lote, "")
|
||||
DtMovimientos.Rows(IndexDTUsado)("Observaciones") = Observaciones
|
||||
|
||||
@@ -1121,7 +1121,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
ImporteConcepto = Dr("PU").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
Mensaje = "Error al guardar los movimientos"
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
@@ -1253,7 +1253,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub GuardaCodigoSerie(Cantidad As Double, CvePS As Integer, CveUM As Integer, CostoPromedio As Decimal, Optional SerieLote As String = "-1")
|
||||
Private Sub GuardaCodigoSerie(Cantidad As Double, CvePS As Integer, CveUM As Integer, CostoPromedio As Decimal, Optional Serie As String = "-1")
|
||||
Dim ObjInv As New ClsInventarios
|
||||
|
||||
If CveMovimiento <= 0 Then
|
||||
@@ -1261,7 +1261,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
-1, -1, -1, -1, Modulo:="RU/G")
|
||||
End If
|
||||
|
||||
ObjInv.AddMovimientoDetalle(CveMovimiento, Cantidad, CveUM, CvePS, CostoPromedio, -1, Serie:=SerieLote)
|
||||
ObjInv.AddMovimientoDetalle(CveMovimiento, Cantidad, CveUM, CvePS, CostoPromedio, -1, Serie:=Serie)
|
||||
ObjInv.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa)
|
||||
DtMovimientos = ObjInv.DtResultados.FiltraParametros("", "CveMovimientoDetalle DESC").AsEnumerable.Take(25).CopyToDataTable
|
||||
ObjInv.Dispose()
|
||||
@@ -1359,7 +1359,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
'Dim TienePermisoImportes = UsuarioActual.TienePermisoProceso(201)
|
||||
|
||||
If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then
|
||||
If DtTemp.MAX("SerieLote").ToString <> "" Then
|
||||
If DtTemp.MAX("Serie").ToString <> "" Then
|
||||
End If
|
||||
|
||||
If DtTemp.MAX("Lote").ToString <> "" Then
|
||||
@@ -1398,7 +1398,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
Dim Precio As Double = GvM.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDouble
|
||||
Dim No As Integer = GvM.Rows(e.RowIndex).DataKey("No").ToEntero
|
||||
Dim serielote As String = GvM.Rows(e.RowIndex).FCTextBox("TxtSerieLote").Text.Replace(" ", String.Empty)
|
||||
Dim serie As String = GvM.Rows(e.RowIndex).FCTextBox("TxtSerie").Text.Replace(" ", String.Empty)
|
||||
Dim Observaciones As String = GvM.Rows(e.RowIndex).FCTextBox("TxtObservaciones").Text
|
||||
Dim CveSeccionAlmacen As Integer = GvM.Rows(e.RowIndex).FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero
|
||||
Dim SeccionAlmacen As String = GvM.Rows(e.RowIndex).FCDropDownList("DdlSeccionAlmacen").SelectedItem.Text
|
||||
@@ -1408,7 +1408,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Drs(0)("PU") = Precio
|
||||
Drs(0)("Total") = Drs(0)("Cantidad").ToString.ToDouble * Precio
|
||||
Drs(0)("Estatus") = "U"
|
||||
Drs(0)("SerieLote") = serielote
|
||||
Drs(0)("Serie") = serie
|
||||
Drs(0)("Observaciones") = Observaciones
|
||||
Drs(0)("CveSeccionAlmacen") = CveSeccionAlmacen
|
||||
Drs(0)("SeccionAlmacen") = SeccionAlmacen
|
||||
@@ -1999,7 +1999,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Dim Cantidad As Double = RowUsado("Cantidad").ToString().ToEntero()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
|
||||
AddNew(CvePS, PS, CveUM, UM, Cantidad, PU, "", "-1", "-1", "-1", "", "", "", DdlAlmacen.SelectedValue.ToEntero, DdlAlmacen.SelectedItem.Text, "", CveTamaño)
|
||||
AddNew(CvePS, PS, CveUM, UM, Cantidad, PU, "", "-1", "-1", "-1", "", "", DdlAlmacen.SelectedValue.ToEntero, DdlAlmacen.SelectedItem.Text, "", CveTamaño)
|
||||
|
||||
Next
|
||||
End If
|
||||
@@ -2150,7 +2150,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Private Function AddPSRNC(ByRef TmpDT As DataTable, Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
|
||||
PU As Decimal, Descuento As Decimal,
|
||||
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
|
||||
Optional SerieLote As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
|
||||
Optional Serie As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
|
||||
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
|
||||
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
|
||||
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional EsCargo As Boolean = False, Optional PorcentajeIVA As Decimal = 0D, Optional CveTamaño As Integer = 0) As Boolean
|
||||
@@ -2176,7 +2176,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Row("Proyecto") = Proyecto
|
||||
Row("CveSubProyecto") = CveSubProyecto
|
||||
Row("SubProyecto") = SubProyecto
|
||||
Row("SerieLote") = SerieLote
|
||||
Row("Serie") = Serie
|
||||
Row("TiempoEntrega") = TiempoEntrega
|
||||
Row("Orden") = TmpDT.Rows.Count + 1
|
||||
Row("Cantidad") = Cantidad
|
||||
@@ -2293,7 +2293,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("SerieLote", GetType(String))
|
||||
TmpDT.Columns.Add("Serie", GetType(String))
|
||||
TmpDT.Columns.Add("CuentaPredial", GetType(String))
|
||||
TmpDT.Columns.Add("Obs", GetType(String))
|
||||
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
|
||||
@@ -2763,7 +2763,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
drTamañoPS = ObjPS.DtResultados.FiltroPrimero("")
|
||||
'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos
|
||||
AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe,
|
||||
"", "-1", "-1", "-1", "", "", "", -1, "", "", CveTamaño)
|
||||
"", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño)
|
||||
|
||||
End If
|
||||
Else
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
<asp:BoundField HeaderText="Producto" DataField="GPO"/>
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaMovto" DataFormatString="{0:d}"/>
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida"/>
|
||||
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote"/>
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie"/>
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Importe" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="40%" ItemStyle-HorizontalAlign="Left"/>
|
||||
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left"/>
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left"/>
|
||||
<asp:BoundField HeaderText="Valor" DataField="Valor" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:n}" />
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
<th width="40%">Clasificación<br />
|
||||
Producto </th>
|
||||
<th width="10%">U.M.</th>
|
||||
<th style="width: 20%" runat="server" id="ThSerieLote" visible="false">Serie - Lote</th>
|
||||
<th style="width: 20%" runat="server" id="ThSerie" visible="false">Serie - Lote</th>
|
||||
<th style="width: 10%;">Observaciones</th>
|
||||
<th width="10%"></th>
|
||||
</tr>
|
||||
@@ -238,8 +238,8 @@
|
||||
<asp:CompareValidator ID="CVUnidad" runat="server" ControlToValidate="ddlUnidad" Type="Integer" Operator="GreaterThan" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad Medida''</b> es necesario, por favor selecione una." Display="None" ValueToCompare="0" ValidationGroup="CVUnidad"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="CVUnidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td runat="server" id="TrSerieLote" visible="false">
|
||||
<asp:TextBox ID="TxtnSerieLote" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
||||
<td runat="server" id="TrSerie" visible="false">
|
||||
<asp:TextBox ID="TxtnSerie" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtObservacionesdetalle" CssClass="form-control input-sm" runat="server" MaxLength="200"></asp:TextBox>
|
||||
@@ -263,13 +263,13 @@
|
||||
<asp:Button ID="BtnVinculaAFEdit" ClientIDMode="Static" Style="display: none;" runat="server" />
|
||||
<asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
<asp:GridView ID="GvM" runat="server" GridLines="none" CssClass="table table-striped table-hover Widthall" EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,CveUM,CvePS,SerieLote,Observaciones,Cantidad" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True" OnRowDataBound="GvM_RowDataBound">
|
||||
<asp:GridView ID="GvM" runat="server" GridLines="none" CssClass="table table-striped table-hover Widthall" EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,CveUM,CvePS,Serie,Observaciones,Cantidad" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True" OnRowDataBound="GvM_RowDataBound">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###,###.##}" ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="40%" />
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" ItemStyle-Width="10%" />
|
||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
<ItemTemplate>
|
||||
@@ -454,7 +454,7 @@
|
||||
|
||||
<asp:UpdatePanel ID="UpGridLiberacion" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvMLiberacion" OnRowCreated="GvMLiberacion_RowCreated" OnRowDataBound="GvMLiberacion_RowDataBound" runat="server" GridLines="none" CssClass="table table-striped table-hover Widthall" EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,CveUM,CvePS,SerieLote,Observaciones,PU" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True">
|
||||
<asp:GridView ID="GvMLiberacion" OnRowCreated="GvMLiberacion_RowCreated" OnRowDataBound="GvMLiberacion_RowDataBound" runat="server" GridLines="none" CssClass="table table-striped table-hover Widthall" EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,CveUM,CvePS,Serie,Observaciones,PU" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Center" />
|
||||
<%-- <asp:BoundField HeaderText="Cant. Disponible" DataField="Cantidad" DataFormatString="{0:#,###,###.##}" ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Right" />--%>
|
||||
@@ -471,7 +471,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" ItemStyle-Width="10%" />
|
||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -200,7 +200,7 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
dt.Columns.Add("PS")
|
||||
dt.Columns.Add("Estatus")
|
||||
dt.Columns.Add("Codigo")
|
||||
dt.Columns.Add("SerieLote")
|
||||
dt.Columns.Add("Serie")
|
||||
dt.Columns.Add("Observaciones")
|
||||
dt.Columns.Add("CvePersonal", Type.GetType("System.Int32"))
|
||||
dt.Columns.Add("Checado", Type.GetType("System.Boolean"))
|
||||
@@ -347,12 +347,12 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
Private Sub VerificaProducto()
|
||||
If DdlProducto2.SelectedValue.ToEntero > 0 Then
|
||||
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltraParametros("Inv_CveMetodoInventario = 5", "PS").Rows.Count > 0 Then
|
||||
ThSerieLote.Visible = True
|
||||
TrSerieLote.Visible = True
|
||||
TxtnSerieLote.Visible = True
|
||||
ThSerie.Visible = True
|
||||
TrSerie.Visible = True
|
||||
TxtnSerie.Visible = True
|
||||
GvM.Columns(4).Visible = True
|
||||
Else
|
||||
TxtnSerieLote.Visible = False
|
||||
TxtnSerie.Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -380,9 +380,9 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
|
||||
|
||||
#Region " EISTENCIAS "
|
||||
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional SerieLote As String = "-1") As Double
|
||||
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional Serie As String = "-1") As Double
|
||||
Dim Inv As New ClsInventarios
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=SerieLote)
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie)
|
||||
Inv.Dispose()
|
||||
Return Existencia
|
||||
End Function
|
||||
@@ -398,15 +398,15 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
Dim PSSelected As Integer = DdlProducto2.SelectedValue.ToEntero
|
||||
If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgInformacion) : Exit Sub
|
||||
If PSSelected > 0 Then
|
||||
If TxtnSerieLote.Visible Then
|
||||
If TxtnSerieLote.Text = "" Then
|
||||
If TxtnSerie.Visible Then
|
||||
If TxtnSerie.Text = "" Then
|
||||
Alert("Serie-Lote es necesario", TipoMensaje.MsgAdvertencia)
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
Dim Valido As Boolean = True
|
||||
Dim cantidadd As Double = txtCantidad.Text.ToDouble
|
||||
Dim Existencia As Double = GetExistencias(PSSelected, DdlUnidad.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, If(TxtnSerieLote.Visible, TxtnSerieLote.Text, "-1").ToString)
|
||||
Dim Existencia As Double = GetExistencias(PSSelected, DdlUnidad.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, If(TxtnSerie.Visible, TxtnSerie.Text, "-1").ToString)
|
||||
If Existencia - txtCantidad.Text.ToDouble < 0 Then
|
||||
If Existencia <= 0 Then
|
||||
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
|
||||
@@ -431,7 +431,7 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
registro.Item("CvePS") = PSSelected
|
||||
registro.Item("PS") = DdlProducto2.SelectedText
|
||||
registro.Item("Estatus") = ""
|
||||
registro.Item("SerieLote") = TxtnSerieLote.Text
|
||||
registro.Item("Serie") = TxtnSerie.Text
|
||||
registro.Item("Observaciones") = TxtObservacionesdetalle.Text
|
||||
DtMovimientos.Rows.Add(registro)
|
||||
CargaGvM()
|
||||
@@ -453,14 +453,14 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
#Region " GvM "
|
||||
Private Sub CargaGvM()
|
||||
|
||||
ThSerieLote.Visible = False
|
||||
TrSerieLote.Visible = False
|
||||
TxtnSerieLote.Visible = False
|
||||
ThSerie.Visible = False
|
||||
TrSerie.Visible = False
|
||||
TxtnSerie.Visible = False
|
||||
GvM.Columns(4).Visible = False
|
||||
For Each Dr As DataRow In DtMovimientos.Rows
|
||||
If Dr("SerieLote").ToString <> "" Then
|
||||
ThSerieLote.Visible = True
|
||||
TrSerieLote.Visible = True
|
||||
If Dr("Serie").ToString <> "" Then
|
||||
ThSerie.Visible = True
|
||||
TrSerie.Visible = True
|
||||
GvM.Columns(4).Visible = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -670,8 +670,8 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
Dim Existencia As Double
|
||||
TextoExistencia.Append("Los siguiente productos se ajustaron por falta de exitencia:<br/>")
|
||||
For Each dr As DataRow In DtMovimientos.Rows
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote:=If(dr("SerieLote").ToString = "", "-1", dr("SerieLote").ToString))
|
||||
Existencia -= DtMovimientos.SUM("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("SerieLote").ToString <> "-1", $" AND SerieLote = '{dr("SerieLote").ToString}'", "")}")
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=If(dr("Serie").ToString = "", "-1", dr("Serie").ToString))
|
||||
Existencia -= DtMovimientos.SUM("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("Serie").ToString <> "-1", $" AND Serie = '{dr("Serie").ToString}'", "")}")
|
||||
|
||||
If Existencia < 0 Then
|
||||
ErrorExistencia = True
|
||||
|
||||
@@ -119,14 +119,14 @@
|
||||
<div class="row">
|
||||
<label class="col-md-2">Almacén Origen:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlAlmacenOrigen" Width="150px" AppendDataBoundItems="true" OnSelectedIndexChanged="DdlAlmacenOrigen_SelectedIndexChanged" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm input-small select2me"></asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlAlmacenOrigen" Width="150px" AppendDataBoundItems="true" OnSelectedIndexChanged="DdlAlmacenOrigen_SelectedIndexChanged" AutoPostBack ="true" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm input-small select2me"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVAlmacenOrigen" runat="server" ControlToValidate="DdlAlmacenOrigen" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen Origen''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEAlmacenOrigen" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacenOrigen" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<label class="col-md-3">Almacén Destino:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlAlmacenDestino" OnSelectedIndexChanged="DdlAlmacenDestino_SelectedIndexChanged" AutoPostBack="true" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm input-small select2me" Width="150px" runat="server"></asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlAlmacenDestino" OnSelectedIndexChanged="DdlAlmacenDestino_SelectedIndexChanged" AutoPostBack="true" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm input-small select2me" Width="150px" runat="server" ></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVAlmacenDestino" runat="server" ControlToValidate="DdlAlmacenDestino" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen Destino''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOAlmacenDestino" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacenDestino" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
@@ -376,10 +376,11 @@
|
||||
Producto
|
||||
</th>
|
||||
<th width="100px">Observaciones</th>
|
||||
<th style="width: 88px" runat="server" id="ThSerieLote" visible="false">Serie - Lote </th>
|
||||
<th style="width: 88px" runat="server" id="ThLote" visible="false">Lote</th>
|
||||
<th style="width: 88px" runat="server" id="ThBatch" visible="false">Batch</th>
|
||||
<th style="width: 88px" runat="server" id="ThSeccionAlmacen" visible="false">Sección Almacen</th>
|
||||
<th style="width: 88px" runat="server" id="ThSerie" visible="false">Serie</th>
|
||||
<th style="width: 88px" runat="server" id="ThLote" visible="false">Lote</th>
|
||||
<th style="width: 88px" runat="server" id="ThFechaCaducidad" visible="false">Caducidad</th>
|
||||
|
||||
<th width="160px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -414,17 +415,25 @@
|
||||
<td>
|
||||
<asp:TextBox ID="TxtnObservaciones" CssClass="form-control input-sm" runat="server" Width="100px"></asp:TextBox>
|
||||
</td>
|
||||
<td runat="server" id="TdSerieLote" visible="false">
|
||||
<td runat="server" id="TdSeccionAlmacen" visible="false">
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
Destino:<asp:DropDownList ID="DdlSeccionAlmacenDestino" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" >
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td runat="server" id="TdSerie" visible="false">
|
||||
<asp:Panel runat="server" DefaultButton="BtnSerieAddNew">
|
||||
<asp:TextBox ID="TxtnSerieLote" Visible="false" runat="server" Width="80px"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtnSerie" Visible="false" runat="server" Width="80px"></asp:TextBox>
|
||||
<asp:Button Text="" ID="BtnSerieAddNew" OnClick="BtnSerieAddNew_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
<td runat="server" id="TdLote" visible="false">
|
||||
<asp:TextBox ID="TxtnLote" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
||||
</td>
|
||||
<td runat="server" id="TdBatch" visible="false">
|
||||
<asp:TextBox ID="TxtnBatch" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
||||
<td runat="server" id="TdFechaCaducidad" visible="false">
|
||||
<asp:TextBox ID="TxtnFechaCaducidad" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
||||
</td>
|
||||
<td align="center">
|
||||
<asp:LinkButton ID="LbAgregar" runat="server" CssClass="Texto" ValidationGroup="GrpAgregar" TabIndex="3" Text="Agregar" />
|
||||
@@ -434,7 +443,7 @@
|
||||
|
||||
|
||||
<div style="max-height: 300px; overflow-y: auto;">
|
||||
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,SerieLote,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="23px" />
|
||||
<asp:TemplateField ItemStyle-Width="93px">
|
||||
@@ -448,7 +457,7 @@
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="86px" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="500px" />
|
||||
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="90px" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="90px" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="90px" />
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-Width="90px" />
|
||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
@@ -631,7 +640,7 @@
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpDatosRecepcion" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosRecepcion" DataKeyNames="CveMovimiento,CveUM,CvePS,PS,CveAF,CodigoBarras,CveAlmacen,CveAlmacenDestino,AplicaSerieLote,CveMovimientoDetalle,PU,CveAlmacenSalida,CveMovimientoSalida,SerieLote,Lote,Batch,Cantidad, GastoIndirectoSalida, Importe,Codigo" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" ToolTip="Listado de Movimientos" CssClass="table table-hover Widthall" GridLines="None">
|
||||
<asp:GridView ID="GvDatosRecepcion" DataKeyNames="CveMovimiento,CveUM,CvePS,PS,CveAF,CodigoBarras,CveAlmacen,CveAlmacenDestino,AplicaSerie,CveMovimientoDetalle,PU,CveAlmacenSalida,CveMovimientoSalida,Serie,Lote,FechaCaducidad,Cantidad, GastoIndirectoSalida, Importe,Codigo" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" ToolTip="Listado de Movimientos" CssClass="table table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
|
||||
<%--<HeaderTemplate>
|
||||
@@ -651,7 +660,7 @@
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="40%" />
|
||||
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="15%" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="15%" />
|
||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
<ItemTemplate>
|
||||
sss
|
||||
|
||||
@@ -54,20 +54,20 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
ViewState("CveUsuarioResponsable") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CvePSSerieLote As Integer
|
||||
Private Property CvePSSerie As Integer
|
||||
Get
|
||||
Return CType(ViewState("CvePSSerieLote"), Integer)
|
||||
Return CType(ViewState("CvePSSerie"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePSSerieLote") = value
|
||||
ViewState("CvePSSerie") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveUMSerieLote As Integer
|
||||
Private Property CveUMSerie As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveUMSerieLote"), Integer)
|
||||
Return CType(ViewState("CveUMSerie"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveUMSerieLote") = value
|
||||
ViewState("CveUMSerie") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CargadoDeMov As Boolean
|
||||
@@ -246,7 +246,11 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
dt.Columns.Add("CveAF", Type.GetType("System.Int32"))
|
||||
dt.Columns.Add("PS")
|
||||
dt.Columns.Add("Observaciones")
|
||||
dt.Columns.Add("SerieLote")
|
||||
dt.Columns.Add("CveSeccionAlmacen", Type.GetType("System.Int32"))
|
||||
dt.Columns.Add("SeccionAlmacen")
|
||||
dt.Columns.Add("CveSeccionAlmacenDestino", Type.GetType("System.Int32"))
|
||||
dt.Columns.Add("SeccionAlmacenDestino")
|
||||
dt.Columns.Add("Serie")
|
||||
dt.Columns.Add("Lote")
|
||||
dt.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
|
||||
|
||||
@@ -313,7 +317,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
'End If
|
||||
|
||||
If Mov.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
DtMovimientos = Mov.DtResultados.DefaultView.ToTable("Cantidad, CveUM, CvePS, CveAF, PS, SerieLote, CveClasificacion, EstatusExistencia")
|
||||
DtMovimientos = Mov.DtResultados.DefaultView.ToTable("Cantidad, CveUM, CvePS, CveAF, PS, Serie, CveClasificacion, EstatusExistencia")
|
||||
CargaGvDatos()
|
||||
End If
|
||||
|
||||
@@ -454,19 +458,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub DdlAlmacenOrigen_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
If UsuarioActual.Empresa.Funcionalidad(141) = "1" Then
|
||||
CargaExistenciasSucursal()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub DdlAlmacenDestino_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToString.ToEntero = 21 Then
|
||||
ChkTransitorio.Checked = False
|
||||
ChkTransitorio.Enabled = False
|
||||
Else
|
||||
ChkTransitorio.Enabled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaExistenciasSucursal()
|
||||
DdlProducto2.Attributes.Remove("Data-cvesubproyecto")
|
||||
DdlProducto2.Attributes.Add("Data-cvesubproyecto", GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue}"))
|
||||
@@ -492,10 +484,10 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim FuncionalidadSinSerie = True
|
||||
|
||||
If CveProducto > 0 Then
|
||||
If TxtnSerieLote.Visible Then
|
||||
If TxtnSerie.Visible Then
|
||||
Cantidad = 1
|
||||
If TxtnSerieLote.Text = "" Then
|
||||
Alert("Serie-Lote es necesario", TipoMensaje.MsgAdvertencia)
|
||||
If TxtnSerie.Text = "" Then
|
||||
Alert("Serie es necesario", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -515,22 +507,22 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, -1, If(TxtnSerieLote.Visible, TxtnSerieLote.Text, "-1"), If(TxtnLote.Visible, TxtnLote.Text, "-1"), MinFecha)
|
||||
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, If(TxtnSerie.Visible, TxtnSerie.Text, "-1"), If(TxtnLote.Visible, TxtnLote.Text, "-1"), If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha))
|
||||
|
||||
If Valido Then
|
||||
AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, If(TxtnSerieLote.Visible, TxtnSerieLote.Text, ""), If(TxtnLote.Visible, TxtnLote.Text, ""), If(TxtnBatch.Visible, TxtnBatch.Text, ""), FuncionalidadSinSerie)
|
||||
AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, ""), Lote:=If(TxtnLote.Visible, TxtnLote.Text, ""), FechaCaducidad:=If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha), Limpia:=FuncionalidadSinSerie)
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, SerieLote As String, Lote As String, Fechacaducidad As Date) As Boolean
|
||||
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, Fechacaducidad As Date) As Boolean
|
||||
Dim Retorno = True
|
||||
|
||||
Dim Inv As New ClsInventarios
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote:=SerieLote, Lote:=Lote, FechaCaducidad:=Fechacaducidad, PendientePorSurtir:=1)
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=Serie, Lote:=Lote, FechaCaducidad:=Fechacaducidad, PendientePorSurtir:=1)
|
||||
Inv.Dispose()
|
||||
|
||||
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUnidadMedida} {If(SerieLote <> "-1", $" AND SerieLote = '{SerieLote}'", "")}") < 0 Then
|
||||
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUnidadMedida} {If(Serie <> "-1", $" AND Serie = '{Serie}'", "")}") < 0 Then
|
||||
If Existencia < 0 Then
|
||||
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
|
||||
@@ -543,7 +535,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional SerieLote As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True)
|
||||
Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional CveSeccionAlmacen As Integer = -1, Optional SeccionAlmacen As String = "", Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True)
|
||||
If Cantidad <= 0 Then
|
||||
Alert("La cantidad debe ser mayor a cero (0). Por favor verifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
@@ -564,7 +556,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
registro.Item("CvePS") = CvePS
|
||||
registro.Item("PS") = DrPS("PSCodigo")
|
||||
registro.Item("Observaciones") = Observaciones
|
||||
registro.Item("SerieLote") = SerieLote
|
||||
registro.Item("Serie") = Serie
|
||||
registro.Item("Lote") = Lote
|
||||
registro.Item("FechaCaducidad") = FechaCaducidad
|
||||
registro.Item("CveClasificacion") = CveClasificacion
|
||||
@@ -591,8 +583,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
LimpiaAgregar()
|
||||
Else
|
||||
txtCantidad.Text = (txtCantidad.Text.ToDouble - 1.0).ToString
|
||||
TxtnSerieLote.Text = ""
|
||||
TxtnSerieLote.Focus()
|
||||
TxtnSerie.Text = ""
|
||||
TxtnSerie.Focus()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -601,10 +593,10 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
DdlClasificacion_SelectedIndexChanged(DdlClasificacion, EventArgs.Empty)
|
||||
txtCantidad.Text = ""
|
||||
TxtnObservaciones.Text = ""
|
||||
TxtnSerieLote.Text = ""
|
||||
TxtnSerieLote.Visible = False
|
||||
TxtnSerie.Text = ""
|
||||
TxtnSerie.Visible = False
|
||||
TxtnLote.Text = ""
|
||||
TxtnBatch.Text = ""
|
||||
TxtnFechaCaducidad.Text = ""
|
||||
|
||||
txtCantidad.Focus()
|
||||
If TxtCodigoPS.Visible Then
|
||||
@@ -692,8 +684,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If Not CargadoDeMov Then
|
||||
|
||||
For Each dr As DataRow In DtMovimientos.Rows
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote:=If(dr("SerieLote").ToString = "", "-1", dr("SerieLote").ToString), PendientePorSurtir:=1)
|
||||
Existencia -= DtMovimientos.SUM("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("SerieLote").ToString <> "-1", $" AND SerieLote = '{dr("SerieLote").ToString}'", "")}")
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=If(dr("Serie").ToString = "", "-1", dr("Serie").ToString), PendientePorSurtir:=1)
|
||||
Existencia -= DtMovimientos.SUM("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("Serie").ToString <> "-1", $" AND Serie = '{dr("Serie").ToString}'", "")}")
|
||||
'DtMovimientos.SUM("Cantidad", String.Format("CvePS = {0}", dr("CvePS").ToString.ToEntero))
|
||||
|
||||
If Existencia < 0 Then
|
||||
@@ -709,7 +701,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Next
|
||||
Else
|
||||
For Each gvr As GridViewRow In GvDatos.Rows
|
||||
Existencia = ObjInventario.GetExistenciasPS(gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote:=If(gvr.DataKey("SerieLote").ToString = "", "-1", gvr.DataKey("SerieLote").ToString), PendientePorSurtir:=1)
|
||||
Existencia = ObjInventario.GetExistenciasPS(gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=If(gvr.DataKey("Serie").ToString = "", "-1", gvr.DataKey("Serie").ToString), PendientePorSurtir:=1)
|
||||
Existencia -= gvr.FCTextBox("TxtCantidad2").Text.ToEntero
|
||||
If Existencia < 0 Then
|
||||
ErrorExistencia = True
|
||||
@@ -772,7 +764,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Else
|
||||
Dim Cont As Integer = 0
|
||||
For Each Dr As DataRow In DtMovimientos.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
@@ -827,7 +819,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
Dim Cont As Integer = 0
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.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, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
@@ -1004,7 +996,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Else
|
||||
|
||||
For Each Dr As DataRow In DtMovimientos.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
@@ -1123,30 +1115,41 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
ElProductoChange()
|
||||
End Sub
|
||||
Private Sub ElProductoChange()
|
||||
TxtnSerieLote.Visible = False
|
||||
TxtnSerie.Visible = False
|
||||
TxtnLote.Visible = False
|
||||
TxtnBatch.Visible = False
|
||||
TxtnFechaCaducidad.Visible = False
|
||||
|
||||
EscondeColumnasGVM(DtMovimientos)
|
||||
|
||||
If DdlProducto2.SelectedValue.ToEntero > 0 Then
|
||||
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltraParametros("Inv_CveMetodoInventario = 5 ", "PS").Rows.Count > 0 Then
|
||||
ThSerieLote.Visible = True
|
||||
TdSerieLote.Visible = True
|
||||
TxtnSerieLote.Visible = True
|
||||
GvDatos.Columns(5).Visible = True
|
||||
Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltroPrimero("", "PS")
|
||||
If drP IsNot Nothing Then
|
||||
If CBool(drP("AplicaSeccion")) Then
|
||||
ThSeccionAlmacen.Visible = True
|
||||
TdSeccionAlmacen.Visible = True
|
||||
DdlSeccionAlmacen.Visible = True
|
||||
GvDatos.Columns(5).Visible = True
|
||||
End If
|
||||
If CBool(drP("AplicaSerie")) Then
|
||||
ThSerie.Visible = True
|
||||
TdSerie.Visible = True
|
||||
TxtnSerie.Visible = True
|
||||
GvDatos.Columns(6).Visible = True
|
||||
End If
|
||||
If CBool(drP("AplicaLote")) Then
|
||||
TxtnLote.Visible = True
|
||||
ThLote.Visible = True
|
||||
TdLote.Visible = True
|
||||
GvDatos.Columns(7).Visible = True
|
||||
End If
|
||||
If CBool(drP("AplicaCaducidad")) Then
|
||||
TxtnFechaCaducidad.Visible = True
|
||||
ThFechaCaducidad.Visible = True
|
||||
TdFechaCaducidad.Visible = True
|
||||
GvDatos.Columns(8).Visible = True
|
||||
End If
|
||||
End If
|
||||
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltraParametros("Inv_CveMetodoInventario = 6", "PS").Rows.Count > 0 Then
|
||||
TxtnLote.Visible = True
|
||||
ThLote.Visible = True
|
||||
TdLote.Visible = True
|
||||
GvDatos.Columns(6).Visible = True
|
||||
|
||||
TxtnBatch.Visible = True
|
||||
ThBatch.Visible = True
|
||||
TdBatch.Visible = True
|
||||
GvDatos.Columns(7).Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
DdlUnidad.Items.Clear()
|
||||
@@ -1190,9 +1193,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End Sub
|
||||
|
||||
Private Sub EscondeColumnasGVM(DtTemp As DataTable)
|
||||
TxtnSerieLote.Visible = False
|
||||
ThSerieLote.Visible = False
|
||||
TdSerieLote.Visible = False
|
||||
TxtnSerie.Visible = False
|
||||
ThSerie.Visible = False
|
||||
TdSerie.Visible = False
|
||||
GvDatos.Columns(5).Visible = False
|
||||
|
||||
TxtnLote.Visible = False
|
||||
@@ -1200,15 +1203,15 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
TdLote.Visible = False
|
||||
GvDatos.Columns(6).Visible = False
|
||||
|
||||
TxtnBatch.Visible = False
|
||||
ThBatch.Visible = False
|
||||
TdBatch.Visible = False
|
||||
TxtnFechaCaducidad.Visible = False
|
||||
ThFechaCaducidad.Visible = False
|
||||
TdFechaCaducidad.Visible = False
|
||||
GvDatos.Columns(7).Visible = False
|
||||
|
||||
If DtTemp.MAX("SerieLote").ToString <> "" Then
|
||||
TxtnSerieLote.Visible = True
|
||||
ThSerieLote.Visible = True
|
||||
TdSerieLote.Visible = True
|
||||
If DtTemp.MAX("Serie").ToString <> "" Then
|
||||
TxtnSerie.Visible = True
|
||||
ThSerie.Visible = True
|
||||
TdSerie.Visible = True
|
||||
GvDatos.Columns(5).Visible = True
|
||||
End If
|
||||
If DtTemp.MAX("Lote").ToString <> "" Then
|
||||
@@ -1217,9 +1220,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
TdLote.Visible = True
|
||||
GvDatos.Columns(6).Visible = True
|
||||
|
||||
TxtnBatch.Visible = True
|
||||
ThBatch.Visible = True
|
||||
TdBatch.Visible = True
|
||||
TxtnFechaCaducidad.Visible = True
|
||||
ThFechaCaducidad.Visible = True
|
||||
TdFechaCaducidad.Visible = True
|
||||
GvDatos.Columns(7).Visible = True
|
||||
End If
|
||||
End Sub
|
||||
@@ -1237,12 +1240,12 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
e.Row.FCTextBox("TxtCantidad2").Attributes.Add("onblur", String.Format("ValidaCantidad(this,{0})", e.Row.DBCampo("Cantidad")))
|
||||
End If
|
||||
|
||||
'If If(e.Row.DBCampo("SerieLote").ToString = "", "-1", e.Row.DBCampo("SerieLote").ToString) <> "-1" Then
|
||||
' TxtnSerieLote.Visible = True
|
||||
' ThSerieLote.Visible = True
|
||||
' TdSerieLote.Visible = True
|
||||
'If If(e.Row.DBCampo("Serie").ToString = "", "-1", e.Row.DBCampo("Serie").ToString) <> "-1" Then
|
||||
' TxtnSerie.Visible = True
|
||||
' ThSerie.Visible = True
|
||||
' TdSerie.Visible = True
|
||||
' GvDatos.Columns(4).Visible = True
|
||||
' e.Row.Cells(4).Text = e.Row.DBCampo("SerieLote").ToString
|
||||
' e.Row.Cells(4).Text = e.Row.DBCampo("Serie").ToString
|
||||
'Else
|
||||
' e.Row.Cells(4).Text = ""
|
||||
'End If
|
||||
@@ -1301,12 +1304,12 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
' Dim CveClasificacion = dr.FCDropDownList("DdlClasificacion").SelectedValue.ToEntero
|
||||
' Dim CvePS = dr.FCDropDownList("DdlProducto").SelectedValue.ToEntero
|
||||
' Dim No = dr.DataKey("No").ToEntero
|
||||
' Dim SerieLote As String = dr.FCTextBox("TxtSerieLote").Text
|
||||
' Dim Serie As String = dr.FCTextBox("TxtSerie").Text
|
||||
|
||||
' 'VALIDA EXISTENCIA
|
||||
' Dim Valido = True
|
||||
' Dim Inv As New ClsInventarios
|
||||
' Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, -1, TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), If(SerieLote = "", "-1", SerieLote))
|
||||
' Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, -1, TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), If(Serie = "", "-1", Serie))
|
||||
' Inv.Dispose()
|
||||
|
||||
' If Existencia - txtCantidad.Text.ToDouble < 0 Then
|
||||
@@ -1515,7 +1518,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, GvRow.DataKey("CveAF").ToEntero, -1, SerieLote:=GvRow.DataKey("SerieLote").ToString, Lote:=GvRow.DataKey("Lote"), FechaCaducidad:=GvRow.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, GvRow.DataKey("CveAF").ToEntero, -1, Serie:=GvRow.DataKey("Serie").ToString, Lote:=GvRow.DataKey("Lote"), FechaCaducidad:=GvRow.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
@@ -1692,7 +1695,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("PU").ToString.ToDecimal, gvr.DataKey("CveAF").ToString.ToEntero, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, SerieLote:=gvr.DataKey("SerieLote").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("PU").ToString.ToDecimal, gvr.DataKey("CveAF").ToString.ToEntero, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
@@ -1787,7 +1790,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
' CostoIndirecto = ((Dr("Total").ToString.ToDouble * GastoIndirectoTotal) / Importe) / Dr("Cantidad").ToString.ToDouble
|
||||
' End If
|
||||
|
||||
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CostoIndirecto:=CostoIndirecto) Then
|
||||
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CostoIndirecto:=CostoIndirecto) Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
' Exit For
|
||||
@@ -1910,8 +1913,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If DrPS("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then
|
||||
TdSeriePS.Visible = True
|
||||
TxtSeriePS.Focus()
|
||||
CvePSSerieLote = DrPS("CvePS").ToString.ToEntero
|
||||
CveUMSerieLote = DrPS("CveUnidadMedida").ToString.ToEntero
|
||||
CvePSSerie = DrPS("CvePS").ToString.ToEntero
|
||||
CveUMSerie = DrPS("CveUnidadMedida").ToString.ToEntero
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -1927,10 +1930,10 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
txtCantidad.Text = "1"
|
||||
|
||||
Dim Valido = ValidaExistencia(1, CvePSSerieLote, CveUMSerieLote, -1, TxtSeriePS.Text.Trim, "-1", MinFecha)
|
||||
Dim Valido = ValidaExistencia(1, CvePSSerie, CveUMSerie, -1, TxtSeriePS.Text.Trim, "-1", MinFecha)
|
||||
|
||||
If Valido Then
|
||||
AgregarPS(1, CvePSSerieLote, CveUMSerieLote, TxtSeriePS.Text.Trim)
|
||||
AgregarPS(1, CvePSSerie, CveUMSerie, TxtSeriePS.Text.Trim)
|
||||
Else
|
||||
TxtSeriePS.Text = ""
|
||||
TxtSeriePS.Focus()
|
||||
@@ -1960,7 +1963,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim TxtCantidad = GvDatosRecepcion.Rows(Gvr.RowIndex).FCTextBox("TxtCantidad")
|
||||
If Gvr.DataKey("Cantidad").ToDecimal - TxtCantidad.Text.ToDecimal - 1 >= 0 Then
|
||||
|
||||
If Gvr.DataKey("AplicaSerieLote") = "True" Then
|
||||
If Gvr.DataKey("AplicaSerie") = "True" Then
|
||||
TdSeriePSRecepcion.Visible = True
|
||||
TxtSeriePSRecepcion.Focus()
|
||||
Exit Sub
|
||||
@@ -1996,7 +1999,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
|
||||
For Each Gvr As GridViewRow In GvDatosRecepcion.Rows
|
||||
If Gvr.DataKey("CodigoBarras") = TxtCodigoPSRecepcion.Text.Trim And Gvr.DataKey("SerieLote") = TxtSeriePSRecepcion.Text.Trim Then
|
||||
If Gvr.DataKey("CodigoBarras") = TxtCodigoPSRecepcion.Text.Trim And Gvr.DataKey("Serie") = TxtSeriePSRecepcion.Text.Trim Then
|
||||
Dim TxtCantidad = GvDatosRecepcion.Rows(Gvr.RowIndex).FCTextBox("TxtCantidad")
|
||||
If Gvr.DataKey("Cantidad").ToDecimal - TxtCantidad.Text.ToDecimal - 1 >= 0 Then
|
||||
|
||||
@@ -2489,7 +2492,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
DtExcel.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
||||
DtExcel.Columns.Add(New DataColumn("Codigo", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Producto", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("SerieLote", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Serie", GetType(String)))
|
||||
DtExcel.Columns.Add(New DataColumn("Observaciones", GetType(String)))
|
||||
|
||||
DtExcel.TableName = "Traspaso"
|
||||
@@ -2544,8 +2547,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Alert("El nombre de la tercera columna debe ser 'Producto'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(3).ColumnName = "SerieLote" Then
|
||||
Alert("El nombre de la cuarta columna debe ser 'SerieLote'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
If Not dt.Columns(3).ColumnName = "Serie" Then
|
||||
Alert("El nombre de la cuarta columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(4).ColumnName = "Observaciones" Then
|
||||
@@ -2557,7 +2560,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim ProductosNoCargados As New StringBuilder()
|
||||
Dim RowsCargados As Integer = 0
|
||||
Dim RowsNoCargados As Integer = 0
|
||||
Dim NoPSConSerieLote As Integer = 0
|
||||
Dim NoPSConSerie As Integer = 0
|
||||
Try
|
||||
Dim DtPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa)
|
||||
For Each RowExcel As DataRow In dt.Rows
|
||||
@@ -2570,7 +2573,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString().ToEntero()
|
||||
|
||||
Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal()
|
||||
Dim SerieLote As String = RowExcel("SerieLote").ToString()
|
||||
Dim Serie As String = RowExcel("Serie").ToString()
|
||||
Dim Observaciones As String = RowExcel("Observaciones").ToString()
|
||||
Dim FechaCaducidad As Date = MinFecha
|
||||
Dim Lote As String = "-1"
|
||||
@@ -2581,14 +2584,14 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
Dim CveMetodoInventario As Integer = RowPS("Inv_CveMetodoInventario").ToString().ToEntero()
|
||||
|
||||
If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then
|
||||
If CveMetodoInventario = 5 And (String.IsNullOrEmpty(Serie.Trim()) OrElse Serie = "-1") Then
|
||||
Valido = False
|
||||
Alert($"El producto '{RowPS("PS")}' requiere 'SerieLote'", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"El producto '{RowPS("PS")}' requiere 'Serie'", TipoMensaje.MsgAdvertencia)
|
||||
ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
|
||||
End If
|
||||
|
||||
If CveMetodoInventario = 5 AndAlso Not String.IsNullOrEmpty(SerieLote.Trim()) Then
|
||||
NoPSConSerieLote = NoPSConSerieLote + 1
|
||||
If CveMetodoInventario = 5 AndAlso Not String.IsNullOrEmpty(Serie.Trim()) Then
|
||||
NoPSConSerie = NoPSConSerie + 1
|
||||
End If
|
||||
|
||||
If Valido AndAlso (Cantidad > 0 AndAlso RowPS("VentaMinima").ToString.ToDecimal > 0) Then
|
||||
@@ -2599,11 +2602,11 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
|
||||
If Valido Then
|
||||
Valido = ValidaExistencia(Cantidad, CveProducto, CveUnidadMedida, -1, If(Not String.IsNullOrEmpty(SerieLote), SerieLote, "-1"), Lote, FechaCaducidad)
|
||||
Valido = ValidaExistencia(Cantidad, CveProducto, CveUnidadMedida, -1, If(Not String.IsNullOrEmpty(Serie), Serie, "-1"), Lote, FechaCaducidad)
|
||||
End If
|
||||
|
||||
If Valido Then
|
||||
AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, If(Not String.IsNullOrEmpty(SerieLote), SerieLote, ""), "", "", False)
|
||||
AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(Not String.IsNullOrEmpty(Serie), Serie, ""), Limpia:=False)
|
||||
RowsCargados = RowsCargados + 1
|
||||
Else
|
||||
RowsNoCargados = RowsNoCargados + 1
|
||||
@@ -2620,10 +2623,10 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
OnError("Ocurrió un error al cargar los productos." & ProductosNoCargados.ToString(), ex)
|
||||
Finally
|
||||
|
||||
If NoPSConSerieLote > 0 Then
|
||||
ThSerieLote.Visible = True
|
||||
TdSerieLote.Visible = True
|
||||
TxtnSerieLote.Visible = True
|
||||
If NoPSConSerie > 0 Then
|
||||
ThSerie.Visible = True
|
||||
TdSerie.Visible = True
|
||||
TxtnSerie.Visible = True
|
||||
GvDatos.Columns(5).Visible = True
|
||||
End If
|
||||
|
||||
@@ -2726,4 +2729,32 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
TxtEspecifUnidad.Text = DtCamiones.FiltroPrimeroValor("Especificacion", String.Format("CveCamion = {0}", DdlUnidadCamion.SelectedValue))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlAlmacenOrigen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacenOrigen.SelectedIndexChanged
|
||||
If UsuarioActual.Empresa.Funcionalidad(141) = "1" Then
|
||||
CargaExistenciasSucursal()
|
||||
End If
|
||||
If DdlAlmacenOrigen.SelectedValue.ToEntero > 0 Then
|
||||
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero)
|
||||
DdlSeccionAlmacen.DataBind()
|
||||
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
UpDatos.Update()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlAlmacenDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacenDestino.SelectedIndexChanged
|
||||
|
||||
If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToString.ToEntero = 21 Then
|
||||
ChkTransitorio.Checked = False
|
||||
ChkTransitorio.Enabled = False
|
||||
Else
|
||||
ChkTransitorio.Enabled = True
|
||||
End If
|
||||
If DdlAlmacenDestino.SelectedValue.ToEntero > 0 Then
|
||||
DdlSeccionAlmacenDestino.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestino.SelectedValue.ToEntero)
|
||||
DdlSeccionAlmacenDestino.DataBind()
|
||||
DdlSeccionAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
UpDatos.Update()
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user