1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Select com_numero_cde,com_date_emission,com_suivi_affaire, com_soc_four,lbl_code_article,lbl_prix_net_ht,lbl_prix_ttc,lbl_tva,lbl_numero_facture,lcd_cos_num, LCD_RUB1_BUDGET,ser_anal_code,ssr_code_anal,sit_anal_code
,(select LFS_NUM_TIERS from F_LFS_LIEN_FOU_SOC where F_LFS_LIEN_FOU_SOC.LFS_SOC_CODE=f_commande.COM_SOC_CODE and F_LFS_LIEN_FOU_SOC.LFS_FOU_CODE_UNIQUE=f_commande.COM_FOU_CODE_UNIQUE) COMPTE_TIERS
,(select AXV_ANAL_CODE from f_axl_lignes,F_AXV_VALEURS where axl_parent = lcd_code_unique and axl_axe_code='AXE00001' and axl_axv_code=axv_code) AXE1
,(select AXV_ANAL_CODE from f_axl_lignes,F_AXV_VALEURS where axl_parent = lcd_code_unique and axl_axe_code='AXE00002' and axl_axv_code=axv_code) AXE2
,(select AXV_ANAL_CODE from f_axl_lignes,F_AXV_VALEURS where axl_parent = lcd_code_unique and axl_axe_code='AXE00003' and axl_axv_code=axv_code) AXE3
,(select AXV_ANAL_CODE from f_axl_lignes,F_AXV_VALEURS where axl_parent = lcd_code_unique and axl_axe_code='AXE00004' and axl_axv_code=axv_code) AXE4
,(select AXV_ANAL_CODE from f_axl_lignes,F_AXV_VALEURS where axl_parent = lcd_code_unique and axl_axe_code='AXE00005' and axl_axv_code=axv_code) AXE5
, f_lbl_ligne_bl.LBL_DESIGNATION_ARTICLE
,(select ser_anal_code from f_service, f_utilisateur where uti_ser_code=ser_code and com_uti_code=uti_code) CODE
,(select ser_nom from f_service, f_utilisateur where uti_ser_code=ser_code and com_uti_code=uti_code) NOM
from f_commande,f_lbl_ligne_bl,f_lcd_ligne_cde,f_service,f_ssr_service,f_utilisateur,f_geographique,f_batiment,f_sites
where com_code_unique<>'*'
and com_tem_livraison<>2
and lbl_com_code_unique=com_code_unique
and lbl_date_bl<='31/12/2015'
and exists (select mvs_code from f_mvs_compta where mvs_soc_code=com_soc_code and mvs_fou_code_unique=com_fou_code_unique and mvs_num_fac=lbl_numero_facture and mvs_flag=0 and MVS_CODE_JOURNAL='BALACHAT')
and lbl_numero_auto_copie=lcd_code_unique
and lcd_ser_code=ser_code
and lcd_ssr_code=ssr_code
and lcd_uti_code=uti_code
and uti_geo_code=geo_code
and geo_bat_code=bat_code
and bat_sit_code=sit_code
order by com_numero_cde; |
Partager