Solicitud de devolución dede OS
This commit is contained in:
@@ -7,6 +7,10 @@ Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports ADSNetLibrary.SIGAPI.Models.Sistema
|
||||
Imports Telerik.Charting.Styles
|
||||
Imports Telerik.Web.UI
|
||||
Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
||||
Imports Profact.TimbraCFDI.Complementos.InstitucionesEducativas
|
||||
|
||||
|
||||
'Imports msExcel = Microsoft.Office.Interop.Excel
|
||||
'Imports VBIDE
|
||||
@@ -84,6 +88,22 @@ Partial Class OS_OrdenesServicios
|
||||
ViewState("CveOS") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property CveVenta As Integer
|
||||
Get
|
||||
If ViewState("CveVenta") Is Nothing Then
|
||||
ViewState("CveVenta") = -1
|
||||
End If
|
||||
|
||||
Return ViewState("CveVenta").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveVenta") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property CveOsDetalle As Integer
|
||||
Get
|
||||
Return ViewState("CveOsDetalle").ToString.ToEntero
|
||||
@@ -286,6 +306,7 @@ Partial Class OS_OrdenesServicios
|
||||
TipoEstatus = 1
|
||||
CveConsecutivo = 0
|
||||
CveOsDetalle = -1
|
||||
CveVenta = -1
|
||||
CveUsuarioAtendioCount = 0
|
||||
ImgImprimir.Visible = False
|
||||
|
||||
@@ -613,6 +634,7 @@ Partial Class OS_OrdenesServicios
|
||||
SeFacturara = GlobalDTTipoOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("SeFacturara", String.Format("CveOrdenServicioTipo = {0}", ObjOS.CveOSTipo))
|
||||
CveTecnico = ObjOS.CveUsuarioAtendio
|
||||
CargarEstatusDelUsuario(TipoEstatus)
|
||||
CveVenta = ObjOS.CveVenta
|
||||
|
||||
'Dim validacionTieneEstatus As Integer = EstatusOSDelUsuario.FiltraParametros(String.Format("CveEstatusOrdenServicio = {0}", ObjOS.CveEstatusOrdenServicio)).Rows.Count
|
||||
|
||||
@@ -677,6 +699,11 @@ Partial Class OS_OrdenesServicios
|
||||
|
||||
CargaEventoBitacora()
|
||||
CargaHistorial()
|
||||
|
||||
|
||||
If CveVenta > 0 And TipoEstatus.Contiene(1, 2, 3) Then
|
||||
LnkAccionesDevolucion.Visible = True
|
||||
End If
|
||||
Else
|
||||
Alert("La Orden de Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
BtnGuardar.Enabled = False
|
||||
@@ -3003,4 +3030,91 @@ Partial Class OS_OrdenesServicios
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkAccionesDevolucion_Click(sender As Object, e As EventArgs)
|
||||
|
||||
LnkModalSolicitarDevolucion.Visible = True
|
||||
|
||||
GvSolicitarDevolucion.DataSource = Nothing
|
||||
|
||||
Dim ObjOS As New ClsOS
|
||||
Dim DTTemp As New DataTable
|
||||
|
||||
|
||||
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
DTTemp = ObjOS.DtResultados
|
||||
GvSolicitarDevolucion.DataSource = DTTemp
|
||||
End If
|
||||
|
||||
ObjOS.Dispose()
|
||||
GvSolicitarDevolucion.DataBind()
|
||||
|
||||
Dim EsDevolucionVenta As Boolean = (DTTemp.FiltroPrimeroValor("EsDevolucionVenta", "").ToEntero > 0)
|
||||
|
||||
RegistraScript("$('#DVModalSolicitarDevolucion').modal();")
|
||||
|
||||
If EsDevolucionVenta Then
|
||||
Alert("Ya existe una solicitud de devolución", TipoMensaje.MsgAdvertencia)
|
||||
LnkModalSolicitarDevolucion.Visible = False
|
||||
End If
|
||||
|
||||
UpModalSolicitarDevolucion.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvSolicitarDevolucion_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCTextBox("TxtDev").Attributes.Add("onblur", String.Format("ValidarCantidad(this, {0})", e.Row.DataKey("Cantidad")))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkModalSolicitarDevolucion_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim PropcesoOK As Boolean = True
|
||||
Dim ObjV As New ClsVentas
|
||||
ObjV.IniciaTransacSQL()
|
||||
|
||||
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then
|
||||
PropcesoOK = False
|
||||
End If
|
||||
|
||||
If PropcesoOK Then
|
||||
For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows
|
||||
|
||||
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
|
||||
Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
|
||||
|
||||
If CantidadDev > 0 Then
|
||||
If Not ObjV.UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle, CantidadDev) Then
|
||||
PropcesoOK = False
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
If PropcesoOK Then
|
||||
'ObjV.RollBack()
|
||||
ObjV.Commit()
|
||||
Alert("La solicitud de Devolución de Almacén se guardó correctamente")
|
||||
RegistraScript("$('#DVModalSolicitarDevolucion').modal('hide');")
|
||||
Else
|
||||
ObjV.RollBack()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
ObjV.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user