function impFP(ident){ document.frm.accion.value=500; document.frm.action="Estatales"; switch(ident){ case 1: document.frm.con.value=false; document.frm.submit(); break; case 2: document.recordatorio.con.value=true; document.recordatorio.submit(); break; } document.frm.accion.value=""; document.frm.action=""; } function formatAsMoney(mnt) { mnt -= 0; mnt = (Math.round(mnt*100))/100; return (mnt == Math.floor(mnt)) ? mnt + '.00': ( (mnt*10 == Math.floor(mnt*10)) ? mnt + '0' : mnt); } function toggle(valor){ forma = document.frm; var comp=document.getElementById("estatalesComp"); var E4N =document.getElementById("E4Num"); var E4L =document.getElementById("E4Lab"); var E4T =document.getElementById("E4"); var E5N =document.getElementById("E5Num"); var E5L =document.getElementById("E5Lab"); var E5T =document.getElementById("E5"); if (valor == 0){ // Declaración Normal forma.recf.disabled = true; forma.reci.disabled = true; if(comp) { comp.style.visibility="hidden"; E4L.style.visibility="hidden"; E4N.style.visibility="hidden"; E4T.style.visibility="hidden"; E5L.style.visibility="hidden"; E5N.style.visibility="hidden"; E5T.style.visibility="hidden"; } } if (valor == 1) { // Declaración Complementaria forma.recf.disabled = false; forma.reci.disabled = false; if(comp) { comp.style.visibility="visible"; E4L.style.visibility="visible"; E4N.style.visibility="visible"; E4T.style.visibility="visible"; E5L.style.visibility="visible"; E5N.style.visibility="visible"; E5T.style.visibility="visible"; } } } function checkValor(pctj){ forma = document.frm; if(parseFloat(forma.E1.value) > 0){ forma.E1.value = formatAsMoney(Math.round(parseFloat(forma.E1.value))); forma.E3.value = 0.00; calcImpuestoDeterminado(forma.E1, pctj); } if(parseFloat(forma.E3.value) > 0){ forma.E3.value = formatAsMoney(Math.round(parseFloat(forma.E3.value))); forma.E1.value = 0.00; calcImpuestoDeterminado(forma.E3, pctj); } } function calcImpuestoDeterminado(ob, pctj){ forma = document.frm; forma.ENB12.value = formatAsMoney(Math.round(parseFloat(ob.value) * pctj)); calcImpuestoACargo(); } function calcImpuestoACargo(){ forma = document.frm; forma.ENB13.value = formatAsMoney(parseFloat(forma.ENB12.value) - parseFloat(forma.ENB17.value)); forma.ENB14.value = forma.ENB13.value; } function validaFecha() { var validador; obj = document.frm.recf; validador = /^[0-9]{2}\/(\d){2}\/[0-9]{4}$/; if (validador.test(obj.value)) { return true; }else{ return false; } } function help(ref){ help = window.open(ref,"ayuda","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=400,height=200"); } function nPopup(ref){ win = window.open(ref,"recordatorio","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=600,height=400"); } function nPopupNW(ref, id){ win = window.open(ref,"recordatorio","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=600,height=400"); var ob = document.getElementById(id); if(ob){ ob.style.visibility="visible";} } function seleccionar(valor) { var cont = 0; forma = document.frm; for (var i=0; i < forma.elements.length; i++) { if (forma.elements[i].type == 'checkbox' && forma.elements[i].name == 'borra' ) { if (forma.elements[i].value == valor ) { cont++; if (cont > 1){ forma.elements[i].checked = !forma.elements[i].checked; } } } } } function valida(accion, frmaccion,tipo){ var errors = ''; var numErrors = 0; forma = document.frm; forma.accion.value = accion; forma.action = frmaccion; switch (accion){ case -10: return confirm("***** Se perderan las declaraciones que no haya pagado o generado formatos *****"); case 7 : forma.bancoid.value = -1 break; case 8 : forma.bancoid.value = -3; break; case 9 : forma.bancoid.value = -2 break; case 4 : // Agrega Partidas if(forma.E1.value == ""){ errors +="El campo E1 debe tener un valor mayor o igual a 0.\n"; numErrors++;} if(forma.E2.value == ""){ errors +="El campo E2 debe tener un valor mayor o igual a 0.\n"; numErrors++;} if(forma.E3.value == ""){ errors +="El campo E3 debe tener un valor mayor o igual a 0.\n"; numErrors++;} if(forma.ENB17.value == ""){ errors +="El campo E7 debe tener un valor mayor o igual a 0.\n"; numErrors++;}else{ if(parseFloat(forma.ENB17.value) > 0){ if(!forma.estfisc.checked && !forma.pagodem.checked){ errors +="Si se esta aplicando saldo a favor debe marcar alguna de las opciones de E6: Estimulo Fiscal y/o Pago en Demasia.\n"; numErrors++; } } } ind = forma.yy.selectedIndex; if (forma.yy.options[ind].value <= 0){ errors += "- Debe seleccionar año del pago.\n"; numErrors++; } ind = forma.mm.selectedIndex; if (forma.mm.options[ind].value <= 0){ errors += "- Debe seleccionar el periodo del pago.\n"; numErrors++; } if (forma.tipo[1].checked){ if (!validaFecha()){ errors += '- La fecha que rectifica debe estar en formato (dd/mm/yyyy)\n'; numErrors++; } if ((forma.reci.value < 0) || (forma.reci.value.length == 0)){ errors += '- Debe indicar el importe de la declaracion que rectifica\n'; numErrors++; } if (forma.aclaracion.value.length == 0){ errors += "Debe llenar el campo de aclaraciones.\n"; numErrors++; } } if (numErrors) { errors = 'Se detectaron ' + numErrors + ' error(es)\n'+ errors; alert(errors); return false; } break; case 5 : // Borra Partidas break; } return true; }