Validaciones de año del vehiculo, cod ensamble en motobaterias

This commit is contained in:
2022-04-05 17:16:38 -07:00
parent a7ca580fcc
commit 28dfee3776
2 changed files with 226 additions and 217 deletions

View File

@@ -2783,6 +2783,7 @@
<asp:HiddenField ID="HdnAplicaIEPS" runat="server" Value="-1" /> <asp:HiddenField ID="HdnAplicaIEPS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnPorcentajeIEPS" runat="server" Value="-1" /> <asp:HiddenField ID="HdnPorcentajeIEPS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnCvePS" runat="server" Value="-1" /> <asp:HiddenField ID="HdnCvePS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnCveClasificacion" runat="server" Value="-1" ClientIDMode="Static" />
<div class="row" runat="server" visible="false"> <div class="row" runat="server" visible="false">
<div class="col-md-12"> <div class="col-md-12">
@@ -2847,10 +2848,6 @@
</div> </div>
</div> </div>
<div class="portlet-body form"> <div class="portlet-body form">
<asp:UpdatePanel runat="server" ID="UPPDatosUsado" UpdateMode="Conditional">
<ContentTemplate>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label>Tipo Servicio:</label> <label>Tipo Servicio:</label>
@@ -2871,7 +2868,7 @@
<div class="col-md-4"> <div class="col-md-4">
<label>Año:</label> <label>Año:</label>
<br /> <br />
<asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control" ></asp:TextBox> <asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control"></asp:TextBox>
<asp:CustomValidator ID="CVAnio" runat="server" ClientValidationFunction="ValidaAnioVehiculo" ValidateEmptyText="true" ControlToValidate="TxtAnioVehiculo" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Año''</b> esta vacío o no tiene el formato correcto, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:CustomValidator> <asp:CustomValidator ID="CVAnio" runat="server" ClientValidationFunction="ValidaAnioVehiculo" ValidateEmptyText="true" ControlToValidate="TxtAnioVehiculo" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Año''</b> esta vacío o no tiene el formato correcto, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:CustomValidator>
</div> </div>
</div> </div>
@@ -2886,7 +2883,7 @@
<label>BCI:</label> <label>BCI:</label>
<br /> <br />
<asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%"> <asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@@ -2913,15 +2910,10 @@
</div> </div>
</div> </div>
</div> </div>
</ContentTemplate>
</asp:UpdatePanel>
</div> </div>
</div> </div>
</div> </div>
<br /> <br />
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
@@ -3053,7 +3045,7 @@
<asp:DropDownList ID="DdlBCIAjuste" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%" AutoPostBack="true"> <asp:DropDownList ID="DdlBCIAjuste" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%" AutoPostBack="true">
</asp:DropDownList> </asp:DropDownList>
<label for="<%= DdlBCIAjuste.ClientID.ToString()%>">BCI:</label> <label for="<%= DdlBCIAjuste.ClientID.ToString()%>">BCI:</label>
<asp:RequiredFieldValidator ID="RFVBCIAjuste" runat="server" ControlToValidate="DdlBCIAjuste" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''BCI''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVBCIAjuste" runat="server" ControlToValidate="DdlBCIAjuste" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''BCI''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEBCIAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVBCIAjuste" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEBCIAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVBCIAjuste" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
@@ -3087,7 +3079,7 @@
<div class="col-md-8"> <div class="col-md-8">
<div id="DivCodEnsamble" runat="server" class="form-group form-md-line-input input-iconright"> <div id="DivCodEnsamble" runat="server" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" /> <asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ValidateEmptyText="true" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label> <label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label>
</div> </div>
</div> </div>
@@ -3278,13 +3270,16 @@
} }
function ValidaAnioVehiculo(val, args) { function ValidaAnioVehiculo(val, args) {
//VALIDA SOLO SI SE SELECCIONO UN USADO var today = new Date();
var cveUsado = ToDouble($get("C_DdlRecepcionUsados").value); var anioActual = today.getFullYear();
if (cveUsado > 0) {
let CveClasificacion = HdnCveClasificacion.value;
const acumuladores = "20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229";
if (acumuladores.includes(CveClasificacion)) {
var anio = ToDouble(args.Value); var anio = ToDouble(args.Value);
if (anio > 0) { if (anio > 0) {
var valido = true; var valido = true;
if (anio < 1900) { if (anio <= 1900 || anio > anioActual) {
valido = false; valido = false;
} }
if (anio.toString().length != 4) { if (anio.toString().length != 4) {
@@ -3305,18 +3300,33 @@
//MARCA OPTIMA //MARCA OPTIMA
if (CveMarca == "1086") { if (CveMarca == "1086") {
let regex = new RegExp("^[0-9]+$"); //SI NO ES REQUERIDO, PONER COMO VALIDO
arguments.IsValid = regex.test(arguments.Value); if (!arguments.Value) {
arguments.IsValid = true;
} else {
let regex = new RegExp("^[0-9]+$");
arguments.IsValid = regex.test(arguments.Value);
}
return; return;
//MARCA MOTOBATERIAS //MARCA MOTOBATERIAS
} else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") { } else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") {
let regex = new RegExp("^[A-L][0-9][0-9A-Z][A-Q][JAVY]$"); //EN MOTOBATERIAS ES REQUERIDO
arguments.IsValid = regex.test(arguments.Value); if (!arguments.Value) {
arguments.IsValid = false;
} else {
let regex = new RegExp("^[A-L][0-9][0-9A-Z][A-Q][JAVY]$");
arguments.IsValid = regex.test(arguments.Value);
}
return; return;
//AUTOMOTRIZ-ACUMULADORES //AUTOMOTRIZ-ACUMULADORES
} else { } else {
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M][0-3][0-9][A-Z][ACEN][2-5]$"); //SI NO ES REQUERIDO, PONER COMO VALIDO
arguments.IsValid = regex.test(arguments.Value); if (!arguments.Value) {
arguments.IsValid = true;
} else {
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M][0-3][0-9][A-Z][ACEN][2-5]$");
arguments.IsValid = regex.test(arguments.Value);
}
return; return;
} }
} }
@@ -3482,13 +3492,13 @@
var Descuento = parseFloat($get("TxtPorDescP").value); var Descuento = parseFloat($get("TxtPorDescP").value);
var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value); var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value);
if (PorcentajeDescuentoMaximo > 0 && Descuento > PorcentajeDescuentoMaximo) { if (PorcentajeDescuentoMaximo > 0 && Descuento > PorcentajeDescuentoMaximo) {
$get("TxtDescP").value = "0"; $get("TxtDescP").value = "0";
$get("TxtPorDescP").value = "0"; $get("TxtPorDescP").value = "0";
Descuento = 0; Descuento = 0;
alert("No puede exceder el descuento maximo autorizado."); alert("No puede exceder el descuento maximo autorizado.");
} }
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ','); $get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
@@ -3500,7 +3510,7 @@
if (TipoDescuento == 2) { if (TipoDescuento == 2) {
$get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ','); $get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ',');
} }
} }
else { else {
$get("LblPrecioFinal").innerText = "0.00"; $get("LblPrecioFinal").innerText = "0.00";
@@ -3547,10 +3557,10 @@
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ','); $get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = (Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""))) ; var Total = (Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")));
$get("LblDescuentoAdicional").innerText = formato_numero(Total, 2, '.', ','); $get("LblDescuentoAdicional").innerText = formato_numero(Total, 2, '.', ',');
//SUMA EL DESCUENTO YA EXISTENTE AL ORIGINAL //SUMA EL DESCUENTO YA EXISTENTE AL ORIGINAL
Total = Total + MontoOriginal; Total = Total + MontoOriginal;
@@ -3694,8 +3704,7 @@
$("#LblSubTotal1").text($("#TxtSubTotal").val()); $("#LblSubTotal1").text($("#TxtSubTotal").val());
} }
function AbrirModalDescuentoAdicional() function AbrirModalDescuentoAdicional() {
{
$('#ModalDescuento').modal(); $('#ModalDescuento').modal();
$get('LblTitulo1').style.display = ''; $get('LblTitulo1').style.display = '';
$get('LblTitulo2').style.display = 'none'; $get('LblTitulo2').style.display = 'none';
@@ -3916,215 +3925,215 @@
var ValorTxt = Obj.value; var ValorTxt = Obj.value;
var suma = 0; var suma = 0;
var total = parseFloat($('#<%= LblSaldoVenta.ClientID%>').text().replace(',', '')); var total = parseFloat($('#<%= LblSaldoVenta.ClientID%>').text().replace(',', ''));
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) { $('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val()) var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 } if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma; suma = currentsaldo + suma;
}); });
var txtvalue = (total - suma) + parseFloat(ValorTxt); var txtvalue = (total - suma) + parseFloat(ValorTxt);
if (txtvalue < 0) { txtvalue = 0; } if (txtvalue < 0) { txtvalue = 0; }
if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); } if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); }
if (isNaN(ValorTxt)) if (isNaN(ValorTxt))
ValorTxt = 0; ValorTxt = 0;
if (isNaN(Monto)) if (isNaN(Monto))
Monto = 0; Monto = 0;
if (parseFloat(ValorTxt) < 0) { if (parseFloat(ValorTxt) < 0) {
ValorTxt = 0; ValorTxt = 0;
Obj.value = 0; Obj.value = 0;
}
if (parseFloat(ValorTxt) > parseFloat(Monto)) {
alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto;
}
// else {
// if (parseFloat(Obj.value) > parseFloat($get("HdnAnticipos").value))
// $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) + (parseFloat($get("HdnAnticipos").value) + parseFloat(ValorTxt));
// else if (parseFloat(Obj.value) < parseFloat($get("HdnAnticipos").value))
// $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) - (parseFloat($get("HdnAnticipos").value) - parseFloat(ValorTxt));
// }
// SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ','));
}
function ImprimirCotizacion() {
__doPostBack('ctl00$HB$LNKImprimirCotizacion', '');
}
function SetText2(ObjTo, Value) {
ObjTo.innerText = Value;
} }
function ValidarCantidad(t, c) { if (parseFloat(ValorTxt) > parseFloat(Monto)) {
if (t.value > c) { alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto;
t.value = c;
}
} }
function Comma(Num) { //function to add commas to textboxes
Num += '';
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
x = Num.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
}
function AddCodigoBarrasSerie(e) { // else {
if (e.keyCode == 13 || e.which == 13) { // if (parseFloat(Obj.value) > parseFloat($get("HdnAnticipos").value))
$('#BtnCodigoBarrasSerie').click(); // $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) + (parseFloat($get("HdnAnticipos").value) + parseFloat(ValorTxt));
} // else if (parseFloat(Obj.value) < parseFloat($get("HdnAnticipos").value))
} // $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) - (parseFloat($get("HdnAnticipos").value) - parseFloat(ValorTxt));
// }
// SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ','));
}
function ImprimirCotizacion() {
__doPostBack('ctl00$HB$LNKImprimirCotizacion', '');
}
function SetText2(ObjTo, Value) {
ObjTo.innerText = Value;
}
//SERIE PS function ValidarCantidad(t, c) {
function SeriePS(e, b, txt, hdn) { if (t.value > c) {
debugger;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
}
function SeriePSBlur(b, txt, hdn) { t.value = c;
debugger; }
}
function Comma(Num) { //function to add commas to textboxes
Num += '';
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
x = Num.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
}
function AddCodigoBarrasSerie(e) {
if (e.keyCode == 13 || e.which == 13) {
$('#BtnCodigoBarrasSerie').click();
}
}
//SERIE PS
function SeriePS(e, b, txt, hdn) {
debugger;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) { if (txt.value != "" && txt.value != hdn.value) {
$(b).click(); $(b).click();
} }
} }
}
//SERIE-LOTE INV function SeriePSBlur(b, txt, hdn) {
var H1 = ""; debugger;
var H2 = ""; if (txt.value != "" && txt.value != hdn.value) {
var T = ""; $(b).click();
function EnterAFEdit(event, Txt, Hdn1, Hdn2) {
if (event.which == 13 || event.keyCode == 13) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
} }
}
function AFBlurEdit(Txt, Hdn1, Hdn2) { //SERIE-LOTE INV
if (Txt.value.length > 0 && Txt.value != Hdn2.value) { var H1 = "";
H1 = Hdn1; var H2 = "";
H2 = Hdn2; var T = "";
T = Txt;
$get("HdnCodAFEdit").value = Txt.value; function EnterAFEdit(event, Txt, Hdn1, Hdn2) {
$('#BtnVinculaAFEdit').click(); if (event.which == 13 || event.keyCode == 13) {
} H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
} }
}
function EnterAFEditOK(Cve, Codigo) { function AFBlurEdit(Txt, Hdn1, Hdn2) {
$get(H1.id).value = Cve; if (Txt.value.length > 0 && Txt.value != Hdn2.value) {
$get(H2.id).value = Codigo; H1 = Hdn1;
$get(T.id).value = (Codigo == -1) ? "" : Codigo; H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
} }
}
//Suma Totales function EnterAFEditOK(Cve, Codigo) {
function FnSuma() { $get(H1.id).value = Cve;
debugger; $get(H2.id).value = Codigo;
$get(T.id).value = (Codigo == -1) ? "" : Codigo;
$get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2); }
var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS').value) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value);
$("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () { //Suma Totales
totalVenta -= ToDouble($(this).val().toString()); function FnSuma() {
}); debugger;
$get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2);
var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS').value) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value);
$("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () {
totalVenta -= ToDouble($(this).val().toString());
});
$('#TxtTotal').attr('value', FormatoNumero(totalVenta, 2)); $('#TxtTotal').attr('value', FormatoNumero(totalVenta, 2));
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2); $get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
} }
function chkAnt(t, txt, importe) { function chkAnt(t, txt, importe) {
debugger; debugger;
$get("HdnTipoDescuento").value = "3"; $get("HdnTipoDescuento").value = "3";
var Total = ToDouble($get('TxtTotal').value); var Total = ToDouble($get('TxtTotal').value);
var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2)); var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (t.checked) { if (t.checked) {
if (SaldoCompra > 0) { if (SaldoCompra > 0) {
if (SaldoCompra > importe) { if (SaldoCompra > importe) {
txt.value = importe.toFixed(2); txt.value = importe.toFixed(2);
SaldoCompra = SaldoCompra - importe; SaldoCompra = SaldoCompra - importe;
$get('HdnVentaSaldo').value = SaldoCompra; $get('HdnVentaSaldo').value = SaldoCompra;
} else {
txt.value = SaldoCompra.toFixed(2);
SaldoCompra = 0.00;
$get('HdnVentaSaldo').value = SaldoCompra;
}
} else { } else {
t.checked = false; txt.value = SaldoCompra.toFixed(2);
SaldoCompra = 0.00;
$get('HdnVentaSaldo').value = SaldoCompra;
} }
} else { } else {
t.checked = false;
$get('HdnVentaSaldo').value = parseFloat(SaldoCompra) + parseFloat(txt.value);
txt.value = "";
} }
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2)); } else {
$get('HdnVentaSaldo').value = parseFloat(SaldoCompra) + parseFloat(txt.value);
txt.value = "";
} }
function FnCambiaAnt(chk, txt, saldo) { $("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
var Total = ToDouble($get('TxtTotal').value);
var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2)); }
if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;
if (ToDouble(txt.value) > 0) { function FnCambiaAnt(chk, txt, saldo) {
chk.checked = true;
} else {
chk.checked = false;
}
if (ToDouble(txt.value) > saldo) { var Total = ToDouble($get('TxtTotal').value);
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo"); var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
} if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
debugger; //minimo entre saldocompra y el saldoanticipo
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2)); if (SaldoCompra < saldo) saldo = SaldoCompra;
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
if (ToDouble(txt.value) > 0) {
chk.checked = true;
} else {
chk.checked = false;
} }
function FnSumaValoresAnt() { if (ToDouble(txt.value) > saldo) {
var totalPoints = 0; txt.value = saldo;
var t = ''; alert("El Importe no debe de exceder a el saldo");
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
return Math.round(totalPoints * 100) / 100;
} }
debugger;
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
}
function showDivEC() { function FnSumaValoresAnt() {
var totalPoints = 0;
var t = '';
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
return Math.round(totalPoints * 100) / 100;
}
function showDivEC() {
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('#<%= TxtDireccionCliente.ClientID %>').val(''); $('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val(''); $('#<%= TxtNumExtCliente.ClientID %>').val('');
$('#<%= TxtNumIntCliente.ClientID %>').val(''); $('#<%= TxtNumIntCliente.ClientID %>').val('');

View File

@@ -4031,6 +4031,7 @@ Partial Class PV
HdnTipoInv.Value = drPS("Inv_CveMetodoInventario").ToString HdnTipoInv.Value = drPS("Inv_CveMetodoInventario").ToString
HdnAplicaIEPS.Value = drPS("AplicaIEPS").ToString HdnAplicaIEPS.Value = drPS("AplicaIEPS").ToString
HdnPorcentajeIEPS.Value = drPS("IEPSPorcentaje").ToString HdnPorcentajeIEPS.Value = drPS("IEPSPorcentaje").ToString
HdnCveClasificacion.Value = drPS("CveClasificacion").ToString
'Muestra la tabla de tamaños 'Muestra la tabla de tamaños
If drPS("CveTamaño").ToString().ToEntero() > 0 Then If drPS("CveTamaño").ToString().ToEntero() > 0 Then
DivRecepcionUsados.Visible = True DivRecepcionUsados.Visible = True
@@ -4736,6 +4737,7 @@ Partial Class PV
HdnCodigoPS.Value = "-1" HdnCodigoPS.Value = "-1"
HdnTipoPS.Value = "-1" HdnTipoPS.Value = "-1"
HdnTipoInv.Value = "-1" HdnTipoInv.Value = "-1"
HdnCveClasificacion.Value = "-1"
DdlClasificacion.SelectedIndex = 0 DdlClasificacion.SelectedIndex = 0
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
@@ -5360,33 +5362,26 @@ Partial Class PV
Exit Sub Exit Sub
End If End If
If DrPS IsNot Nothing Then End If
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
If DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
If String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
Alert("El campo año esta vacío.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then If DrPS IsNot Nothing Then
Alert("El campo año debe ser mayor a 1900.", TipoMensaje.MsgAdvertencia) 'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
Exit Sub If DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
End If If String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
Alert("El campo año esta vacío.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If TxtAnioVehiculo.Text.ToDecimal() <= 1900 Then
Alert("El campo año debe ser mayor a 1900.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If TxtAnioVehiculo.Text.ToDecimal() > Now.Year Then
Alert("El campo año no puede ser mayor al año actual.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If End If
End If End If
Else
If DrPS IsNot Nothing Then
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
If DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
If Not String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then
Alert("El año del vehiculo del vehículo no tiene el formato correcto.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
End If
End If End If
@@ -5448,9 +5443,14 @@ Partial Class PV
PU = ObjDescuento.PU PU = ObjDescuento.PU
End If End If
Dim RowSP As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
Dim CveProyecto As Integer = -1 '
Dim Proyecto As String = ""
Dim CveProyecto As Integer = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveProyecto").ToString.ToEntero If RowSP IsNot Nothing Then
Dim Proyecto As String = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("Proyecto").ToString CveProyecto = RowSP("CveProyecto").ToString.ToEntero
Proyecto = RowSP("Proyecto").ToString
End If
Dim Consec = AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, Dim Consec = AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text,
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento, CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,