dbo.imperium_pdf_extract_cuit

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

CREATE OR ALTER PROCEDURE dbo.imperium_pdf_extract_cuit
/*
select cuit_found,* from led_docs where doc_id in (4975406441)
update led_docs set cuit_found= null where doc_id in (4975406441)
*/

AS

-- 202201_1564570_00703_C4975911392_cnrbhsast.nea122021.pdf

BEGIN
    SET NOCOUNT ON;
 /*tipo_doc,periodo,cliente,contratista_1,led_seccion,*/
 select top 500 doc_id,'/var/www/html/compartido/LED/' + convert(varchar(6),periodo) + '/'+ convert(varchar(100),cliente) + '/' + convert(varchar(100),contratista_1) + '/' as path_previo,periodo
  from led_docs where 
 /*cliente not in (9936068) and */
  /*cliente in (1226057645) and */
 (last_modified > getdate()-403 or  insertado > getdate()-403) and estado_doc not in ('N','R','V') 
 and tipo_doc in (select tipo_doc from led_tipos_doc where validar_lista_cuil=1 and tipo_doc_lista is null)
 /*and doc_id= 4983812258*/
 and cuit_found is null
-- and periodo >= dbo.PeriodoAnual()
 and periodo >= 202307
 and tipo_doc !=730
 --and doc_id not in (4975406039,4975970780,4975958573,497649461,4976494616,4976446455,4977703465)  /* revisar los 88*/
 /*and doc_id in (4995844364)*/
 and doc_id not in (4983898136,4983887561)  /* revisar los 88*/
 /*and cliente = 2046807993*/
 /*and doc_id in (4991274728)*/

 /*select cuit_found, * from led_docs where  doc_id in (4995844364)*/

 order by periodo desc
 
-- update led_docs set cuit_found = null where  doc_id in (4990892555)

 
END 

/*
-- select  cuit_found,last_modified,* from led_docs where doc_id=4970888211

update led_docs set cuit_found=null where doc_id in (
select top 500 doc_id /* , cuit_found,last_modified, '/var/www/html/compartido/LED/' + convert(varchar(6),periodo) + '/'+ convert(varchar(100),cliente) + '/' + convert(varchar(100),contratista_1) + '/' as path_previo,periodo*/

 from led_docs where cliente not in (9936068) and
(last_modified > getdate()-730 or  insertado > getdate()-730) and estado_doc not in ('N','R','V') 
 and tipo_doc in (select tipo_doc from led_tipos_doc where validar_lista_cuil=1 and tipo_doc_lista is null)
/* and last_modified> getdate()-10*/

--and last_modified between getdate() and getdate()
and last_modified between '2022-03-03 00:00:00' and getdate()

AND convert(varchar,cuit_found) in ('88','99')
and periodo >= dbo.PeriodoAnual()

)

/*order by last_modified DESC*/


*/


GO

Used By

No items found