Retro SMS, precios lisa en modal vetas, cantidades, OS dev , lote, serie, caducidad, OS bitacora dev
This commit is contained in:
@@ -355,7 +355,7 @@
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvMateriales" CssClass="table table-striped table-hover Widthall mysmallbtn" GridLines="None" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS" EmptyDataText="Sin Materiales en la Orden de Servicio" ToolTip="Listado de Materiales de Orden de Servicio">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" ItemStyle-Width="60px" />
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" ItemStyle-Width="60px" DataFormatString="{0:N3}" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" />
|
||||
<asp:TemplateField Visible="false">
|
||||
<ItemTemplate>
|
||||
@@ -1277,8 +1277,8 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:GridView ID="GvSolicitarDevolucion" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado Historial"
|
||||
DataKeyNames="CveVentaDetalle,Cantidad,CveAlmacenActual,CvePS,CveUM,PU,CveMovimientoDetalle,Lote,Serie,FechaCaducidad"
|
||||
<asp:GridView ID="GvSolicitarDevolucion" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado Historial"
|
||||
DataKeyNames="CveVentaDetalle,Cantidad,CveAlmacenActual,CvePS,CveUM,PU,CveMovimientoDetalle,Lote,Serie,FechaCaducidad,AplicaSerie,AplicaLote,AplicaCaducidad,CodigoPS"
|
||||
CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvSolicitarDevolucion_RowDataBound">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
@@ -1297,9 +1297,44 @@
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Concepto</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlcodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
|
||||
<asp:Literal ID="LtlcodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>' ></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Lote</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLote" runat="server" Width="50px" Text='<%# Eval("Lote") %>' Visible="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Serie</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtSerie" runat="server" Width="50px" Text='<%# Eval("Serie") %>' Visible="false" ></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha Cad.</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
|
||||
<div runat="server" id="DVFechaCaducidad" visible="false">
|
||||
|
||||
<asp:TextBox ID="TxtFechaCaducidad" runat="server" Width="70px" Text='<%# Eval("FechaCaducidad") %>' ></asp:TextBox>
|
||||
<ajax:MaskedEditExtender ID="METxtFechaCaducidad" runat="server" TargetControlID="TxtFechaCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CCTxtFechaCaducidad" TargetControlID="TxtFechaCaducidad" PopupButtonID="TxtFechaCaducidad" PopupPosition="BottomLeft" ></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CVTxtFechaCaducidad" runat="server" ControlToValidate="TxtFechaCaducidad" Display="None"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Caducidad''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."
|
||||
Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpDevolucion">
|
||||
</asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCTxtFechaCaducidad" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaCaducidad" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
@@ -1311,7 +1346,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<asp:LinkButton ID="LnkModalSolicitarDevolucion" runat="server" CssClass="btn btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si"
|
||||
<asp:LinkButton ID="LnkModalSolicitarDevolucion" runat="server" CssClass="btn btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" ValidationGroup="GrpDevolucion"
|
||||
OnClick="LnkModalSolicitarDevolucion_Click" >Guardar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
|
||||
@@ -1320,8 +1355,9 @@
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<%--MODAL FINALIZAR ORDEN INICIO --%>
|
||||
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="content7" ContentPlaceHolderID="JS" runat="server">
|
||||
|
||||
@@ -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