1"use strict";(self.webpackChunkcomfama_portalservicios_archetype=self.webpackChunkcomfama_portalservicios_archetype||[]).push([[8229],{5290:function(e,o,t){t.d(o,{Lr:function(){return q},AL:function(){return Z},d2:function(){return V},Bk:function(){return G},Y5:function(){return U},hp:function(){return K},XJ:function(){return R},DB:function(){return L},u7:function(){return Q},ji:function(){return M},Pt:function(){return Y},UX:function(){return B},ex:function(){return m},CX:function(){return A},qc:function(){return T},GG:function(){return $},uJ:function(){return D},hn:function(){return b},QS:function(){return _},VY:function(){return x},r4:function(){return I},pR:function(){return w},xW:function(){return j},ZY:function(){return J},gw:function(){return f},vw:function(){return v},Xt:function(){return H},he:function(){return E},n6:function(){return X},Ft:function(){return S},cl:function(){return z},aG:function(){return y},lg:function(){return g},iy:function(){return h},mO:function(){return C},M:function(){return F},K2:function(){return P},ko:function(){return O},Dc:function(){return p},WU:function(){return k},ui:function(){return N},_8:function(){return W}});var n=t(84166),a=t(48314),i=t(89179),r=t(51145);const c=n.A.create(),s=new r.A;c.interceptors.response.use(e=>e,e=>{const o=e.config,{response:{status:t}}=e;return 403===t||401===t?u(o):Promise.reject(e)});const u=async e=>{try{e._retry=!0,await d(e)}catch(o){console.log(o)}},d=async e=>{const o=s.get("token"),t={headers:{apikey:`${a.aE}`}},i={action:"getJWT"};try{const r=await n.A.post(`${o}`,i,t);if(200===r.status)return e.headers.Authorization=`Bearer ${r.data.data.id_token}`,e.headers.apikey=`${a.gQ}`,e}catch(r){console.log(r)}},l=a.oX+"/afiliaciones/api/v1/",m=async(e,o,t,n="",a="")=>i.S.get(`${l}consultaCertificado?numeroDocumento=${e}&tipoDocumento=${o}&tipoDocumentoEmpresa=${a}&numeroDocumentoEmpresa=${n}`,{headers:{Authorization:`${t}`}}),p=async(e,o,t,n,a="",r="")=>i.S.get(`${l}consultarAfiliacionRetirado${n?"Empresa":""}?tipoDocumentoEmpresa=${r}&numeroDocumentoEmpresa=${a}&tipoDocumento=${o}&numeroDocumento=${e}`,{headers:{Authorization:`${t}`}}),f=async(e,o,t)=>i.S.get(`${a.oX}/certificados/proveedores/api/v1/CertificadoExperiencia?numeroDocumento=${e}&tipoDocumento=${o}`,{headers:{Authorization:`${t}`}}),$=async(e,o,t="",n="")=>i.S.get(`${l}consultarCarnetPdfAfiliacionTitularTrabajador?numeroDocumento=${e}&tipoDocumento=${o}&tipoDocumentoEmpresa=${n}&numeroDocumentoEmpresa=${t}`),D=async(e,o,t="",n="")=>i.S.get(`${l}consultarCarnetPdfAfiliacionPacTrabajador?numeroDocumento=${e}&tipoDocumento=${o}&tipoDocumentoEmpresa=${n}&numeroDocumentoEmpresa=${t}`),g=async(e,o)=>i.S.post(`${l}${o}`,e),y=async e=>i.S.post(`${l}descargarMasivoAfiliacion`,e),h=async e=>i.S.post(`${l}descargarMasivoAfiliacionCarnet`,e),v=async(e,o,t,n)=>i.S.get(`${l}consultarTrabajadorMasivoHistorico?numeroDocumento=${e}&numeroDocumentoEmpresa=${t}&tipoDocumento=${o}&tipoDocumentoEmpresa=${n}`),b=async(e,o,t,n,r,c,s)=>i.S.get(`${a.oX}/reportecompensacion/api/v1/consultaReporteCompensacion?anyo=${n}${r&&`&documentoContable=${r}`}${c&&`&fechaDesde=${c}`}${s&&`&fechaHasta=${s}`}&numeroDocumento=${e}&tipoConsulta=${t}&tipoDocumento=${o}`),S=async(e,o,t)=>i.S.get(`${l}listarAfiliadosCarnet?numeroDocumento=${e}&tipoDocumento=${o}`,{headers:{Authorization:`${t}`}}),x=async(e,o,t)=>i.S.get(`${l}consultarCarnetPdfAfiliacionTitular?numeroDocumento=${e}&tipoDocumento=${o}`,{headers:{Authorization:`${t}`}}),_=async(e,o,t)=>i.S.get(`${l}consultarCarnetPdfAfiliacionPac?numeroDocumentoPac=${e}&tipoDocumentoPac=${o}`,{headers:{Authorization:`${t}`}}),A=async(e="",o="",t)=>i.S.get(`${l}consultaCertificadoEmpleador?tipoDocumento=${o}&numeroDocumento=${e}`,{headers:{Authorization:`${t}`}}),j=async(e,o)=>i.S.get(`${a.oX}/certificadodeudas/api/v1/consultaCertificadoPersona?numeroDocumento=${e}&tipoDocumento=${o}`),N=async(e,o,t)=>i.S.get(`${a.oX}/entregasubsidio/api/v1/consultaEntregaSubsidio?numeroDocumento=${e}&periodo=${t}&tipoDocumento=${o}`),C=async(e,o,t,n)=>i.S.get(`${a.oX}/cuotamonetaria/api/v1/consultaCuotaMonetaria?numeroDocumento=${e}&periodoFinal=${t}&periodoInicial=${o}&tipoDocumento=${n}`),P=async(e,o,t,n)=>i.S.get(`${a.oX}/aportes/api/v1/consultaCertificadoPagoAporte?numeroDocumento=${e}&tipoDocumento=${n}&periodoInicio=${o}&periodoFin=${t}`),E=async(e,o,t)=>i.S.get(`${a.oX}/postulacionvivienda/api/v1/consultaEstadoPostulacion?numeroDocumento=${e}&tipoDocumento=${o}${t&&`&numeroFormulario=${t}`}`),T=async(e,o)=>i.S.get(`${a.oX}/cesde/api/v1/getStudentByIdentification/${o}?identificationType=${e}`),I=async(e,o)=>i.S.get(`${a.oX}/certificadodeudas/api/v1/consultaCertificadoEmpresa?numeroDocumento=${e}&tipoDocumento=${o}`),X=async e=>i.S.get(`${a.oX}/declaracionrenta/api/v1/certificado/${e}`),w=async(e,o,t,n)=>i.S.get(`${a.oX}/certificadodeudas/api/v1/consultaCertificadoTrabajador?numeroDocumento=${e}&numeroDocumentoEmpresa=${t}&tipoDocumento=${o}&tipoDocumentoEmpresa=${n}`),M=async({numeroDocumento:e,periodoAnyos:o,tipoDocumento:t})=>i.S.get(`${l}consultaCertificadoFosfec?numeroDocumento=${e}&periodoAnyos=${o}&tipoDocumento=${t}&applicationId=1`),Y=async({numeroDocumento:e,tipoDocumento:o})=>i.S.get(`${a.oX}/declaracionrentasubsidio/api/v1/declaracionRentaSubsidio?numeroDocumento=${e}&tipoDocumento=${o}&applicationId=1`),B=async({anyo:e,bimester:o,id:t,certificateType:n,idType:r})=>i.S.get(`${a.U$}consultarCertificadoRetencion?anyo=${e}&bimestre=${o}&numeroDocumento=${t}&tipoCertificado=${n}&tipoDocumento=${r}`),O=async()=>i.S.get(`${a.U$}listarPeriodosIva`),k=async()=>i.S.get(`${a.U$}listarTiposCertificados`),L=async({tipoDocumento:e,numeroDocumento:o,jwt:t,isBussinesTab:i})=>{const r={headers:{Authorization:`Bearer ${t}`}},c=`${a.oX}/aportes/api/v1/estado-cuenta-o-certificado`.concat(i?"":"-indUPensionado",`?numeroDocumento=${o}&tipoDocumento=${e}`);return n.A.get(c,r)},F=async({tipoDocumento:e,numeroDocumento:o})=>i.S.get(`${a.oX}/afiliaciones/api/v1/consultarCertificadoNoAfiliado?tipoDocumento=${e}&numeroDocumento=${o}`),R=async({documentType:e,documentNumber:o,jwt:t})=>{const n={headers:{apikey:`${a.hV}`,Authorization:`Bearer ${t}`}};return c.get(`${a.xQ}${e}/${o}`,n)},z=async(e,o,t)=>i.S.get(`${a.ht}listarEventosAsistencia?anyo=${e}&numeroDocumento=${o}&tipoDocumento=${t}`),Q=async(e,o,t,n)=>i.S.get(`${a.ht}
1consultarCertificadoAsistencia?curso=${e}&numeroDocumento=${t}&fechaInicio=${o}&tipoDocumento=${n}`),W=async(e,o,t)=>{const n={document:e,documentType:o,email:t,id:6};return i.S.post(`${a.MR}`,n)},G=async(e,o)=>i.S.get(`${a.oX}/creditoestadocuenta/api/v1/consultaCreditoEstadoCuenta?numeroDocumento=${e}&tipoDocumento=${o}`),U=async(e,o,t)=>i.S.get(`${a.oX}/creditoestadocuenta/api/v1/certificadoCreditoEstadoCuenta?numeroDocumento=${e}&tipoDocumento=${o}&numeroCredito=${t}`),H=async(e,o,t,n,r,c)=>i.S.get(`${a.oX}/afiliaciones/api/v1/consultarAfiliacionHistorico?fechaFin=${c}&fechaInicio=${r}&numeroDocumento=${e}${""!==t?`&numeroDocumentoEmpresa=${t}`:""}&tipoDocumento=${o}${""!==n?`&tipoDocumentoEmpresa=${n}`:""}`),J=async(e,o,t,n)=>{const r=`?documentType=${o}&documentNumber=${e}&creditNumber=${t}&user=${n}`,c=`${a.oX}/certificadocredito/api/v1/credits/receipt-payment${r}`;return i.S.get(c)},V=(e,o,t)=>{const n=`?documentType=${o}&documentNumber=${e}&page=1&pageSize=10&user=${t}`,r=`${a.oX}/certificadocredito/api/v1/credits/peacedmind-pdf${n}`;return i.S.get(r)},K=async(e,o)=>{const t=`?documentType=${o}&page=1&documentNumber=${e}&pageSize=50`,n=`${a.oX}/certificadocredito/api/v1/credits/account-status${t}`;return i.S.get(n)},q=e=>i.S.post(`${a.oX}/certificadocredito/api/v1/credits/account-pdf`,e),Z=e=>i.S.post(`${a.oX}/certificadocredito/api/v1/credits/debt-pdf`,e)},20320:function(e,o,t){var n=t(4240),a=t(45871),i=t(5588),r=t(29390),c=t(74848);o.A=({image:e,title:o,content:t})=>{const s={renderNode:{[a.BLOCKS.PARAGRAPH]:(e,o)=>(0,c.jsx)("p",{children:o}),[a.BLOCKS.OL_LIST]:(e,o)=>(0,c.jsx)("ol",{type:"1",children:o}),[a.INLINES.HYPERLINK]:(e,o)=>{var t,n,a,i,r;return(0,c.jsx)("a",{href:null==e||null===(t=e.data)||void 0===t?void 0:t.uri,rel:"noopener noreferrer",target:null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(a=n.uri)&&void 0!==a&&a.includes("www")||null!=e&&null!==(i=e.data)&&void 0!==i&&null!==(r=i.uri)&&void 0!==r&&r.includes("https")?"_blank":"_self",title:o,children:o})}}};return(0,c.jsxs)("div",{className:"a-to-be-aware-image",children:[(0,c.jsx)("div",{className:"a-to-be-aware-image__left",children:e&&e.gatsbyImage?(0,c.jsx)(i.G,{className:"a-to-be-aware-image__left__img",image:e.gatsbyImage,loading:"eager",alt:e.description?e.descripcion:e.title||"Imagen ¡Estamos para ayudarte!",title:e.description?e.descripcion:e.title||"Imagen ¡Estamos para ayudarte!"}):(null==e?void 0:e.file)&&(null==e?void 0:e.file.url)&&(0,c.jsx)("img",{src:(0,r.s)(e),alt:e.description?e.descripcion:e.title||"Imagen ¡Estamos para ayudarte!",title:e.description?e.descripcion:e.title||"Imagen ¡Estamos para ayudarte!",className:"a-to-be-aware-image__left__img"})}),(0,c.jsxs)("div",{className:"a-to-be-aware-image__right",children:[o&&(0,c.jsx)("h2",{children:o}),t&&t.raw&&(0,n.i)(JSON.parse(null==t?void 0:t.raw),s)]})]})}},33320:function(e){e.exports=JSON.parse('[{"name":"Cédula de Ciudadania","id":"1","typaDocSAP":"CO1C","legal":"02"},{"name":"Cédula ExtranjerÃa","id":"5","typaDocSAP":"CO1E","legal":"03"},{"name":"NIT","id":"6","typaDocSAP":"CO1N","legal":"06"},{"name":"Pasaporte","id":"8","typaDocSAP":"CO1P","legal":"05"},{"name":"Permiso especial de permanencia","id":"9","typaDocSAP":"CO1V","legal":"15"},{"name":"Permiso por Protección Temporal","id":"11","typaDocSAP":"CO1W"},{"name":"Registro Civil","id":"3","typaDocSAP":"CO1L","legal":"11"},{"name":"Tarjeta de identidad","id":"2","typaDocSAP":"CO1T","legal":"04"}]')},84945:function(e,o,t){t.r(o),t.d(o,{default:function(){return X}});var n=t(64810),a=t(96540),i=t(62514),r=t(88767),c=t(20320),s=t(70893),u=t(69890),d=t(58363),l=t(601),m=t(53478),p=t(75737),f=t(74353),$=t.n(f),D=t(49785),g=t(18952),y=(t(47317),t(17325)),h=t(64691),v=t(54460),b=t(5290),S=t(19871),x=t(33320),_=t(6515),A=t(99996),j=t(74848);const N=g.Ik({documentType:g.Yj().nonempty("Este campo es obligatorio").refine(e=>x.some(o=>o.id===e),"Tipo de documento inválido"),documentNumber:g.Yj().nonempty("Este campo es obligatorio"),startDate:g.Nl($()).refine(e=>e.isValid(),"Fecha inicial inválida").nullable().transform(e=>e||null).refine(e=>null!==e,"La fecha inicial es obligatoria"),endDate:g.Nl($()).refine(e=>e.isValid(),"Fecha final inválida").nullable().transform(e=>e||null).refine(e=>null!==e,"La fecha final es obligatoria")}).refine(e=>!e.startDate||!e.endDate||!e.endDate.isBefore(e.startDate),{path:["endDate"],message:"La fecha final debe ser igual o mayor a la fecha inicial"});var C=({dataQuery:e})=>{var o;const{handleSubmit:t,control:n,formState:{errors:i}}=(0,D.mN)({resolver:(0,s.u)(N),defaultValues:{documentType:"",documentNumber:"",startDate:null,endD
1ate:null}}),{business:r}=(0,a.useContext)(h.A),{localStorage:c}=(0,S.A)(),[f,g]=(0,a.useState)(!1),[C,P]=(0,a.useState)(!1),[E,T]=(0,a.useState)(!1),[I,X]=(0,a.useState)(!1),[w,M]=(0,a.useState)(""),Y=c.getItem("currentTab"),B=null==r||null===(o=r.get)||void 0===o?void 0:o.serviceId.includes(`${e.serviceId}`),O=!("PERSONAS"===Y||null!=r&&r.get&&B);return(0,j.jsx)(p.$,{dateAdapter:l.R,adapterLocale:"es",children:(0,j.jsxs)("form",{className:"form-document",onSubmit:t(async e=>{g(!0);try{var o,t;const n="personas"!==Y&&null!=r&&null!==(o=r.get)&&void 0!==o&&o.companyDocID?r.get.companyDocID+("CO1N"===r.get.companyDocType?(0,v.A)(String(r.get.companyDocID)):""):void 0,a="personas"!==Y&&null!=r&&r.get?(null===(t=x.find(e=>e.typaDocSAP===(null==r?void 0:r.get.companyDocType)))||void 0===t?void 0:t.id)||"":void 0,i=await(0,b.Xt)(e.documentNumber,e.documentType,n,a,e.startDate?e.startDate.format("YYYY-MM-DD"):"",e.endDate?e.endDate.format("YYYY-MM-DD"):"");200===i.status&&(200===i.data.status?(M(i.data.data.certificadoB64||i.data.data.certificateB64),X(!0)):400===i.data.status?T(!0):P(!0))}catch(n){console.error("Error al obtener la afiliación histórica:",n),P(!0)}finally{g(!1)}}),children:[(0,j.jsxs)("div",{className:"form-document__group",children:[(0,j.jsx)("label",{htmlFor:"documentType",className:"form-document__label",children:"Tipo de documento"}),(0,j.jsx)(D.xI,{disabled:O,name:"documentType",control:n,render:({field:e})=>(0,j.jsx)(u.A,{variant:"standard",select:!0,placeholder:"Tipo de documento",fullWidth:!0,error:!!i.documentType,...e,children:x.map((e,o)=>(0,j.jsx)(d.A,{value:e.id,children:e.name},`${e.id}-${o}`))})}),i.documentType&&(0,j.jsx)("p",{className:"form-document__error",children:i.documentType.message})]}),(0,j.jsxs)("div",{className:"form-document__group",children:[(0,j.jsx)("label",{htmlFor:"documentNumber",className:"form-document__label",children:"Número de documento"}),(0,j.jsx)(D.xI,{name:"documentNumber",control:n,render:({field:e})=>(0,j.jsx)(u.A,{disabled:O,className:"form-document__input",id:"documentNumber",variant:"standard",fullWidth:!0,error:!!i.documentNumber,...e})}),i.documentNumber&&(0,j.jsx)("p",{className:"form-document__error",children:i.documentNumber.message})]}),(0,j.jsxs)("div",{className:"form-document__group",children:[(0,j.jsx)("label",{className:"form-document__labelbig",children:"Selecciona el rango de fecha"}),(0,j.jsxs)("div",{className:"form-document__dates",children:[(0,j.jsxs)("div",{className:"form-document__date",children:[(0,j.jsxs)("label",{className:"form-document__date-label",children:["Fecha inicial ",(0,j.jsx)("span",{className:"form-document__error",children:"*"})]}),(0,j.jsx)("div",{className:"form-document__date-input",children:(0,j.jsx)(D.xI,{name:"startDate",control:n,render:({field:e})=>(0,j.jsx)(m.l,{disabled:!(null!=r&&r.get),slotProps:{openPickerButton:{sx:{color:"#EE2B7B"}}},format:"DD/MM/YYYY",minDate:$()().subtract(10,"years"),maxDate:$()(),value:e.value||null,onChange:o=>{e.onChange(o)},renderInput:e=>(0,j.jsx)(u.A,{...e,fullWidth:!0,error:!!i.startDate,helperText:i.startDate?i.startDate.message:"",variant:"standard"})})})}),i.startDate&&(0,j.jsx)("p",{className:"form-document__error",children:i.startDate.message})]}),(0,j.jsxs)("div",{className:"form-document__date",children:[(0,j.jsxs)("label",{className:"form-document__date-label",children:["Fecha final ",(0,j.jsx)("span",{className:"form-document__error",children:"*"})]}),(0,j.jsx)("div",{className:"form-document__date-input",children:(0,j.jsx)(D.xI,{name:"endDate",control:n,render:({field:e})=>(0,j.jsx)(m.l,{disabled:!(null!=r&&r.get),slotProps:{openPickerButton:{sx:{color:"#EE2B7B"}}},format:"DD/MM/YYYY",minDate:$()().subtract(10,"years"),maxDate:$()(),value:e.value||null,onChange:o=>e.onChange(o),renderInput:e=>(0,j.jsx)(u.A,{...e,fullWidth:!0,error:!!i.endDate,helperText:i.endDate?i.endDate.message:"",variant:"standard"})})})}),i.endDate&&(0,j.jsx)("p",{className:"form-document__error",children:i.endDate.message})]})]})]}),C&&(0,j.jsx)(_.A,{buttonCopy:"Aceptar",isMobile:!0,closeModal:()=>P(!1)}),E&&(0,j.jsx)(_.A,{title:"¡Ups! No encontramos una coincidencia",subtitle:"Por favor, revise los datos ingresados y la empresa con la que inició sesión e inténtelo de nuevo.",closeModal:()=>T(!1),isMobile:!0,buttonCopy:"ACEPTAR"}),I&&(0,j.jsx)(A.A,{base64:w,selectedFileName:"Historico de afiliación empresas",setActiveModal:X}),(0,j.jsx)(y.A,{classname:O||f?"form-document__submitDisable":"form-document__submit",isDisabled:O||f,text:f?"Generando...":"Generar"}),O&&(0,j.jsx)("p",{className:"form-document__error",children:"Debes seleccionar una empresa y tener habilitados tus permisos empresariales"})]})})},P=t(1038),E=t(68315),T=t(26659);var I=({dataQuery:e})=>{const{business:o}=(0,a.useContext)(h.A),t=(0,T.A)(),[n,s]=(0,a.useState)(!1),[u,d]=(0,a.useState)(!0),[,l]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{null!=o&&o.get||s(!0)},[o]),(0,a.useEffect)(()=>{t.gigyaAccount&&d(!1)}
1,[t.gigyaAccount]),(0,j.jsx)(E.A,{data:null==e?void 0:e.metaInfo[0],hasLoader:!1,isPrivate:!1,isActive:!0,children:u?(0,j.jsx)(i.A,{}):(0,j.jsxs)("div",{className:"bussines-historical",children:[(0,j.jsx)("div",{className:"bussines-historical__bread",children:(0,j.jsx)(r.A,{content:null==e?void 0:e.migaDePan})}),(0,j.jsx)("h1",{className:"bussines-historical__title",children:null==e?void 0:e.nombre}),(0,j.jsxs)("div",{className:"bussines-historical__content",children:[(0,j.jsx)("div",{children:(0,j.jsx)(c.A,{image:e.imagen[0],content:e.descripcion})}),(0,j.jsxs)("div",{style:{width:"100%"},children:[n&&(0,j.jsx)(P.A,{closeModal:()=>s(!1),isMobile:!0,setShowConfirmation:l,isPrivate:!1,closeModalPermissionPage:()=>s(!1),serviceId:e.serviceId}),(0,j.jsx)(C,{business:o,gigyaAccount:t.gigyaAccount,docTypesList:null==e?void 0:e.referencias[0].listaJson,dataQuery:e})]})]})]})})};var X=()=>{const e=(0,n.useStaticQuery)("1374041031");return(0,j.jsx)(I,{dataQuery:e.allContentfulTemplate.nodes[0]})}}}]); 2//# sourceMappingURL=component---src-pages-empresas-certificados-historico-afiliacion-a-comfama-empresas-tsx-287f503fe9bb7dc148d5.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.