This commit is contained in:
Antonio Gonzalez
2020-06-09 13:39:20 -07:00
parent 3efe1c537f
commit 2bb4d34483
4 changed files with 76 additions and 26 deletions

View File

@@ -187,6 +187,8 @@ Partial Class Inventarios_ResguardoMaterial
dt.Columns.Add("Observaciones")
dt.Columns.Add("CvePersonal", Type.GetType("System.Int32"))
dt.Columns.Add("Checado", Type.GetType("System.Boolean"))
dt.Columns.Add("CveSeccionAlmacen", Type.GetType("System.Int32"))
dt.Columns.Add("SeccionAlmacen")
DtMovimientos = dt
@@ -272,14 +274,17 @@ Partial Class Inventarios_ResguardoMaterial
DdlAlmacenDestinoLiberacion.DataBind()
DdlAlmacenDestinoLiberacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
DdlSeccionAlmacen.DataBind()
CargaPS()
End Sub
Private Sub CargaPS()
DdlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
If DdlProducto2.UsaWebService Then
DdlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
DdlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue.ToString)
'DdlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
'DdlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue.ToString)
End If
If Not DdlProducto2.UsaWebService AndAlso CType(DdlProducto2.DataSource, DataTable) Is Nothing Then
DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
@@ -333,6 +338,10 @@ Partial Class Inventarios_ResguardoMaterial
ThSerie.Visible = True
TrSerie.Visible = True
TxtnSerie.Visible = True
ThSeccion.Visible = True
TrSeccion.Visible = True
GvM.Columns(4).Visible = True
Else
TxtnSerie.Visible = False
@@ -415,10 +424,12 @@ Partial Class Inventarios_ResguardoMaterial
registro.Item("PS") = DdlProducto2.SelectedText
registro.Item("Estatus") = ""
registro.Item("Serie") = TxtnSerie.Text
registro.Item("SeccionAlmacen") = If(DdlSeccionAlmacen.SelectedValue.ToEntero > 0, DdlSeccionAlmacen.SelectedItem.Text, "")
registro.Item("CveSeccionAlmacen") = If(DdlSeccionAlmacen.SelectedValue.ToEntero > 0, DdlSeccionAlmacen.SelectedValue.ToEntero, -1)
registro.Item("Observaciones") = TxtObservacionesdetalle.Text
DtMovimientos.Rows.Add(registro)
CargaGvM()
UPDatos.Update()
txtCantidad.Text = ""
txtCantidad.Focus()
@@ -439,15 +450,37 @@ Partial Class Inventarios_ResguardoMaterial
ThSerie.Visible = False
TrSerie.Visible = False
TxtnSerie.Visible = False
GvM.Columns(5).Visible = False
GvM.Columns(4).Visible = False
For Each Dr As DataRow In DtMovimientos.Rows
If Dr("Serie").ToString <> "" Then
ThSerie.Visible = True
TrSerie.Visible = True
GvM.Columns(4).Visible = True
Exit For
End If
Next
Dim Contador As Integer = 0
Dim UltimoRenglon As Integer = DtMovimientos.Rows.Count - 1
Dim MostrarSerie As Boolean = False
Dim MostrarSeccion As Boolean = False
While Contador <= UltimoRenglon And (Not MostrarSerie And Not MostrarSeccion)
Dim Dr As DataRow = DtMovimientos.Rows(Contador)
MostrarSerie = If(Not MostrarSerie, Dr("Serie").ToString <> "", True)
MostrarSeccion = If(Not MostrarSerie, Dr("SeccionAlmacen").ToString <> "", True)
Contador += 1
End While
ThSerie.Visible = MostrarSerie
TrSerie.Visible = MostrarSerie
GvM.Columns(5).Visible = MostrarSerie
GvM.Columns(4).Visible = MostrarSeccion
'For Each Dr As DataRow In DtMovimientos.Rows
' If Dr("Serie").ToString <> "" Then
' ThSerie.Visible = True
' TrSerie.Visible = True
' GvM.Columns(5).Visible = True
' Exit For
' End If
' If Dr("SeccionAlmacen").ToString <> "" Then
' GvM.Columns(4).Visible = True
' End If
'Next
GvM.DataSource = DtMovimientos
GvM.DataBind()
@@ -460,6 +493,7 @@ Partial Class Inventarios_ResguardoMaterial
GvM.EditIndex = -1
CargaGvM()
UPDatos.Update()
End Sub
Protected Sub GvM_RowDataBound(sender As Object, e As GridViewRowEventArgs)
@@ -740,7 +774,8 @@ Partial Class Inventarios_ResguardoMaterial
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, -1, -1, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0,
-1, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
TieneError = True
Exit For
@@ -759,7 +794,9 @@ Partial Class Inventarios_ResguardoMaterial
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, Serie:=Dr("Serie").ToString, 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, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero,
Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then
TieneError = True
MensajeError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For