dbo.api_obtener_balances

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

1
Name Data Type Length Description
@p_cuit varchar 20

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

CREATE OR ALTER PROCEDURE dbo.api_obtener_balances
@p_cuit varchar(20)

AS

BEGIN
select id_balance, cuit,
fecha_balance,
bal_manifestacion,
ejercicio,
periodo,
moneda,
ac_cajban,
ac_inver,
ac_crevta,
ac_otrcre,
ac_biecam,
ac_otract,
ac_bietan,
ac_total,
anc_crevta,
anc_otrcre,
anc_inver,
anc_actint,
anc_otract,
anc_bieuso,
anc_bieusovo,
anc_depacu,
anc_total,
act_total,
pc_ctapag,
pc_presta,
pc_remune,
pc_carfis,
pc_antcli,
pc_otrpas,
pc_total,
pnc_cuepag,
pnc_previ,
pnc_presta,
pnc_otrpas,
pnc_deufis,
pnc_total,
pas_total,
capsoc,
resacu,
res_noasig,
patrimonio,
res_vtanet,
res_compras,
res_cosmer,
amortiza,
res_gascom,
res_gasadm,
res_gasfin,
res_otrosing,
res_otrosegr,
res_resfin,
res_iva,
ganancia,
ebitda,
ajucap,
comentarios,
ind_liqcorr,
ind_liqseca,
ind_endeu,
convert(decimal(12,2),iif(isnull(patrimonio,0) > 0, isnull(pas_total,0)/patrimonio, 0)) as endeudamiento_total, /*** pasivo_total / patrimonio_neto  **/

ind_solvencia,
ind_endeuact,
ind_captra,
ind_cappro,
ind_invbu,
ind_inmact,
ind_inmpat,
ind_marbru,
ind_utilfin,
ind_retpat,
ind_rotvta,
ind_rotvta_dias,
ind_rotact,
ind_rotact_dias,
ind_rentabilidad,
ind_indrot,
ind_indrot_dias,
ind_rotinv,
ind_rotinv_dias,
ind_prest_pn,
ind_prest_vtas,
ind_solvencia_pat,
convert(bigint,(isnull(res_vtanet,0) - isnull(res_cosmer,0)) - isnull(amortiza,0) - isnull(res_gascom,0) - isnull(res_gasadm,0)) as ebit,
(((isnull(res_vtanet,0) - isnull(res_cosmer,0)) - isnull(amortiza,0) - isnull(res_gascom,0) - isnull(res_gasadm,0)) / isnull(res_vtanet,0))*100 as ebit_ventas,
    fecha_balance_dmy = convert(varchar(10),fecha_balance,103)
  from balances_contables 
 where cuit = @p_cuit and
  isnull(visible,0) = 1
  AND isnull(estado,'') = 'PUBLICADO' 
  and datediff(YY,fecha_balance,getdate()) < 6 
 order by fecha_balance desc
END 

GO

Depends On

1

Used By

No items found