dbo.listado_mantenimiento_cuits

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

1
Name Data Type Length Description
@client_id int 4

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

CREATE OR ALTER PROCEDURE dbo.listado_mantenimiento_cuits
@client_id int
AS

BEGIN
     SET NOCOUNT ON;
  declare @cantidad int 
  set @cantidad = (select COUNT(distinct cuit) 
        from monitoreos 
        where seccion_mantenimiento != 99 
          and cliente = @client_id 
          and monitoreos.visible = 1) 

  select  distinct @cantidad as cantidad, 
          cuit,
    nombre_persona,
    convert(varchar(13),
    monitoreos.fecha_modificacion,103) as fecha_modificacion,
    productos_secciones.nombre_seccion as seccion_mantenimiento,
    convert(varchar(13),
    fecha_vigencia_mantenimiento,103) as fecha_vigencia_mantenimiento,
    cliente,
    user_id,
    id_mantenimiento, observaciones_cliente as observaciones
   from monitoreos 
  inner join padrones
         on padrones.identificacion = cuit
     and habilitado = 1 
 inner join productos_secciones 
       on productos_secciones.id_seccion = monitoreos.seccion_mantenimiento
  where seccion_mantenimiento != 99 
    and cliente = @client_id 
    and monitoreos.visible = 1
  order by fecha_vigencia_mantenimiento desc
END

GO

Used By

No items found