EntradasSalidas, si el movtodetalle tiene cvecompradetalle, validar el total original vs el nuevo. y afectar directamente sobre la tabla de compradetalle, así como se hace cuando se edita el cveps
This commit is contained in:
@@ -675,7 +675,7 @@
|
||||
<asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
<asp:GridView ID="GvM" runat="server" GridLines="none" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" EmptyDataText="Aún no hay registros."
|
||||
DataKeyNames="No,CveMovimientoDetalle,Cantidad,CvePS,CveUM,PU,Observaciones,CodigoPS,UnidadMedida,CveAF,Serie,Lote,FechaCaducidad,CveSeccionAlmacen,Codigo" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True">
|
||||
DataKeyNames="No,CveMovimientoDetalle,Cantidad,CvePS,CveUM,PU,Observaciones,CodigoPS,UnidadMedida,CveAF,Serie,Lote,FechaCaducidad,CveSeccionAlmacen,Codigo,Total" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt">
|
||||
<EditItemTemplate>
|
||||
|
||||
@@ -287,6 +287,23 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Public Property TotalOriginalEdit() As Decimal
|
||||
Get
|
||||
|
||||
If ViewState("TotalOriginalEdit") Is Nothing Then
|
||||
ViewState("TotalOriginalEdit") = 0D
|
||||
End If
|
||||
|
||||
Return ViewState("TotalOriginalEdit").ToString.ToDecimal
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("TotalOriginalEdit") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Public Property IndexActualTabla() As Integer
|
||||
Get
|
||||
|
||||
@@ -1534,7 +1551,20 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
If CveMovimiento > 0 Then
|
||||
If CveMovimientoDetalleEdit > 0 Then
|
||||
|
||||
If CveCompra > 0 Then
|
||||
Dim TotalActual As Decimal = (txtCantidad.Text.ToDecimal * txtPrecio.Text.ToDecimal)
|
||||
Dim Diferencia As Decimal = Math.Abs(TotalOriginalEdit - TotalActual).RoundSQL(2)
|
||||
|
||||
If Diferencia > 0 Then
|
||||
Alert($"Existe una diferencia de {Diferencia.ToString("###,###,###.00")} entre el total anterior ({TotalOriginalEdit.ToString("###,###,###.00")}) y actual({TotalActual.ToString("###,###,###.00")}).", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ActualizarPS()
|
||||
|
||||
Else
|
||||
AgregarPS()
|
||||
End If
|
||||
@@ -2894,6 +2924,8 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
TotalOriginalEdit = 0D
|
||||
CveMovimientoDetalleEdit = -1
|
||||
|
||||
'Dim i As Integer = e.NewEditIndex
|
||||
'GvM.EditIndex =
|
||||
@@ -2903,7 +2935,8 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
If CveMovimiento > 0 Then
|
||||
CveMovimientoDetalleEdit = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
||||
txtCantidad.Enabled = False
|
||||
TotalOriginalEdit = GvRow.DataKey("Total").ToDecimal
|
||||
'txtCantidad.Enabled = False
|
||||
'DdlClasificacion.Enabled = False
|
||||
DdlProducto2.Enabled = False
|
||||
'DdlUnidad.Enabled = False
|
||||
|
||||
@@ -436,20 +436,7 @@
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpOCS" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="col-md-1" style="text-align:right!important">
|
||||
|
||||
<div id="DivIndicadorOC2" runat="server" visible="false" >
|
||||
<div style=" color: gray;font-size: 12px;font-weight: bold;">
|
||||
OC
|
||||
</div>
|
||||
<div style=" color: blue; font-size: 20px; font-weight: bold;">
|
||||
<asp:LinkButton ID="LnkIndicador_OC2" Text="" OnClick="LnkIndicador_OC_Click" runat="server" CssClass="Texto" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="col-md-1" style="text-align:right!important">
|
||||
<div id="DivIndicadorL1" runat="server" visible="false" >
|
||||
@@ -475,6 +462,19 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="text-align:right!important">
|
||||
|
||||
<div id="DivIndicadorOC2" runat="server" visible="false" >
|
||||
<div style=" color: gray;font-size: 12px;font-weight: bold;">
|
||||
OC
|
||||
</div>
|
||||
<div style=" color: blue; font-size: 20px; font-weight: bold;">
|
||||
<asp:LinkButton ID="LnkIndicador_OC2" Text="" OnClick="LnkIndicador_OC_Click" runat="server" CssClass="Texto" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
Reference in New Issue
Block a user