dbo.FACONES_UPD_MIGRACION

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

1
Name Data Type Length Description
@docid int 4

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

CREATE OR ALTER PROCEDURE dbo.FACONES_UPD_MIGRACION  
@docid int

/*
FACON id = 1159


42-Datos Personales - 1143

34-Perfil Académico Secundario - 1144

22-Perfil Académico Universitario - 1145

19-Perfil Académico Cursos - 1146

82-Perfil Académico Matrículas - 1147

11-Experiencia laboral amplia - 1148

223-Certificado de Antecedentes Penales - 1157

100-Currículum Vitae - 1158



*/


AS
BEGIN
    SET NOCOUNT ON;


update ln_docs set estado_doc = 'V' where doc_id=@docid

/*
select LN_contrapartes.cliente, LN_contrapartes.contraparte, LN_gestiones.gestion, LN_gestiones.iv_busqueda, LN_demo.informe,LN_docs.doc_id,LN_docs.tipo_doc
from LN_contrapartes inner join LN_gestiones on LN_contrapartes.contraparte = LN_gestiones.contraparte
inner join LN_demo on (LN_gestiones.contraparte = LN_demo.contraparte AND LN_gestiones.gestion = LN_demo.gestion)
inner join informes on LN_demo.informe = informes.informe
inner join ln_docs on LN_gestiones.contraparte = ln_docs.contraparte and LN_gestiones.gestion=ln_docs.gestion and ln_docs.tipo_doc=1159
where LN_contrapartes.cliente = 2054196795 and informes.informe_padre is null
*/


-- select 2054196795 as cliente,69582 as contraparte ,    62922 as gestion,   922  as iv_busqueda,        4128529 as informe

/*

select LN_contrapartes.cliente, LN_contrapartes.contraparte, LN_gestiones.gestion, LN_gestiones.iv_busqueda, LN_demo.informe

from LN_contrapartes inner join LN_gestiones on LN_contrapartes.contraparte = LN_gestiones.contraparte

inner join LN_demo on (LN_gestiones.contraparte = LN_demo.contraparte AND LN_gestiones.gestion = LN_demo.gestion)

inner join informes on LN_demo.informe = informes.informe

where LN_contrapartes.cliente = 2054196795 and informes.informe_padre is null

*/




/*

select @top = count(*) from servicios_externos_cuits_consultados  where fecha = convert(date,getdate())

select count(*) from consultar_afip  where proceso = 'MONSANTO-REP'

aND procesado = 0
and ierror = 1

update consultar_afip set procesado=0,ierror = 0 where 
procesado = 1
and proceso = 'MONSANTO-REP'
and ierror = 1

*/


---- select @top = count(*) from consultar_afip  where procesado = 1 and convert(date,fecha_proceso) = convert(date,getdate())

 ---- set @top2=39900-@top

--select @top as ATOP,@top2 as TOP2
/*

if (@top2 > 250)
BEGIN
SET @TOP2 = 250
END
if (@top2 < 0)
BEGIN 
SET @TOP2 = 0
END
*/

-- select @top as ATOP,@top2 as TOP2
------ select TOP (@top2)  * from consultar_afip where isnull(procesado,0) = 0  and proceso = @proceso ORDER BY CUIT DESC,FECHA ASC
/*
select * from consultar_afip where isnull(procesado,0) = 0  and proceso = 'experta090120' ORDER BY CUIT DESC,FECHA ASC
*/


/*
select * from consultar_afip where fecha between '2018-08-16 00:00:00' and '2018-08-16 23:59:59' and isnull(procesado,0)=0 AND LEN(RTRIM(RTRIM(cuit)))=11 and proceso = 'WORLDSYS14082018'
*/

/*select top 9000 * from consultar_afip where procesado = 0
 --and fecha = '2019-07-14'
 and fecha = convert(date,getdate())
 and isnull(procesado,0)=0 
 AND LEN(RTRIM(RTRIM(cuit)))=11 
 /*
 and proceso = 'ESTRELLA2'
 */

union

select top 9000 * from consultar_afip where procesado = 0
 /*and fecha between '2018-08-16 00:00:00' and '2018-08-16 23:59:59' */

 --and fecha = '2019-07-14'
 and fecha = convert(date,getdate())
 and isnull(procesado,0)=0 
 AND LEN(RTRIM(RTRIM(cuit)))=11 
 
order by proceso desc 
*/

/*
update consultar_afip set procesado=1,fecha_proceso=getdate()-1 where fecha = convert(date,getdate()-1) and proceso='ESTRELLA2'
*/



 /*
  and proceso = 'SYSWORLD'
 
  insert into consultar_afip (proceso,cuit,fecha,procesado,fecha_proceso)
  select top 11750 'HSBC' AS PROCESO,cuit,'2019-04-12' as fecha,0 as procesado,null as fecha_proceso from hsbc_temp_procesamiento order by cuit asc
  */






/* select top 15000 * from consultar_afip where proceso = 'WORLDSYS14082018' and isnull(procesado,0)=0 AND LEN(RTRIM(RTRIM(cuit)))=11
*/


/*
update consultar_afip set fecha = '2018-08-16' where idreg in (
select top 15000 idreg from consultar_afip where proceso = 'WORLDSYS14082018' and isnull(procesado,0)=0 AND LEN(RTRIM(RTRIM(cuit)))=11 and fecha = '2018-08-14'
)
*/





/*
select * from consultar_afip
WHERE FECHA = '2018-08-13'
AND PROCESO = 'MACRO TELEFONOS'
and procesado=0
*/

END
GO

Depends On

1

Used By

No items found