
| Path : /home/gujo45me/public_html/consultacpe/js/ |
| Disable Functions : exec,passthru,shell_exec,system System : Linux server-604606.appsiete.com 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 [ Home ][ Zone-h ][ Jumping ][ Symlink ][ Mass Depes ][ Command ] |
| Current File : /home/gujo45me/public_html/consultacpe/js/buscar.js |
$(function () {
/******************************************************************************/
/* start: valida formulario
/******************************************************************************/
$.fn.form.settings.rules.recaptchaValidate = function() {
return (recaptchaVerified);
};
$('#frmNuevo').form({
keyboardShortcuts: false,
fields: {
ruc_empresa: {
rules: [
{ type : 'empty', prompt : 'Complete este campo'},
{ type : 'integer', prompt : 'Ingrese solo nĂºmeros'},
{ type : 'exactLength[11]', prompt : 'El RUC debe tener {ruleValue} digitos'}
]
},
numero_documento: {
rules: [
{ type : 'empty', prompt : 'Complete este campo'},
{ type : 'integer', prompt : 'Ingrese solo nĂºmeros'}
]
},
nombre_comprobante: {
rules: [
{ type : 'empty', prompt : 'Complete este campo'},
]
},
/*recaptcha: {
identifier: 'recaptcha',
rules: [
{type: 'recaptchaValidate', prompt: 'Por favor seleccione esta opcion'}
]
}*/
},
inline : true,
});
$('.btn_registrar').on('click', function() {
if ($('#frmNuevo').form('is valid')) {
sendForm();
} else {
$('#frmNuevo').form('validate form');
}
});
function sendForm() {
var data = $('#frmNuevo').serialize();
$.tzPOST('getComprobante', data, function(resolve){
if(resolve.error){
swal({title: "Error Interno!", text: "Por favor verifique que todo este correcto e intente de nuevo", icon: "error", button: "OK"});
}
else{
if (resolve.msg) {
swal({title: "No hay resultados", text: "para su busqueda", icon: "warning", button: "OK"});
}
else if (resolve.comprobantes.length > 0 ) {
$.redirect('resultados.php', {ruc_empresa: $("#ruc_empresa").val(), numero_documento: $("#numero_documento").val(), nombre_comprobante: $("#nombre_comprobante").val()});
}
else {
swal({title: "No hay resultados", text: "para su busqueda", icon: "warning", button: "OK"});
}
}
});
return false;
};
});
/*********************************************************************************************************/
/* Otras funciones
/*********************************************************************************************************/
$.tzPOST = function(action,data,callback){
$.post('php/ajax.php?action='+action,data,callback,'json');
}
/** @function
* @name upperCase
* @description Devuelve un input en mayusculas y mantiene el focus en la posicion indicada
* @param {string} El value del input
* @return {void} void
*/
$.upperCase = function (e) {
var start = e.selectionStart;
var end = e.selectionEnd;
e.value = e.value.toUpperCase();
e.setSelectionRange(start, end);
}