-
This commit is contained in:
@@ -343,8 +343,8 @@ Partial Class OS_OrdenesServicios
|
||||
CargaPS(-1, DdlPSDetalle)
|
||||
CargaPsMateriales()
|
||||
'CargaClasificaciones()
|
||||
CargaPSCaracteristicasOpciones()
|
||||
CargaCuentasCaracteristicas()
|
||||
'CargaPSCaracteristicasOpciones()
|
||||
'CargaCuentasCaracteristicas()
|
||||
CargaAlmacen()
|
||||
CargaModelos()
|
||||
|
||||
@@ -847,14 +847,13 @@ Partial Class OS_OrdenesServicios
|
||||
If Row("Estatus").ToString = "Activo" Then Estatus = True Else Estatus = False
|
||||
If Row("SeSuperviso").ToString = "Sí" Then SeSuperviso = True Else SeSuperviso = False
|
||||
|
||||
|
||||
CargaMaterialesDetalle(CveOsDetalle, IDOSDetalle, IDOSDetalle)
|
||||
For Each R As DataRow In TmpDTMaterialesDetalle.FiltraParametros(String.Format("CveConsecutivoDetalle = {0}", IDOSDetalle)).Rows
|
||||
If Materiales = "-1" Then Materiales = "" Else Materiales = Materiales + "<br>"
|
||||
Materiales = Materiales + String.Format("{0} {1}", R("Cantidad").ToString, R("PS").ToString)
|
||||
Next
|
||||
|
||||
CargaEspecificaciones(CveOsDetalle, IDOSDetalle, IDOSDetalle)
|
||||
'CargaEspecificaciones(CveOsDetalle, IDOSDetalle, IDOSDetalle)
|
||||
For Each R As DataRow In TmpDTCaracteristica.FiltraParametros(String.Format("CveConsecutivoDetalle = {0}", IDOSDetalle)).Rows
|
||||
If Especificaciones = "-1" Then Especificaciones = "" Else Especificaciones = Especificaciones + ","
|
||||
Especificaciones = Especificaciones + String.Format("{0}:{1}:{2}:{3}:{4}:{5}", R("CveCaracteristica").ToString, R("Caracteristica").ToString, R("CveCaracteristicaTipo"), R("CveOpcion").ToString, R("Opcion").ToString, R("Valor").ToString)
|
||||
@@ -3112,11 +3111,20 @@ Partial Class OS_OrdenesServicios
|
||||
|
||||
'---------------- FIN VALIDACIONES -----------------
|
||||
|
||||
Dim CveAlmacenActual As Integer = DTSolicitudDev.FiltroPrimeroValor("CveAlmacenActual").ToEntero
|
||||
'Validación solo para que no sean uso de material
|
||||
Dim ValidaPU As String = ""
|
||||
If Not DdlTipoVenta.SelectedValue.Contiene("5") Then ValidaPU = "PU > 0"
|
||||
|
||||
Dim CveAlmacenActual As Integer = DTSolicitudDev.FiltroPrimeroValor("CveAlmacenActual", ValidaPU).ToEntero 'PU>0, para indicar que solo los productos que no se han retornado.
|
||||
Dim CveMoneda As Integer = DTSolicitudDev.FiltroPrimeroValor("CveMoneda").ToEntero
|
||||
Dim CveVentaPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveVenta").ToEntero
|
||||
Dim CveVentaRemisionGenerada As Integer = -1
|
||||
|
||||
If CveAlmacenActual <= 0 Then
|
||||
Alert("No se pudo determinar el almacen del material", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjV As New ClsVentas
|
||||
Dim ObjOS As New ClsOS(ObjV.IniciaTransacSQL())
|
||||
Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL())
|
||||
@@ -3774,6 +3782,11 @@ Partial Class OS_OrdenesServicios
|
||||
|
||||
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
CancelarOS()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CancelarOS()
|
||||
Dim CveEstatusOrdenServicioCancelacion As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", " TipoEstatus = 5 ").ToEntero
|
||||
Dim CveAlmacenDevolucion As Integer
|
||||
Dim CveMotivoCancelacion As Integer = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMotivoCancelacion", "CveSATMotivoCancelacion IN (3)").ToEntero
|
||||
@@ -3836,7 +3849,6 @@ Partial Class OS_OrdenesServicios
|
||||
Catch ex As Exception
|
||||
Alert("Se presento un error al cancelar la orden de servicio")
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CancelarRemision(CveVenta As Integer, CveAlmacenDevolucion As Integer, CvePedido As Integer)
|
||||
@@ -3848,6 +3860,12 @@ Partial Class OS_OrdenesServicios
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'If DdlTipoVenta.SelectedValue.Contiene("5", "6") Then
|
||||
' CancelarOS() 'uso de material
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
|
||||
Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=True, VerificaAlmacen:=True)
|
||||
Try
|
||||
Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing
|
||||
@@ -3869,7 +3887,7 @@ Partial Class OS_OrdenesServicios
|
||||
Dim HuboError As Boolean = False
|
||||
If Not resp.HuboError Then
|
||||
|
||||
If resp.CveEstatus = 12 Then
|
||||
If resp.CveEstatus.Contiene(12) Then '12 - Rem - Cancelado, 14 - Pedido - cancelado
|
||||
Dim cveoo As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", $" TipoEstatus = 3").ToEntero
|
||||
If objos.UpdateOrdenesServiciosEstatus(cveoo, UsuarioActual.CveUsuario, CveOS) Then
|
||||
'retornar el estatus de la OS,
|
||||
@@ -3879,9 +3897,13 @@ Partial Class OS_OrdenesServicios
|
||||
Else
|
||||
HuboError = True
|
||||
End If
|
||||
ElseIf resp.CveEstatus.Contiene(14) Then ' 14 - Pedido - cancelado
|
||||
If Not ObjVenta.UpdateVentasDevolucionAlmacen(1, CvePedido) Then
|
||||
HuboError = True
|
||||
End If
|
||||
Else
|
||||
'si tiene pagos
|
||||
HuboError = True
|
||||
|
||||
HuboError = True 'si tiene pagos
|
||||
End If
|
||||
Else
|
||||
HuboError = True
|
||||
|
||||
Reference in New Issue
Block a user