Retro SMS, precios lisa en modal vetas, cantidades, OS dev , lote, serie, caducidad, OS bitacora dev
This commit is contained in:
@@ -875,7 +875,7 @@ Partial Class OS_OrdenesServicios
|
||||
Private Sub CargaMateriales()
|
||||
Dim objOS As New ClsOS
|
||||
|
||||
If objOS.GetDetalleMateriales(-1, CveOS) Then
|
||||
If objOS.GetDetalleMateriales(-1, CveOS, True) Then
|
||||
GvMateriales.DataSource = objOS.DtResultados
|
||||
End If
|
||||
objOS.Dispose()
|
||||
@@ -3083,7 +3083,31 @@ Partial Class OS_OrdenesServicios
|
||||
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")))
|
||||
|
||||
'AplicaSerie, AplicaLote, AplicaCaducidad
|
||||
If Boolean.Parse(e.Row.DataKey("AplicaSerie")) Then
|
||||
e.Row.FCTextBox("TxtSerie").Visible = True
|
||||
End If
|
||||
|
||||
If Boolean.Parse(e.Row.DataKey("AplicaLote")) Then
|
||||
e.Row.FCTextBox("TxtLote").Visible = True
|
||||
End If
|
||||
|
||||
If Boolean.Parse(e.Row.DataKey("AplicaCaducidad")) Then
|
||||
|
||||
e.Row.FCHtmlGenericControl("DVFechaCaducidad").Visible = True
|
||||
'e.Row.FCTextBox("TxtFechaCaducidad").Visible = True
|
||||
'e.Row.FCMaskedEditExtender("METxtFechaCaducidad").Visible = True
|
||||
'e.Row.FCCalendarExtender("CCTxtFechaCaducidad").Visible = True
|
||||
'e.Row.FCCompareValidator("CVTxtFechaCaducidad").Visible = True
|
||||
'e.Row.FCValidatorCalloutExtender("VCTxtFechaCaducidad").Visible = True
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -3101,6 +3125,58 @@ Partial Class OS_OrdenesServicios
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim SbErroresDev As New StringBuilder
|
||||
|
||||
For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows
|
||||
|
||||
|
||||
If GvRow.DataKey("Cantidad").ToDecimal > 0 Then
|
||||
|
||||
Dim sbTemperror As New StringBuilder
|
||||
Dim ErrorCountDev As Integer = 0
|
||||
|
||||
sbTemperror.Append($"Producto: {GvRow.DataKey("CodigoPS") } requiere: ")
|
||||
|
||||
|
||||
If Boolean.Parse(GvRow.DataKey("AplicaSerie")) Then
|
||||
If GvRow.FCTextBox("TxtSerie").Text.Trim = String.Empty Then
|
||||
sbTemperror.Append($" Serie, ")
|
||||
ErrorCountDev = ErrorCountDev + 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If Boolean.Parse(GvRow.DataKey("AplicaLote")) Then
|
||||
If GvRow.FCTextBox("TxtLote").Text = String.Empty Then
|
||||
sbTemperror.Append($" Lote, ")
|
||||
ErrorCountDev = ErrorCountDev + 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If Boolean.Parse(GvRow.DataKey("AplicaCaducidad")) Then
|
||||
If Not IsDate(GvRow.FCTextBox("TxtFechaCaducidad").Text) Then
|
||||
sbTemperror.Append($" Fecha de caducidad")
|
||||
ErrorCountDev = ErrorCountDev + 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If ErrorCountDev > 0 Then
|
||||
sbTemperror.Append($"<br/>")
|
||||
SbErroresDev.AppendLine(sbTemperror.ToString)
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
|
||||
If SbErroresDev.ToString.Length > 0 Then
|
||||
Alert($"Se encontraron los siguientes errores: <br> {SbErroresDev.ToString}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim PropcesoOK As Boolean = True
|
||||
Dim ObjV As New ClsVentas
|
||||
ObjV.IniciaTransacSQL()
|
||||
@@ -3130,6 +3206,7 @@ Partial Class OS_OrdenesServicios
|
||||
Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL())
|
||||
|
||||
Dim CveMovimiento As Integer = ObjInventario.AddMovimiento(CveAlmacenActual, 8, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaPedido, CveSubProyectoPedido, -1, CveOS:=CveOS, CveAlmacenDestino:=CveAlmacenDestino)
|
||||
Dim Folio As Integer = ObjInventario.Folio
|
||||
|
||||
If CveMovimiento > 0 Then
|
||||
|
||||
@@ -3143,9 +3220,12 @@ Partial Class OS_OrdenesServicios
|
||||
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
|
||||
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
|
||||
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
||||
Dim Lote As String = GvRow.DataKey("Lote")
|
||||
Dim Serie As String = GvRow.DataKey("Serie")
|
||||
Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDateTime
|
||||
|
||||
Dim Lote As String = GvRow.FCTextBox("TxtLote").Text.Trim
|
||||
Dim Serie As String = GvRow.FCTextBox("TxtSerie").Text.Trim
|
||||
Dim FechaCaducidad As DateTime = GvRow.FCTextBox("TxtFechaCaducidad").Text.ToDate
|
||||
|
||||
|
||||
|
||||
If CantidadRegistro > 0 Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadRegistro, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
||||
@@ -3171,6 +3251,7 @@ Partial Class OS_OrdenesServicios
|
||||
Dim PU As Decimal = dRow("PU").ToString.ToDecimal
|
||||
Dim CveVentaDetalle As Integer = dRow("CveVentaDetalle").ToString.ToEntero
|
||||
Dim CveMovimientoDetalle As Integer = dRow("CveMovimientoDetalle").ToString.ToEntero
|
||||
|
||||
Dim Lote As String = dRow("Lote").ToString
|
||||
Dim Serie As String = dRow("Serie").ToString
|
||||
Dim FechaCaducidad As DateTime = dRow("FechaCaducidad").ToString.ToDateTime
|
||||
@@ -3183,6 +3264,18 @@ Partial Class OS_OrdenesServicios
|
||||
|
||||
Next
|
||||
|
||||
If PropcesoOK Then
|
||||
|
||||
Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL)
|
||||
Dim LigaVenta As String = String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimiento, Folio, "Material utilizado")
|
||||
|
||||
If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaPedido, CveOS:=CveOS) Then
|
||||
PropcesoOK = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
PropcesoOK = False
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user