AGREGAR CODICIONES NUEVAS A LOS CODIGOS DE INSPECCION,LINEA Y ENSAMBLE DEPENDIENDO DE LA CLASIFICACION

This commit is contained in:
2020-02-07 19:49:30 -07:00
parent f5b9e0354f
commit 61899a38f6
2 changed files with 56 additions and 9 deletions

View File

@@ -2830,6 +2830,7 @@
<ADS:DropDownLost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange" > <ADS:DropDownLost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange" >
</ADS:DropDownLost> </ADS:DropDownLost>
<asp:HiddenField ID="HdnPSAjusteMarca" ClientIDMode="Static" runat="server" Value="-1" /> <asp:HiddenField ID="HdnPSAjusteMarca" ClientIDMode="Static" runat="server" Value="-1" />
<asp:HiddenField ID="HdnPSAjusteClasificacion" ClientIDMode="Static" runat="server" Value="-1" />
<label for="<%= DdlPSAjuste.ClientID.ToString()%>">Producto/Servicio a Recibir:</label> <label for="<%= DdlPSAjuste.ClientID.ToString()%>">Producto/Servicio a Recibir:</label>
</div> </div>
</div> </div>
@@ -2916,6 +2917,7 @@
<div class="col-md-8"> <div class="col-md-8">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodInspeccion" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtCodInspeccion" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator id="CVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" ClientValidationFunction="ValidarCodigoInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<asp:RegularExpressionValidator ID="REVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[A-L][0-9][1-9A-Z][A-HJ-M]$"></asp:RegularExpressionValidator> <asp:RegularExpressionValidator ID="REVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[A-L][0-9][1-9A-Z][A-HJ-M]$"></asp:RegularExpressionValidator>
<%--<asp:RequiredFieldValidator ID="RFVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspeccion''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%> <%--<asp:RequiredFieldValidator ID="RFVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspeccion''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
<%--<ajax:ValidatorCalloutExtender ID="VCECodInspeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodInspeccion"></ajax:ValidatorCalloutExtender>--%> <%--<ajax:ValidatorCalloutExtender ID="VCECodInspeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodInspeccion"></ajax:ValidatorCalloutExtender>--%>
@@ -3011,23 +3013,65 @@
<script type="text/javascript"> <script type="text/javascript">
function ValidarCodigoEnsamble(source, arguments) { function ValidarCodigoEnsamble(source, arguments) {
var CveMarca = HdnPSAjusteMarca.value; let CveMarca = HdnPSAjusteMarca.value;
let CveClasificacion = HdnPSAjusteClasificacion.value;
let regex = "";
//SI ES MOTOBATERIA
if (CveClasificacion = "20517") {
regex = "[*]|"
//SI ES OPTIMA
} else if (CveClasificacion = "20511") {
regex = "[1X]|"
}
//MARCA OPTIMA
if (CveMarca == "1086") { if (CveMarca == "1086") {
var re = new RegExp("^[0-9]+$"); let re = new RegExp("^" + regex + "[0-9]+$");
arguments.IsValid = re.test(parseInt(arguments.Value));
return;
} else {
let re = new RegExp("^" + regex + "[0-9][A-HJ-M]([[0-2][0-9]|3[0-1])[0-9A-Z][ACEN][2-5]$");
arguments.IsValid = re.test(arguments.Value);
return;
}
}
function ValidarCodigoLinea(source, arguments) {
var CveMarca = HdnPSAjusteMarca.value;
let CveClasificacion = HdnPSAjusteClasificacion.value;
let regex = "";
//SI ES MOTOBATERIA
if (CveClasificacion = "20517") {
regex = "[*]|";
} else {
regex = "";
}
if (CveMarca == "1086") {
var re = new RegExp("^" + regex + "[0-9]+$");
arguments.IsValid = re.test(parseInt(arguments.Value)); arguments.IsValid = re.test(parseInt(arguments.Value));
} else { } else {
var re = new RegExp("^[0-9][A-HJ-M]([[0-2][0-9]|3[0-1])[0-9A-Z][ACEN][2-5]$"); var re = new RegExp("^" + regex + "$");
arguments.IsValid = re.test(arguments.Value); arguments.IsValid = re.test(arguments.Value);
} }
} }
function ValidarCodigoLinea(source, arguments) {
var CveMarca = HdnPSAjusteMarca.value; function ValidarCodigoInspeccion(source, arguments) {
if (CveMarca == "1086") { let CveClasificacion = HdnPSAjusteClasificacion.value;
var re = new RegExp("^[0-9]+$");
let clasificaciones = ["20517", "20511"]
//SI ES MOTOBATERIA
if (clasificaciones.includes(CveClasificacion)) {
var re = new RegExp("^[*]|[A-L][0-9][1-9A-Z][A-HJ-M]$");
arguments.IsValid = re.test(parseInt(arguments.Value)); arguments.IsValid = re.test(parseInt(arguments.Value));
return;
} else { } else {
var re = new RegExp("^[*]$"); var re = new RegExp("^[A-L][0-9][1-9A-Z][A-HJ-M]$");
arguments.IsValid = re.test(arguments.Value); arguments.IsValid = re.test(arguments.Value);
return;
} }
} }

View File

@@ -5232,11 +5232,13 @@ Partial Class PV
Dim CvePSParametro As Integer = DdlPSAjuste.SelectedValue.ToEntero Dim CvePSParametro As Integer = DdlPSAjuste.SelectedValue.ToEntero
Dim PrecioSugerido As Decimal = 0 Dim PrecioSugerido As Decimal = 0
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("") Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
Dim CveMarca As Integer Dim CveMarca As Integer = -1
Dim CveClasificacion As Integer = -1
If drPS IsNot Nothing Then If drPS IsNot Nothing Then
PrecioSugerido = drPS("Precio").ToString.ToDecimal PrecioSugerido = drPS("Precio").ToString.ToDecimal
CveMarca = drPS("CveMarca").ToString.ToEntero CveMarca = drPS("CveMarca").ToString.ToEntero
CveClasificacion = drPS("CveClasificacion").ToString.ToEntero
End If End If
TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2) TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2)
@@ -5247,6 +5249,7 @@ Partial Class PV
DdlTipoUso.DataBind() DdlTipoUso.DataBind()
HdnPSAjusteMarca.Value = CveMarca.ToString() HdnPSAjusteMarca.Value = CveMarca.ToString()
HdnPSAjusteClasificacion.Value = CveClasificacion.ToString()
End If End If