Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -56,7 +56,8 @@
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvD" DataKeyNames="CvePS,CveUM,CveAlmacen,PU,Existencia,Serie,SeccionAlmacen,CveSeccionAlmacen,FechaCaducidad,Lote,Codigo,PS" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" CssClass="table table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" />
|
||||
<asp:BoundField HeaderText="Codigo" DataField="Codigo" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-Width="5%" />
|
||||
|
||||
@@ -76,6 +76,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
|
||||
Dim CveMovimientoDetalleEntrada As Integer = 0
|
||||
Dim Cont As Integer = 0
|
||||
Dim Lista As New Hashtable
|
||||
For Each gvr As GridViewRow In GvD.Rows
|
||||
|
||||
'que este seleccionado y que tenga diferente seccion
|
||||
@@ -83,7 +84,10 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
|
||||
If gvr.DataKey("CveSeccionAlmacen").ToEntero > 0 Then
|
||||
ObjPS.UpdateAplicaSeccionAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True)
|
||||
Else
|
||||
ObjPS.UpdateAplicaSeccionAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, False)
|
||||
End If
|
||||
If Not Lista.ContainsKey(gvr.DataKey("CvePS").ToEntero) Then Lista.Add(gvr.DataKey("CvePS").ToEntero, gvr.FCDropDownList("DDlS").SelectedValue.ToEntero) 'guardo que dato le corresponde
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.DataKey("Existencia").ToDecimal, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, 0, -1, CveSeccionAlmacen:=gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=gvr.DataKey("Serie"), Lote:=gvr.DataKey("Lote"), FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate) Then
|
||||
ErrorMovInv = True
|
||||
@@ -108,7 +112,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = Row("CveUM").ToString().ToEntero()
|
||||
Dim CveSeccionAlmacen As Integer = GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero()
|
||||
Dim CveSeccionAlmacen As Integer = Lista(Row("CvePS").ToString().ToEntero()) 'GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero()
|
||||
Dim CostoIndirecto As Decimal = Row("CostoIndirecto").ToString().ToDecimal()
|
||||
Dim Serie As String = Row("Serie").ToString()
|
||||
Dim Lote As String = Row("Lote").ToString()
|
||||
@@ -117,6 +121,9 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
'actualizamos el PS, para que tenga el aplica seccion
|
||||
|
||||
ObjPS.UpdateAplicaSeccionAlmacen(Row("CvePS").ToString().ToEntero(), UsuarioActual.CveEmpresa, True)
|
||||
If Not ObjInventario.AddProductosServiciosAlmacenSeccion(CvePS, CveAlmacen, CveSeccionAlmacen) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
@@ -132,11 +139,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Lista = Nothing
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
ObjInventario.Commit()
|
||||
GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, -1, -1) = Nothing
|
||||
CargaDatos()
|
||||
Alert("El Movimiento quede registrado correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
@@ -318,11 +326,11 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
CveSeccionAlmacen = DrSeccion("CveSeccion").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
Dim Serie As String = RowExcel("Serie").ToString()
|
||||
Dim Serie As String = RowExcel("Serie").ToString().Trim
|
||||
Dim Lote As String = RowExcel("Lote").ToString()
|
||||
Dim FechaCaducidad As Date = IfNull(RowExcel("FechaCaducidad"), MinFecha).ToString.ToDate
|
||||
|
||||
Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS}")
|
||||
Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS} and ISNULL(Serie,'') = '{Serie}'")
|
||||
|
||||
If RowExistencia IsNot Nothing AndAlso CveSeccionAlmacen > 0 Then
|
||||
Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero()
|
||||
@@ -332,6 +340,13 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
Dim FechaCaducidadSalida As Date = IfNull(RowExistencia("FechaCaducidad"), MinFecha).ToString.ToDate
|
||||
Dim PUSalida As Decimal = RowExistencia("PU").ToString()
|
||||
|
||||
'condicion para ajustar la seccion y permita hacer los cambios en el trigger
|
||||
If CveSeccionAlmacenSalida > 0 Then
|
||||
ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, True)
|
||||
Else
|
||||
ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, False)
|
||||
End If
|
||||
|
||||
'GENERA LA SALIDA DE LOS PRODUCTOS QUE VIENEN EN EL EXCEL
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadSalida, CveUM, CvePS, PUSalida, CveSeccionAlmacen:=CveSeccionAlmacenSalida, Serie:=SerieSalida, Lote:=LoteSalida, FechaCaducidad:=FechaCaducidadSalida, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
@@ -355,6 +370,9 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
|
||||
'ACTUALIZAMOS EL PS, PARA QUE TENGA EL APLICA SECCION
|
||||
ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, True)
|
||||
If Not ObjInventario.AddProductosServiciosAlmacenSeccion(CvePS, CveAlmacen, CveSeccionAlmacen) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, CantidadEntrada, CveUMEntrada, CvePSEntrada, PUEntrada, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
@@ -370,7 +388,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
End If
|
||||
|
||||
If RowExistencia Is Nothing Then
|
||||
ExistenciasNoEncontradas.AppendFormat("{0},", SeccionAlmacen)
|
||||
ExistenciasNoEncontradas.AppendFormat("{0} - S:{1}<br/>", Codigo, Serie)
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
</td>
|
||||
<td runat="server" id="TdSeccionAlmacen" visible="false">
|
||||
|
||||
<asp:DropDownlist ID="DdlSeccionAlmacen" runat="server" DataTextField="Seccion" DataValueField="CveSeccionAlmacen" CssClass="form-control input-sm select2me" />
|
||||
<asp:DropDownlist ID="DdlSeccionAlmacen" runat="server" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" CssClass="form-control input-sm select2me" />
|
||||
|
||||
</td>
|
||||
<td align="center">
|
||||
@@ -403,7 +403,7 @@
|
||||
<div style="max-height: 300px; overflow-y: auto;">
|
||||
<asp:GridView ID="GvDatosDesapartado" DataKeyNames="CvePS,CveUM,CveMovimientoDetalle,CveSeccionAlmacen,Serie,Lote,FechaCaducidad,PU,Cantidad,AplicaSeccion" 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="#" DataField="No" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" ItemStyle-Font-Size="6pt" />
|
||||
<asp:BoundField HeaderText="Disponible" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
@@ -418,7 +418,7 @@
|
||||
<asp:BoundField HeaderText="F.Caducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="10%" />
|
||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" AppendDataBoundItems="true" DataValueField="CveSeccion" Class="form-control input-sm select2me" Style="width: 95% !important" runat="server" CausesValidation="true">
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" Class="form-control input-sm select2me" Style="width: 95% !important" runat="server" CausesValidation="true">
|
||||
|
||||
</asp:DropDownList>
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -805,10 +805,14 @@ Partial Class Inventarios_Apartados
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onblur", String.Format("ValidaCantidad(this,{0})", e.Row.DBCampo("Cantidad")))
|
||||
If CBool(e.Row.DBCampo("AplicaSeccion")) AndAlso DdlAlmacenDestinoDesapartado.SelectedValue.ToEntero > 0 Then
|
||||
Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestinoDesapartado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero)
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestinoDesapartado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero)
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
If dtt.Rows.Count = 0 Then
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
dtt.Dispose()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
@@ -1049,7 +1049,9 @@
|
||||
<div style="text-align: center">
|
||||
<label for="<%= DdlAlmacenInventarioFisico.ClientID.ToString()%>">Almacen:</label>
|
||||
<asp:DropDownList ID="DdlAlmacenInventarioFisico" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" Width="60%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true"></asp:DropDownList>
|
||||
<%--<asp:RequiredFieldValidator ID="RFVAlmacenInvFisico" runat="server" InitialValue="-1" ControlToValidate="DdlAlmacenInventarioFisico" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>--%>
|
||||
<asp:RequiredFieldValidator ID="RFVAlmacenInvFisico" runat="server" InitialValue="-1" ControlToValidate="DdlAlmacenInventarioFisico" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen''</b> es necesario, por favor ingréselo." ValidationGroup="InvFisico"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="CERFVAlmacenInvFisico" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacenInvFisico" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1062,6 +1064,19 @@
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaInvFisico" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVTxtFechaInvFisico" runat="server" ControlToValidate="TxtFechaInvFisico" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="InvFisico"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="CERFVTxtFechaInvFisico" runat="server" HighlightCssClass="vco" TargetControlID="RFVTxtFechaInvFisico" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
|
||||
|
||||
<ajax:MaskedEditExtender ID="MEFechaInv" runat="server" TargetControlID="TxtFechaInvFisico" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalEFehcInv" TargetControlID="TxtFechaInvFisico" PopupButtonID="ImgFechaInvFisico" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CvFechaInv" runat="server" ControlToValidate="TxtFechaInvFisico" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="InvFisico"></asp:CompareValidator>
|
||||
@@ -1424,7 +1439,7 @@
|
||||
<br />
|
||||
</div>
|
||||
<div runat="server" id="divSerie" class="form-group form-md-line-input input-iconright" visible="false">
|
||||
<asp:TextBox ID="TxtnSerie" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtnSerie" CssClass="form-control input-sm" runat="server" Width="120px" Visible="false"></asp:TextBox>
|
||||
<asp:Button Text="" ID="BtnSerieAddNew" OnClick="BtnSerieAddNew_Click" Style="display: none" runat="server" />
|
||||
<label for="<%= TxtnSerie.ClientID.ToString()%>">Serie</label>
|
||||
<br />
|
||||
|
||||
@@ -2217,6 +2217,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
'PERMISO SOLO PARA EDITAR SERIELOTE
|
||||
If UsuarioActual.TienePermisoProceso(245) Then
|
||||
GvM.Columns(9).Visible = True
|
||||
TxtnSerie.Visible = True
|
||||
End If
|
||||
|
||||
TxtnLote.Visible = False
|
||||
@@ -2294,7 +2295,6 @@ Partial Class Inventarios_EntradasSalidas
|
||||
e.Row.FCTextBox("LblEditCodigo").Enabled = False
|
||||
e.Row.FCTextBox("TxtSerie").Enabled = False
|
||||
e.Row.FCTextBox("TxtLote").Enabled = False
|
||||
e.Row.FCTextBox("TxtBatch").Enabled = False
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Enabled = False
|
||||
End If
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Data.Entity.Core.Common.CommandTrees
|
||||
Imports System.IO
|
||||
Imports Extensiones
|
||||
|
||||
@@ -655,7 +656,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Select Case ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString
|
||||
Case "Ing", "Ped"
|
||||
Filtro = "CveConcepto IN (3,40)"
|
||||
Case "Dev"
|
||||
Case "Dev", "dPe"
|
||||
'cuand es devolucionventa=1, es cancelación de la devolución
|
||||
If EsDevolucionVenta = 1 Then Filtro = "CveConcepto = 18" Else Filtro = "CveConcepto IN (3,40)"
|
||||
Case Else
|
||||
@@ -2180,7 +2181,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("FechaCaducidad").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("CveSeccionAlmacen").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
|
||||
@@ -2339,7 +2340,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("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1), EsInterno:=EsInterno) 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("CveSeccionAlmacen").ToString.ToEntero, -1), EsInterno:=EsInterno) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
|
||||
@@ -240,23 +240,23 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;" runat="server" id="divSeccionAlmacen" visible="false">
|
||||
<label class="col-md-4">Sección Almacén</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" runat="server" CssClass="form-control input-sm select2me" Width="100%" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" ></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;" runat="server" id="divLote" visible="false">
|
||||
<label class="col-md-4">Lote</label>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox runat="server" ID="TxtLote"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RFVLote" ControlToValidate="TxtLote" Enabled="false" ValidationGroup="GrpIngresar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lote''</b> es necesario, por favor ingrése una." Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCELote" runat="server" HighlightCssClass="vco" TargetControlID="RFVLote" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;" runat="server" id="divFechaCaducidad" visible="false">
|
||||
<label class="col-md-4">Fecha Caducidad</label>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox runat="server" ID="TxtFechaCaducidad"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RFVCaducidad" ControlToValidate="TxtFechaCaducidad" Enabled="false" ValidationGroup="GrpIngresar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingrése una." Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;">
|
||||
@@ -325,7 +325,7 @@
|
||||
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Serie" DataField="SerieLote" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
@@ -349,7 +349,7 @@
|
||||
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Serie/Lote" DataField="SerieLote" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" Visible="false" DataFormatString="{0:d}"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
|
||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -88,10 +88,8 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
#Region " CARGA DATOS "
|
||||
Private Sub CargaDatos(CveInventarioFisico As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1)
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
|
||||
DdlSeccionAlmacen.DataBind()
|
||||
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
|
||||
If ObjInventario.GetInventarioFisico(CveInventarioFisico, CveEmpresa, -1, -1) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
Dim CveEstatus = ObjInventario.DtResultados.FiltroPrimeroValor("CveEstatus")
|
||||
Select Case CveEstatus
|
||||
@@ -230,9 +228,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Dim Inventario As New ClsInventarios
|
||||
If Inventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then
|
||||
If Inventario.DtResultados.Rows.Count > 0 Then
|
||||
GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen") > 0
|
||||
GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen", "CveSeccionAlmacen IS NOT NULL").ToEntero > 0
|
||||
GvIFD.Columns(6).Visible = Inventario.DtResultados.MAX("Lote") <> ""
|
||||
GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad", "FechaCaducidad IS NOT NULL").ToDate > MinFecha
|
||||
GvIFD.DataSource = Inventario.DtResultados '.AsEnumerable.OrderByDescending(Function(k) k!CveInventarioFisicoDetalle).Take(500).CopyToDataTable
|
||||
Else
|
||||
GvIFD.DataSource = Nothing
|
||||
@@ -259,48 +257,83 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Dim CveUnidadMedida As Integer
|
||||
Dim Codigo As String = If(TxtCodigo.Text.Trim <> "", TxtCodigo.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes
|
||||
Dim CodigoBarras As String = If(TxtCodigoBarras.Text.Trim <> "", TxtCodigoBarras.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes
|
||||
Dim SeccionAlmacen As String = If(DdlSeccionAlmacen.SelectedValue.ToEntero > -1, DdlSeccionAlmacen.SelectedItem.Text, "")
|
||||
Dim CveSeccionAlmacen As Integer = If(DdlSeccionAlmacen.SelectedValue.ToEntero > 0, DdlSeccionAlmacen.SelectedValue.ToEntero, -1)
|
||||
Dim SerieLote As String = TxtCodigoSerie.Text.Trim
|
||||
Dim Serie As String = TxtCodigoSerie.Text.Trim
|
||||
Dim Lote As String = If(TxtLote.Text.Length > 0, TxtLote.Text, "-1")
|
||||
Dim FechaCaducidad As String = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString)
|
||||
Dim CveMetodoInv As Integer = -1
|
||||
Dim FechaCaducidad As String=MinFecha.ToString
|
||||
Dim CveSeccionAlmacen As Integer = -1
|
||||
|
||||
Dim Cantidad = TxtCantidadProducto.Text.ToDouble
|
||||
|
||||
Dim dr As DataRow
|
||||
dr = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}' ")
|
||||
|
||||
If dr IsNot Nothing Then
|
||||
CveMetodoInv = dr("Inv_CveMetodoInventario").ToString.ToEntero
|
||||
'dr = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}' ")
|
||||
dr = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}'")
|
||||
|
||||
|
||||
|
||||
If dr IsNot Nothing Then
|
||||
|
||||
CveProducto = dr("CvePS").ToString.ToEntero
|
||||
CveUnidadMedida = dr("CveUnidadMedida").ToString.ToEntero
|
||||
CveUnidadMedida = dr("CveUnidadMedida").ToString.ToEntero
|
||||
'Dim AplicaSeccion As Boolean = dr("AplicaSeccion") = "1"
|
||||
Dim AplicaCaducidad As Boolean = dr("AplicaCaducidad") = "1"
|
||||
Dim AplicaLote As Boolean = dr("AplicaLote") = "1"
|
||||
Dim AplicaSerie As Boolean = dr("AplicaSerie") = "1"
|
||||
|
||||
'divSeccionAlmacen.Visible = AplicaSeccion
|
||||
divLote.Visible = AplicaLote
|
||||
divFechaCaducidad.Visible = AplicaCaducidad
|
||||
divSerie.Visible = AplicaSerie
|
||||
UPAgregarPro.Update()
|
||||
|
||||
If CveMetodoInv = 5 And SerieLote = "" Then
|
||||
If AplicaSerie And Serie = "" Then
|
||||
RFVSerie.Enabled = True
|
||||
RFVSerie.Visible = True
|
||||
RFVSerie.SetFocusOnError = True
|
||||
RFVSerie.Validate()
|
||||
RFVSerie.ValidationGroup = " "
|
||||
Exit Sub
|
||||
End If
|
||||
If AplicaLote And Lote = "" Then
|
||||
RFVLote.Enabled = True
|
||||
RFVLote.Visible = True
|
||||
RFVLote.SetFocusOnError = True
|
||||
RFVLote.Validate()
|
||||
RFVLote.ValidationGroup = " "
|
||||
Exit Sub
|
||||
End If
|
||||
If AplicaCaducidad Then
|
||||
If TxtFechaCaducidad.Text.Trim = "" Then
|
||||
RFVCaducidad.Enabled = True
|
||||
RFVCaducidad.Visible = True
|
||||
RFVCaducidad.SetFocusOnError = True
|
||||
RFVCaducidad.Validate()
|
||||
RFVCaducidad.ValidationGroup = " "
|
||||
Exit Sub
|
||||
End If
|
||||
FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString)
|
||||
End If
|
||||
|
||||
RFVSerie.ValidationGroup = "GrpIngresar"
|
||||
RFVSerie.Enabled = False
|
||||
|
||||
'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)
|
||||
RFVLote.ValidationGroup = "GrpIngresar"
|
||||
RFVLote.Enabled = False
|
||||
RFVCaducidad.ValidationGroup = "GrpIngresar"
|
||||
RFVCaducidad.Enabled = False
|
||||
|
||||
'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
|
||||
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
|
||||
|
||||
Dim Consulto As Boolean = False
|
||||
Using Inventarios As New ClsInventarios
|
||||
|
||||
If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(CveMetodoInv = 5, 1, Cantidad), SerieLote, UsuarioActual.CveUsuario,
|
||||
CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
|
||||
If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(AplicaSerie, 1, Cantidad), Serie, UsuarioActual.CveUsuario,
|
||||
CveSeccionAlmacen:=-1, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
|
||||
|
||||
GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0
|
||||
GvIFDUltimoRegistrado.Columns(5).Visible = SerieLote <> "-1"
|
||||
GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> "-1"
|
||||
GvIFDUltimoRegistrado.Columns(6).Visible = Lote <> "-1"
|
||||
GvIFDUltimoRegistrado.Columns(7).Visible = FechaCaducidad <> "01/01/1900"
|
||||
|
||||
@@ -310,7 +343,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PS").ToString
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = SeccionAlmacen
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = ""
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCodigoSerie.Text.Trim
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(6).Text = Lote
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(7).Text = FechaCaducidad
|
||||
@@ -332,9 +365,11 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
TxtCodigoSerie.Text = ""
|
||||
TxtCodigo.Text = ""
|
||||
TxtCantidadProducto.Text = "1"
|
||||
DdlSeccionAlmacen.SelectedValue = "-1"
|
||||
TxtLote.Text = ""
|
||||
TxtFechaCaducidad.Text = ""
|
||||
divLote.Visible = False
|
||||
divFechaCaducidad.Visible = False
|
||||
divSerie.Visible = False
|
||||
RegistraScript("playsonidito('beep-07.wav')")
|
||||
Else
|
||||
TxtCodigoSerie.Text = ""
|
||||
@@ -346,8 +381,10 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Else
|
||||
TxtCodigoBarras.Text = ""
|
||||
TxtCodigoSerie.Text = ""
|
||||
TxtCodigo.Text = ""
|
||||
DdlSeccionAlmacen.SelectedValue = "-1"
|
||||
TxtCodigo.Text = ""
|
||||
divLote.Visible = False
|
||||
divFechaCaducidad.Visible = False
|
||||
divSerie.Visible = False
|
||||
TxtLote.Text = ""
|
||||
TxtFechaCaducidad.Text = ""
|
||||
Alert("No se encontró el producto, favor de escribirlo correctamente.", TipoMensaje.MsgError)
|
||||
@@ -530,7 +567,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Dim AplicaLote As Boolean = Producto("AplicaLote") = "1"
|
||||
Dim AplicaSerie As Boolean = Producto("AplicaSerie") = "1"
|
||||
|
||||
divSeccionAlmacen.Visible = AplicaSeccion
|
||||
'divSeccionAlmacen.Visible = AplicaSeccion
|
||||
divLote.Visible = AplicaLote
|
||||
divFechaCaducidad.Visible = AplicaCaducidad
|
||||
divSerie.Visible = AplicaSerie
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Existencia" DataField="CantidadAlmacen" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Inv. Físico" DataField="CantidadInventarioFisico" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Diferencia" DataField="Diferencia" DataFormatString="{0:#,###.##}" ItemStyle-Font-Bold="true" />
|
||||
@@ -234,7 +234,7 @@
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Existencia" DataField="CantidadAlmacen" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Inv. Físico" DataField="CantidadInventarioFisico" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Diferencia" DataField="Diferencia" DataFormatString="{0:#,###.##}" ItemStyle-Font-Bold="true" />
|
||||
|
||||
@@ -275,7 +275,7 @@ Partial Class Inventarios_RepAnomalias
|
||||
Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable)
|
||||
Gv.Columns(4).Visible = resultado.MAX("Serie") <> ""
|
||||
Gv.Columns(5).Visible = resultado.MAX("Lote") <> ""
|
||||
Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad") <> ""
|
||||
Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user