PopIECompras validacion exedente
This commit is contained in:
@@ -549,7 +549,12 @@
|
|||||||
<div class="col-xs-7">
|
<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>
|
<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="+-.," />
|
<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="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>
|
<asp:CustomValidator ID="CVImportePesos" runat="server" Enabled="false" ControlToValidate="LbImporteMN" OnServerValidate="CVImportePesos_ServerValidate" ErrorMessage="Importe Excedido" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:CustomValidator>
|
||||||
</div>
|
</div>
|
||||||
@@ -801,6 +806,7 @@
|
|||||||
CambiaPesosDolares()
|
CambiaPesosDolares()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -685,10 +685,10 @@ Partial Class Bancos_PopIECompras
|
|||||||
DdlTipoTransaccion.Enabled = True
|
DdlTipoTransaccion.Enabled = True
|
||||||
TxtObservaciones.Enabled = True
|
TxtObservaciones.Enabled = True
|
||||||
BtnGuardar.Visible = True
|
BtnGuardar.Visible = True
|
||||||
RVImporte.Enabled = True
|
'RVImporte.Enabled = True
|
||||||
|
|
||||||
RVImporte.Enabled = True
|
'RVImporte.Enabled = True
|
||||||
RVImporte.MaximumValue = dr("Saldo").ToString.ToDecimal.ToString.FormatoNumero
|
'RVImporte.MaximumValue = dr("Saldo").ToString.ToDecimal.ToString.FormatoNumero
|
||||||
TxtImporte.Text = dr("Saldo").ToString.ToDecimal.FormatoNumero
|
TxtImporte.Text = dr("Saldo").ToString.ToDecimal.FormatoNumero
|
||||||
|
|
||||||
SaldoVenta = dr("Saldo").ToString.ToDecimal
|
SaldoVenta = dr("Saldo").ToString.ToDecimal
|
||||||
@@ -1185,9 +1185,9 @@ Partial Class Bancos_PopIECompras
|
|||||||
GvDeudores.Columns(5).Visible = True
|
GvDeudores.Columns(5).Visible = True
|
||||||
GvDeudores.Columns(6).Visible = True
|
GvDeudores.Columns(6).Visible = True
|
||||||
|
|
||||||
RVImporte.Enabled = False
|
'RVImporte.Enabled = False
|
||||||
RVImporte.MaximumValue = "0.00"
|
' RVImporte.MaximumValue = "0.00"
|
||||||
|
|
||||||
CVImporteDolares.Enabled = True
|
CVImporteDolares.Enabled = True
|
||||||
Else
|
Else
|
||||||
DivTipoCambio.Visible = False
|
DivTipoCambio.Visible = False
|
||||||
@@ -1205,8 +1205,8 @@ Partial Class Bancos_PopIECompras
|
|||||||
GvDeudores.Columns(5).Visible = False
|
GvDeudores.Columns(5).Visible = False
|
||||||
GvDeudores.Columns(6).Visible = False
|
GvDeudores.Columns(6).Visible = False
|
||||||
|
|
||||||
RVImporte.Enabled = True
|
'RVImporte.Enabled = True
|
||||||
RVImporte.MaximumValue = LtlSaldo.Text.ToDecimal.ToString
|
'RVImporte.MaximumValue = LtlSaldo.Text.ToDecimal.ToString
|
||||||
|
|
||||||
CVImporteDolares.Enabled = False
|
CVImporteDolares.Enabled = False
|
||||||
CVImportePesos.Enabled = False
|
CVImportePesos.Enabled = False
|
||||||
@@ -1244,8 +1244,8 @@ Partial Class Bancos_PopIECompras
|
|||||||
GvDeudores.Columns(5).Visible = True
|
GvDeudores.Columns(5).Visible = True
|
||||||
GvDeudores.Columns(6).Visible = True
|
GvDeudores.Columns(6).Visible = True
|
||||||
|
|
||||||
RVImporte.Enabled = False
|
'RVImporte.Enabled = False
|
||||||
RVImporte.MaximumValue = "0.00"
|
'RVImporte.MaximumValue = "0.00"
|
||||||
|
|
||||||
CVImportePesos.Enabled = True
|
CVImportePesos.Enabled = True
|
||||||
Else
|
Else
|
||||||
@@ -1262,10 +1262,10 @@ Partial Class Bancos_PopIECompras
|
|||||||
GvIngresos.Columns(6).Visible = False
|
GvIngresos.Columns(6).Visible = False
|
||||||
|
|
||||||
GvDeudores.Columns(5).Visible = False
|
GvDeudores.Columns(5).Visible = False
|
||||||
GvDeudores.Columns(6).Visible = False
|
GvDeudores.Columns(6).Visible = False
|
||||||
|
|
||||||
RVImporte.Enabled = True
|
' RVImporte.Enabled = True
|
||||||
RVImporte.MaximumValue = LtlSaldo.Text.ToDecimal.ToString
|
'RVImporte.MaximumValue = LtlSaldo.Text.ToDecimal.ToString
|
||||||
|
|
||||||
CVImporteDolares.Enabled = False
|
CVImporteDolares.Enabled = False
|
||||||
CVImportePesos.Enabled = False
|
CVImportePesos.Enabled = False
|
||||||
@@ -3439,4 +3439,35 @@ Partial Class Bancos_PopIECompras
|
|||||||
End Sub
|
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
|
End Class
|
||||||
@@ -116,21 +116,30 @@
|
|||||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-1" id="tsubprocto" style="padding-right: 2px; padding-left: 2px; display: none;">
|
<div class="col-md-1" id="tsubprocto" style="padding-right: 2px; padding-left: 2px; display: none;">
|
||||||
Proyecto:
|
Proyecto:
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1" runat="server" id="Div1">Aplica NC/Dev:</div>
|
|
||||||
<div class="col-md-1" id="ds" >
|
<div class="col-md-2" id="subproyecto" style="margin-top: 3px;">
|
||||||
<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>
|
<div class="row">
|
||||||
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
|
<div class="col-md-6" runat="server" id="Div1">Aplica NC/Dev:</div>
|
||||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
<div class="col-md-6" id="ds" >
|
||||||
</asp:DropDownList>
|
<asp:DropDownList CssClass="form-control select2me input-sm" ID="DdlAplicaNC" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="100%">
|
||||||
<%-- <asp:CheckBox ID="ChkAplicaNotaCredito" CssClass="make-switchsd" runat="server" />--%>
|
<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>
|
||||||
|
|
||||||
<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 ">
|
<asp:UpdatePanel ID="UpProgramadas" runat="server" UpdateMode="Conditional" RenderMode="Inline ">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
@@ -155,6 +164,8 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user