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="HdnPorcentajeIEPS" 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="col-md-12">
@@ -2847,10 +2848,6 @@
</div>
</div>
<div class="portlet-body form">
<asp:UpdatePanel runat="server" ID="UPPDatosUsado" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-4">
<label>Tipo Servicio:</label>
@@ -2871,7 +2868,7 @@
<div class="col-md-4">
<label>Año:</label>
<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>
</div>
</div>
@@ -2886,7 +2883,7 @@
<label>BCI:</label>
<br />
<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 class="row">
@@ -2913,15 +2910,10 @@
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-3">
<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>
<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>
</div>
</div>
@@ -3087,7 +3079,7 @@
<div class="col-md-8">
<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: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>
</div>
</div>
@@ -3278,13 +3270,16 @@
}
function ValidaAnioVehiculo(val, args) {
//VALIDA SOLO SI SE SELECCIONO UN USADO
var cveUsado = ToDouble($get("C_DdlRecepcionUsados").value);
if (cveUsado > 0) {
var today = new Date();
var anioActual = today.getFullYear();
let CveClasificacion = HdnCveClasificacion.value;
const acumuladores = "20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229";
if (acumuladores.includes(CveClasificacion)) {
var anio = ToDouble(args.Value);
if (anio > 0) {
var valido = true;
if (anio < 1900) {
if (anio <= 1900 || anio > anioActual) {
valido = false;
}
if (anio.toString().length != 4) {
@@ -3305,18 +3300,33 @@
//MARCA OPTIMA
if (CveMarca == "1086") {
let regex = new RegExp("^[0-9]+$");
arguments.IsValid = regex.test(arguments.Value);
//SI NO ES REQUERIDO, PONER COMO VALIDO
if (!arguments.Value) {
arguments.IsValid = true;
} else {
let regex = new RegExp("^[0-9]+$");
arguments.IsValid = regex.test(arguments.Value);
}
return;
//MARCA MOTOBATERIAS
} else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") {
let regex = new RegExp("^[A-L][0-9][0-9A-Z][A-Q][JAVY]$");
arguments.IsValid = regex.test(arguments.Value);
//EN MOTOBATERIAS ES REQUERIDO
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;
//AUTOMOTRIZ-ACUMULADORES
} 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);
//SI NO ES REQUERIDO, PONER COMO VALIDO
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;
}
}
@@ -3482,13 +3492,13 @@
var Descuento = parseFloat($get("TxtPorDescP").value);
var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value);
if (PorcentajeDescuentoMaximo > 0 && Descuento > PorcentajeDescuentoMaximo) {
$get("TxtDescP").value = "0";
$get("TxtPorDescP").value = "0";
Descuento = 0;
alert("No puede exceder el descuento maximo autorizado.");
}
}
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
@@ -3500,7 +3510,7 @@
if (TipoDescuento == 2) {
$get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ',');
}
}
else {
$get("LblPrecioFinal").innerText = "0.00";
@@ -3547,10 +3557,10 @@
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 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, '.', ',');
//SUMA EL DESCUENTO YA EXISTENTE AL ORIGINAL
Total = Total + MontoOriginal;
@@ -3694,8 +3704,7 @@
$("#LblSubTotal1").text($("#TxtSubTotal").val());
}
function AbrirModalDescuentoAdicional()
{
function AbrirModalDescuentoAdicional() {
$('#ModalDescuento').modal();
$get('LblTitulo1').style.display = '';
$get('LblTitulo2').style.display = 'none';
@@ -3916,215 +3925,215 @@
var ValorTxt = Obj.value;
var suma = 0;
var total = parseFloat($('#<%= LblSaldoVenta.ClientID%>').text().replace(',', ''));
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma;
});
var txtvalue = (total - suma) + parseFloat(ValorTxt);
if (txtvalue < 0) { txtvalue = 0; }
if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); }
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma;
});
var txtvalue = (total - suma) + parseFloat(ValorTxt);
if (txtvalue < 0) { txtvalue = 0; }
if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); }
if (isNaN(ValorTxt))
ValorTxt = 0;
if (isNaN(Monto))
Monto = 0;
if (parseFloat(ValorTxt) < 0) {
ValorTxt = 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;
if (isNaN(ValorTxt))
ValorTxt = 0;
if (isNaN(Monto))
Monto = 0;
if (parseFloat(ValorTxt) < 0) {
ValorTxt = 0;
Obj.value = 0;
}
function ValidarCantidad(t, c) {
if (t.value > c) {
t.value = c;
}
if (parseFloat(ValorTxt) > parseFloat(Monto)) {
alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto;
}
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();
}
}
// 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;
}
//SERIE PS
function SeriePS(e, b, txt, hdn) {
debugger;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
}
function ValidarCantidad(t, c) {
if (t.value > c) {
function SeriePSBlur(b, txt, hdn) {
debugger;
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) {
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) {
$(b).click();
}
}
}
//SERIE-LOTE INV
var H1 = "";
var H2 = "";
var T = "";
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 SeriePSBlur(b, txt, hdn) {
debugger;
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
function AFBlurEdit(Txt, Hdn1, Hdn2) {
if (Txt.value.length > 0 && Txt.value != Hdn2.value) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
//SERIE-LOTE INV
var H1 = "";
var H2 = "";
var T = "";
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 EnterAFEditOK(Cve, Codigo) {
$get(H1.id).value = Cve;
$get(H2.id).value = Codigo;
$get(T.id).value = (Codigo == -1) ? "" : Codigo;
function AFBlurEdit(Txt, Hdn1, Hdn2) {
if (Txt.value.length > 0 && Txt.value != Hdn2.value) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
}
//Suma Totales
function FnSuma() {
debugger;
function EnterAFEditOK(Cve, Codigo) {
$get(H1.id).value = Cve;
$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 () {
totalVenta -= ToDouble($(this).val().toString());
});
//Suma Totales
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));
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
$('#TxtTotal').attr('value', FormatoNumero(totalVenta, 2));
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
}
}
function chkAnt(t, txt, importe) {
debugger;
$get("HdnTipoDescuento").value = "3";
var Total = ToDouble($get('TxtTotal').value);
function chkAnt(t, txt, importe) {
debugger;
$get("HdnTipoDescuento").value = "3";
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 > importe) {
txt.value = importe.toFixed(2);
SaldoCompra = SaldoCompra - importe;
$get('HdnVentaSaldo').value = SaldoCompra;
} else {
txt.value = SaldoCompra.toFixed(2);
SaldoCompra = 0.00;
$get('HdnVentaSaldo').value = SaldoCompra;
}
if (SaldoCompra > 0) {
if (SaldoCompra > importe) {
txt.value = importe.toFixed(2);
SaldoCompra = SaldoCompra - importe;
$get('HdnVentaSaldo').value = SaldoCompra;
} else {
t.checked = false;
txt.value = SaldoCompra.toFixed(2);
SaldoCompra = 0.00;
$get('HdnVentaSaldo').value = SaldoCompra;
}
} else {
$get('HdnVentaSaldo').value = parseFloat(SaldoCompra) + parseFloat(txt.value);
txt.value = "";
t.checked = false;
}
$("#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) {
chk.checked = true;
} else {
chk.checked = false;
}
function FnCambiaAnt(chk, txt, saldo) {
if (ToDouble(txt.value) > saldo) {
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo");
}
debugger;
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
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) {
chk.checked = true;
} else {
chk.checked = false;
}
function FnSumaValoresAnt() {
var totalPoints = 0;
var t = '';
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
return Math.round(totalPoints * 100) / 100;
if (ToDouble(txt.value) > saldo) {
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo");
}
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('');
$('#<%= TxtNumExtCliente.ClientID %>').val('');
$('#<%= TxtNumIntCliente.ClientID %>').val('');

View File

@@ -4031,6 +4031,7 @@ Partial Class PV
HdnTipoInv.Value = drPS("Inv_CveMetodoInventario").ToString
HdnAplicaIEPS.Value = drPS("AplicaIEPS").ToString
HdnPorcentajeIEPS.Value = drPS("IEPSPorcentaje").ToString
HdnCveClasificacion.Value = drPS("CveClasificacion").ToString
'Muestra la tabla de tamaños
If drPS("CveTamaño").ToString().ToEntero() > 0 Then
DivRecepcionUsados.Visible = True
@@ -4736,6 +4737,7 @@ Partial Class PV
HdnCodigoPS.Value = "-1"
HdnTipoPS.Value = "-1"
HdnTipoInv.Value = "-1"
HdnCveClasificacion.Value = "-1"
DdlClasificacion.SelectedIndex = 0
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
@@ -5360,33 +5362,26 @@ Partial Class PV
Exit Sub
End If
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 String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
Alert("El campo año esta vacío.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
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 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 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
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
@@ -5448,9 +5443,14 @@ Partial Class PV
PU = ObjDescuento.PU
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
Dim Proyecto As String = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("Proyecto").ToString
If RowSP IsNot Nothing Then
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,
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,