1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| SELECT
dbo.DP_TIERS.TI_NUM+' - '+dbo.DP_TIERS.TI_INTITULE,
dbo.DP_ECRITC.EC_CGNUM,
sum(dbo_DP_ECRITC2.EC_ECMONTANT),
dbo.DP_ECRITC.EC_ECECHEANCE,
dbo.DP_ECRITC.EC_TYPEANEW,
dbo.DP_ECRITC.EC_TYPEECRITU,
dbo.DP_ECRITC.EC_TACODE,
dbo.DP_ECRITC.EC_ECRAPPEL,
dbo.DP_ECRITC.EC_ECPOINT,
dbo.DP_ECRITC.EC_ECLETTRE,
dbo.DP_ECRITC.EC_ECLETTRAGE,
sum(abs(dbo_DP_ECRITC2.EC_ECMONTANT)),
dbo.DP_ECRITC.EC_ECSENS,
dbo.DP_ECRITC.EC_ECTRESOPIECE,
dbo.DP_ECRITC.EC_JONUM,
dbo.DP_ECRITC.EC_ECRTYPE,
dbo.DP_ECRITC.EC_ECPARITE,
dbo.DP_ECRITC.EC_ECQUANTITE,
dbo.DP_ECRITC.EC_ECPOINTAGE,
dbo.DP_ECRITC.EC_ECDATE,
dbo.DP_TIERS.TI_NUM,
dbo.DP_TIERS.TI_INTITULE,
dbo.DP_ECRITC.EC_ECPIECE,
dbo.DP_TIERS.TI_STAT03
FROM
dbo.DP_TIERS,
dbo.DP_ECRITC,
dbo.DP_ECRITC dbo_DP_ECRITC2,
dbo.DP_EXSOCIAL_ECRITURES,
dbo.F_COMPTEG
WHERE
( dbo.DP_ECRITC.EC_CGNUM=dbo.F_COMPTEG.CG_Num )
AND ( dbo.DP_ECRITC.EC_PK=dbo.DP_EXSOCIAL_ECRITURES.REPERE )
AND ( dbo.DP_TIERS.TI_NUM=dbo.DP_ECRITC.EC_CTNUM )
AND ( dbo.DP_ECRITC.EC_PK=dbo_DP_ECRITC2.EC_PK )
AND (
( dbo.DP_EXSOCIAL_ECRITURES.EX=@Prompt ('Indiquez un exercice social ?', 'A', 'Période\Exercice Social', MONO, CONSTRAINED) )
AND (dbo.DP_ECRITC.EC_ECECHEANCE IS NULL
OR dbo.DP_ECRITC.EC_ECECHEANCE IS NOT NULL )
AND dbo.DP_ECRITC.EC_ECLETTRE = 'NON'
AND ( dbo.F_COMPTEG.N_Nature=1 )
AND dbo.DP_ECRITC.EC_CGNUM = '41100000'
)
GROUP BY
dbo.DP_TIERS.TI_NUM+' - '+dbo.DP_TIERS.TI_INTITULE,
dbo.DP_ECRITC.EC_CGNUM,
dbo.DP_ECRITC.EC_ECECHEANCE,
dbo.DP_ECRITC.EC_TYPEANEW,
dbo.DP_ECRITC.EC_TYPEECRITU,
dbo.DP_ECRITC.EC_TACODE,
dbo.DP_ECRITC.EC_ECRAPPEL,
dbo.DP_ECRITC.EC_ECPOINT,
dbo.DP_ECRITC.EC_ECLETTRE,
dbo.DP_ECRITC.EC_ECLETTRAGE,
dbo.DP_ECRITC.EC_ECSENS,
dbo.DP_ECRITC.EC_ECTRESOPIECE,
dbo.DP_ECRITC.EC_JONUM,
dbo.DP_ECRITC.EC_ECRTYPE,
dbo.DP_ECRITC.EC_ECPARITE,
dbo.DP_ECRITC.EC_ECQUANTITE,
dbo.DP_ECRITC.EC_ECPOINTAGE,
dbo.DP_ECRITC.EC_ECDATE,
dbo.DP_TIERS.TI_NUM,
dbo.DP_TIERS.TI_INTITULE,
dbo.DP_ECRITC.EC_ECPIECE,
dbo.DP_TIERS.TI_STAT03 |
Partager