} } validarSesion(isset($_SESSION["isAgenteComercial"])); SetNumberFormatOracle(); $curs = null; $params = array(":naumento" => zeroIfEmpty(str_replace(",", ".", $_REQUEST["a"])), ":ncanttrabajador" => $_REQUEST["ct"], ":ndescuento" => 0, ":nidciiu" => getIdActividad($_REQUEST["c"]), ":nmasasalarial" => str_replace(",", ".", $_REQUEST["ms"])); $sql = "BEGIN webart.get_valor_online(:nidciiu, :nmasasalarial, :ncanttrabajador, :ndescuento, :naumento, :data); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $row = DBGetSP($curs); ?> <script type="text/javascript"> with (window.parent.document) { getElementById('alicuotasFijo').value = '<?php echo str_replace(",", ".", $row["SUMAFIJA"]); ?> '; getElementById('alicuotasMasaSalarial').value = '<?php echo str_replace(",", ".", $row["PORCVARIABLE"]); ?> '; getElementById('aumento').value = '<?php echo $_REQUEST["a"]; ?> ';
LEFT JOIN aco_cotizacion ON (co_id = sc_idcotizacion) LEFT JOIN cac_actividad cac_asc ON (cac_asc.ac_id = sc_idactividad) LEFT JOIN cac_actividad cac_aco ON (cac_aco.ac_id = co_idactividad) LEFT JOIN aca_canal ON (ca_id = sc_canal) LEFT JOIN aar_art ON (sc_idartanterior = ar_id) WHERE sc_id = :id"; } $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt, 1, false); if ($modulo == "C") { // Si es una solicitud de cotización, llamo al SP para tomar los valores de la carta.. $curs = null; $params = array(":nrosolicitud" => $row["NROSOLICITUD"]); $sql = "BEGIN art.cotizacion.get_valor_carta(:nrosolicitud, :data); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $rowValorFinal = DBGetSP($curs, false); // Hago el query de abajo para formatear 2 campos que salian mal.. $sql = "SELECT TO_CHAR(".str_replace(array("$", ","), array("", "."), $rowValorFinal["COSTOANUAL"]).", '$9,999,999,990.00') costoanual, TO_CHAR(".str_replace(array("$", ","), array("", "."), $rowValorFinal["COSTOCAPITAS"]).", '$9,999,999,990.00') costocapitas FROM DUAL"; $stmt = DBExecSql($conn, $sql, array()); $row2 = DBGetQuery($stmt, 1, false); $row["CUOTAANUAL"] = $row2["COSTOANUAL"]; $row["CUOTAMENSUAL"] = $rowValorFinal["COSTOMENSUAL"]; $row["CUOTATRABAJADOR"] = $row2["COSTOCAPITAS"]; $row["PORCENTAJEVARIABLETRABAJADOR"] = $rowValorFinal["PORCVARIABLE"]; $row["SUMAFIJATRABAJADOR"] = $rowValorFinal["SUMAFIJA"]; } $pdf = new FPDI();
$calculoSumaFija = $row["COSTOFIJOCOMPETENCIA2"]; $calculoVariable = $row["COSTOVARIABLECOMPETENCIA"]." %"; $resultadoMensualPorTrabajador = $row["COSTOFINAL"]; break; case "S": $calculoSumaFija = $row["COSTOFIJO9312"]; $calculoVariable = $row["COSTOVARIABLE9312"]." %"; $resultadoMensualPorTrabajador = $row["COSTOFINALFORM931"]; break; } $curs = null; $params = array(":nrosolicitud" => $row["NROSOLICITUD"]); $sql = "BEGIN art.cotizacion.get_valor_carta(:nrosolicitud, :data); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $rowValorFinal = DBGetSP($curs); } validarAccesoCotizacion($_REQUEST["id"]); if (strpos($paginaAnterior, "pageid=28")) $paginaAnterior = "/index.php?pageid=27&buscar=yes&numero=".$row["NROSOLICITUD"]; } if ($alta) { $aumentoODescuentoAplicado = false; $mostrarAumento = false; $mostrarDescuento = false; } else {
function logUrlIn($url) { global $conn; $curs = null; $params = array(":idusuario" => getUserId(), ":url" => $url); $sql = "BEGIN art.intranet.get_id_estadistica(:data, :idusuario, :url); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $row = DBGetSP($curs); return $row[0]; }
function setClave($usuario, $clave) { global $conn; try { $params = array(":usuario" => $usuario); $sql = "SELECT uw_id FROM afi.auw_usuarioweb WHERE uw_fechabaja IS NULL AND uw_usuario = :usuario"; $id = ValorSql($sql, "", $params); $params = array(":usuario" => $usuario); $sql = "SELECT uw_ctrbcra FROM afi.auw_usuarioweb WHERE uw_fechabaja IS NULL AND uw_usuario = :usuario"; $controlBcra = ValorSql($sql, "", $params); if ($controlBcra == 1) { // Si hay que hacerle controles especiales al usuario, se setea la clave desde un SP.. $curs = null; $params = array(":id" => $id, ":password" => $clave); $sql = "BEGIN art.cotizacion.set_cambiopassword(:id, :password, :data); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $rowCtrl = DBGetSP($curs); if ($rowCtrl["NERROR"] == 1) { $_SESSION["fieldError"] = "psn"; $_SESSION["msgError"] = $rowCtrl["SERROR"]." (7)"; $error = true; } } // Actualizo la clave.. $params = array(":id" => $id, ":password" => $clave); $sql = "UPDATE afi.auw_usuarioweb SET uw_password = :password, uw_forzarclave = 0 WHERE uw_id = :id"; DBExecSql($conn, $sql, $params); $xml = '<?xml version="1.0" encoding="utf-8"?>'; $xml.= "<clave><mensaje>El cambio de clave se realizó correctamente.</mensaje><status>OK</status></clave>"; } catch (Exception $e) { $xml = '<?xml version="1.0" encoding="utf-8"?>'; //$xml.= "<error>".$e->getMessage()."</error>"; $xml.= "<clave><error><fecha>".date("d/m/Y")."</fecha><hora>".date("H:i:s")."</hora><mensaje>Ocurrió un error inesperado en la función setClave.</mensaje></error></clave>"; } return new soapval("return", "xsd:string", $xml); }
FROM aco_contrato, aem_empresa, adc_domiciliocontrato, cac_actividad, cpv_provincias WHERE co_idempresa = em_id AND co_contrato = dc_contrato AND co_idactividad = ac_id AND dc_provincia = pv_codigo AND dc_tipo = 'L' AND co_contrato = :contrato"; $stmt = DBExecSql($conn, $sql, $params); $rowEmpleador = DBGetQuery($stmt, 1, false); // Armo el sql principal.. $curs = null; $params = array(":idtransaccion" => $_REQUEST["id"]); $sql = "BEGIN art.webart.get_denuncia_siniestro(:data, :idtransaccion); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $row = DBGetSP($curs, false); // ******* INICIO - Armado del reporte.. ******* $pdf = new FPDI(); $pdf->setSourceFile($_SERVER["DOCUMENT_ROOT"]."/modules/usuarios_registrados/clientes/denuncias_de_siniestros/templates/denuncia_siniestro.pdf"); $pdf->AddPage(); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont("Arial", "", 8); $pdf->Ln(15); switch ($row["EW_TIPOSINIESTRO"]) { case 1: $pdf->Cell(81); $pdf->Cell(0, 0, "X");
function setCampanaF931() { global $conn; $curs = null; $params = array(":naumento" => 0, ":ncanttrabajador" => intval($_POST["totalTrabajadores"]), ":ndescuento" => 0, ":nidciiu" => nullIfCero(getIdActividad($_POST["ciiu1"])), ":nmasasalarial" => floatval($_POST["masaSalarialSinSac"])); $sql = "BEGIN webart.get_valor_online(:nidciiu, :nmasasalarial, :ncanttrabajador, :ndescuento, :naumento, :data); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params, true, 0); $row = DBGetSP($curs); if (floatval($row["SUMAFIJA"]) < 0.6) $row["SUMAFIJA"] = 0.6; $curs2 = null; $params2 = array(":naumento" => 121, ":ncanttrabajador" => intval($_POST["totalTrabajadores"]), ":ndescuento" => 0, ":nidciiu" => nullIfCero(getIdActividad($_POST["ciiu1"])), ":nmasasalarial" => floatval($_POST["masaSalarialSinSac"])); $sql2 = "BEGIN webart.get_valor_online(:nidciiu, :nmasasalarial, :ncanttrabajador, :ndescuento, :naumento, :data); END;"; $stmt2 = DBExecSP($conn, $curs2, $sql2, $params2, true, 0); $row2 = DBGetSP($curs2); // Traigo los límites de la SSN.. $params3 = array(":idactividad" => getIdActividad($_POST["ciiu1"])); $sql3 = "SELECT ls_minimo minimo, ls_maximo maximo FROM als_limitessn WHERE ls_idactividad IN(SELECT ac_id FROM cac_actividad WHERE ac_codigo = SUBSTR(art.hys.get_codactividadrevdos(:idactividad), 1, 1)) AND ls_fechadesde <= SYSDATE AND ls_fechahasta >= SYSDATE AND ls_fechabaja IS NULL"; $stmt3 = DBExecSql($conn, $sql3, $params3, OCI_DEFAULT); $row3 = DBGetQuery($stmt3); if ($row3["MINIMO"] == "") $row3["MINIMO"] = 0; if ($row3["MAXIMO"] == "") $row3["MAXIMO"] = 0; $params = array("identidad" => $_SESSION["entidad"], "idSucursal" => $_SESSION["sucursal"]); $sql = "SELECT ca_descuento FROM afi.aca_campania931 WHERE ca_identidad = :identidad AND SYSDATE < ca_fechahasta AND ca_fechabaja IS NULL AND NOT EXISTS (SELECT 1 FROM comercial.cse_sucursalexcluidof931 WHERE se_identidad = ca_identidad AND se_idsucursal = :idSucursal)"; ?> <script src="/js/validations.js" type="text/javascript"></script> <script src="/modules/solicitud_cotizacion/js/cotizacion.js" type="text/javascript"></script> <script type="text/javascript"> alert('Por favor, indique la Alícuota FINAL.'); // Deshabilito todos los campos, porque ya presionó el botón "Obtener Cotización".. window.parent.lockControls(true, true); with (window.parent.document) { mostrarBotonGuardar(window.parent.document); var minimoSSN = <?php echo $row3["MINIMO"]; ?> ; var maximoSSN = <?php echo $row3["MAXIMO"]; ?> ; // Muestro los objetos relacionados con la campaña F931.. getElementById('campanaF931').value = 'N'; getElementById('spanAlicuotaF931').innerHTML = 'Alícuota F931 <?php echo ValorSql($sql, "", $params, 0); ?> % Descuento'; getElementById('porcVarTarifario').value = (<?php echo $row["PORCVARIABLE"]; ?> ).toFixed(3); getElementById('porcVarF931').value = <?php echo (floatval($_POST["calculoVariable"]) * (floatval($_POST["masaSalarialSinSac"]) / intval($_POST["totalTrabajadores"])) + (floatval($_POST["calculoSumaFija"]) - 0.6)) / (floatval($_POST["masaSalarialSinSac"]) / intval($_POST["totalTrabajadores"])); ?> ; getElementById('porcVarF931').value = (getElementById('porcVarF931').value * (1 - (<?php echo ValorSql($sql, "0", $params, 0); ?> / 100))).toFixed(3); if (Number(getElementById('porcVarTarifario').value * 0.3) > Number(getElementById('porcVarF931').value)) getElementById('porcVarF931').value = Number(getElementById('porcVarTarifario').value * 0.3).toFixed(3); // No dejo que el porcentaje variable del F931 pase los límites de la SSN.. if ((minimoSSN == 0) && (maximoSSN == 0)) throw new Error('No se encontraron los límites ante la SSN.'); if (Number(getElementById('porcVarF931').value) < minimoSSN) getElementById('porcVarF931').value = minimoSSN; if (Number(getElementById('porcVarF931').value) > maximoSSN) getElementById('porcVarF931').value = maximoSSN; getElementById('porcVarDescuento').value = (<?php echo $row["PORCVARIABLE"]; ?> * (1 - (25 / 100))).toFixed(3); // getElementById('porcVarAumento').value = (<?php echo $row["PORCVARIABLE"]; ?> * (1 + (80 / 100))).toFixed(3); getElementById('porcVarAumento').value = (<?php echo $row2["PORCVARIABLE"]; ?> ).toFixed(3); getElementById('costoFinalTarifario').value = (<?php echo $row["COSTOCAPITAS"]; ?> ).toFixed(2); getElementById('costoMensualTarifario').value = (<?php echo $row["COSTOMENSUAL"]; ?> ).toFixed(0); getElementById('costoAnualTarifario').value = (<?php echo $row["COSTOANUAL"]; ?> ).toFixed(0); getElementById('costoFinalF931').value = ((getElementById('porcVarF931').value /100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> / <?php echo intval($_POST["totalTrabajadores"]); ?> + 0.6).toFixed(2); getElementById('costoMensualF931').value = (((getElementById('porcVarF931').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> ) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> ).toFixed(0); getElementById('costoAnualF931').value = (((getElementById('porcVarF931').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> * 13) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> * 12).toFixed(0); getElementById('costoFinalDescuento').value = ((getElementById('porcVarDescuento').value /100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> / <?php echo intval($_POST["totalTrabajadores"]); ?> + 0.6).toFixed(2); getElementById('costoMensualDescuento').value = (((getElementById('porcVarDescuento').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> ) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> ).toFixed(0); getElementById('costoAnualDescuento').value = (((getElementById('porcVarDescuento').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> * 13) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> * 12).toFixed(0); getElementById('costoFinalAumento').value = ((getElementById('porcVarAumento').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> / <?php echo intval($_POST["totalTrabajadores"]); ?> + 0.6).toFixed(2); getElementById('costoMensualAumento').value = (((getElementById('porcVarAumento').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> ) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> ).toFixed(0); getElementById('costoAnualAumento').value = (((getElementById('porcVarAumento').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> * 13) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> * 12).toFixed(0); <? $params = array(":canttrabajador" => intval($_POST["totalTrabajadores"]), ":cuit" => $_POST["cuit"], ":idactividad" => nullIfCero(getIdActividad($_POST["ciiu1"])), ":usuario" => "W_".$_SESSION["usuario"]); $sql = "SELECT cotizacion.get_descuento(:cuit, :canttrabajador, :idactividad, :usuario) FROM DUAL"; ?> getElementById('descuentoTopeF931').value = <?php echo ValorSql($sql, 0, $params, 0); ?> ; getElementById('spanAlicuotaDescuento').innerHTML = 'Alícuota ' + getElementById('descuentoTopeF931').value + '% Descuento'; if (getElementById('descuentoTopeF931').value > 0) getElementById('trDescuento').style.display = 'block'; else getElementById('trDescuento').style.display = 'none'; <? $params = array(":emplecoti" => intval($_POST["totalTrabajadores"]), ":idactividad" => nullIfCero(getIdActividad($_POST["ciiu1"])), ":masacoti" => floatval($_POST["masaSalarialSinSac"]), ":porcvariable" => floatval($row["PORCVARIABLE"]), ":sumafija" => floatval($row["SUMAFIJA"]), ":usuario" => "W_".$_SESSION["usuario"]); $sql = "SELECT art.cotizacion.get_aumento(:idactividad, :masacoti, :emplecoti, :sumafija, :porcvariable, :usuario) FROM DUAL"; ?> getElementById('aumentoTopeF931').value = <?php echo ValorSql($sql, 0, $params, 0); ?> ; // getElementById('spanAlicuotaAumento').innerHTML = 'Alícuota ' + getElementById('aumentoTopeF931').value + '% Aumento'; if (getElementById('aumentoTopeF931').value > 0) getElementById('trAumento').style.display = 'block'; else getElementById('trAumento').style.display = 'none'; getElementById('spanTopesAlicuotaFinal').innerHTML = '(Entre ' + getTopeMinimoF931() + '% y ' + getTopeMaximoF931() + '%)'; getElementById('sumaFijaF931').value = (<?php echo $row["SUMAFIJA"]; ?> ).toFixed(2); // edSumaAseguradaRCF931.Value := 0; // edAlicuotaVariableRCF931.Value := 0; // edMasaSalarialRCF931.Value := floatval($_POST["masaSalarialSinSac"]); // edCuotaInicialRCF931.Value := 0; getElementById('tableCampanaF931').style.display = 'block'; getElementById('aumento').value = 0; getElementById('descuento').value = 0; getElementById('alicuotaFinalF931').focus(); } </script> <? }
function setCampanaF931() { global $conn; $curs = null; $params = array(":naumento" => 0, ":ncanttrabajador" => intval($_POST["totalTrabajadores"]), ":ndescuento" => 0, ":nidciiu" => nullIfCero(getIdActividad($_POST["ciiu1"])), ":nmasasalarial" => floatval($_POST["masaSalarialSinSac"])); $sql = "BEGIN webart.get_valor_online(:nidciiu, :nmasasalarial, :ncanttrabajador, :ndescuento, :naumento, :data); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params, true, 0); $row = DBGetSP($curs); if (floatval($row["SUMAFIJA"]) < 0.6) $row["SUMAFIJA"] = 0.6; $curs2 = null; $params2 = array(":naumento" => 121, ":ncanttrabajador" => intval($_POST["totalTrabajadores"]), ":ndescuento" => 0, ":nidciiu" => nullIfCero(getIdActividad($_POST["ciiu1"])), ":nmasasalarial" => floatval($_POST["masaSalarialSinSac"])); $sql2 = "BEGIN webart.get_valor_online(:nidciiu, :nmasasalarial, :ncanttrabajador, :ndescuento, :naumento, :data); END;"; $stmt2 = DBExecSP($conn, $curs2, $sql2, $params2, true, 0); $row2 = DBGetSP($curs2); $params = array("identidad" => $_SESSION["entidad"]); $sql = "SELECT ca_descuento FROM afi.aca_campania931 WHERE ca_identidad = :identidad AND SYSDATE < ca_fechahasta AND ca_fechabaja IS NULL"; ?> <script src="/js/validations.js" type="text/javascript"></script> <script src="/modules/solicitud_cotizacion/js/cotizacion.js" type="text/javascript"></script> <script type="text/javascript"> alert('Por favor, indique la Alícuota FINAL.'); // Deshabilito todos los campos, porque ya presionó el botón "Obtener Cotización".. window.parent.lockControls(true, true); with (window.parent.document) { mostrarBotonGuardar(window.parent.document); // Muestro los objetos relacionados con la campaña F931.. getElementById('campanaF931').value = 'N'; getElementById('spanAlicuotaF931').innerHTML = 'Alícuota F931 <?php echo ValorSql($sql, "", $params, 0); ?> % Descuento'; getElementById('porcVarTarifario').value = (<?php echo $row["PORCVARIABLE"]; ?> ).toFixed(3); getElementById('porcVarF931').value = <?php echo (floatval($_POST["calculoVariable"]) * (floatval($_POST["masaSalarialSinSac"]) / intval($_POST["totalTrabajadores"])) + (floatval($_POST["calculoSumaFija"]) - 0.6)) / (floatval($_POST["masaSalarialSinSac"]) / intval($_POST["totalTrabajadores"])); ?> ; getElementById('porcVarF931').value = (getElementById('porcVarF931').value * (1 - (<?php echo ValorSql($sql, "", $params, 0); ?> / 100))).toFixed(3); if (Number(getElementById('porcVarTarifario').value * 0.3) > Number(getElementById('porcVarF931').value)) getElementById('porcVarF931').value = Number(getElementById('porcVarTarifario').value * 0.3).toFixed(3); getElementById('porcVarDescuento').value = (<?php echo $row["PORCVARIABLE"]; ?> * (1 - (25 / 100))).toFixed(3); // getElementById('porcVarAumento').value = (<?php echo $row["PORCVARIABLE"]; ?> * (1 + (80 / 100))).toFixed(3); getElementById('porcVarAumento').value = (<?php echo $row2["PORCVARIABLE"]; ?> ).toFixed(3); getElementById('costoFinalTarifario').value = (<?php echo $row["COSTOCAPITAS"]; ?> ).toFixed(2); getElementById('costoMensualTarifario').value = (<?php echo $row["COSTOMENSUAL"]; ?> ).toFixed(0); getElementById('costoAnualTarifario').value = (<?php echo $row["COSTOANUAL"]; ?> ).toFixed(0); getElementById('costoFinalF931').value = ((getElementById('porcVarF931').value /100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> / <?php echo intval($_POST["totalTrabajadores"]); ?> + 0.6).toFixed(2); getElementById('costoMensualF931').value = (((getElementById('porcVarF931').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> ) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> ).toFixed(0); getElementById('costoAnualF931').value = (((getElementById('porcVarF931').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> * 13) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> * 12).toFixed(0); getElementById('costoFinalDescuento').value = ((getElementById('porcVarDescuento').value /100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> / <?php echo intval($_POST["totalTrabajadores"]); ?> + 0.6).toFixed(2); getElementById('costoMensualDescuento').value = (((getElementById('porcVarDescuento').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> ) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> ).toFixed(0); getElementById('costoAnualDescuento').value = (((getElementById('porcVarDescuento').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> * 13) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> * 12).toFixed(0); getElementById('costoFinalAumento').value = ((getElementById('porcVarAumento').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> / <?php echo intval($_POST["totalTrabajadores"]); ?> + 0.6).toFixed(2); getElementById('costoMensualAumento').value = (((getElementById('porcVarAumento').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> ) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> ).toFixed(0); getElementById('costoAnualAumento').value = (((getElementById('porcVarAumento').value / 100) * <?php echo floatval($_POST["masaSalarialSinSac"]); ?> * 13) + 0.6 * <?php echo intval($_POST["totalTrabajadores"]); ?> * 12).toFixed(0); <? $params = array(":canttrabajador" => intval($_POST["totalTrabajadores"]), ":cuit" => $_POST["cuit"], ":idactividad" => nullIfCero(getIdActividad($_POST["ciiu1"])), ":usuario" => "W_".$_SESSION["usuario"]); $sql = "SELECT cotizacion.get_descuento(:cuit, :canttrabajador, :idactividad, :usuario) FROM DUAL"; ?> getElementById('descuentoTopeF931').value = <?php echo ValorSql($sql, 0, $params, 0); ?> ; getElementById('spanAlicuotaDescuento').innerHTML = 'Alícuota ' + getElementById('descuentoTopeF931').value + '% Descuento'; if (getElementById('descuentoTopeF931').value > 0) getElementById('trDescuento').style.display = 'block'; else getElementById('trDescuento').style.display = 'none'; <? $params = array(":emplecoti" => intval($_POST["totalTrabajadores"]), ":idactividad" => nullIfCero(getIdActividad($_POST["ciiu1"])), ":masacoti" => floatval($_POST["masaSalarialSinSac"]), ":porcvariable" => floatval($row["PORCVARIABLE"]), ":sumafija" => floatval($row["SUMAFIJA"]), ":usuario" => "W_".$_SESSION["usuario"]); $sql = "SELECT art.cotizacion.get_aumento(:idactividad, :masacoti, :emplecoti, :sumafija, :porcvariable, :usuario) FROM DUAL"; ?> getElementById('aumentoTopeF931').value = <?php echo ValorSql($sql, 0, $params, 0); ?> ; // getElementById('spanAlicuotaAumento').innerHTML = 'Alícuota ' + getElementById('aumentoTopeF931').value + '% Aumento'; if (getElementById('aumentoTopeF931').value > 0) getElementById('trAumento').style.display = 'block'; else getElementById('trAumento').style.display = 'none'; getElementById('spanTopesAlicuotaFinal').innerHTML = '(Entre ' + getTopeMinimoF931() + '% y ' + getTopeMaximoF931() + '%)'; getElementById('sumaFijaF931').value = (<?php echo $row["SUMAFIJA"]; ?> ).toFixed(2); // edSumaAseguradaRCF931.Value := 0; // edAlicuotaVariableRCF931.Value := 0; // edMasaSalarialRCF931.Value := floatval($_POST["masaSalarialSinSac"]); // edCuotaInicialRCF931.Value := 0; getElementById('tableCampanaF931').style.display = 'block'; getElementById('aumento').value = 0; getElementById('descuento').value = 0; getElementById('alicuotaFinalF931').focus(); } </script> <? }
":sestablecimientos" => getEstablecimiento($row["CM_ESTABLECIMIENTO"]), ":sestadocivil" => $row["CODIGOESTADOCIVIL"], ":slateralidad" => NULL, ":slocalidad" => $row["CM_LOCALIDAD"], ":snombre" => $row["CM_NOMBRE"], ":snumero" => $row["CM_NUMERO"], ":sotranacionalidad" => $row["CM_OTRANACIONALIDAD"], ":spiso" => $row["CM_PISO"], ":sprovincia" => $row["CODIGOPROVINCIA"], ":ssector" => $row["CM_SECTOR"], ":ssexo" => $row["CM_SEXO"], ":starea" => $row["CM_TAREA"], ":stelefono" => NULL); $sql = "BEGIN webart.set_trabajador(:data, :cconfirmapuesto, TO_DATE(:dfechabaja, 'dd/mm/yyyy'), TO_DATE(:dfechaingreso, 'dd/mm/yyyy'), TO_DATE(:dfechanacimiento, 'dd/mm/yyyy'), :ncontrato, :nidmodalidadcontratacion, :nidnacionalidad, :nidrelacionlaboral, :nidtrabajador, :nidusuario, :nsueldo, :scalle, :scategoria, :sciuo, :scodaltatemprana, :scodareatelefono, :scpostal, :scpostala, :scuil, :sdepartamento, :sdocumento, :sdomicilio, :semail, :sestablecimientos, :sestadocivil, :slateralidad, :slocalidad, :snombre, :snumero, :sotranacionalidad, :spiso, :sprovincia, :ssector, :ssexo, :starea, :stelefono); END;"; $stmt2 = DBExecSP($conn, $curs, $sql, $params); $row2 = DBGetSP($curs); if (($row2["NUMEROERROR"] != "0") and ($row2["NUMEROERROR"] != "")) throw new Exception($row2["NUMEROERROR"]." - ".$row2["DESCRIPCIONERROR"]); } } catch (Exception $e) { echo "<script type='text/javascript'>alert(unescape('".rawurlencode($e->getMessage())."'));</script>"; exit; } ?> <script type="text/javascript"> with (window.parent.document) { // getElementById('btnImportar').style.display = 'inline'; getElementById('btnVolver').style.display = 'inline'; getElementById('guardadoOk').style.visibility = 'visible';
private function SPValidation(&$advertencias, &$errores) { global $conn; try { $curs = null; $params = array(":cbajapordeuda" => "F", ":ccampanaF931" => "S", ":cdatoscompetencia" => $this->datosSolicitud["datosCompetencia"], ":cprestacionesespeciales" => $this->datosSolicitud["prestacionesEspeciales"], ":csuscribepolizarc" => $this->datosSolicitud["suscribePolizaRC"], ":naumento" => -1, ":ncantidadtrabajadores" => $this->datosSolicitud["totalTrabajadores"], ":ndescuento" => -1, ":nedadpromedio" => IIF(($this->datosSolicitud["edadPromedio"] == ""), -1, intval($this->datosSolicitud["edadPromedio"])), ":nestablecimientos" => intval($this->datosSolicitud["cantidadEstablecimientos"]), ":nidartanterior" => nullIsEmpty($this->datosSolicitud["artAnterior"]), ":nidcanal" => $this->datosUsuario["CANAL"], ":nidciiu" => nullIfCero($this->datosSolicitud["ciiu1"]), ":nidciiu2" => nullIfCero($this->datosSolicitud["ciiu2"]), ":nidciiu3" => nullIfCero($this->datosSolicitud["ciiu3"]), ":nidentidad" => $this->datosUsuario["ENTIDAD"], ":nidholding" => nullIfCero($this->datosSolicitud["holding"]), ":nidsector" => nullIfCero($this->datosSolicitud["sector"]), ":nidstatusbcra" => nullIsEmpty($this->datosSolicitud["statusBcra"]), ":nidstatussrt" => nullIsEmpty($this->datosSolicitud["statusSrt"]), ":nidvendedor" => $this->datosSolicitud["idVendedor"], ":nidzonageografica" => $this->datosSolicitud["zonaGeografica"], ":nmasasalarial" => $this->getMasaSalarialSinSac(), ":nresultadomensualtrabajador" => $this->getResultadoMensualPorTrabajador(), ":nsumaaseguradarc" => nullIfCero($this->datosSolicitud["sumaAseguradaRC"]), ":sactividadreal" => $this->datosSolicitud["actividadReal"], ":scontacto" => $this->datosSolicitud["contacto"], ":scuit" => $this->datosSolicitud["cuit"], ":semail" => $this->datosSolicitud["email"], ":speriodo" => $this->datosSolicitud["periodo"], ":srazonsocial" => $this->datosSolicitud["razonSocial"], ":susualta" => $this->datosUsuario["USUARIO"]); $sql = "BEGIN webart.get_validacion_solicitud(:data, :cbajapordeuda, :ccampanaF931, :cdatoscompetencia, :cprestacionesespeciales, :csuscribepolizarc, :naumento, :ncantidadtrabajadores, :ndescuento, :nedadpromedio, :nestablecimientos, :nidartanterior, :nidcanal, :nidciiu, :nidciiu2, :nidciiu3, :nidentidad, :nidholding, :nidsector, :nidstatusbcra, :nidstatussrt, :nidvendedor, :nidzonageografica, :nmasasalarial, :nresultadomensualtrabajador, :nsumaaseguradarc, :sactividadreal, :scontacto, :scuit, :semail, :speriodo, :srazonsocial, :susualta); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $row = DBGetSP($curs); $this->huboErrores = ((intval($row["NUMEROERROR"]) != 0) and ($row["ADVERTENCIA"] != "A")); $this->motivoNoAutocotizacion = $row["MOTIVONOAUTOCOTIZACION"]; $this->verificaTecnica = (($row["VERIFICATECNICA"] == "S") or ($this->datosUsuario["AUTOCOTIZACION"] == 0)); // Si el query devuelve "S" o si no autocotiza, la mando a técnica.. if (trim($row["ADVERTENCIA"]) != "") { $advertencias.= "<advertencia><mensaje>".$row["ERROR"]."</mensaje></advertencia>"; } if ($this->datosSolicitud["origen"] == "W") { // Si el origen es la Web de Provincia ART.. if ($row["NUMEROERROR"] == -3) { // Si el error es -3 indica que se tienen que mostrar los datos de la campaña F931 del año 2012.. $errores.= "<error><codigo>-3</codigo>"; $errores.= "<mensaje>setCampanaF931</mensaje></error>"; } elseif ($row["NUMEROERROR"] == -1) { // Si el error es -1 indica que se le tiene que permitir al usuario cargar un descuento.. $errores.= "<error><codigo>-1</codigo>"; $errores.= "<mensaje>mostrarDescuento</mensaje></error>"; } elseif ($row["NUMEROERROR"] == -2) { // Si el error es -2 indica que se le tiene que permitir al usuario cargar un aumento.. $errores.= "<error><codigo>-2</codigo>"; $errores.= "<mensaje>mostrarAumento</mensaje></error>"; } elseif ($row["NUMEROERROR"] == -12) { // Si el error es -12 indica que se le tiene que permitir al usuario cargar un aumento y un descuento.. $errores.= "<error><codigo>-12</codigo>"; $errores.= "<mensaje>mostrarAumentoYDescuento</mensaje></error>"; } elseif (intval($row["NUMEROERROR"]) != "0") { if (($row["NUMEROERROR"] >= 1) and ($row["NUMEROERROR"] <= 13)) // Son los números de error de la vieja función get_validacion.. sendEmailSituacionAfiliatoria($row["NUMEROERROR"]." - ".$row["ERROR"]); $errores.= "<error><codigo>".$row["NUMEROERROR"]."</codigo>"; $errores.= "<mensaje>".$row["ERROR"]."</mensaje></error>"; } } } catch (Exception $e) { // $errores.= "<error>".$e->getMessage()."</error>"; $errores.= "<error><fecha>".date("d/m/Y")."</fecha><hora>".date("H:i:s")."</hora><mensaje>Ocurrió un error inesperado en la función SPValidation.</mensaje></error>"; } }
if (((isset($_POST["psn"])) and ($_POST["psn"] == "")) or ((isset($_POST["cnf"])) and ($_POST["cnf"] == ""))) { $_SESSION["fieldError"] = "psn"; $_SESSION["msgError"] = "Por favor ingrese la Contraseña Nueva y su Confirmación (6)."; $error = true; } elseif ($_POST["psn"] != $_POST["cnf"]) { $_SESSION["fieldError"] = "psn"; $_SESSION["msgError"] = "La Confirmación no coincide con la Contraseña Nueva (7)."; $error = true; } else { $curs = null; $params = array(":id" => $id, ":password" => $_POST["psn"]); $sql = "BEGIN art.cotizacion.set_cambiopassword(:id, :password, :data); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $rowCtrl = DBGetSP($curs); if ($rowCtrl["NERROR"] == 1) { $_SESSION["fieldError"] = "psn"; $_SESSION["msgError"] = $rowCtrl["SERROR"]." (8)."; $error = true; } } } } else { // Validaciones a usuarios comunes.. $params = array(":usuario" => $_POST["sr"]); $sql = "SELECT uw_forzarclave FROM afi.auw_usuarioweb WHERE uw_fechabaja IS NULL AND uw_usuario = :usuario";