PopIECompras validacion exedente
This commit is contained in:
@@ -549,7 +549,12 @@
|
||||
<div class="col-xs-7">
|
||||
<asp:TextBox ID="TxtImporte" runat="server" MaxLength="12" Width="100%" ClientIDMode="Static" onkeyup="CambioTipoMoneda();" Style="text-align: right;"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="ftbe" runat="server" TargetControlID="TxtImporte" FilterType="Custom, Numbers" ValidChars="+-.," />
|
||||
<asp:RangeValidator ID="RVImporte" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue="0" ErrorMessage="Importe Excedido" ControlToValidate="TxtImporte" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:RangeValidator>
|
||||
|
||||
<%--<asp:RangeValidator ID="RVImporte" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue="0" ErrorMessage="Importe Excedido" ControlToValidate="TxtImporte" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:RangeValidator>--%>
|
||||
|
||||
<asp:CustomValidator ID="CVTxtImporte" runat="server" Enabled="true" ControlToValidate="TxtImporte" OnServerValidate="CVTxtImporte_ServerValidate"
|
||||
ErrorMessage="Importe Excedido" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:CustomValidator>
|
||||
|
||||
<asp:CustomValidator ID="CVImporteDolares" runat="server" Enabled="false" ControlToValidate="LbImporteME" OnServerValidate="CVImporteDolares_ServerValidate" ErrorMessage="Importe Excedido" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:CustomValidator>
|
||||
<asp:CustomValidator ID="CVImportePesos" runat="server" Enabled="false" ControlToValidate="LbImporteMN" OnServerValidate="CVImportePesos_ServerValidate" ErrorMessage="Importe Excedido" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:CustomValidator>
|
||||
</div>
|
||||
@@ -801,6 +806,7 @@
|
||||
CambiaPesosDolares()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
@@ -685,10 +685,10 @@ Partial Class Bancos_PopIECompras
|
||||
DdlTipoTransaccion.Enabled = True
|
||||
TxtObservaciones.Enabled = True
|
||||
BtnGuardar.Visible = True
|
||||
RVImporte.Enabled = True
|
||||
'RVImporte.Enabled = True
|
||||
|
||||
RVImporte.Enabled = True
|
||||
RVImporte.MaximumValue = dr("Saldo").ToString.ToDecimal.ToString.FormatoNumero
|
||||
'RVImporte.Enabled = True
|
||||
'RVImporte.MaximumValue = dr("Saldo").ToString.ToDecimal.ToString.FormatoNumero
|
||||
TxtImporte.Text = dr("Saldo").ToString.ToDecimal.FormatoNumero
|
||||
|
||||
SaldoVenta = dr("Saldo").ToString.ToDecimal
|
||||
@@ -1185,9 +1185,9 @@ Partial Class Bancos_PopIECompras
|
||||
GvDeudores.Columns(5).Visible = True
|
||||
GvDeudores.Columns(6).Visible = True
|
||||
|
||||
RVImporte.Enabled = False
|
||||
RVImporte.MaximumValue = "0.00"
|
||||
|
||||
'RVImporte.Enabled = False
|
||||
' RVImporte.MaximumValue = "0.00"
|
||||
|
||||
CVImporteDolares.Enabled = True
|
||||
Else
|
||||
DivTipoCambio.Visible = False
|
||||
@@ -1205,8 +1205,8 @@ Partial Class Bancos_PopIECompras
|
||||
GvDeudores.Columns(5).Visible = False
|
||||
GvDeudores.Columns(6).Visible = False
|
||||
|
||||
RVImporte.Enabled = True
|
||||
RVImporte.MaximumValue = LtlSaldo.Text.ToDecimal.ToString
|
||||
'RVImporte.Enabled = True
|
||||
'RVImporte.MaximumValue = LtlSaldo.Text.ToDecimal.ToString
|
||||
|
||||
CVImporteDolares.Enabled = False
|
||||
CVImportePesos.Enabled = False
|
||||
@@ -1244,8 +1244,8 @@ Partial Class Bancos_PopIECompras
|
||||
GvDeudores.Columns(5).Visible = True
|
||||
GvDeudores.Columns(6).Visible = True
|
||||
|
||||
RVImporte.Enabled = False
|
||||
RVImporte.MaximumValue = "0.00"
|
||||
'RVImporte.Enabled = False
|
||||
'RVImporte.MaximumValue = "0.00"
|
||||
|
||||
CVImportePesos.Enabled = True
|
||||
Else
|
||||
@@ -1262,10 +1262,10 @@ Partial Class Bancos_PopIECompras
|
||||
GvIngresos.Columns(6).Visible = False
|
||||
|
||||
GvDeudores.Columns(5).Visible = False
|
||||
GvDeudores.Columns(6).Visible = False
|
||||
|
||||
RVImporte.Enabled = True
|
||||
RVImporte.MaximumValue = LtlSaldo.Text.ToDecimal.ToString
|
||||
GvDeudores.Columns(6).Visible = False
|
||||
|
||||
' RVImporte.Enabled = True
|
||||
'RVImporte.MaximumValue = LtlSaldo.Text.ToDecimal.ToString
|
||||
|
||||
CVImporteDolares.Enabled = False
|
||||
CVImportePesos.Enabled = False
|
||||
@@ -3439,4 +3439,35 @@ Partial Class Bancos_PopIECompras
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub CVTxtImporte_ServerValidate(source As Object, args As ServerValidateEventArgs)
|
||||
|
||||
Dim Saldo As Decimal = LtlSaldo.Text.Replace("USD", "").Replace(",", "").ToDecimal
|
||||
Dim ImportePagado As Decimal = TxtImporte.Text.ToDecimal
|
||||
|
||||
If ChkPagarPesos.Checked Then
|
||||
|
||||
Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
|
||||
Dim PagoEnDollares As Decimal = (ImportePagado / TC).RoundSQL()
|
||||
|
||||
If PagoEnDollares <= Saldo Then
|
||||
args.IsValid = True
|
||||
Else
|
||||
args.IsValid = False
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
If ImportePagado <= Saldo Then
|
||||
args.IsValid = True
|
||||
Else
|
||||
args.IsValid = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -116,21 +116,30 @@
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" id="tsubprocto" style="padding-right: 2px; padding-left: 2px; display: none;">
|
||||
Proyecto:
|
||||
|
||||
</div>
|
||||
<div class="col-md-1" runat="server" id="Div1">Aplica NC/Dev:</div>
|
||||
<div class="col-md-1" id="ds" >
|
||||
<asp:DropDownList CssClass="form-control select2me input-sm" ID="DdlAplicaNC" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<%-- <asp:CheckBox ID="ChkAplicaNotaCredito" CssClass="make-switchsd" runat="server" />--%>
|
||||
|
||||
<div class="col-md-2" id="subproyecto" style="margin-top: 3px;">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6" runat="server" id="Div1">Aplica NC/Dev:</div>
|
||||
<div class="col-md-6" id="ds" >
|
||||
<asp:DropDownList CssClass="form-control select2me input-sm" ID="DdlAplicaNC" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" id="subproyecto" style="margin-top: 3px;">
|
||||
|
||||
|
||||
<div class="col-md-3" style="margin-top: 3px;">
|
||||
<asp:UpdatePanel ID="UpProgramadas" runat="server" UpdateMode="Conditional" RenderMode="Inline ">
|
||||
<ContentTemplate>
|
||||
|
||||
@@ -155,6 +164,8 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user