-- cambios E140. recolecciones

This commit is contained in:
2024-02-25 19:20:28 -07:00
parent 9e12eb370b
commit f3b83548df
9 changed files with 363 additions and 339 deletions

View File

@@ -70,7 +70,7 @@ Partial Class Acumuladores_RepRecolecciones
Private Sub CargaDatos()
Dim ObjGeneral As New ClsGenerales
If ObjGeneral.GetInvEntregaAlmacenRuta(-1, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 2, -1) Then
If ObjGeneral.GetInvEntregaAlmacenRuta(DdlSubProyecto.SelectedValue.ToEntero, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero) Then
GvR.DataSource = ObjGeneral.DtResultados
End If
ObjGeneral.Dispose()
@@ -82,20 +82,20 @@ Partial Class Acumuladores_RepRecolecciones
Protected Sub gvR_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim LnkEditar As LinkButton = e.Row.FCLinkButton("LnkGvDatosRecoleccionEditar")
If e.Row.DataKey("Estatus") = "0" OrElse e.Row.DataKey("Estatus") = "" Then
If e.Row.DBCampo("CveMovimientoEntrada") = "" Then
e.Row.FCHyperLink("HplR").Visible = True
e.Row.FCLabel("LblRef").ToolTip = e.Row.DBCampo("CveEntregaAlmacen")
e.Row.FCHyperLink("HplR").NavigateUrl = "/Inventarios/EntradasSalidas.aspx?CveEntregaAlmacen=" & e.Row.DBCampo("CveEntregaAlmacen")
End If
If e.Row.DBCampo("CveMovimientoEntrada") <> "" AndAlso e.Row.DBCampo("CveMovimientoTraslado") = "" Then
Dim LnkEditar As LinkButton = e.Row.FCLinkButton("LnkGvDatosRecoleccionEditar")
'If e.Row.DBCampo("Estatus") = "0" OrElse e.Row.DBCampo("Estatus") = "" Then
LnkEditar.Visible = True
'End If
End If
' If e.Row.DataKey("Estatus") = "1" Then
e.Row.FCHyperLink("HplR").Visible = True
e.Row.FCHyperLink("HplR").NavigateUrl = "/Inventarios/EntradasSalidas.aspx?CveEntregaAlmacen=" & e.Row.DBCampo("CveEntregaAlmacen")
'End If
If e.Row.DataKey("CveTimbre") <> "" Then
e.Row.FCCheckBox("Chk").Visible = False
End If
End If
End Sub
@@ -105,7 +105,6 @@ Partial Class Acumuladores_RepRecolecciones
CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero()
Dim CveDireccionOrigen As Integer = GvRow.DataKey("CveDireccionOrigen").ToEntero()
CargaDatosRecoleccionDetallePS()
LtlModalRecoleccionTitulo.Text = "Definición de tamaños"
BtnModalRecoleccionGuardar.Text = "Guardar"
@@ -117,7 +116,6 @@ Partial Class Acumuladores_RepRecolecciones
ElProductoChange()
End Sub
Private Sub ElProductoChange()
DdlModalRecoleccionUnidad.Items.Clear()
DdlModalRecoleccionUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveEmpresa)
@@ -138,7 +136,6 @@ Partial Class Acumuladores_RepRecolecciones
Next
LblProductosCargados.Text = Str.ToString
End If
ObjGenerales.Dispose()
GvModalPSRecoleccion.DataSource = DTRecoleccion
@@ -207,7 +204,6 @@ Partial Class Acumuladores_RepRecolecciones
Private Sub BtnModalRecoleccionGuardar_Click(sender As Object, e As EventArgs) Handles BtnModalRecoleccionGuardar.Click
Dim Cantidad As Decimal = HdnCantidadRecoleccion.Value.ToDecimal
Dim CantidadDefinido As Decimal = 0
For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows
@@ -220,6 +216,7 @@ Partial Class Acumuladores_RepRecolecciones
Dim ObjInventario As New ClsInventarios
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
Dim ObjGral As New ClsGenerales(ObjInventario.IniciaTransacSQL)
Dim ErrorMovInv As Boolean = False
Dim Fecha As DateTime = NowADS()
Dim Concepto As String = "Traspaso Recolección"
@@ -268,16 +265,19 @@ Partial Class Acumuladores_RepRecolecciones
ErrorMovInv = True
End If
End If
If Not ErrorMovInv Then
ObjGral.UpdateInvEntregaAlmacenEstatus(CveEntregaAlmacen, UsuarioActual.CveEmpresa, 1)
End If
End If
End If
If Not ErrorMovInv Then
ObjInventario.Commit()
GvR.DataBind()
DTRecoleccion.Clear()
Dim MensajeAlert As New StringBuilder
MensajeAlert.Append("Se realizó con éxito el traspaso.")
MensajeAlert.AppendFormat("<br/> Folio de Salida: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" class='Texto' target=""_blank"">{0}</a></b>", FolioSalida, CveMovimientoSalida)
'MensajeAlert.AppendFormat("<br/><a target='_blank' class='Texto' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida)))
Alert(MensajeAlert.ToString)
@@ -286,4 +286,24 @@ Partial Class Acumuladores_RepRecolecciones
End If
End Sub
Protected Sub LnkModalGvModalPSRecoleccionEliminar_Click(sender As Object, e As EventArgs)
Dim LnkEliminar As LinkButton = CType(sender, LinkButton)
Dim GvRow As GridViewRow = CType(LnkEliminar.NamingContainer, GridViewRow)
Dim CveEntregaAlmacenDetalle = GvRow.DataKey("CveEntregaAlmacenDetalle").ToEntero()
Dim drss As DataRow() = DTRecoleccion.Select($"CveEntregaAlmacenDetalle = {CveEntregaAlmacenDetalle}")
If drss.Count > 0 Then
DTRecoleccion.Rows.Remove(drss(0))
End If
DTRecoleccion.AcceptChanges()
GvModalPSRecoleccion.DataSource = DTRecoleccion
GvModalPSRecoleccion.DataBind()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
End Class