Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
3| Name | Data Type | Length | Description |
|---|---|---|---|
| @p_cliente | int | 4 | |
| @p_fecha | date | 3 | |
| @p_cuit | varchar | 20 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
/*
exec [pe_actualizar_bcra] 2144275673, '2019-04-12', '20349603773'
*/
CREATE OR ALTER PROCEDURE dbo.pe_actualizar_bcra
@p_cliente int,
@p_fecha date,
@p_cuit varchar(20)
AS
BEGIN
SET NOCOUNT ON;
/* en bcra_ult_monto_sit_1 se esta guardando el ultimo monto de deuda en cualquier situacion */
declare @respuesta table (cantidad_bancos int, periodo varchar(10), deuda_total decimal(18,2))
INSERT INTO @respuesta
exec obtener_card_bancos @p_cuit
update pedidos_enriquecimiento set
bcra_ult_monto = (select deuda_total from @respuesta),
bcra_periodo_ult = (select periodo from @respuesta),
bcra_cantidad_bancos = (select cantidad_bancos from @respuesta),
bcra_sit_1_desde = (select top 1 fecha_desde FROM cendeu_sit1_desde where iden = @p_cuit order by fecha_desde desc)
where cuit = @p_cuit
and cliente = @p_cliente
and fecha_proceso = @p_fecha
END
GO
GO
/*
exec [pe_actualizar_bcra] 2144275673, '2019-04-12', '20349603773'
*/
CREATE OR ALTER PROCEDURE dbo.pe_actualizar_bcra
@p_cliente int,
@p_fecha date,
@p_cuit varchar(20)
AS
BEGIN
SET NOCOUNT ON;
/* en bcra_ult_monto_sit_1 se esta guardando el ultimo monto de deuda en cualquier situacion */
declare @respuesta table (cantidad_bancos int, periodo varchar(10), deuda_total decimal(18,2))
INSERT INTO @respuesta
exec obtener_card_bancos @p_cuit
update pedidos_enriquecimiento set
bcra_ult_monto = (select deuda_total from @respuesta),
bcra_periodo_ult = (select periodo from @respuesta),
bcra_cantidad_bancos = (select cantidad_bancos from @respuesta),
bcra_sit_1_desde = (select top 1 fecha_desde FROM cendeu_sit1_desde where iden = @p_cuit order by fecha_desde desc)
where cuit = @p_cuit
and cliente = @p_cliente
and fecha_proceso = @p_fecha
END
GO
Used By
No items found