This commit is contained in:
Hector Javier Rodriguez Flores
2021-09-26 20:44:23 -07:00
parent 72b4c47cbe
commit 0eb9ed6245
4 changed files with 69 additions and 7 deletions

View File

@@ -131,6 +131,8 @@ Public Class ClsInventarios
Public Property ResponsableCarga As String Public Property ResponsableCarga As String
Public Property ResponsableRecibio As String Public Property ResponsableRecibio As String
Public Property Modulo As String Public Property Modulo As String
Public Property ConAplicacion As Boolean
@@ -2306,6 +2308,8 @@ Public Class ClsInventarios
FechaI = dr("FechaInicio").ToString FechaI = dr("FechaInicio").ToString
FechaF = dr("FechaFin").ToString FechaF = dr("FechaFin").ToString
Estatus = dr("Estatus").ToString Estatus = dr("Estatus").ToString
ConAplicacion = Convert.ToBoolean(dr("ConAplicacion").ToString)
Retorno = True Retorno = True
End If End If

View File

@@ -507,6 +507,7 @@ Partial Class Inventarios_InventarioFisico
FechaFin = GvRow.DataKey("FechaFin").ToEntero FechaFin = GvRow.DataKey("FechaFin").ToEntero
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto").ToEntero) DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto").ToEntero)
chkUsarApp.Checked = Convert.ToBoolean(GvRow.DataKey("ConAplicacion").ToString) chkUsarApp.Checked = Convert.ToBoolean(GvRow.DataKey("ConAplicacion").ToString)
divUsuarios.Visible = chkUsarApp.Checked
CargaGvAlmacen() CargaGvAlmacen()
CargaGvClasificacion() CargaGvClasificacion()
CargaGvProductosServicios() CargaGvProductosServicios()

View File

@@ -161,7 +161,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
End If End If
str.Clear() str.Clear()
CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length - 1) CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length)
End If End If
If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then

View File

@@ -41,6 +41,24 @@ Partial Class Inventarios_RepAnomalias
End Set End Set
End Property End Property
Public Property aplicacion As Boolean
Get
Return CType(ViewState("aplicacion"), Boolean)
End Get
Set(value As Boolean)
ViewState("aplicacion") = value
End Set
End Property
Public Property CreandoNuevoInventario As Boolean
Get
Return CType(ViewState("CreandoNuevoInventario"), Boolean)
End Get
Set(value As Boolean)
ViewState("CreandoNuevoInventario") = value
End Set
End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -51,6 +69,7 @@ Partial Class Inventarios_RepAnomalias
If CveInventarioFisico > 0 Then If CveInventarioFisico > 0 Then
CargaDatos(CveInventarioFisico) CargaDatos(CveInventarioFisico)
CreandoNuevoInventario = False
End If End If
End If End If
@@ -72,7 +91,7 @@ Partial Class Inventarios_RepAnomalias
lbFechaI.Text = Inventario.FechaI lbFechaI.Text = Inventario.FechaI
lbFechaF.Text = Inventario.FechaF lbFechaF.Text = Inventario.FechaF
CveSubProyecto = Inventario.CveSubProyectoInventario CveSubProyecto = Inventario.CveSubProyectoInventario
aplicacion = Inventario.ConAplicacion
If Inventario.Estatus = "Finalizado" Then If Inventario.Estatus = "Finalizado" Then
btnFin.Visible = False btnFin.Visible = False
End If End If
@@ -254,7 +273,7 @@ Partial Class Inventarios_RepAnomalias
#End Region #End Region
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvF.RowDataBound, GvS.RowDataBound Protected Sub GVF_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvF.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Costo") = "-1" Then If e.Row.DBCampo("Costo") = "-1" Then
e.Row.Cells(8).Text = "0" e.Row.Cells(8).Text = "0"
@@ -264,6 +283,29 @@ Partial Class Inventarios_RepAnomalias
End If End If
e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1 e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1
End If End If
If e.Row.RowType = DataControlRowType.Header Then
If CreandoNuevoInventario Then
e.Row.FCCheckBox("ChkAllFaltante").Attributes.Add("onclick", "SeleccionarTodosFaltante(this);")
End If
End If
End Sub
Protected Sub GVS_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvS.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Costo") = "-1" Then
e.Row.Cells(8).Text = "0"
End If
If e.Row.Cells(7).Text = MinFecha.ToString Then
e.Row.Cells(7).Text = ""
End If
e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1
End If
If e.Row.RowType = DataControlRowType.Header Then
If CreandoNuevoInventario Then
e.Row.FCCheckBox("ChkAllSobrante").Attributes.Add("onclick", "SeleccionarTodosSobrante(this);")
End If
End If
End Sub End Sub
#Region " IMPRIMIR " #Region " IMPRIMIR "
@@ -353,14 +395,14 @@ Partial Class Inventarios_RepAnomalias
GvF.Columns(0).Visible = True GvF.Columns(0).Visible = True
LnkGuardar.Visible = True LnkGuardar.Visible = True
LnkCrear.Visible = False LnkCrear.Visible = False
GvF.HeaderRow.FCCheckBox("ChkAllFaltante").Attributes.Add("onclick", "SeleccionarTodosFaltante(this);") CreandoNuevoInventario = True
End If End If
If GvS.Rows.Count > 0 Then If GvS.Rows.Count > 0 Then
GvS.Columns(0).Visible = True GvS.Columns(0).Visible = True
LnkGuardar.Visible = True LnkGuardar.Visible = True
LnkCrear.Visible = False LnkCrear.Visible = False
GvS.HeaderRow.FCCheckBox("ChkAllSobrante").Attributes.Add("onclick", "SeleccionarTodosSobrante(this);") CreandoNuevoInventario = True
End If End If
UPAnomalias.Update() UPAnomalias.Update()
UpdateGvS.Update() UpdateGvS.Update()
@@ -374,13 +416,15 @@ Partial Class Inventarios_RepAnomalias
Dim ErrorClasif As Boolean = False Dim ErrorClasif As Boolean = False
Dim ObjInventario As New ClsInventarios Dim ObjInventario As New ClsInventarios
Dim CveInventarioFisicoNew As Integer Dim CveInventarioFisicoNew As Integer
Dim DtAlmacen, DtClasificacion, DtClasificacionExcluida, DtProveedor As DataTable Dim DtAlmacen, DtClasificacion, DtClasificacionExcluida, DtProveedor, DtUsuario As DataTable
DtAlmacen = Nothing DtAlmacen = Nothing
DtClasificacion = Nothing DtClasificacion = Nothing
DtClasificacionExcluida = Nothing DtClasificacionExcluida = Nothing
DtProveedor = Nothing DtProveedor = Nothing
DtUsuario = Nothing
ObjInventario.IniciaTransacSQL() ObjInventario.IniciaTransacSQL()
If ObjInventario.AddInventarioFisico(UsuarioActual.CveEmpresa, TxtTitulo.Text, lbObservaciones.Text, 0, CveSubProyecto) Then If ObjInventario.AddInventarioFisico(UsuarioActual.CveEmpresa, TxtTitulo.Text, lbObservaciones.Text, 0, CveSubProyecto, aplicacion) Then
CveInventarioFisicoNew = ObjInventario.CveInventarioFisico CveInventarioFisicoNew = ObjInventario.CveInventarioFisico
If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
@@ -396,6 +440,18 @@ Partial Class Inventarios_RepAnomalias
DtProveedor = ObjInventario.DtResultados.FiltraParametros("Incluye = 1") DtProveedor = ObjInventario.DtResultados.FiltraParametros("Incluye = 1")
End If End If
If ObjInventario.GetInventarioFisicoDetallesUsuarios(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
DtUsuario = ObjInventario.DtResultados.FiltraParametros("Incluye = 1")
End If
For Each Gvr As DataRow In DtUsuario.Rows
If Not ObjInventario.AddInventarioFisicoUsuarios(CveInventarioFisicoNew, Gvr("CveUsuario").ToString.ToEntero, Convert.ToBoolean(Gvr("Incluye").ToString), Convert.ToBoolean(Gvr("Cerrado").ToString), Convert.ToBoolean(Gvr("Bloqueado").ToString)) Then
ErrorClasif = True
Exit For
End If
Next
For Each Gvr As DataRow In DtAlmacen.Rows For Each Gvr As DataRow In DtAlmacen.Rows
If Not ObjInventario.AddInventarioFisicoAlmacenes(CveInventarioFisicoNew, Gvr("CveAlmacen").ToString.ToEntero) Then If Not ObjInventario.AddInventarioFisicoAlmacenes(CveInventarioFisicoNew, Gvr("CveAlmacen").ToString.ToEntero) Then
ErrorClasif = True ErrorClasif = True
@@ -455,6 +511,7 @@ Partial Class Inventarios_RepAnomalias
GvS.Columns(0).Visible = False GvS.Columns(0).Visible = False
LnkGuardar.Visible = False LnkGuardar.Visible = False
LnkCrear.Visible = True LnkCrear.Visible = True
CreandoNuevoInventario = False
CargaDatos(CveInventarioFisico) CargaDatos(CveInventarioFisico)
Else Else
ObjInventario.RollBack() ObjInventario.RollBack()