diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index b792e8c86..4f1733273 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -4780,13 +4780,14 @@ Public Class ClsInventarios
#Region "MOVIMIENTOS DETALLE SECCION ALMACEN"
- Public Function GetMovimientosDetalleSeccionesAlmacen(CveAlmacen As Integer, CveClasificacion As Integer, CveEmpresa As Integer) As Boolean
+ Public Function GetMovimientosDetalleSeccionesAlmacen(CveAlmacen As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Folio As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleAjusteSeccionesGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Folio", SqlDbType.NVarChar).Value = Folio
End With
Try
SqlAdapter.Fill(Data)
diff --git a/Inventarios/AjustesSeccionAlmacen.aspx b/Inventarios/AjustesSeccionAlmacen.aspx
index 4fc1c050d..7ec3297eb 100644
--- a/Inventarios/AjustesSeccionAlmacen.aspx
+++ b/Inventarios/AjustesSeccionAlmacen.aspx
@@ -46,6 +46,10 @@
+
+
+
+
@@ -62,10 +66,17 @@
-
-
+ <%----%>
+
-
+ <%----%>
+
+
+
+
+
+
+
diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb
index 726db4464..f4d99325d 100644
--- a/Inventarios/AjustesSeccionAlmacen.aspx.vb
+++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb
@@ -33,7 +33,8 @@ Partial Class Inventarios_AjustesSeccionAlmacen
Private Sub CargaDatos()
Dim ObjInv As New ClsInventarios
- If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacen.SelectedValue.ToEntero, DdlClasificaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
+ Dim FolioAux As String = If(TxtFolioFiltro.Text.Length > 0, TxtFolioFiltro.Text, "-1")
+ If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacen.SelectedValue.ToEntero, DdlClasificaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FolioAux) Then
GvD.DataSource = ObjInv.DtResultados
End If
@@ -48,6 +49,14 @@ Partial Class Inventarios_AjustesSeccionAlmacen
e.Row.FCDropDownList("DDlS").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero)
e.Row.FCDropDownList("DDlS").DataBind()
+ Dim ExistenciasAux As Decimal = e.Row.DataKey("Existencia").ToDecimal
+ e.Row.FCRangeValidator("RVR").Enabled = ExistenciasAux > 0
+ If ExistenciasAux > 0 Then
+ e.Row.FCRangeValidator("RVR").MaximumValue = ExistenciasAux
+ Else
+ e.Row.FCCheckBox("Chk").Visible = False
+ e.Row.FCRangeValidator("RVR").MaximumValue = 0
+ End If
End If
End Sub
@@ -77,11 +86,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen
Dim CveMovimientoDetalleEntrada As Integer = 0
Dim Cont As Integer = 0
Dim Lista As New Hashtable
+ Dim Cantidad As Decimal = 0
For Each gvr As GridViewRow In GvD.Rows
'que este seleccionado y que tenga diferente seccion
If gvr.FCCheckBox("Chk").Checked AndAlso gvr.FCDropDownList("DDlS").SelectedValue.ToEntero <> gvr.DataKey("CveSeccionAlmacen").ToEntero Then
-
+ Cantidad = gvr.FCTextBox("TxtCantidad").Text.ToDecimal()
If gvr.DataKey("CveSeccionAlmacen").ToEntero > 0 Then
ObjPS.UpdateAplicaSeccionAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True)
Else
@@ -89,7 +99,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
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
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, 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
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
@@ -109,7 +119,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
For Each Row As DataRow In resultado.Rows
Dim CvePS = Row("CvePS").ToString().ToEntero()
- Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
+ '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 = Lista(Row("CvePS").ToString().ToEntero()) 'GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero()
@@ -288,7 +298,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
Try
Dim DtExistenciasSecciones As DataTable = Nothing
- If ObjInventario.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacenExcel.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
+ If ObjInventario.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacenExcel.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, "-1") Then
DtExistenciasSecciones = ObjInventario.DtResultados.Copy()
End If
@@ -447,4 +457,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen
End If
End Sub
+ Protected Sub Chk_Click(sender As Object, e As EventArgs)
+ Dim row As GridViewRow = (CType((CType(sender, CheckBox)).NamingContainer, GridViewRow))
+ Dim ExistenciaBackup As Integer = row.DataKey("Existencia").ToEntero()
+ row.FCTextBox("TxtCantidad").Enabled = Not row.FCTextBox("TxtCantidad").Enabled
+ If Not row.FCTextBox("TxtCantidad").Enabled Then
+ row.FCTextBox("TxtCantidad").Text = ExistenciaBackup
+ End If
+ End Sub
End Class
\ No newline at end of file