Validaciones en el punto de venta
This commit is contained in:
@@ -2576,7 +2576,7 @@
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabelVenta">Registrar Venta</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="modal-body" onkeydown="return (event.keyCode!=13)">
|
||||
<div class="row">
|
||||
<div id="DivDatosVenta" runat="server" class="col-md-12">
|
||||
<div class="portlet light xspadding bordered">
|
||||
@@ -2595,7 +2595,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCantidad" onkeyup="Recalcula();" Text="1" onkeypress="DisableEnterKey(event);" runat="server" CssClass="form-control " ClientIDMode="Static" MaxLength="12" ValidationGroup="GrpAddVenta" Width="60px"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtCantidad" inputmode="numeric" onkeyup="Recalcula();" Text="1" runat="server" CssClass="form-control " ClientIDMode="Static" MaxLength="12" ValidationGroup="GrpAddVenta" Width="60px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumerosCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVCantidad" runat="server" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCantidad1" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
@@ -2666,7 +2666,6 @@
|
||||
</div>
|
||||
|
||||
<div id="DivRecepcionUsados" runat="server">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label>Modelo:</label>
|
||||
@@ -2677,7 +2676,7 @@
|
||||
<div class="col-md-6">
|
||||
<label>Año:</label>
|
||||
<br />
|
||||
<asp:TextBox ID="TxtAnioVehiculo" runat="server" Height="100%" Width="100%" CssClass="form-control" CausesValidation="true" MaxLength="500"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -2709,12 +2708,6 @@
|
||||
<ajax:FilteredTextBoxExtender ID="FTBECantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:TemplateField HeaderText="Modelo" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="30%">
|
||||
<ItemTemplate>
|
||||
<asp:DropDownList ID="DdlModeloAuto" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="ModeloMarca" DataValueField="CveModeloAuto">
|
||||
</asp:DropDownList>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField HeaderText="BCI" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25%">
|
||||
<ItemTemplate>
|
||||
<asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="90%">
|
||||
@@ -2727,22 +2720,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- <br />
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<label>BCI:</label>
|
||||
<br />
|
||||
<asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="200px">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
<br />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" onkeypress="setFocus(event,'LbAgregar');" onkeyup="Recalcula();" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="GrpAddVenta" Width="76px" CssClass="form-control "></asp:TextBox>
|
||||
<asp:TextBox ID="TxtPrecio" inputmode="numeric" runat="server" onkeyup="Recalcula();" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="GrpAddVenta" Width="76px" CssClass="form-control "></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" TargetControlID="TxtPrecio" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVPrecio" runat="server" ControlToValidate="TxtPrecio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCPrecio" runat="server" HighlightCssClass="vco" TargetControlID="RFVPrecio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
@@ -2753,7 +2736,7 @@
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtDescuento" runat="server" onkeypress="setFocus(event,'LbAgregar');" onkeyup="Recalcula();" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="GrpAddVenta" Width="100px" CssClass="form-control "></asp:TextBox>
|
||||
<asp:TextBox ID="TxtDescuento" inputmode="numeric" runat="server" onkeyup="Recalcula();" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="GrpAddVenta" Width="100px" CssClass="form-control "></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="TxtDescuento" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:CustomValidator ID="CVDescuento" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtDescuento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descuento''</b> no tiene el formato correcto. Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GrpAddVenta"></asp:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="CVDescuento" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
@@ -2777,7 +2760,7 @@
|
||||
</div>
|
||||
<div class="col-md-6" align="right" id="divagregrarotrops" runat="server">
|
||||
<label>Agregar otro Producto:</label>
|
||||
<asp:CheckBox ID="ChkAgregar" runat="server" Checked="true" />
|
||||
<asp:CheckBox ID="ChkAgregar" runat="server" Checked="true" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -2988,7 +2971,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" />
|
||||
<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" UseSubmitBehavior="false" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3000,8 +2983,8 @@
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpAgregar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnCalculaMesesUso" Text="" OnClick="BtnCalculaMesesUso_Click" ClientIDMode="Static" Style="display: none;" runat="server" />
|
||||
<asp:Button ClientIDMode="Static" ID="LnkAgregarPS" OnClick="LnkAgregarPS_Click" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpAddVenta" />
|
||||
<%-- <asp:Button ID="BtnCalculaMesesUso" Text="" OnClick="BtnCalculaMesesUso_Click" ClientIDMode="Static" Style="display: none;" runat="server" />--%>
|
||||
<asp:Button ClientIDMode="Static" ID="LnkAgregarPS" OnClick="LnkAgregarPS_Click" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpAddVenta" UseSubmitBehavior="false" />
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -3067,9 +3050,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
function CalculaMesesUso() {
|
||||
$get("BtnCalculaMesesUso").click();
|
||||
}
|
||||
//function CalculaMesesUso() {
|
||||
// $get("BtnCalculaMesesUso").click();
|
||||
//}
|
||||
|
||||
function ConvertirDllsPesos() {
|
||||
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) * ToDouble($get('TxtTipoCambio').value), 2)
|
||||
|
||||
@@ -1097,7 +1097,7 @@ Partial Class PV
|
||||
'ImgCerrarEstadoCaja.Attributes.Add("OnClick", "$('#DivEstadoCaja').hide();")
|
||||
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
||||
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMonto();")
|
||||
TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();")
|
||||
'TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();")
|
||||
|
||||
CreaDTmpC()
|
||||
CreaDTmpF()
|
||||
@@ -5917,13 +5917,20 @@ Partial Class PV
|
||||
TxtPrecio.Enabled = Not Dr("CveVenta").ToString.ToEntero > 0
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
|
||||
CalculaMesesUso()
|
||||
End Sub
|
||||
'Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
|
||||
' CalculaMesesUso()
|
||||
'End Sub
|
||||
|
||||
Private Sub CalculaMesesUso()
|
||||
Private Function CalculaMesesUso() As Boolean
|
||||
Dim FechaI As Date = TxtFechaAjuste.Text.ToDate.AddDays(1)
|
||||
Dim FechaF As Date = Now
|
||||
|
||||
If FechaI.AddDays(-1) > FechaF Then
|
||||
TxtFechaAjuste.Text = FechaF.ToString("dd/MM/yyyy")
|
||||
Alert("La fecha de ajuste debe ser menor a la fecha actual", TipoMensaje.ToastAdventencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim Dia As Integer = FechaI.Day
|
||||
Try
|
||||
'validación adicional, para saber si el mes tiene 31 días y el actua es menor.
|
||||
@@ -5941,16 +5948,15 @@ Partial Class PV
|
||||
|
||||
TxtMesesUso.Text = MesesTrascurridos.ToString
|
||||
|
||||
CalculaPorcentajeAjuste()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al calcular los meses de uso", ex)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs)
|
||||
If DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
Dim Contador As Integer = 1
|
||||
Dim PUFactura As Decimal = 0
|
||||
For Each Dr As DataRow In DtPUFacturas.Rows
|
||||
@@ -5960,7 +5966,6 @@ Partial Class PV
|
||||
Contador += 1
|
||||
Next
|
||||
TxtPUFactura.Text = PUFactura.FormatoNumero(2)
|
||||
|
||||
End If
|
||||
|
||||
If DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero <= 0 Then
|
||||
@@ -6000,8 +6005,9 @@ Partial Class PV
|
||||
If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
|
||||
TxtPUFactura.Text = ""
|
||||
End If
|
||||
|
||||
CalculaPorcentajeAjuste()
|
||||
If DdlPSAjuste.SelectedValue.ToEntero() > 0 Then
|
||||
CalculaPorcentajeAjuste()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlTipoUso_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
@@ -6021,6 +6027,9 @@ Partial Class PV
|
||||
Alert("No se ha especificado producto de ajuste a entregar")
|
||||
Exit Sub
|
||||
End If
|
||||
If Not CalculaMesesUso() Then
|
||||
Exit Sub
|
||||
End If
|
||||
Try
|
||||
TxtImporteAjuste.Text = "0.00"
|
||||
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" AndAlso DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
@@ -6282,12 +6291,13 @@ Partial Class PV
|
||||
Dim Retorno As Boolean = True
|
||||
|
||||
If Modalidad = "U" Then
|
||||
If TmpDTRecepcionUsados.Rows.Count > 0 Then
|
||||
If TmpDTPolizaVirtual.Rows.Count > 0 Then
|
||||
Dim Elimino As Boolean = False
|
||||
For Each RowPoliza As DataRow In TmpDTPolizaVirtual.Rows
|
||||
If RowPoliza("CvePS").ToString().ToEntero() = CvePS Then
|
||||
RowPoliza.Delete()
|
||||
Elimino = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Elimino Then
|
||||
|
||||
Reference in New Issue
Block a user