function SendEmail($body, $fromName, $subject, $to, $cc, $bcc, $tipoCuerpo = "T", $tipoRegistroAsociado = NULL, $idRegistroAsociado = -1, $direccionOrigen = NULL) { global $conn; $rawParamName = "valor"; $params = array(":direccionesdestino" => implode(",", $to), ":direccionorigen" => $direccionOrigen, ":motivo" => $subject, ":tipocuerpo" => $tipoCuerpo, ":tiporegistroasociado" => $tipoRegistroAsociado, ":idregistroasociado" => nullIfCero($idRegistroAsociado)); $sql = "INSERT INTO comunes.cee_emailaenviar (ee_direccionesdestino, ee_direccionorigen, ee_motivo, ee_fechamensaje,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ee_tipocuerpo, ee_tiporegistroasociado, ee_idregistroasociado, ee_cuerpoex)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t VALUES (:direccionesdestino, :direccionorigen, :motivo, SYSDATE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t :tipocuerpo, :tiporegistroasociado, :idregistroasociado, RAWTOHEX(:" . $rawParamName . "))"; DBExecSqlRawValue($conn, $sql, $params, $rawParamName, $body); }
function formatFloat($number, $nullIfCero = false) { // Formatea un número para poder ser pasado como parámetro de un query.. if ($nullIfCero) { return nullIfCero($number, false, false); } else { return "0" . trim(str_replace(array("%"), array(""), $number)); } }
function getArtAnteriorParaAfiliacion($motivoAlta) { global $rowCotizacion; if ($motivoAlta == "03") return NULL; elseif ($motivoAlta == "04") return NULL; elseif ($motivoAlta == "05") return NULL; else return nullIfCero($rowCotizacion["IDARTANTERIOR"]); }
function guardarResponsable($num) { global $conn; global $idSolicitudRGRL; if ($num == 1) { $cargo = "R"; $responsableForm = "S"; } if ($num == 2) { $cargo = "H"; $responsableForm = "N"; } if ($num == 3) { $cargo = "M"; $responsableForm = "N"; } if (($_POST["cuit".$num] != "") or ($_POST["nombre".$num] != "") or ($_POST["representacion".$num] != -1) or ($_POST["tipo".$num] != -1) or ($_POST["titulo".$num] != "") or ($_POST["entidad".$num]) or ($_POST["matricula".$num] != "") or ($_POST["entidad".$num] != "")) { // Si se llenó algún campo, guardo.. if ($_POST["idResponsable".$num] == "") { // Alta.. $params = array(":cargo" => $cargo, ":cuitcuil" => $_POST["cuit".$num], ":entidad" => $_POST["entidad".$num], ":idrepresentacion" => $_POST["representacion".$num], ":idsolicitudfgrl" => $idSolicitudRGRL, ":matricula" => $_POST["matricula".$num], ":nombre" => $_POST["nombre".$num], ":relacion" => nullIfCero($_POST["tipo".$num]), ":responsableform" => $responsableForm, ":titulo" => $_POST["titulo".$num], ":usualta" => substr("W_".$_SESSION["usuario"], 0, 20)); $sql = "INSERT INTO hys.hrw_responsablerelevweb (rw_cargo, rw_cuitcuil, rw_entidad, rw_fechaalta, rw_id, rw_idrepresentacion, rw_idsolicitudfgrl, rw_matricula, rw_nombre, rw_relacion, rw_responsableform, rw_titulo, rw_usualta) VALUES (:cargo, :cuitcuil, :entidad, SYSDATE, -1, :idrepresentacion, :idsolicitudfgrl, :matricula, :nombre, :relacion, :responsableform, :titulo, :usualta)"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); } else { // Modificación.. $params = array(":cuitcuil" => $_POST["cuit".$num], ":entidad" => $_POST["entidad".$num], ":id" => $_POST["idResponsable".$num], ":idrepresentacion" => $_POST["representacion".$num], ":matricula" => $_POST["matricula".$num], ":nombre" => $_POST["nombre".$num], ":relacion" => nullIfCero($_POST["tipo".$num]), ":titulo" => $_POST["titulo".$num], ":usumodif" => substr("W_".$_SESSION["usuario"], 0, 20)); $sql = "UPDATE hys.hrw_responsablerelevweb SET rw_cuitcuil = :cuitcuil, rw_entidad = :entidad, rw_fechamodif = SYSDATE, rw_idrepresentacion = :idrepresentacion, rw_matricula = :matricula, rw_nombre = :nombre, rw_relacion = :relacion, rw_titulo = :titulo, rw_usumodif = :usumodif WHERE rw_id = :id"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); } } else { // Sino doy la baja.. $params = array(":id" => $_POST["idResponsable".$num], ":usubaja" => substr("W_".$_SESSION["usuario"], 0, 20)); $sql = "UPDATE hys.hrw_responsablerelevweb SET rw_fechabaja = SYSDATE, rw_usubaja = :usubaja WHERE rw_id = :id"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); } }
"INSERT INTO rrhh.rbr_banners (br_fechavigenciadesde, br_fechavigenciahasta, br_id, br_multilink, br_posicion, br_target, br_url, br_urlsingrupo, br_usualta, br_vistaprevia) VALUES (TO_DATE(:fechavigenciadesde, 'DD/MM/YYYY'), TO_DATE(:fechavigenciahasta, 'DD/MM/YYYY'), -1, :multilink, :posicion, :target, :url, :urlsingrupo, :usualta, :vistaprevia)"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); $sql = "SELECT MAX(br_id) FROM rrhh.rbr_banners"; $_POST["id"] = valorSql($sql, -1, array(), 0); } else { // Es una modificación.. $params = array(":fechavigenciadesde" => $_POST["vigenciaDesde"], ":fechavigenciahasta" => $_POST["vigenciaHasta"], ":id" => $_POST["id"], ":multilink" => $multiLink, ":posicion" => zeroIfEmpty($_POST["posicion"]), ":target" => nullIfCero($_POST["destino"]), ":url" => $_POST["link"], ":urlsingrupo" => $_POST["linkSinGrupo"], ":usumodif" => getWindowsLoginName(true), ":vistaprevia" => $vistaPrevia); $sql = "UPDATE rrhh.rbr_banners SET br_fechamodif = SYSDATE, br_fechavigenciadesde = TO_DATE(:fechavigenciadesde, 'DD/MM/YYYY'), br_fechavigenciahasta = TO_DATE(:fechavigenciahasta, 'DD/MM/YYYY'), br_multilink = :multilink, br_posicion = :posicion, br_target = :target, br_url = :url, br_urlsingrupo = :urlsingrupo, br_usumodif = :usumodif,
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 guardarRegistrosImpresion($tipoPdf, $cantidadHojas, $idEstablecimiento = 0, $establecimientoDeBaja = false) { global $conn; $params = array(":idestablecimiento" => $idEstablecimiento, ":idsolicitudafiliacion" => $_REQUEST["idsa"], ":idtipopdf" => $tipoPdf); $sql = "SELECT ir_id FROM web.wir_impresionesrgrl WHERE ir_idsolicitudafiliacion = :idsolicitudafiliacion AND ir_idtipopdf = :idtipopdf AND NVL(ir_idestablecimiento, 0) = :idestablecimiento"; $idTmp = valorSql($sql, 0, $params, 0); if ($idTmp < 1) { // Si es un alta.. $params = array(":cantidadhojas" => $cantidadHojas, ":idestablecimiento" => nullIfCero($idEstablecimiento), ":idsolicitudafiliacion" => $_REQUEST["idsa"], ":idtipopdf" => $tipoPdf, ":usualta" => substr($_SESSION["usuario"], 0, 20)); $sql = "INSERT INTO web.wir_impresionesrgrl (ir_cantidadhojas, ir_fechaalta, ir_id, ir_idestablecimiento, ir_idsolicitudafiliacion, ir_idtipopdf, ir_usualta) VALUES (:cantidadhojas, SYSDATE, 1, :idestablecimiento, :idsolicitudafiliacion, :idtipopdf, :usualta)"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); } else { if ($establecimientoDeBaja) { // Si el establecimiento está dado de baja.. $params = array(":id" => $idTmp); $sql = "SELECT DECODE(ir_fechabaja, NULL, 0, 1) FROM web.wir_impresionesrgrl WHERE ir_id = :id"; // Si el registro de impresión NO está dado de baja.. if (valorSql($sql, 0, $params, 0) == 0) { $params = array(":id" => $idTmp, ":usubaja" => substr($_SESSION["usuario"], 0, 20)); $sql = "UPDATE web.wir_impresionesrgrl SET ir_fechabaja = SYSDATE, ir_usubaja = :usubaja WHERE ir_id = :id"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); } } else { // Sino, es una modificación.. $params = array(":cantidadhojas" => $cantidadHojas, ":id" => $idTmp, ":usumodif" => substr($_SESSION["usuario"], 0, 20)); $sql = "UPDATE web.wir_impresionesrgrl SET ir_cantidadhojas = :cantidadhojas, ir_fechamodif = SYSDATE, ir_usumodif = :usumodif WHERE ir_id = :id"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); } } }
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> <? }
// Guardo los objetivos.. for ($i = 1; $i <= 2; $i++) { if ($_POST["Objetivo" . $i . "Id"] == "") { $sql = "INSERT INTO rrhh.hfo_formularioobjetivo\n\t\t\t\t\t\t\t\t\t\t\t(fo_id_formularioevaluacion, fo_nroobjetivo, fo_objetivo, fo_resultado, fo_indicador, fo_plazo, fo_objetivofuturo,\n\t\t\t\t\t\t\t\t\t\t\tfo_resultadofuturo, fo_indicadorfuturo, fo_plazofuturo, fo_usualta, fo_fechaalta)\n\t\t\t\t\t\t\t VALUES (" . $_POST["FormularioId"] . ", " . $i . ",\n\t\t\t\t\t\t\t \t\t\t\tSUBSTR(" . addQuotes($_POST["Objetivo" . $i . "Descripcion"]) . ", 1, 2000),\n\t\t\t\t\t\t\t \t\t\t\tSUBSTR(" . addQuotes($_POST["Objetivo" . $i . "ResultadoAObtener"]) . ", 1, 2000),\n\t\t\t\t\t\t\t \t\t\t\tSUBSTR(" . addQuotes($_POST["Objetivo" . $i . "Indicador"]) . ", 1, 2000),\n\t\t\t\t\t\t\t \t\t\t\tSUBSTR(" . addQuotes($_POST["Objetivo" . $i . "PlazoEjecucion"]) . ", 1, 2000),\n\t\t\t\t\t\t\t \t\t\t\tSUBSTR(" . addQuotes($_POST["Objetivo" . $i . "DescripcionFuturo"]) . ", 1, 2000),\n\t\t\t\t\t\t\t \t\t\t\tSUBSTR(" . addQuotes($_POST["Objetivo" . $i . "ResultadoAObtenerFuturo"]) . ", 1, 2000),\n\t\t\t\t\t\t\t \t\t\t\tSUBSTR(" . addQuotes($_POST["Objetivo" . $i . "IndicadorFuturo"]) . ", 1, 2000),\n\t\t\t\t\t\t\t \t\t\t\tSUBSTR(" . addQuotes($_POST["Objetivo" . $i . "PlazoEjecucionFuturo"]) . ", 1, 2000),\n\t\t\t\t\t\t\t \t\t\t\tUPPER(" . addQuotes($user) . "), SYSDATE)"; } else { $sql = "UPDATE rrhh.hfo_formularioobjetivo\n\t\t\t\t\t\t\tSET fo_objetivo = SUBSTR(:objetivo, 1, 2000),\n\t\t\t\t\t\t\t\t\tfo_resultado = SUBSTR(:resultado, 1, 2000),\n\t\t\t\t\t\t\t\t\tfo_indicador = SUBSTR(:indicador, 1, 2000),\n\t\t\t\t\t\t\t\t\tfo_plazo = SUBSTR(:plazo, 1, 2000),\n\t\t\t\t\t\t\t\t\tfo_objetivofuturo = SUBSTR(:objetivofuturo, 1, 2000),\n\t\t\t\t\t\t\t\t\tfo_resultadofuturo = SUBSTR(:resultadofuturo, 1, 2000),\n\t\t\t\t\t\t\t\t\tfo_indicadorfuturo = SUBSTR(:indicadorfuturo, 1, 2000),\n\t\t\t\t\t\t\t\t\tfo_plazofuturo = SUBSTR(:plazofuturo, 1, 2000),\n\t\t\t\t\t\t\t\t\tfo_usumodif = UPPER(:usumodif),\n\t\t\t\t\t\t\t\t\tfo_fechamodif = SYSDATE\n\t\t\t\t\t WHERE fo_id = :id"; } $params = array(":objetivo" => $_POST["Objetivo" . $i . "Descripcion"], ":resultado" => $_POST["Objetivo" . $i . "ResultadoAObtener"], ":indicador" => $_POST["Objetivo" . $i . "Indicador"], ":plazo" => $_POST["Objetivo" . $i . "PlazoEjecucion"], ":objetivofuturo" => $_POST["Objetivo" . $i . "DescripcionFuturo"], ":resultadofuturo" => $_POST["Objetivo" . $i . "ResultadoAObtenerFuturo"], ":indicadorfuturo" => $_POST["Objetivo" . $i . "IndicadorFuturo"], ":plazofuturo" => $_POST["Objetivo" . $i . "PlazoEjecucionFuturo"], ":usumodif" => $user, ":id" => $_POST["Objetivo" . $i . "Id"]); DBExecSql($conn, $sql, $params); } // Guardo el porcentaje de cumplimiento y el estado de los objetivos.. $sql = "UPDATE rrhh.hfo_formularioobjetivo\n\t\t\t\t\tSET fo_porcentajecumplimiento = :porcentajecumplimiento,\n\t\t\t\t\t\t\tfo_estado = :estado,\n\t\t\t\t\t\t\tfo_usumodif = UPPER(:usumodif),\n\t\t\t\t\t\t\tfo_fechamodif = SYSDATE\n\t\t\t WHERE fo_id = (SELECT MAX(fo_id)\n\t\t\t\t\t\t\t\t\t\t\tFROM rrhh.hfo_formularioobjetivo\n\t\t\t\t\t\t\t\t\t\t WHERE fo_id_formularioevaluacion = :idformularioevaluacion\n\t\t\t\t\t\t\t\t\t\t\t AND fo_nroobjetivo = 1)"; $params = array(":porcentajecumplimiento" => nullIfCero($_POST["porcentajeCumplimiento1"]), ":estado" => $_POST["estadoObjetivo1Tmp"], ":usumodif" => $user, ":idformularioevaluacion" => $_POST["FormularioId"]); DBExecSql($conn, $sql, $params); $sql = "UPDATE rrhh.hfo_formularioobjetivo\n\t\t\t\t\tSET fo_porcentajecumplimiento = :porcentajecumplimiento,\n\t\t\t\t\t\t\tfo_estado = :estado,\n\t\t\t\t\t\t\tfo_usumodif = UPPER(:usumodif),\n\t\t\t\t\t\t\tfo_fechamodif = SYSDATE\n\t\t\t WHERE fo_id = (SELECT MAX(fo_id)\n\t\t\t\t\t\t\t\t\t\t\tFROM rrhh.hfo_formularioobjetivo\n\t\t\t\t\t\t\t\t\t\t WHERE fo_id_formularioevaluacion = :idformularioevaluacion\n\t\t\t\t\t\t\t\t\t\t\t AND fo_nroobjetivo = 2)"; $params = array(":porcentajecumplimiento" => nullIfCero($_POST["porcentajeCumplimiento2"]), ":estado" => $_POST["estadoObjetivo2Tmp"], ":usumodif" => $user, ":idformularioevaluacion" => $_POST["FormularioId"]); DBExecSql($conn, $sql, $params); // Guardo los compromisos de mejora.. $iLoop = 1; while (isset($_POST["CompromisoMejoraId" . $iLoop])) { if ($_POST["CompromisoMejoraId" . $iLoop] > 0) { $sql = "UPDATE rrhh.hcm_compromisomejora\n\t\t\t\t\t\t\tSET cm_mejora = SUBSTR(:mejora, 1, 2000),\n\t\t\t\t\t\t\t\t\tcm_usumodif = UPPER(:usumodif),\n\t\t\t\t\t\t\t\t\tcm_fechamodif = SYSDATE\n\t\t\t\t\t WHERE cm_id = :id"; $params = array(":mejora" => $_POST["CompromisoMejora" . $iLoop], ":usumodif" => $user, ":id" => $_POST["CompromisoMejoraId" . $iLoop]); DBExecSql($conn, $sql, $params); } else { $sql = "INSERT INTO rrhh.hcm_compromisomejora (cm_id_formularioevaluacion, cm_mejora, cm_usualta, cm_fechaalta)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t VALUES (:idformularioevaluacion, SUBSTR(:mejora, 1, 2000), UPPER(:usualta), SYSDATE)"; $params = array(":idformularioevaluacion" => $_POST["FormularioId"], ":mejora" => $_POST["CompromisoMejora" . $iLoop], ":usualta" => $user); DBExecSql($conn, $sql, $params); } $iLoop++; }
DBExecSql($conn, $sql, $params, OCI_DEFAULT); $sql = "INSERT INTO rrhh.hfe_formularioevaluacion2008 (fe_anoevaluacion, fe_estado, fe_evaluado, fe_fechaalta, fe_fechadesde,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t fe_fechahasta, fe_usualta)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tVALUES (:ano, :estado, :evaluado, SYSDATE, TO_DATE(:fechadesde, 'dd/mm/yyyy'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE(:fechahasta, 'dd/mm/yyyy'), :usualta)"; $params = array(":ano" => $_REQUEST["ano"], ":estado" => $_REQUEST["estado"], ":evaluado" => $_REQUEST["evaluadoId"], ":fechadesde" => $_REQUEST["fechaDesde"], ":fechahasta" => $_REQUEST["fechaHasta"], ":usualta" => GetWindowsLoginName(true)); DBExecSql($conn, $sql, $params, OCI_DEFAULT); // Actualizo las competencias que se espera que el usuario cumpla trayendolas de la evaluación anterior.. $sql = "UPDATE rrhh.hfe_formularioevaluacion2008\n\t\t\t\t\tSET (fe_orientacionesp, fe_adaptabilidadesp, fe_equipoesp, fe_clienteesp, fe_liderazgoesp, fe_planificacionesp, fe_analiticoesp) =\n\t\t\t (SELECT fe_orientacionfuturo, fe_adaptabilidadfuturo, fe_equipofuturo, fe_clientefuturo, fe_liderazgofuturo, fe_planificacionfuturo,\n\t\t\t\t\t\t\t fe_analiticofuturo\n\t\t\t\t FROM rrhh.hfe_formularioevaluacion2008\n\t\t\t WHERE fe_evaluado = :evaluado\n\t\t\t\t\tAND fe_fechabaja IS NULL\n\t\t\t\t\tAND fe_anoevaluacion = :ano1)\n\t\t\t\tWHERE fe_evaluado = :evaluado\n\t\t\t\t\tAND fe_anoevaluacion = :ano2"; $params = array(":ano" => $_REQUEST["ano"] - 1, ":evaluado" => $_REQUEST["evaluadoId"], ":ano2" => $_REQUEST["ano"]); DBExecSql($conn, $sql, $params, OCI_DEFAULT); } if ($_POST["tipoOp"] == "M") { // Modificación.. $sql = "UPDATE rrhh.hue_usuarioevaluacion\n\t\t\t\t\tSET ue_categoria = :categoria,\n\t\t\t\t\t\t\tue_estado = :estado,\n\t\t\t\t\t\t\tue_evaluador = :evaluador,\n\t\t\t\t\t\t\tue_fechamodif = SYSDATE,\n\t\t\t\t\t\t\tue_notificacion = :notificacion,\n\t\t\t\t\t\t\tue_supervisor = :supervisor,\n\t\t\t\t\t\t\tue_usumodif = :usumodif\n\t\t\t WHERE ue_id = :id"; $params = array(":categoria" => nullIfCero($_REQUEST["competencias"], true), ":estado" => $_REQUEST["estado"], ":evaluador" => nullIfCero($_REQUEST["evaluadorId"], true), ":notificacion" => $notificacion, ":supervisor" => nullIfCero($_REQUEST["supervisorId"], true), ":usumodif" => GetWindowsLoginName(true), ":id" => $_REQUEST["id"]); DBExecSql($conn, $sql, $params, OCI_DEFAULT); $sql = "UPDATE rrhh.hfe_formularioevaluacion2008\n\t\t\t\t\tSET fe_estado = :estado,\n\t\t\t\t\t\t\tfe_evaluador = :evaluador,\n\t\t\t\t\t\t\tfe_fechadesde = TO_DATE(:fechahasta, 'dd/mm/yyyy'),\n\t\t\t\t\t\t\tfe_fechahasta = TO_DATE(:fechahasta, 'dd/mm/yyyy'),\n\t\t\t\t\t\t\tfe_fechamodif = SYSDATE,\n\t\t\t\t\t\t\tfe_supervisor = :supervisor,\n\t\t\t\t\t\t\tfe_usumodif = :usumodif\n\t\t\t WHERE fe_evaluado = :evaluado\n\t\t\t\t\tAND fe_anoevaluacion = :ano"; $params = array(":estado" => $_REQUEST["estado"], ":evaluador" => nullIfCero($_REQUEST["evaluadorId"], true), ":fechadesde" => $_REQUEST["fechaDesde"], ":fechahasta" => $_REQUEST["fechaHasta"], ":supervisor" => nullIfCero($_REQUEST["supervisorId"], true), ":usumodif" => GetWindowsLoginName(true), ":evaluado" => $_REQUEST["evaluadoId"], ":ano" => $_REQUEST["ano"]); DBExecSql($conn, $sql, $params, OCI_DEFAULT); } if ($_POST["tipoOp"] == "B") { // Baja.. $sql = "UPDATE rrhh.hue_usuarioevaluacion\n\t\t\t\t\tSET ue_fechabaja = SYSDATE,\n\t\t\t\t\t\t\tue_usubaja = :usubaja\n\t\t\t WHERE ue_id = :id"; $params = array(":usubaja" => GetWindowsLoginName(true), ":id" => $_REQUEST["id"]); DBExecSql($conn, $sql, $params, OCI_DEFAULT); $sql = "UPDATE rrhh.hfe_formularioevaluacion2008\n\t\t\t\t\tSET fe_fechabaja = SYSDATE,\n\t\t\t\t\t\t\tfe_usubaja = :usubaja\n\t\t\t WHERE fe_evaluado = :evaluado\n\t\t\t\t\tAND fe_anoevaluacion = :ano"; $params = array(":usubaja" => GetWindowsLoginName(true), ":evaluado" => $_REQUEST["evaluadoId"], ":ano" => $_REQUEST["ano"]); DBExecSql($conn, $sql, $params, OCI_DEFAULT); } DBCommit($conn); } catch (Exception $e) { DBRollback($conn); echo "<script>alert(unescape('" . rawurlencode($e->getMessage()) . "'));</script>";
$row = DBGetQuery($stmt); $curs = null; $params = array(":nrosolicitud" => $row["SC_NROSOLICITUD"]); $sql = "BEGIN art.cotizacion.get_valor_carta(:nrosolicitud, :data); END;"; $stmt2 = DBExecSP($conn, $curs, $sql, $params); $rowValorFinal = DBGetSP($curs); $params = array(":descuento" => 0, ":id" => $id, ":n_capitas_cotiz" => $row["CANTTRABAJADOR"], ":n_masa_cotiz" => $row["MASASALARIAL"], ":n_porc_var_cotiz" => str_replace(array(".", "%"), array(",", ""), $rowValorFinal["PORCVARIABLE"]), ":n_sumafija_cotiz" => str_replace(array("$", ",", "."), array("", "", ","), $rowValorFinal["SUMAFIJA"]), ":nid_cotizacion" => nullIfCero($row["SC_IDCOTIZACION"]), ":nsc_idzonageografica" => nullIfCero($row["SC_IDZONAGEOGRAFICA"]), ":s_cuit" => $row["SC_CUIT"], ":seleccion_sumaaseg" => $_REQUEST["valor"]); $sql = "SELECT TO_CHAR(sc_masasalarial * art.cotizacion.get_valor_rc(:s_cuit, :n_capitas_cotiz, :n_masa_cotiz, :n_porc_var_cotiz, :n_sumafija_cotiz, :nsc_idzonageografica, :nid_cotizacion, :seleccion_sumaaseg, :descuento) / 100, '$9,999,999,990.00') cuotainicialrc, art.cotizacion.get_valor_rc(:s_cuit, :n_capitas_cotiz, :n_masa_cotiz, :n_porc_var_cotiz, :n_sumafija_cotiz, :nsc_idzonageografica, :nid_cotizacion, :seleccion_sumaaseg, :descuento) polizarc FROM asc_solicitudcotizacion, aco_cotizacion WHERE sc_idcotizacion = co_id(+) AND sc_id = :id"; $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt); ?> <script type="text/javascript"> with (window.parent.document) { getElementById('polizaRC').value = '<?php
pl_mail = :email, pl_jefe = :jefe, pl_referente = :referente, pl_fechadesde = :activardesde, pl_fechahasta = :activarhasta, pl_idgrupo = :grupo, pl_idestado = :estado, pl_departamento = :departamento, pl_administrador = :administrador,"; if (isset($_REQUEST["resetearClave"])){ $params[":password"] = md5($_REQUEST["numeroDocumento"]); $sql.= " pl_cambiopassword = 0, pl_password = :password,"; } $params[":referenterrhh"] = nullIfCero($_REQUEST["referenteRrhh"]); $params[":id"] = $_REQUEST["id"]; $sql.= "pl_rrhh = :referenterrhh WHERE pl_id = :id"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); } if ($_REQUEST["tipoOp"] == "B") { // Baja.. $params = array(":usubaja" => $_SESSION["idUsuario"], ":id" => $_REQUEST["id"]); $sql = "UPDATE rrhh.dpl_login SET pl_fechabaja = SYSDATE, pl_usubaja = :usubaja WHERE pl_id = :id"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); }
$curs = null; $params = array(":calle" => $_POST["calle"], ":codprov" => $_POST["idProvincia"], ":contrato" => $_SESSION["contrato"], ":estableci" => $_POST["numeroEstablecimiento"], ":cpa" => $_POST["cpa"], ":cpostal" => $_POST["codigoPostal"], ":desctipoobra" => $_POST["observaciones"], ":fechafin" => $_POST["fechaFinalizacion"], ":fechainicio" => $_POST["fechaInicio"], ":fextension" => $_POST["fechaExtension"], ":freinicio" => $_POST["fechaReinicio"], ":fsuspension" => $_POST["fechaSuspension"], ":idavisoobraweb" => nullIfCero($_POST["idAvisoObraWeb"]), ":idestab319" => nullIfCero($_POST["idObrador"]), ":idresolucion" => nullIfCero($_POST["idResolucion"]), ":localidad" => $_POST["localidad"], ":numero" => $_POST["numero"], ":plantas" => $_POST["numeroPlantas"], ":superficie" => $_POST["superficieConstruir"], ":tipo" => $_POST["tipoFormulario"], ":tipoform" => $_POST["tipoForm"], ":usuario" => $_SESSION["usuario"]); $sql = "BEGIN art.hys_avisoobraweb.do_guardaravisodeobra(:data, :idavisoobraweb, :contrato, :estableci, TO_DATE(:fechainicio, 'DD/MM/YYYY'), TO_DATE(:fechafin, 'DD/MM/YYYY'), TO_DATE(:fextension, 'DD/MM/YYYY'), TO_DATE(:fsuspension, 'DD/MM/YYYY'), TO_DATE(:freinicio, 'DD/MM/YYYY'), :calle, :numero, :localidad, :codprov, :cpostal, :cpa, :desctipoobra, :superficie, :plantas, :tipo, :idresolucion, :idestab319, :tipoform, :usuario); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params, true, 0); $row = DBGetSP($curs); $curs = null; $params = array(":idavisoobraweb" => $row["ID"], ":obrasdearquitectura" => getObrasArquitectura(), ":obrasdeductos" => getDuctos(),
":slocalidad" => $_POST["localidad"], ":snombre" => strtoupper($_POST["nombre"]), ":snumero" => $_POST["numero"], ":sotranacionalidad" => $_POST["otraNacionalidad"], ":spiso" => $_POST["piso"], ":sprovincia" => $_POST["idProvincia"], ":ssector" => $_POST["sector"], ":ssexo" => $_POST["sexo"], ":starea" => $_POST["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;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $row = DBGetSP($curs); if (nullIfCero($idTrabajador) == NULL) { $sql = "SELECT MAX(tj_id) FROM ctj_trabajador"; $idTrabajador = valorSql($sql, "", array()); } if (($row["NUMEROERROR"] != "0") and ($row["NUMEROERROR"] != "")) throw new Exception($row["NUMEROERROR"]." - ".$row["DESCRIPCIONERROR"]); // Actualizo los teléfonos.. $dataTel = inicializarTelefonos(OCI_COMMIT_ON_SUCCESS, "tt_idtrabajador", $idTrabajador, "tt", "att_telefonotrabajador", $_SESSION["usuario"]); copiarTempATelefonos($dataTel); $params = array(":id" => $idTrabajador); $sql = "UPDATE ctj_trabajador SET tj_telefono = SUBSTR(art.afi.get_telefonos('ATT_TELEFONOTRABAJADOR', tj_id), 1, 30)
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>"; } }
exit; $params = array(":cargo" => $_POST["cargo"], ":contrato" => nullIfCero($_POST["relacionLaboral"]), ":cuil" => nullIsEmpty($_POST["cuil"]), ":delegacion" => nullIfCero($_POST["delegacion"]), ":fechacumple" => nullIsEmpty($_POST["fechaNacimiento"]), ":horarioatencion" => nullIsEmpty($_POST["horarioAtencion"]), ":id" => $_POST["id"], ":iddelegacionsede" => nullIfCero($_POST["edificio"]), ":idsector" => nullIfCero($_POST["sector"]), ":interno" => nullIsEmpty($_POST["interno"]), ":legajo" => nullIsEmpty($_POST["codigoInternoRRHH"]), ":legajorrhh" => nullIsEmpty($_POST["legajoRRHH"]), ":piso" => nullIsEmpty($_POST["piso"]), ":respondea" => nullIfCero($_POST["respondeA"]), ":usumodif" => getWindowsLoginName(true)); $sql = "UPDATE use_usuarios SET se_cargo = :cargo, se_contrato = :contrato, se_cuil = :cuil, se_delegacion = :delegacion, se_fechacumple = TO_DATE(:fechacumple, 'dd/mm/yyyy'), se_fechamodif = SYSDATE, se_horarioatencion = :horarioatencion, se_iddelegacionsede = :iddelegacionsede, se_idsector = :idsector, se_interno = :interno, se_legajo = :legajo, se_legajorrhh = :legajorrhh,
":sjw_departamento" => nullIsEmpty($_POST["departamento"]), ":sjw_documento" => $cuilTrabajador, ":sjw_estcivil" => nullIfCero($_POST["estadoCivil"]), ":sjw_horarioinicio" => $_POST["horaDesde"].":".$_POST["minutoDesde"], ":sjw_horariofin" => $_POST["horaHasta"].":".$_POST["minutoHasta"], ":sjw_localidad" => $_POST["localidad"], ":sjw_nacionalidad" => nullIfCero($_POST["nacionalidad"]), ":sjw_nombre" => $apellidoNombreTrabajador, ":sjw_numero" => $_POST["numero"], ":sjw_piso" => nullIsEmpty($_POST["piso"]), ":sjw_provincia" => $_POST["idProvincia"], ":sjw_puesto" => $_POST["puesto"], ":sjw_sexo" => nullIfCero($_POST["sexo"]), ":sjw_telefono" => nullIsEmpty(substr($_POST["telefono"], 0, 30)), ":sjw_tipodoc" => 1, ":new_nro_cecap" => nullIfCero($_POST["numeroCecap"])); $sql ="BEGIN webart.set_denuncia_siniestro(:data, TO_DATE(:dew_epmanifestacion, 'dd/mm/yyyy'), TO_DATE(:dew_fechasin, 'dd/mm/yyyy'), TO_DATE(:djw_fec_ingreso, 'dd/mm/yyyy'), TO_DATE(:djw_fec_nacimiento, 'dd/mm/yyyy'), :new_dnidenunciante, :new_idestablecimientotercero, :new_prestadorid, :new_tiposiniestro, :njw_idtrabajador, :sew_agente, :sew_cuit, :sew_descripcion, :sew_denunciante, :sew_domicilioestable, :sew_establecimiento, :sew_establepropio, :sew_forma, :sew_gravedad, :sew_horasin, :sew_horjornadadesde, :sew_horjornadahasta, :sew_lugarcalle, :sew_lugarcpostal, :sew_lugardenuncia, :sew_lugarlocalidad, :sew_lugarnro, :sew_lugarocurrencia, :sew_lugarprovincia, :sew_manohabil, :sew_multiple, :sew_naturaleza, :sew_otrolugar, :sew_prestadordomicilio, :sew_prestadornombre, :sew_prestadortelefono, :sew_tareaaccidente, :sew_transito, :sew_zona, :sjw_calle, :sjw_codpostal, :sjw_cuitcontratista, :sjw_departamento, :sjw_documento, :sjw_estcivil, :sjw_horarioinicio, :sjw_horariofin, :sjw_localidad, :sjw_nacionalidad, :sjw_nombre, :sjw_numero, :sjw_piso, :sjw_provincia, :sjw_puesto, :sjw_sexo, :sjw_telefono, :sjw_tipodoc, :new_nro_cecap); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $row = DBGetSP($curs); } catch (Exception $e) { ?> <script type="text/javascript"> alert(unescape('<?php echo rawurlencode($e->getMessage()); ?> ')); with (window.parent.document) { getElementById('imgProcesando').style.display = 'none'; getElementById('btnEnviar').style.display = 'inline'; }
require_once($_SERVER["DOCUMENT_ROOT"]."/functions/general.php"); validarSesion(isset($_SESSION["isAgenteComercial"])); $id = substr($_REQUEST["id"], 1); $params = array(":id" => $id); $sql = "SELECT sc_idcotizacion FROM asc_solicitudcotizacion WHERE sc_id = :id"; $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt); $params = array(":descuento" => 0, ":n_capitas_cotiz" => str_replace(array("%"), array(""), $_REQUEST["capitas"]), ":n_masa_cotiz" => str_replace(array("%", "NaN"), array("", 0), $_REQUEST["masasalarial"]), ":n_porc_var_cotiz" => str_replace(array("%"), array(""), $_REQUEST["porcentajevariable"]), ":n_sumafija_cotiz" => str_replace(array("$", ","), array("", ""), $_REQUEST["costomensual"]), ":nid_cotizacion" => nullIfCero($row["SC_IDCOTIZACION"]), ":nsc_idzonageografica" => $_REQUEST["zonageografica"], ":s_cuit" => $_REQUEST["cuit"], ":seleccion_sumaaseg" => $_REQUEST["valor"]); $sql = "SELECT art.cotizacion.get_valor_rc(:s_cuit, :n_capitas_cotiz, :n_masa_cotiz, :n_porc_var_cotiz, :n_sumafija_cotiz, :nsc_idzonageografica, :nid_cotizacion, :seleccion_sumaaseg, :descuento) FROM DUAL"; ?> <script type="text/javascript"> with (window.parent.document) if (getElementById('polizaRC') != undefined) getElementById('polizaRC').value = '<?php echo ValorSql($sql, "", $params); ?> '; </script>
if (!hasPermiso(76)) throw new Exception("Usted no tiene permiso para ingresar a este módulo."); if (!validar()) exit; if ($_POST["destino"] == -1) $_POST["destino"] = "_self"; if ($_POST["ubicacion"] == -1) $_POST["ubicacion"] = NULL; if ($_POST["id"] == 0) { // Es un alta.. $params = array(":cuerpo" => $_POST["bajada"], ":destino" => nullIfCero($_POST["destino"]), ":fechavigenciadesde" => $_POST["vigenciaDesde"], ":fechavigenciahasta" => $_POST["vigenciaHasta"], ":habilitarcomentarios" => $habilitarComentarios, ":mostrarenportada" => $mostrarEnPortada, ":posicion" => zeroIfEmpty($_POST["posicion"]), ":tipo" => $_POST["tipo"], ":titulo" => $_POST["titulo"], ":ubicacion" => $_POST["ubicacion"], ":usualta" => getWindowsLoginName(true), ":vistaprevia" => $vistaPrevia, ":volanta" => $_POST["volanta"]); $sql = "INSERT INTO web.wai_articulosintranet (ai_cuerpo, ai_destino, ai_fechaalta, ai_fechavigenciadesde, ai_fechavigenciahasta, ai_habilitarcomentarios, ai_id, ai_mostrarenportada, ai_posicion, ai_tipo, ai_titulo, ai_ubicacion, ai_usualta, ai_vistaprevia, ai_volanta) VALUES (:cuerpo, :destino, SYSDATE, TO_DATE(:fechavigenciadesde, 'DD/MM/YYYY'), TO_DATE(:fechavigenciahasta, 'DD/MM/YYYY'), :habilitarcomentarios, -1,
if (!$uploadOk) { ?> <script> alert('Ocurrió un error al cargar la Foto. Inténtelo nuevamente.'); history.go(-1); <script> <? exit; } } // Guardo los datos en la tabla.. $params = array(":cargo" => $_REQUEST["Cargo"], ":contrato" => nullIsEmpty($_REQUEST["RelacionLaboral"]), ":delegacion" => $_REQUEST["Delegacion"], ":edificio" => nullIfCero($_REQUEST["Edificio"]), ":ejex" => nullIsEmpty($_REQUEST["EjeX"]), ":ejey" => nullIsEmpty($_REQUEST["EjeY"]), ":fechacumple" => $_REQUEST["FechaNacimiento"], ":horarioatencion" => $_REQUEST["HorarioAtencion"], ":idsector" => IIF(($_REQUEST["Sector"] == "-1"), NULL, $_REQUEST["Sector"]), ":interno" => $_REQUEST["Interno"], ":legajo" => nullIsEmpty($_REQUEST["Legajo"]), ":legajorrhh" => nullIsEmpty($_REQUEST["LegajoRRHH"]), ":piso" => nullIsEmpty($_REQUEST["Piso"]), ":respondea" => IIF(($_REQUEST["RespondeA"] == "-1"), NULL, $_REQUEST["RespondeA"]), ":usumodif" => GetWindowsLoginName()); $sql = "UPDATE use_usuarios SET se_fechamodif = SYSDATE, se_usumodif = UPPER(:usumodif),
while ($row = DBGetQuery($stmt)) { $curs = null; $params = array(":cconfirmapuesto" => "S" /*$row["CM_CONFIRMAPUESTO"]*/, ":dfechabaja" => NULL, ":dfechaingreso" => $row["CM_FECHAINGRESO"], ":dfechanacimiento" => $row["CM_FECHANACIMIENTO"], ":ncontrato" => $_SESSION["contrato"], ":nidmodalidadcontratacion" => nullIfCero($row["IDTIPOCONTRATO"]), ":nidnacionalidad" => nullIfCero($row["IDNACIONALIDAD"]), ":nidrelacionlaboral" => NULL, ":nidtrabajador" => NULL, ":nidusuario" => $_SESSION["idUsuario"], ":nsueldo" => formatFloat(nullIfCero($row["CM_SUELDO"])), ":scalle" => $row["CM_CALLE"], ":scategoria" => NULL, ":sciuo" => nullIfCero($row["CM_CIUO"]), ":scodaltatemprana" => NULL, ":scodareatelefono" => NULL, ":scpostal" => $row["CM_CODIGOPOSTAL"], ":scpostala" => NULL, ":scuil" => $row["CM_CUIL"], ":sdepartamento" => $row["CM_DEPARTAMENTO"], ":sdocumento" => NULL, ":sdomicilio" => NULL, ":semail" => NULL, ":sestablecimientos" => getEstablecimiento($row["CM_ESTABLECIMIENTO"]), ":sestadocivil" => $row["CODIGOESTADOCIVIL"], ":slateralidad" => NULL, ":slocalidad" => $row["CM_LOCALIDAD"], ":snombre" => $row["CM_NOMBRE"], ":snumero" => $row["CM_NUMERO"],
":esp_nivel_1" => nullIfCero(substr($_POST["nivelEspecializacion1"], 0, 40)), ":esp_tipo_2"=> nullIfCero(($_POST["especializacion2visible"] == "t")?substr($_POST["tipo2"], 0, 40):""), ":esp_elemento_2" => nullIfCero(($_POST["especializacion2visible"] == "t")?substr($_POST["elemento2"], 0, 40):""), ":esp_nivel_2" => nullIfCero(($_POST["especializacion2visible"] == "t")?substr($_POST["nivelEspecializacion2"], 0, 40):""), ":esp_tipo_3"=> nullIfCero(($_POST["especializacion3visible"] == "t")?substr($_POST["tipo3"], 0, 40):""), ":esp_elemento_3" => nullIfCero(($_POST["especializacion3visible"] == "t")?substr($_POST["elemento3"], 0, 40):""), ":esp_nivel_3" => nullIfCero(($_POST["especializacion3visible"] == "t")?substr($_POST["nivelEspecializacion3"], 0, 40):""), ":esp_tipo_4"=> nullIfCero(($_POST["especializacion4visible"] == "t")?substr($_POST["tipo4"], 0, 40):""), ":esp_elemento_4" => nullIfCero(($_POST["especializacion4visible"] == "t")?substr($_POST["elemento4"], 0, 40):""), ":esp_nivel_4" => nullIfCero(($_POST["especializacion4visible"] == "t")?substr($_POST["nivelEspecializacion4"], 0, 40):""), ":foto" => nullIfCero(($_FILES["foto"]["name"] != "")?$filename.".".pathinfo(strtolower($_FILES["foto"]["name"]), PATHINFO_EXTENSION):""), ":cv" => nullIfCero(($_FILES["cv"]["name"] != "")?$filename.".".pathinfo(strtolower($_FILES["cv"]["name"]), PATHINFO_EXTENSION):"")); $sql = "INSERT INTO rrhh.rcv_curriculumvitae (tipo_doc, nro_doc, nombre_1, nombre_2, apellido_1, apellido_2, fec_nacimiento, sexo, estado_civil, fec_estado_civil, apellido_casada, pais_nacimiento, nacionalidad, fec_ingreso_pais, cantidad_hijos, foto_postulante, fecha_ingreso_curriculum, referencias, procedencia, remuneracion_pretendida, telefono_personal, telefono_celular, email, dir_calle, dir_nro, dir_piso, dir_dpto, dir_torre, dir_manzana, dir_sector, cod_postal, localidad, provincia, partido, zona, pais, nivel_1, completo_1, titulo_1, institucion_1, carrera_1, fecha_desde_1, fecha_hasta_1, promedio_1, rango_1, estudia_actualmente_1, nivel_2, completo_2, titulo_2, institucion_2, carrera_2, fecha_desde_2, fecha_hasta_2, promedio_2, rango_2, estudia_actualmente_2, nivel_3, completo_3, titulo_3, institucion_3, carrera_3, fecha_desde_3, fecha_hasta_3, promedio_3, rango_3, estudia_actualmente_3, nivel_4, completo_4, titulo_4, institucion_4, carrera_4, fecha_desde_4, fecha_hasta_4, promedio_4, rango_4, estudia_actualmente_4, cargo_anterior_1, empresa_1, tarea_desempenada_1, fec_desde_1, fec_hasta_1, remuneracion_1, causa_baja_1, cargo_anterior_2, empresa_2, tarea_desempenada_2, fec_desde_2, fec_hasta_2, remuneracion_2, causa_baja_2, cargo_anterior_3, empresa_3, tarea_desempenada_3, fec_desde_3, fec_hasta_3, remuneracion_3, causa_baja_3, cargo_anterior_4, empresa_4, tarea_desempenada_4, fec_desde_4, fec_hasta_4, remuneracion_4, causa_baja_4, idioma_1, lee_nivel_1, habla_nivel_1, escribe_nivel_1, idioma_2, lee_nivel_2, habla_nivel_2, escribe_nivel_2, idioma_3, lee_nivel_3, habla_nivel_3, escribe_nivel_3, idioma_4, lee_nivel_4, habla_nivel_4, escribe_nivel_4, desc_curso_1, tipo_curso_1, fec_curso_1, instituto_1, desc_curso_2, tipo_curso_2, fec_curso_2, instituto_2, desc_curso_3,
":tiponovedad" => nullIfCero($_REQUEST["tipoNovedad"]), ":titulo" => $_REQUEST["titulo"], ":usualta" => GetWindowsLoginName()); $sql = "INSERT INTO rrhh.rnp_novedadespersonales (np_id, np_tiponovedad, np_texto, np_fechaalta, np_usualta, np_titulo) VALUES (:id, :tiponovedad, :texto, SYSDATE, UPPER(:usualta), :titulo)"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); $sql = "SELECT MAX(np_id) FROM rrhh.rnp_novedadespersonales"; $_REQUEST["id"] = ValorSql($sql, 0, array(), 0); } if ($_REQUEST["tipoOp"] == "M") { // Modificación.. $params = array(":id" => $_REQUEST["id"], ":texto" => $_REQUEST["texto"], ":tiponovedad" => nullIfCero($_REQUEST["tipoNovedad"]), ":titulo" => $_REQUEST["titulo"], ":usumodif" => GetWindowsLoginName()); $sql = "UPDATE rrhh.rnp_novedadespersonales SET np_tiponovedad = :tiponovedad, np_texto = :texto, np_titulo = :titulo, np_fechamodif = SYSDATE, np_usumodif = UPPER(:usumodif) WHERE np_id = :id"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); } if ($_REQUEST["tipoOp"] == "B") { // Baja.. $params = array(":id" => $_REQUEST["id"], ":usubaja" => GetWindowsLoginName());