DEFINITION NUMTABSEL_860026562 0
DEFINITION NUMTAB_GMT_860026562 1
DEFINITION NUMTAB_METRO_860026562 0
DEFINITION ZONE_METRO_860026562 7
DEFINITION UIFS_860026562 6
DEFINITION C_PREF1_SRP_SPORT_860026562 "842"
DEFINITION C_PREF1_SRPLA_EPORT_860026562 "15094"
DEFINITION C_PREF2_SRPLA_EPORT_860026562 "15095"
DEFINITION C_PREF_MLV87_860026562 "87"
DEFINITION C_PREF_MLV9_860026562 "9"
DEFINITION C_PREF2_SPORT_860026562 "08"
DEFINITION C_CASCORR1_860026562 "SRP_CORR"
DEFINITION C_CASCORR2_860026562 "TAG_CORR"
DEFINITION C_InstCENTVG_860026562 "CENTAUREVG"
DEFINITION C_InstCENTDEA_860026562 "CENTAUREDEA"
DEFINITION C_TcentaureDEA_860026562 "TcentaureDEA"
DEFINITION C_Inst16XCONV_860026562 "16XCONV"
DEFINITION C_InstFE_860026562 "FE"
DEFINITION C_InstFERPV_860026562 "FERPV"
DEFINITION C_InstSC_860026562 "SC"
DEFINITION C_InstTRAFIC_860026562 "TRAFIC"
DEFINITION C_InstSYMP_860026562 "SYMP"
DEFINITION C_Inst42L_860026562 "42L"
DEFINITION C_TsymTconvNE_860026562 "TsymTconvNE"
DEFINITION C_T16xCONV_860026562 "T16xCONV"
DEFINITION C_TtraficN_860026562 "TtraficN"
DEFINITION C_Tfe_860026562 "Tfe"
DEFINITION C_Tfe_rpv_860026562 "Tfe_rpv"
DEFINITION C_Tdelta_minute_860026562 "Tdelta_minute"
DEFINITION C_TscTconvNE_860026562 "TscTconvNEB"
DEFINITION C_Conversion_860026562 "Conversion"
DEFINITION C_TconvNE_860026562 "TconvNE"
DEFINITION C_FEFACT_860026562 "FE"
DEFINITION C_16XFACT_860026562 "16X"
DEFINITION C_Article_860026562 "TconvNE"
DEFINITION C_ArtCSV_860026562 "TconvNE/CSV"
DEFINITION C_REF42L_860026562 "42L"
DEFINITION C_REFMAJ2G_860026562 "MAJ2G"
DEFINITION TD_VGA1_860026562 7
DEFINITION TD_VGA2_860026562 2
DEFINITION INST_VGA_860026562 "VGA"
DEFINITION INST_VGAIP_860026562 "VGAIP"
DEFINITION INST_OPEN_860026562 "OPEN"
DEFINITION C_TcentaureVG_860026562 "TcentaureVG"
DEFINITION C_InstSIP_860026562 "SIP"
DEFINITION C_pref_cle_860026562 "INi"
DEFINITION TD_SIP_860026562 3
DEFINITION TD_BSS_860026562 6
DEFINITION TD_NPF_860026562 3
DEFINITION C_FU_860026562 "U"
DEFINITION C_InstBSS_860026562 "BSS"
DEFINITION C_InstNPF_860026562 "NPF"
DEFINITION C_TRAFBSS_860026562 "TtrafBSS"
DEFINITION C_InstTRAFBSS1_860026562 "TRAFBSS1"
DEFINITION C_InstTRAFBSS2_860026562 "TRAFBSS2"
DEFINITION C_TRAFBSS1FACT_860026562 "TRAFBSS1"
DEFINITION C_TRAFBSS2FACT_860026562 "TRAFBSS2"
DEFINITION C_InstANDROMERI_860026562 "ANDROMERI"
DEFINITION C_TandromeRI_860026562 "TandromeRI"
DEFINITION C_instOPT_860026562 "OPT"
DEFINITION CODE_AUDIO_860026562 1
DEFINITION CATEG_AUDIO_860026562 8
DEFINITION RES_CLDEST_860026562 1
DEFINITION BASE_AUDIO_860026562 1
DEFINITION RES_TYPCOM_860026562 0
DEFINITION RES_CODCIR_860026562 3
DEFINITION RES_TYPCTR_860026562 2
DEFINITION C_InstDQD_860026562 "DQD"
DEFINITION C_TdqdTconvNE_860026562 "TdqdTconvNE"
DEFINITION C_Tcome_860026562 "Tcome"
DEFINITION C_InstCOME_860026562 "COME"
DEFINITION C_InstELIG_860026562 "ELIGIBLE"
DEFINITION C_InstCOM_ELIG_860026562 "COME_ELIGIBLE"
DEFINITION C_COMEFACT_860026562 "COME"
DEFINITION C_T16xCONVCPS_860026562 "T16xCONVCPS"
DEFINITION C_NUMTABSEL_1_860026562 1
DEFINITION TYPCTR_Fact_RI_860026562 17
DEFINITION C_DATCPS_860026562 "DATCPS"
DEFINITION TD_SVA_860026562 9
DEFINITION C_INST_ALICE_860026562 "ALICE"
REGISTRE ENTIER date_locale_860026562
REGISTRE ENTIER dpivot_860026562
REGISTRE ENTIER b_NPF_SIP_860026562
REGISTRE ENTIER instSIP_860026562
REGISTRE ENTIER gmt_date_860026562
REGISTRE ENTIER L_NDR_860026562
REGISTRE ENTIER lg_ND_RTC_860026562
REGISTRE ENTIER ddebut_860026562
REGISTRE ENTIER idsv_860026562
REGISTRE ENTIER erreur_860026562
REGISTRE ENTIER duree_860026562
REGISTRE ENTIER duracc_860026562
REGISTRE ENTIER duraut_860026562
REGISTRE ENTIER natach_860026562
REGISTRE ENTIER itx_860026562
REGISTRE ENTIER cptx_860026562
REGISTRE ENTIER code_errone_860026562
REGISTRE ENTIER seq_860026562
REGISTRE ENTIER cause_860026562
REGISTRE ENTIER res_860026562
REGISTRE ENTIER res1_860026562
REGISTRE ENTIER bitE_860026562
REGISTRE ENTIER idus_inf_860026562
REGISTRE ENTIER zone_860026562
REGISTRE ENTIER ref_860026562
REGISTRE ENTIER Max_SVTR_860026562
REGISTRE ENTIER Num_SVTR_860026562
REGISTRE ENTIER Ind_SVTR_860026562
REGISTRE ENTIER Max_0dede16X_860026562
REGISTRE ENTIER Num_0dede16X_860026562
REGISTRE ENTIER lg_860026562
REGISTRE ENTIER cfr_860026562
REGISTRE ENTIER dizaine_860026562
REGISTRE ENTIER unite_860026562
REGISTRE ENTIER hdfin_860026562
REGISTRE ENTIER hduree_860026562
REGISTRE ENTIER detr_int_860026562
REGISTRE ENTIER article_uifs_860026562
REGISTRE ENTIER gvi_860026562
REGISTRE ENTIER id_corr_860026562
REGISTRE ENTIER nelem_860026562
REGISTRE ENTIER cpt_RDT_860026562
REGISTRE ENTIER dede_reroute_860026562
REGISTRE ENTIER VGA_860026562
REGISTRE ENTIER val_860026562
REGISTRE ENTIER TYPCOM_860026562
REGISTRE ENTIER bFERPV_860026562
REGISTRE ENTIER bFE_860026562
REGISTRE ENTIER bTRAFIC_860026562
REGISTRE ENTIER bDM_860026562
REGISTRE ENTIER bSC_860026562
REGISTRE ENTIER b16XCONV_860026562
REGISTRE ENTIER bSYMPHONIE_860026562
REGISTRE ENTIER bREDISTIP_860026562
REGISTRE ENTIER bREDISTMAJ2G_860026562
REGISTRE ENTIER bCENTVG_860026562
REGISTRE ENTIER bANDRO_860026562
REGISTRE ENTIER bTrafBSS1_860026562
REGISTRE ENTIER bTrafBSS2_860026562
REGISTRE ENTIER arTRAFIC_860026562
REGISTRE ENTIER arSC_860026562
REGISTRE ENTIER arFERPV_860026562
REGISTRE ENTIER arFE_860026562
REGISTRE ENTIER instFERPV_860026562
REGISTRE ENTIER instFE_860026562
REGISTRE ENTIER instTRAFIC_860026562
REGISTRE ENTIER instDM_860026562
REGISTRE ENTIER instSC_860026562
REGISTRE ENTIER inst16XCONV_860026562
REGISTRE ENTIER instSYMPHONIE_860026562
REGISTRE ENTIER inst42L_860026562
REGISTRE ENTIER instVGA_860026562
REGISTRE ENTIER instVGAIP_860026562
REGISTRE ENTIER instOPEN_860026562
REGISTRE ENTIER instECCv_860026562
REGISTRE ENTIER instCENTAUREVG_860026562
REGISTRE ENTIER instANDROMERI_860026562
REGISTRE ENTIER SCP_860026562
REGISTRE ENTIER SCP_SPORTABILITE_860026562
REGISTRE ENTIER SRP_860026562
REGISTRE ENTIER SRP_SPORTABILITE_860026562
REGISTRE ENTIER SRP_EPORTABILITE_860026562
REGISTRE ENTIER EPORTABILITE_SRPLA_860026562
REGISTRE ENTIER SRP_FACTURABLE_860026562
REGISTRE ENTIER SCP_FACTURABLE_860026562
REGISTRE ENTIER SRP_CORR_860026562
REGISTRE ENTIER REROUT_TYPE_860026562
REGISTRE ENTIER EFFICACE_860026562
REGISTRE ENTIER CCD_860026562
REGISTRE ENTIER CCD_REEL_860026562
REGISTRE ENTIER NB_CSV_860026562
REGISTRE ENTIER DEDE_INF_860026562
REGISTRE ENTIER ICAR_860026562
REGISTRE ENTIER ICAR_ORIG_860026562
REGISTRE ENTIER ICAR_C_860026562
REGISTRE ENTIER CAX_860026562
REGISTRE ENTIER SUP_860026562
REGISTRE ENTIER SERVICE_860026562
REGISTRE ENTIER REROUTAGE_ACCOMPAGNE_860026562
REGISTRE ENTIER IDUS_IP_860026562
REGISTRE ENTIER RETOUR_CORR_860026562
REGISTRE ENTIER NB_UT_860026562
REGISTRE ENTIER NB_UTini_860026562
REGISTRE ENTIER SRP_Tiers_860026562
REGISTRE ENTIER instBSS_860026562
REGISTRE ENTIER instNPF_860026562
REGISTRE ENTIER b_TETRIS_TRAFBSS_860026562
REGISTRE ENTIER b_TETRIS_FU_860026562
REGISTRE ENTIER L_COMPTE_NPF_860026562
REGISTRE ENTIER instTRAFBSS1_860026562
REGISTRE ENTIER instTRAFBSS2_860026562
REGISTRE ENTIER b_TRAFBSScritCOM_860026562
REGISTRE ENTIER CODCIR_860026562
REGISTRE ENTIER sdate_conv_860026562
REGISTRE ENTIER bVGTplus_860026562
REGISTRE ENTIER V1S_860026562
REGISTRE ENTIER MLV_860026562
REGISTRE ENTIER TYPAR_SIPFE_860026562
REGISTRE ENTIER TYPAR_FE_860026562
REGISTRE ENTIER TYPAR_ETEL_860026562
REGISTRE ENTIER NM3_860026562
REGISTRE ENTIER b_FRT_Kiosque_860026562
REGISTRE ENTIER TYPCOM_fct_860026562
REGISTRE ENTIER b_arretfct_centaure_860026562
REGISTRE ENTIER instCENTAUREDEA_860026562
REGISTRE ENTIER bCENTDEA_860026562
REGISTRE ENTIER b_NPF_OPT_860026562
REGISTRE ENTIER instOPT_860026562
REGISTRE ENTIER MER_Kiosque_DC1_860026562
REGISTRE ENTIER MER_Kiosque_DC2_860026562
REGISTRE ENTIER Long_Dede_Num_Fact_860026562
REGISTRE ENTIER TAG_gratuit_860026562
REGISTRE ENTIER TAG_Accueil_860026562
REGISTRE ENTIER DURCONV_860026562
REGISTRE ENTIER DateLocaleRetourCorr_860026562
REGISTRE ENTIER CORR_TAG_860026562
REGISTRE ENTIER sdate_860026562
REGISTRE ENTIER datefin_860026562
REGISTRE ENTIER VARDATEFIN_860026562
REGISTRE ENTIER VARDATE_860026562
REGISTRE ENTIER date_table_860026562
REGISTRE ENTIER TYPE_860026562
REGISTRE ENTIER Indice_860026562
REGISTRE ENTIER CUMUL_DUREE_860026562
REGISTRE ENTIER Appel_BNC_860026562
REGISTRE ENTIER SIP_Fibre_860026562
REGISTRE ENTIER b118PTD_860026562
REGISTRE ENTIER valeur_860026562
REGISTRE ENTIER TYPAR_BIV_SIP_860026562
REGISTRE ENTIER b_CodOperVG_860026562
REGISTRE ENTIER b_FFMV3_860026562
REGISTRE ENTIER b_OperNBE_860026562
REGISTRE ENTIER b_FERPV_860026562
REGISTRE ENTIER b_FERPV_NBE_860026562
REGISTRE ENTIER instDQD_860026562
REGISTRE ENTIER bDQD_860026562
REGISTRE ENTIER instCOME_860026562
REGISTRE ENTIER instELIG_860026562
REGISTRE ENTIER arCome_860026562
REGISTRE ENTIER arElig_860026562
REGISTRE ENTIER bCome_860026562
REGISTRE ENTIER bElig_860026562
REGISTRE ENTIER taille_860026562
REGISTRE ENTIER date_audit_860026562
REGISTRE ENTIER b_FERPV_COME_860026562
REGISTRE ENTIER instCOM_ELIG_860026562
REGISTRE ENTIER longueur_860026562
REGISTRE ENTIER CPS_860026562
REGISTRE ENTIER CPS_SPORTABILITE_860026562
REGISTRE ENTIER detr1_int_860026562
REGISTRE ENTIER B_APPEL_BANIP_860026562
REGISTRE ENTIER typeCTR_860026562
REGISTRE ENTIER b_Fact_CPS_RI_860026562
REGISTRE ENTIER Date_CPS_860026562
REGISTRE ENTIER instALICE_860026562
REGISTRE ENTIER b_ALICE_860026562
REGISTRE POINTEUR pt_PREFIXE_CENTAURE_860026562
REGISTRE POINTEUR pt_VGTplus_OP_860026562
REGISTRE POINTEUR pt_VGTplus_OF_860026562
REGISTRE POINTEUR pt_RES1_860026562
REGISTRE POINTEUR pt_CODE_DEUR_860026562
REGISTRE POINTEUR pt_SIP_ECC_860026562
REGISTRE POINTEUR pt_CLE_860026562
REGISTRE POINTEUR pt_TETRIS_compte_860026562
REGISTRE POINTEUR pt_COMPTE_NPF_860026562
REGISTRE POINTEUR pt_TETRIS_RTC_860026562
REGISTRE POINTEUR pt_CODE_FU_860026562
REGISTRE POINTEUR pt_TARIF_860026562
REGISTRE POINTEUR pt_TRAFIC_860026562
REGISTRE POINTEUR pt_IDUS_NDRTC_860026562
REGISTRE POINTEUR pt_C_CSV_860026562
REGISTRE POINTEUR pt_OP_CSV_860026562
REGISTRE POINTEUR pt_CodeTable_860026562
REGISTRE POINTEUR pt_LIBELREDIST_860026562
REGISTRE POINTEUR pt_InfoCompl_860026562
REGISTRE POINTEUR pt_InfoCompl_FERPV_860026562
REGISTRE POINTEUR pt_temp_860026562
REGISTRE POINTEUR pt_temp2_860026562
REGISTRE POINTEUR pt_basTRAFIC_860026562
REGISTRE POINTEUR pt_DM_860026562
REGISTRE POINTEUR pt_BUF_860026562
REGISTRE POINTEUR pt_BUF2_860026562
REGISTRE POINTEUR pt_SGTQS_860026562
REGISTRE POINTEUR pt_ECCFACT_860026562
REGISTRE POINTEUR pt_cascorr_860026562
REGISTRE POINTEUR pt_DEDE_NUM_860026562
REGISTRE POINTEUR pt_DEDEini_NUM_860026562
REGISTRE POINTEUR pt_NDRTC_860026562
REGISTRE POINTEUR pt_adr_NDRTC_860026562
REGISTRE POINTEUR pt_VGA_OP_860026562
REGISTRE POINTEUR pt_VGA_OF_860026562
REGISTRE POINTEUR pt_OFFRE_860026562
REGISTRE POINTEUR pt_OPERA_860026562
REGISTRE POINTEUR pt_STY_860026562
REGISTRE POINTEUR pt_InfoComplFE_860026562
REGISTRE POINTEUR pt_Info_FERPV_860026562
REGISTRE POINTEUR pt_Info_ETEL_860026562
REGISTRE POINTEUR pt_service_860026562
REGISTRE POINTEUR pt_NM3_OP_860026562
REGISTRE POINTEUR pt_NM3_OF_860026562
REGISTRE POINTEUR pt_CSV_860026562
REGISTRE POINTEUR pt_OPT_RTC_860026562
REGISTRE POINTEUR pt_OPT_ECC_860026562
REGISTRE POINTEUR pt_XY_860026562
REGISTRE POINTEUR pt_DEDE_NUM_FACT_860026562
REGISTRE POINTEUR pt_IDUS_NORM_860026562
REGISTRE POINTEUR pt_ITX_860026562
REGISTRE POINTEUR pt_DEDEINI_NUM_N_860026562
REGISTRE POINTEUR pt_DEDEini_DIST_N_860026562
REGISTRE POINTEUR pt_buffer_860026562
REGISTRE POINTEUR pt_Support_860026562
REGISTRE POINTEUR pt_TYPOFFRE_860026562
REGISTRE POINTEUR pt_CodOperVG_860026562
REGISTRE POINTEUR pt_CodOffreVG_860026562
REGISTRE POINTEUR pt_TEMP1_860026562
REGISTRE POINTEUR pt_NIDAV_CENTAURE_860026562
REGISTRE POINTEUR pt_HFAPP_860026562
REGISTRE POINTEUR pt_NDI_COME_860026562
REGISTRE POINTEUR pt_IDSV_860026562
REGISTRE POINTEUR pt_DEDEini2_NUM_860026562
REGISTRE POINTEUR pt_TYPE_SERV_860026562
REGISTRE POINTEUR pt_NDRTC_MAY_860026562
REGISTRE POINTEUR pt_MESSAGE_860026562
REGISTRE POINTEUR pt_CODE_TARIF_860026562
REGISTRE POINTEUR pt_TYPE_EDIT_860026562
REGISTRE POINTEUR pt_NDE_860026562
REGISTRE POINTEUR pt_NORM_860026562
################################################################################
#	Article convergent (TconvNEB_dis.src)Libre Appel / Audiotel  Nas Existant
#       MODULE		Distribution
#	PCODE		TconvNE.src
#
#	SORTIES
#		Application            |g_iartout      |Flag
#		=======================|===============|==========
#		instTRAFBSS1           |g_iartout2     |bTrafBSS1
#		instTRAFBSS2           |g_iartout2     |bTrafBSS2
#		instTRAFIC             |g_iartout2     |bTRAFIC
#		instSC                 |g_iartout3     |bSC
#		instFE                 |g_iartout4     |bFE
#		instEVE                |               |bEVE
#		instDM                 |g_iartout6     |bDM
#		inst16XCONV            |g_iartout7     |b16XCONV
#		instSYMPHONIE          |g_iartout8     |bSYMPHONIE
#		instCENTAUREDEA        |g_iartout9     |bCENTDEA
#		instCENTAUREVG         |g_iartout10    |bCENTVG
#		instFERPV              |g_iartout11    |bFERPV
#		instANDROMERI          |g_iartout12    |bANDRO
#		instDQD                |g_iartout5     |bDQD
#		instCome Eligible      |g_iartout14    |bCome ou bElig
#
# 	USAGE INTERNE
#		Conversion             |g_iartout13
#
################################################################################
#
# HISTORIQUE
#	15/11/04 -PSA- Creation
#	31/01/05 -PSA- FO 1074 : appel a BANIP (Spec Conv_AULA_S0F4.doc)
#	08/03/05 -PSA- FO 1147
#	18/03/05 -PSA- FO 1162, 1163, 1168, 1169, 1170
#	30/03/05 -PSA- FO 1209
#	06/04/05 -DRE- G2R1Cm : Facturation des appels vers SRP tiers avec ITX
#	                        depuis des origines IP (ajout de SRP_Tiers)
#	08/04/05 -FAL- FO 1231 : BANIP SI 8732 ou 876
#	08/04/05 -FAL- FO 1234 : modif critere 16XCONV
#	12/04/05 -PSA- FO 1238 : ajout T4NDRTC optionnel pour Symphonie
#	13/04/05 -PSA- FO 1239, 1240
#	19/04/05 -PSA- Reprise FO 1234 + reorganisation enchainement redistribution-correlation
#	12/05/05 -DRE- Ajout variable SRP_Tiers + FO 1277, FO 1278, FO 1279, FO 1280
#	23/05/05 -PSA- G2R1Ca : FO 1262, 1281, 1290, 1314
#	09/06/05 -PSA- G2R1Ca : FO 1332
#	05/07/05 -THE- G2R1Ca FO 1375
#	11/07/05 -PSA- G2R1Ca : FO 1374, 1375(reprise), 1382
#	03/08/05 -FAL- FO1402 suppression taille enveloppe
#	18/08/05 -FAL- FO1413 correction envoi Symphonie apres passage redistribution
#	05/09/05 -FAL- FO1437 evolution calcul SRP_SPORTABILITE
#		       FO1438 evolution variable SRP_FACTURABLE
#	06/09/05 -FAL- FO1440 evolution DEDE 16X sans 0 a gauche
#	13/09/05 -DRE- FO1438bis reprise DRE correction de la FO1438
#	14/09/05 -DRE- FO1406 Retour Fonction i_LireInfoECC (doit etre != et non >)
#	26/09/05 -PSA- G2R1Cj : FO 1464, 1465, 1472 et 1473
#	29/09/05 -PSA- G2R1Co : fusion Cq sur Cj
#	14/10/05 -PSA- G2R2Co : FO 1505, 1507, 1508, 1509
#	21/10/05 -PSA- G2R2Co : FO 1527, 1528, 1530, 1533, 1534
#	08/11/05 -PSA- G2R2Co : FO 1551
#	23/11/05 -PSA- G2R2Co : FO 1578
#	02/12/05 -PSA- G2R2Co : FO 1587, 1588, 1593
#	19/12/05 -PSA- G2R2Ca : SPEC CONV_AULA S5F1 + FO 1629, 1640
#	04/01/06 -PSA- G2R2Ca : SPEC CONV_AULA S5F2 + FO 1591, 1667
#	17/03/06 -FAL- G2R2Cd : FO1695 extension FO1591 aux OT
#	17/03/06 -FAL- G2R2Cd : FO1755 DURCONV vers les applications de facturation cas SRP
#	07/04/06 -PSA- G2R2C3 : FO 1773 champ DETR1 pour 16XCONV et EVE
#	09/05/06 -FAL THE- G2R2Cw : ajout ECC TRAFBSS modification BDC g_artout2 et 7 et redist42L
#	19/05/06 -FAL THE- G2R2Cw : FO1787 1791 1793 1794 (1792)
#	22/05/06 -FAL THE- G2R2Cw : FO1799 IDUS_NUM SC si BSS
#				    retour arriere sur FO1793 CLASSDEST de TtrafBSS
#				    FO1802 SUP pour trafic si MLV
#	26/05/06 -FAL THE- G2R2Cw : choix definitif du nom des tables ft pour lib_ct et tar_ccd
#	26/05/06 -FAL THE- G2R2Cu : VGTplus fin rdt sur NPF
#	20/06/06 -FAL THE- G2R2Cu : FO1836
#	30/06/06 -FAL THE- G2R2Cu : FO1852 OPE_VGA en sortie en attente confirmation
#	30/06/06 -FAL THE- G2R2Cu : FO1852 OPE_VGA en sortie en attente confirmation
#	30/06/06 -FAL THE- G2R2Cu : FO1851 evol IDUS en sortie cas IDUS_IP  TRAFIC FCT DM SC
#	03/07/06 -FAL THE- G2R2Cu : FO1858 SC meme sans presence referentiel si T3G et non Tetris
#	10/07/06 -THEFAL - G2R2Cu lot2
#	17/07/06 -FAL- G2R2Cq Fusion G2R2Cs Nouvelle appli cliente: AndromeRI avec FO1880 1890 1897 et 1904
#	08/08/06 -FAL- G2R2Cu : FO1924 TAX pour TRAFBSS et Sconso cas SRP
#	08/08/06 -FAL- G2R2Cu : FO1925 CODCIR cas SRP
#	06/09/06 -FAL- G2R2Cq : FO1940 distribution Andromede et DEDEini andro opt
#	18/09/06 -FAL- G2R2Cu : FO1968 critere RDT et 16X
#				FO1969 IDUS et NDIP pour 16X
#	22/09/06 -FAL- G2R2Cq : en commentaire preparation FO1972 nouvelle valeur IDSV 18 pour SCP
#	20/10/06 -RHE- G3R0Cz : facturation SIP premiere ligne sur demandeur IP
#				FT2013: trop de messages 7719 -> mise en commentaire des ligne pour l alarme 7719
#	15/11/06 -RHE - 	FO2028: Supprimer la variable SIP_CPTFAC
#				FO2032: Pour les clients BANIP SIP (variable V1S), DC pour Trafic, SC, 16X: idus_num = NDIP (et non NDRTC)
#	20/11/06 -RHE   report de G2R2Cv : FO2040 : Champ REF pour ANDROMERI
#	20/11/06 -RHE   G3R0cy : arret de l'alimentation de FCT si V1S ou TETRIS_FU
#	22/11/06 -RHE   report de G2R2Cv : correctif pour FO2040
#	07/12/06 -RHE - FO2067: TAX pour Trafic
#	13/12/06 -RHE - G3R0Ca
#	01/02/07 -PKH-  G3R0Cw arret alimentation FCT sur les appels SRP Tiers(deterministe et non deterministe), SRP FT et FRT (Kiosque,PTD)
#	12/02/07 -RHE - G3R0Ca : FO2111 Numero Noir (IDSV = 18)
#	08/03/07 -RHE - G3R0Ca : FO2119 IDUS_NUM pour T16xCONV: g_iartout2 mauvais, g_iartout7 OK
#	14/03/07 -RHE - G3R0Ca : FO2131 interrogation LAR FE/FERPV avec IDUS_N, crithres pour FE/FERPV (TETRIS_Woo faux)
#	19/03/07 -RHE - G3R0Cb : fusion G2R2Ct FO2118
#	20/03/07 -RHE - G3R0Cb : distri CCD a TRAFIC et SC
#				   Modif FO2131 (Reqdouble TD_Fixe, TD_Inter avec NDRTC pour SC)
#	30/03/07 -RHE - G3R0Cb : FO2140 Pb ajout ECC (SC)
#	16/04/07 -RHE - G3R0Cb : FO2144 report de la G3R0Ca (modif distribution a TRAFIC)
#	19/04/07 -RHE - G3R0Cb : FO2149 TARIF pour BSS avec TYPCOM sans distinction de MER
#	24/04/07 -PKH - G3R0Cu : Client FE SIP avec TYPAR_SIPFE=23 distribue dans FERPV RI
#	22/05/07  THE ParamFTSA-G3R2 report version G3R0Cx
#	28/05/07  THE ParamFTSA-G3R2 report version G3R0Cw
#	30/05/07  THE ParamFTSA-G3R2 report version G3R0Cu
#	08/06/07  THE ParamFTSA-G3R2 FO 2159
#	19/06/07  THE ParamFTSA-G3R2 FO 2185 pb metachamp c_libre
#	25/06/07  THE ParamFTSA-G3R2 Correction FO 2187, 2190 et 2191
#	03/07/07  THE ParamFTSA-G3R2 Correction FO 2193
#	03/07/07  THE ParamFTSA-G3R2 Correction FO 2195
#	23/07/07  FAL ParamFTSA-G3R3 FO 2204 critere Centaure VG
#	07/08/07  JLG ParamFTSA-G3R3 lot2 Arret de FCT pour RTC
#	24/09/07  FAL ParamFTSA-G3R3 FO 2231 champ NDIP 16X
#	08/10/07  BEA ParamFTSA-G3R3Cv Conv_AULA_S13F5.doc
#	16/10/07  BEA ParamFTSA-G3R3Cv Conv_AULA_S13F6.doc
#	24/10/07  THE ParamFTSA-G3R4 Ajout DATE_LOCALE pour Symphonie
#	19/11/07  BEA ParamFTSA-G3R3Cv FO 2264
#	21/11/07  PKH ParamFTSA-G3R5 Offre T3G S2D1 substitution NDIP par ND RTC pour ebil si client SIP E//
#	13/12/07  THE ParamFTSA-G3R4 FO 2281 pour CentaureVG Champ TAX
#	29/12/07  PKH ParamFTSA-G3R5 LOT2 arret FCT besoin CENTAURE
#	10/12/08  PKH FO 2288 Correction alimentation des CSV pour TRAFBSS
#	18/01/08  PKH FO 2295 Evolution alimentation du champ NIDAV pour centaureDEA
#	22/01/08  FAL ParamFTSA-G3R5 spec S15F3 Ajout variable PREFIXE_CENTAURE pour alimentation IDAV_NUM
#	25/01/08  FAL ParamFTSA-G3R5 spec S15F3 (ter) Pas de PREFIXE_CENTAURE si SRP/LA
#	                                        Ajout SRP_FACTURABLE dans critere CENTAURE_DEA
#	04/02/08  JLG Param-FTSA G3R6 fusion G3R5C5 et G3R4Cz(C999) optimale
#	29/02/08  FAL Param-FTSA G3R6 FO2331 Suivi Conso cas AR NPF_OPT modif champs IDUS_NUM et NDS_NUM
#	14/03/08  JLG Param-FTSA G3R6 FO2348 evol aiguillage centaureVG
#	17/03/08  JLG Param-FTSA G3R6 FO2355 DEDE_NUM de la forme 000118XYZ pb appel CSV
#	20/03/08  JLG Param-FTSA G3R6 FO2360 FO2362 CCD_REEL, arretfct_centaure, prefixe_centaure
#	02/04/08  JLG Param-FTSA G3R6 FO2367 modif L1 de TscTconvNE suite a ajout champs CSi et NDS_NUM
#	28/04/08  JLG Param-FTSA G3R6 FO2373  CCD pour 16XCONV
#	28/04/08  JLG Param-FTSA G3R6 FO2374
#	23/04/08  DRE Param-FTSA G3R7 Evolution spec Conv_AULA_S16F5
#	05/05/08  THE Param-FTSA G3R7 Evolution spec Conv_AULA_S16F7 (crit distri + ELM si TAG acc et grat)
#	19/05/08  DRE Param-FTSA G3R7 Evolution spec Conv_AULA_S17F0  FO 2387 2388 2389
#	26/05/08  DRE Param-FTSA G3R7 Evolution spec FO 2401
#	28/05/08  DRE Param-FTSA G3R7 FO 2406 Reprise d'une partie de la FO 2383 G3R6: Recalcul de DEDE_NUM et par consequent de DEDE_INF
#	28/05/08  DRE Param-FTSA G3R7 FO 2406 Reprise FO 2392 et 2398 de G3R6
#	30/05/08  THE Param-FTSA G3R7 FO 2409 Distri vers centaureDEA et redist.
#	18/06/08  THE Param-FTSA G3R7 FO 2411 correction pour Efficacite DC Correl avec duree=000000
# 	27/06/08  DRE Param-FTSA G3R7 FO 2412 G3R7C9
#	24/06/08  THE ParamFTSA-G3R8Cx version unitaire
#	24/07/08  PSA ParamFTSA-G3R9 fusion G3R8Cx/G3R8C6
# 	29/07/08  PSA ParamFTSA-G3R9 report G3R8C9 : FO QC 68, 69, 70 et 71
# 	18/08/08  PSA ParamFTSA-G3R9 report G3R8C11 : FO QC 72 et 73
# 	03/09/08  DRE Reprise de la FO QC 71
# 	03/09/08  DRE THE FO QC 78
# 	03/09/08  DRE THE FO QC 82
# 	11/09/08  DRE Reprise de la FO QC 71
# 16/10/08	RHE Param-FTSA G3R10 : fusion G3R9Cy (simplification alimentation e-bill)
# 17/10/08  RHE Param-FTSA G3R10 : Numero noir IDSV 20
# 10/11/08  RHE Param-FTSA G3R10 : QC126
# 25/11/08  RHE Param-FTSA G3R10 : Report QC139
# 	02/02/09  THE Solution cible loi chatel (plus d'appel a la table externe : "TAG_Application")
# 02/03/09 - RHE - Param-FTSA-G3R11 QC194 champ CCNDE pour EBILL
# 03/03/09 - RHE - Param-FTSA-G3R11 QC194 giartout13 pour Conversion
# 26/03/09 - PKH - Param-FTSA-G3R13 Report prise en compte FTTH fibre SIP
# 01/04/09 - JLG - Param-FTSA-G3R13 Report QC203 les DC 118PTD envoye a tort a 16X  - solution CCD = 27
# 05/05/09 - RHE - Param-FTSA-G3R13 QC237, QC246 (correction post G3R13C3)
# 02/06/09 - DRE - Param-FTSA G3R13: QC253 Correction calcul ID_CORR
# 17/06/09 - PKH - Param-FTSA G3R13Cz portabilite des numeros cristal
# 30/07/09 - THE - Param-FTSA G3R14 QC273 Pb NIDAV
# 11/08/09 - DRE - Param-FTSA G3R14 QC275 Pb PREFIXE_CENTAURE
# 13/10/09 - PKH - Param-FTSA G3R14 QC294 utilisation de la fonction num_hex_str au lieu de convNum_Str pour calculer le champ $TandromeRI::IDSV
# 03/12/09 - THE - Param-FTSA G3R145C9 QC 314
# 16/12/09 - THE - Param FTSA G3R15C12 reprise QC 314
# 25/01/10 - DRE THE - Param FTSA G3R16 QC331
# 28/04/10 - PKH	G3R17lot1 Item BIVSIP Distribution des DCs BIVSIP par identification LARRPV
# 10/05/10 - PKH - G3R17lot2 Item NBE 2etape
# 10/05/10 - PKH - QC362 ajout nouvelle valorisation du champ SERVICE a 8 pour FERPV si b_0perNBE && (bVGTplus || b_FFMV3)
# 03/06/10 - PKH - QC373 item NBE ajout test retour correlation sur criteres de distribution TRAFIC et CENTVG
# 10/06/10 - PKH - QC373 suppression des filtres pour recuperer instance de CENTAUREVG
# 08/07/10 - PKH - G3R18 Annonce vocale standard generale
# 08/07/10 - PKH - G3R18 ODEBI arret de la substitution du ND IP par ND RTC pour TRAFIC
# 13/07/10 - DRE - G3R18 QC397 NIDAV pour CentaureDEA
# 08/10/10 - DRE - G3R18Cx HDCONV a FFFFFF du DC RI Convergent pour Andromede (ANDROMERI) (crise 51 Meteor)
# 08/10/10 - PKH - G3R18Cy Ajout dans fe_rpv  nature du numero demande (champ INFDDE et valorisation du champ NUMDDE avec DEDE_NUM_FACT
# 03/11/10 - PKH - G3R18Cy - QC428 - Correction format du champ INFDDE pour Tfe_rpv
# 11/02/11 - DRE THE - G3R20 modification des regles de correlation ("suite" crise 51 Meteor)
# 01/04/11 - RHE - G3R21 : valorisation sortie 16x si GLA2/HFAPP = 0xFFFFFF
# 26/04/11 - RHE - G3R21 lot2 : Facturation Open , evol LAR VIO
# 11/08/11 - THE - G3R22 QC501 traitement des AVP 387 et 359
# 01/12/2011 - THE - G3R22C6 QC501=> QC552 modif SRP Facturable
# 22/12/2011 - THE - G3R23C2 QC560 Envoi CentaureDEA
# 19/01/2012 - THE - VerifPcode
# 09/03/2012 - RHE - G3R24 Errones IP vers DQD
# 26/03/2012 - RHE - G3R24 Errones IP vers DQD  + alarme 8503 pour MAJ2G
# 03/04/2012 - RHE - G3R24 QC587 suppression T3ajout et T3correl vers DQD
# 22/01/2013 - THE - G4R2 Integration du lar OPEN
# 15/02/2013 - THE - G4R2 QC683 lecture LAR OPEN
# 25/02/2013 - THE - G4R2 Envoi COME et ELIGIBLE
# 04/03/2013 - THE - G4R02 QC693 Ajout ECC COME_ELIGIBLE
# 08/03/2013 - THE - G4R2 QC695 lecture IC referentiel
# 12/03/2013 - THE - G4R2 QC696 champ portabilite dans Tcome (couleur) (Retiree)
# 25/03/2013 - DRE - G4R2 QC701 Remplace "BEAM" par "OPEN"
# 29/03/2013 - THE - G4R2 QC704 Tcome T3t1.8 et T3t58
# 03/05/2013 - THE - G4R2 QC721 envoi a FERPV avant envoi en correlation
# 03/05/2013 - DRE - G4R3C5 QC746 Ajout test retour i_LireInfoECC
# 11/10/2013 - THE - G4R4 QC756 correction  mise au format GASCII pour COME
# 18/12/2013 - THE - G4R5 C+S facturation de l'appele .
# 06/01/2014 - DRE - G4R5 Sup. acces TDATODEBI
# 09/01/2014 - DRE - G4R5 QC778 Correction Pb idsv + C-EFF inversion de la valeur efficace
# 22/01/2014 - DRE - G4R5 Recherche de la date locale dans le cas de Numero IP (commencant par 976 dont le demandeur est a la reunion ou mayotte
# 31/01/2014 - THE - G4R5 QC781
# 31/01/2014 - THE - G4R5 QC783 NDS_NUM pour Trafic
# 03/02/2014 - THE - G4R5 QC786 Champ TRAD pour 16X CPS
# 03/02/2014 - THE - G4R5 QC785 Test Champ DEDEini2 en traitement
# 05/02/2014 - DRE - G4R5 QC790 Correction valeur ECCFACT : Pour symphonie et SuiviConso, mettre "TRAFOPT" seulement si le DC OPT est envoye vers Trafic.
# 11/03/2014 - THE - G4R5C8 QC802 : Flux Convergent et sortie 16X - NDI present ? tort => Ajout test sur natach pour IDUS_IP
# 11/04/2014 - PSA - G4R6 lot 3 : C+S appelant
# 18/04/2014 - THE - ##### G4R6 QC805 ##### modif de la mise au format de 16xCONVCPS::DETR_INT
# 20/05/2014 - THE - # G4R6C4 QC820 # Un DC C+S, assimil? "SRP facturable"
# 04/06/2014 - THE - # G4R6 QC824 # Init type_edit
# 17/06/2014 - THE DRE - # G4R6 QC828 et 829 # Debordement pointeur pt_NORM
# 18/06/2014 - THE DRE - # G4R6 QC826 # Criteres CentaureDEA
# 25/06/2014 - THE - # G4R6 QC822 # Valo ECC_FACT pour 16X Pas de redist pour un DC "C+S appelant" (SRP et  type contr?le = 17) pour TRAFBSS
# 29/07/2014 - THE - # G4R7 Lot3 QC830 distribution ? TRAFIC et CentaureVG
# 26/11/2014 - THE - # G4R8 QC859 appel maj2g si N?IP dans aucun referentiel
# 28/11/2014 - THE - # G4R8 QC861 RedistIp envoi a DQD et RedistMaj alarme 8503 et 8504 Envoi en ARD
#
################################################################################

# VerifPcode
#G4R2
#G3R24
#G4R2
# G4R5

# G4R6 Lot3

# /G4R6 Lot2

################################################################################
# VerifPcode
#G3R24 trait_ok renomme en cpt_RDT

# Flags d emission vers les ECC
# Flags de presence dans le referentiel
# Instances ECC
#G4R2
# Variables fonctionnelles
# NOTA: TETRIS_Woo dans la spec s'appelle ici b_TETRIS_TRAFBSS
#DRE G4R5 Sup. acces TDATODEBI
#G3R24
#G4R2
# G4R5
#G4R6 lot 3 : C+S appelant
# /G4R6 Lot3

################################################################################
# VerifPcode
#DRE G4R5
#G4R2
# G4R5
# G4R6 Lot3
# /G4R6 Lot3


################################################################################
gmt_date_860026562 = 0
date_locale_860026562 = 0
L_NDR_860026562 = 0
ddebut_860026562 = 0
duree_860026562 = 0
duracc_860026562 = 0
duraut_860026562 = 0
natach_860026562 = 0
itx_860026562 = 0
cptx_860026562 = 0
seq_860026562 = 0
cause_860026562 = 0xff
#heure = 0
#minute = 0
#seconde = 0
res1_860026562 = 0
lg_860026562 = 0
hdfin_860026562 = 0
hduree_860026562 = 0
gvi_860026562 = 0
id_corr_860026562 = 0
#prefixe = 0
#envoi_CORR = 0
instECCv_860026562 = 0
instCENTAUREVG_860026562 = 0
VGA_860026562 = 0
val_860026562 = 0
bFERPV_860026562 = 0
bFE_860026562 = 0
bTrafBSS1_860026562 = 0
bTrafBSS2_860026562 = 0
#
bTRAFIC_860026562 = 0
bDM_860026562 = 0
bSC_860026562 = 0
b16XCONV_860026562 = 0
#bEVE = 0
bSYMPHONIE_860026562 = 0
bREDISTIP_860026562 = 0
bREDISTMAJ2G_860026562 = 0
bCENTVG_860026562 = 0
arTRAFIC_860026562 = 0
arFERPV_860026562 = 0
arFE_860026562 = 0
arSC_860026562 = 0
SCP_860026562 = 0
SRP_860026562 = 0
SCP_SPORTABILITE_860026562 = 0
SRP_SPORTABILITE_860026562 = 0
SRP_EPORTABILITE_860026562 = 0
SRP_FACTURABLE_860026562 = 0
SCP_FACTURABLE_860026562 = 0
EPORTABILITE_SRPLA_860026562 = 0
REROUT_TYPE_860026562 = 0
EFFICACE_860026562 = 0
CCD_860026562 = 0
CCD_REEL_860026562 = 0
NB_CSV_860026562 = 0
SERVICE_860026562 = 0
IDUS_IP_860026562 = 0
NB_UT_860026562 = 0
#bitA = 0
#bitB = 0
#bitC = 0
#bitD = 0
cfr_860026562 = 0
dizaine_860026562 = 0
unite_860026562 = 0
dede_reroute_860026562 = 0
instBSS_860026562 = 0
instNPF_860026562 = 0
b_TETRIS_FU_860026562 = 0
b_TETRIS_TRAFBSS_860026562 = 0
L_COMPTE_NPF_860026562 = 0
instTRAFBSS1_860026562 = 0
instTRAFBSS2_860026562 = 0
CODCIR_860026562 = -1
b_TRAFBSScritCOM_860026562 = 0
V1S_860026562 = 0
MLV_860026562 = 0
b_NPF_SIP_860026562 = 0
instSIP_860026562 = 0
dpivot_860026562 = 0
bVGTplus_860026562 = 0
TYPCOM_860026562 = 0
TYPAR_SIPFE_860026562 = 0
TYPAR_FE_860026562 = 0
TYPAR_ETEL_860026562 = 0
b_FRT_Kiosque_860026562	= 0
TYPCOM_fct_860026562 = 0
b_arretfct_centaure_860026562 = 0
bCENTDEA_860026562 = 0
b_NPF_OPT_860026562 = 0
MER_Kiosque_DC1_860026562 = 0
MER_Kiosque_DC2_860026562 = 0
TAG_gratuit_860026562 = 0
TAG_Accueil_860026562 = 0
DURCONV_860026562 = 0
TYPE_860026562 = 0
Indice_860026562 = 0
CUMUL_DUREE_860026562  = 0
Appel_BNC_860026562 = 0
SIP_Fibre_860026562 = 0
b118PTD_860026562 = 0
valeur_860026562 = 0
TYPAR_BIV_SIP_860026562 = 0
b_CodOperVG_860026562 = 0
b_FFMV3_860026562 = 0
b_OperNBE_860026562 = 0
b_FERPV_860026562 = 0
b_FERPV_NBE_860026562 = 0
#b_DATODEBI = 0
date_table_860026562 = 0
sdate_conv_860026562 = 0
#G4R2
instCOME_860026562 = 0
instELIG_860026562 = 0
arCome_860026562 = 0
arElig_860026562 = 0
bCome_860026562 = 0
bElig_860026562 = 0
taille_860026562 = 0
date_audit_860026562 = 0
b_FERPV_COME_860026562 = 0
instCOM_ELIG_860026562 = 0
longueur_860026562 = 0
# G4R5
CPS_860026562 = 0
CPS_SPORTABILITE_860026562 = 0
detr1_int_860026562 = 0
B_APPEL_BANIP_860026562 = 0
b_ALICE_860026562 = 0
#G4R6 lot 3 : C+S appelant
typeCTR_860026562 = 0
b_Fact_CPS_RI_860026562 = 0
Date_CPS_860026562 = 0
instALICE_860026562 = -1
val_860026562 = 0
# /G4R6 Lot3

################################################################################
pt_PREFIXE_CENTAURE_860026562 = "112116095080082069070073088069"
pt_SIP_ECC_860026562 = "3164852"
pt_CLE_860026562 = "pt_CLE852369515182"
pt_VGTplus_OP_860026562 = "504754564754564754564"
pt_VGTplus_OF_860026562 = "464754564754564754564"
pt_RES1_860026562 = "07895825648589989828989898"
pt_TETRIS_compte_860026562 = "776677667766776677667766776677667766"
pt_COMPTE_NPF_860026562 = "2323232323232323232323232323232323232323232323232323"
pt_TETRIS_RTC_860026562 = "2828282828282828282828282828"
pt_CODE_FU_860026562 = "2525"
#pt_codcir = "14141414141414141414"
pt_TARIF_860026562 = "4444444444444444444444444444444444444444444444444444444444444"
pt_TRAFIC_860026562 = "55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555"
pt_IDUS_NDRTC_860026562 = "748174817481748174817481748174817481748174817481748174817481748174817481748174817481748174817481"
pt_LIBELREDIST_860026562 = "78901234567890123456789012345612345789012345678901234567890123456123457890123456789012345678901234561234578901234567890123456789012345612345"
pt_temp_860026562 = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
pt_temp2_860026562 = "170119690312345678901234567890123456789012345678901234567890123456789012345678901234567890"
pt_XY_860026562 = "pt_XY"
pt_InfoCompl_860026562 = "234567890123456789012345678901"
pt_InfoCompl_FERPV_860026562 = "777767890123456789012345678901"
pt_basTRAFIC_860026562 = "345678901234567890123456789012"
pt_DM_860026562 = "456789012345678901234567890123"
pt_C_CSV_860026562 = "999912345"
pt_OP_CSV_860026562 = "0012345"
pt_CodeTable_860026562 = "000012345"
pt_BUF_860026562 = "666666123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
pt_BUF2_860026562 = "999999123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
pt_SGTQS_860026562 = "8888000012345000012345"
pt_ECCFACT_860026562 = "963258741963258741963258741"
pt_cascorr_860026562 = "18181818181818"
pt_DEDE_NUM_860026562 = "292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929"
pt_DEDEini_NUM_860026562 = "35353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535"
pt_NDRTC_860026562 = "56565656565656565656353535353535353535353535353535353535353535353535353535353535353535353535353535"
pt_adr_NDRTC_860026562 = "3838383838382929292929292929292929292929292929292929292929292929292929292929292929292929292929000"
pt_CODE_DEUR_860026562 = "434F44455F44455552"
pt_VGA_OP_860026562 = "035035035035035035035"
pt_VGA_OF_860026562 = "907907907907907907907"
pt_OFFRE_860026562 = "502350235023502350235023"
pt_OPERA_860026562 = "879879879878978987789857"
pt_STY_860026562 = "28962896"
pt_InfoComplFE_860026562 = "190190190190190190190190190190190190190"
pt_Info_FERPV_860026562 = "1717171717171717171717171717171717717171"
pt_Info_ETEL_860026562 = "520520520520520520520520520520520520520520"
pt_NM3_OP_860026562 = "504E4D334F504E4D334F50"
pt_NM3_OF_860026562 = "464E4D334F464E4D334F46"
pt_service_860026562 = "6543"
pt_CSV_860026562 = "24567457424167433546121657446574151245754857"
pt_OPT_RTC_860026562 = "pt_OPT_RTC333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333"
pt_OPT_ECC_860026562 = "pt_OPT_ECC4321"
pt_DEDE_NUM_FACT_860026562 = "pt_DEDE_NUM_FACT11111111111111111111111111111111111111111111111111111111111111"
pt_IDUS_NORM_860026562 = "pt_IDUS_NORM888888888888888888888888888888888888888888888888888888888888888888"
pt_ITX_860026562 = "pt_ITX1111111111111111111"
pt_DEDEINI_NUM_N_860026562 = "pt_DEDEINI_NUM_N5555555555555555555555555555555555555555555555"
pt_DEDEini_DIST_N_860026562 = "pt_DEDEini_DIST_N666666666666666666666666666666666666666666666"
pt_buffer_860026562 = "pt_buffer123"
pt_Support_860026562 = "pt_Support678678678678678678"
pt_TYPOFFRE_860026562 = "pt_TYPOFFRE8123812381238123812381238123812381238123812838123818238123813238123"
pt_CodOperVG_860026562 = "pt_CodOperVG73173173173173173173173173173137313137317137131317317317317311731731731831931"
pt_CodOffreVG_860026562 = "pt_CodOffreVG832583258325832583258325832583258432584358543845385438345834585438438855838"
pt_TEMP1_860026562 = "pt_TEMP1797798798798798798798797879787977879787978797897879778978779787978797879787977879787977879789787977879798"
#DRE G4R5
#pt_datODEBI = "pt_datODEBI1761761767167671676716761767167167617617167167167167161767167161716716171671167116716"
pt_NIDAV_CENTAURE_860026562 = "pt_NIDAV_CENTAURE123456789123456789123456789123456789"
pt_HFAPP_860026562 = "pt_HFAPP123"
#G4R2
pt_NDI_COME_860026562 = "pt_NDI_COME9876543210987654321"
# G4R5
pt_IDSV_860026562 = "pt_IDSV9876543210123456789"
pt_DEDEini2_NUM_860026562 = "pt_DEDEini2_NUM35353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535"
pt_TYPE_SERV_860026562 = "pt_TYPE_SERV"
pt_NDRTC_MAY_860026562 = "pt_NDRTC_MAYpt_NDRTC_MAYpt_NDRTC_MAYpt_NDRTC_MAYpt_NDRTC_MAYpt_NDRTC_MAYpt_NDRTC_MAYpt_NDRTC_MAYpt_NDRTC_MAY"
# G4R6 Lot3
pt_MESSAGE_860026562 = "pt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGEpt_MESSAGE"
pt_CODE_TARIF_860026562 = "pt_CODE_TARIFpt_CODE_TARIF"
pt_TYPE_EDIT_860026562 = "pt_TYPE_EDIT"
pt_NDE_860026562 = "pt_NDE987654321098765432109876543210987654321098765432109876543210pt_NDE"
pt_NORM_860026562 = "pt_NORM012345678901234567890123456789012345678901234567890123456789pt_NORM"
# /G4R6 Lot3


################################################################################
i_strcpy(pt_PREFIXE_CENTAURE_860026562, "")
i_strcpy(pt_TETRIS_compte_860026562, "")
i_strcpy(pt_COMPTE_NPF_860026562, "")
i_strcpy(pt_TETRIS_RTC_860026562, "")
i_strcpy(pt_CODE_FU_860026562, "")
#i_strcpy(pt_codcir, "")
i_strcpy(pt_TARIF_860026562, "")
i_strcpy(pt_TRAFIC_860026562, "")
i_strcpy(pt_IDUS_NDRTC_860026562, "")
i_strcpy(pt_NDRTC_860026562, "")
i_strcpy(pt_adr_NDRTC_860026562, "")
i_strcpy(pt_temp_860026562, "")
i_strcpy(pt_OFFRE_860026562, "")
i_strcpy(pt_VGA_OF_860026562, "")
i_strcpy(pt_OPERA_860026562, "")
i_strcpy(pt_VGA_OP_860026562, "")
i_strcpy(pt_STY_860026562, "")
i_strcpy(pt_VGTplus_OF_860026562, "")
i_strcpy(pt_VGTplus_OP_860026562, "")
i_strcpy(pt_RES1_860026562, "")
i_strcpy(pt_CODE_DEUR_860026562, "")
i_strcpy(pt_ECCFACT_860026562, "")
i_strcpy(pt_SIP_ECC_860026562, "")
i_strcpy(pt_CLE_860026562, "")
i_strcpy (pt_InfoComplFE_860026562,"")
i_strcpy (pt_Info_FERPV_860026562,"")
i_strcpy (pt_Info_ETEL_860026562,"")
i_strcpy(pt_NM3_OP_860026562, "")
i_strcpy(pt_NM3_OF_860026562, "")
i_strcpy(pt_CSV_860026562, "")
i_strcpy(pt_OPT_RTC_860026562," ")
i_strcpy(pt_OPT_ECC_860026562, "")
i_strcpy(pt_XY_860026562, "")
i_strcpy(pt_DEDE_NUM_FACT_860026562,"")
i_strcpy(pt_IDUS_NORM_860026562,"")
i_strcpy(pt_DEDEINI_NUM_N_860026562, "")
i_strcpy(pt_DEDEini_DIST_N_860026562, "")
i_strcpy(pt_buffer_860026562, "   ")
i_strcpy(pt_Support_860026562, " ")
i_strcpy(pt_TYPOFFRE_860026562,"")
i_strcpy(pt_InfoCompl_860026562,"")
i_strcpy(pt_CodOperVG_860026562,"")
i_strcpy(pt_CodOffreVG_860026562,"")
i_strcpy(pt_TEMP1_860026562,"")
#DRE G4R5
#i_strcpy (pt_datODEBI,"")
i_strcpy(pt_NIDAV_CENTAURE_860026562,"")
i_strcpy(pt_HFAPP_860026562,"      ")

# VerifPcode
i_strcpy(pt_C_CSV_860026562,"")
i_strcpy(pt_OP_CSV_860026562,"")
i_strcpy(pt_CodeTable_860026562,"")
i_strcpy(pt_LIBELREDIST_860026562,"")
i_strcpy(pt_InfoCompl_FERPV_860026562,"")
i_strcpy(pt_temp2_860026562,"")
i_strcpy(pt_basTRAFIC_860026562,"")
i_strcpy(pt_DM_860026562,"")
i_strcpy(pt_BUF_860026562,"")
i_strcpy(pt_BUF2_860026562,"")
i_strcpy(pt_SGTQS_860026562,"")
i_strcpy(pt_cascorr_860026562,"")
i_strcpy(pt_DEDE_NUM_860026562,"")
i_strcpy(pt_service_860026562,"")
i_strcpy(pt_ITX_860026562,"")
#G4R2
i_strcpy(pt_NDI_COME_860026562,"")
# G4R5
i_strcpy(pt_IDSV_860026562, "")
i_strcpy(pt_DEDEini2_NUM_860026562, "")
i_strcpy(pt_TYPE_SERV_860026562, "")
i_strcpy(pt_NDRTC_MAY_860026562, "")
# G4R6 Lot3
i_strcpy(pt_MESSAGE_860026562, "")
i_strcpy(pt_CODE_TARIF_860026562, "    ")
#G4R6 QC824 #
i_strcpy(pt_TYPE_EDIT_860026562, " ")
i_strcpy(pt_NDE_860026562,"")
i_strcpy(pt_NORM_860026562, "")
# /G4R6 Lot3


trace("################## DEBUT PCODE DIST_TCONVNE.src ####################")

# Duplication de l'article

erreur_860026562 = i_dup_art_id(g_iartin, g_iartout)
erreur_860026562 = i_cree_art(C_Conversion_860026562, g_iartout13)

#==============================================================================
# Test redistribution
#==============================================================================
cpt_RDT_860026562 = i_LireRedistCpt()

#==============================================================================
# Test retour de correlation
#==============================================================================

#trace1("DIST: GIPT: <%d>", g_ipt)
SI (g_ipt == PT_CORRELE)
ALORS
	RETOUR_CORR_860026562 = 1
	#trace("RETOUR_CORR est vrai")
SINON
	RETOUR_CORR_860026562 = 0
FINSI

SI (g_ipt == PT_RECYCLE )
ALORS
	trace("===== Article mis en RECYCLAGE =====")
	erreur_860026562 = i_stocke_art(g_iartin, 0, PT_RECYCLE, 0)
	RETOUR TRAIT_OK
FINSI

#==============================================================================
#              VARIABLES FONCTIONNELLES/variables diverses
#==============================================================================

#G4R6 lot 3 : C+S appelant
# recuperation de typeCTR
SI (i_valid_field_n(g_iartout, $TconvNE::ACE_N3))
ALORS
	typeCTR_860026562 = i_get_art_field(g_iartout, $TconvNE::ACE_N3)
	erreur_860026562 = i_supprChamp(g_iartout, "T4ACE_N3")
FINSI

#recuperation du demande utilise pour appel a la BNC
SI (i_valid_field_n(g_iartout, $TconvNE::DEDE_BNC))
ALORS
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE_BNC, pt_NORM_860026562)
	erreur_860026562 = i_supprChamp(g_iartout, "T4dede_bnc")
FINSI

#/G4R6 lot 3 : C+S appelant

# Calcul de la date GMT
ddebut_860026562 = i_get_art_field(g_iartout, $TconvNE::ddebut)
gmt_date_860026562 = i_DHgetCe2gTime(NUMTAB_GMT_860026562, ZONE_METRO_860026562, ddebut_860026562)

dpivot_860026562 = i_get_art_field(g_iartout, $TconvNE::dpivot)

########################################
# 		TAG_gratuit
########################################
erreur_860026562 = i_dup_chp_1val(g_iartout,g_iartout13, $TconvNE::ITX, $Conversion::NUM)

erreur_860026562 = i_get_art_str(g_iartout13, $Conversion::DCB, pt_ITX_860026562)
i_get_sub_str(pt_ITX_860026562, -2, -1, pt_ITX_860026562)
i_strcpy(pt_temp_860026562, i_get_tab_field("Indice_ITX", gmt_date_860026562, pt_ITX_860026562))

SI (i_strcmp(pt_temp_860026562,g_inull)) != 0
ALORS
	TAG_gratuit_860026562 = 1
SINON
	TAG_gratuit_860026562 = 0
FINSI

########################################
# 		TAG_Accueil
########################################
erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDEINI_NUM_N, pt_temp2_860026562)
i_strcpy(pt_temp_860026562, i_get_tab_field("TAG_Accueil", gmt_date_860026562, pt_temp2_860026562))

SI (i_strcmp(pt_temp_860026562,g_inull)) != 0
ALORS
	TAG_Accueil_860026562 = 1
SINON
	TAG_Accueil_860026562 = 0
FINSI

datefin_860026562 = i_concat_date(g_iartout, $TconvNE::DATE, $TconvNE::HFAPP, 0)

########################################
# 		TAG_Accueil
########################################
TYPE_860026562 = 0

SI (i_valid_field_n(g_iartout, $TconvNE::TYPE))
ALORS
	TYPE_860026562 = i_get_art_field(g_iartout, $TconvNE::TYPE)
FINSI

#####################################################################################
# Controle presence et recuperation de l'instance du referentiel VGA
#########################################################################################

instVGA_860026562 = i_LireInstanceECC(INST_VGA_860026562)

SI (!instVGA_860026562)
ALORS
	#trace("erreur Pas d'instance pour VGA!")
	code_errone_860026562 = 0xA0C1
	erreur_860026562 = i_PlvMessEmettre(8607,2,g_iartin,"",3,code_errone_860026562,"VGA",C_Article_860026562)
	SAUT DISTRI_ERR
FINSI
#trace1("instVGA =<%d>",instVGA)

instVGAIP_860026562 = i_LireInstanceECC(INST_VGAIP_860026562)

SI (!instVGAIP_860026562)
ALORS
	#trace("erreur Pas d'instance pour VGAIP!")
	code_errone_860026562 = 0xA0C1
	erreur_860026562 = i_PlvMessEmettre(8607,2,g_iartin,"",3,code_errone_860026562,"VGAIP",C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

instOPEN_860026562 = i_LireInstanceECC(INST_OPEN_860026562)

SI (!instOPEN_860026562)
ALORS
	#trace("erreur Pas d'instance pour VGA!")
	code_errone_860026562 = 0xA0C1
	erreur_860026562 = i_PlvMessEmettre(8607,2,g_iartin,"",3,code_errone_860026562,"OPEN",C_Article_860026562)
	SAUT DISTRI_ERR
FINSI
#trace1("__FILE__:__LINE__ ## TEST ## ======> Valeur de instOPEN : <%d> #### ", instOPEN)

##############################################################################
# Envoi Requetes Table de Distribution VGA
##############################################################################
L_NDR_860026562 = i_get_art_fieldlength(g_iartout, $IDUS_NUM)

SI (L_NDR_860026562 % 2 == 0)
ALORS
	L_NDR_860026562 = L_NDR_860026562 / 2
SINON
	L_NDR_860026562 = L_NDR_860026562 / 2 + 1
FINSI

#trace2("debut req TD_VGA1 IDUS_NUM <%s> ", pt_BUF, "")
#trace1("    L_NDR <%d>",L_NDR)

SI (i_EnvoiReqConsTabDist(TD_VGA1_860026562, gmt_date_860026562, i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
ALORS
	code_errone_860026562 = 0xA0C1
	erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, "erreur requette VGA1", C_Article_860026562)
	#trace("erreur i_EnvoiReqConsTabDistDouble pour VGA1 (table 8)")
	SAUT DISTRI_ERR
FINSI

erreur_860026562 = i_LireReqConsTabDist()
#trace1("RETOUR i_LireReqConsTabDist retour requette VGA1, erreur=<%d>",erreur)

SI (erreur_860026562 != 0)
ALORS
	#trace1("erreur i_LireReqConsTabDist VGA1: <%d>", erreur)
	code_errone_860026562 = 0xA0C1
	erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, "erreur i_LireReqConsTabDist VGA1 ", C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

val_860026562 = i_LireInfoECC(instVGA_860026562, 0)

SI (val_860026562 != 0)
ALORS
	erreur_860026562 = i_LireChaineInfo(val_860026562, 0, 6, pt_OFFRE_860026562)
#G3R17lot2 recopie de pt_OFFRE dans pt_CodOffreVG pour besoin Item NBE
	i_strcpy(pt_CodOffreVG_860026562,pt_OFFRE_860026562)

	SI (i_strcmp(pt_OFFRE_860026562, g_inull))
	ALORS
		#trace2("pt_OFFRE de VGA1 <%s> pour appel table CodeOffre", pt_OFFRE, "")
		erreur_860026562 = i_format_str2(pt_temp_860026562, "%s%s", "INj", pt_OFFRE_860026562)
		i_strcpy(pt_RES1_860026562, i_get_tab_field("Inter", gmt_date_860026562, pt_temp_860026562))
		#trace2("pt_RES1 table CodeOffre <%s> ", pt_RES1, "")
		SI (i_strcmp(pt_RES1_860026562, "NM3") == 0)
		ALORS
			NM3_860026562 = 1
			i_strcpy(pt_NM3_OF_860026562, pt_OFFRE_860026562)
		SINON
			SI (IDUS_IP_860026562 == 0)
			ALORS
				SI (i_strcmp(pt_RES1_860026562, "VGT+") == 0)
				ALORS
					bVGTplus_860026562 = 1
					i_strcpy(pt_VGTplus_OF_860026562, pt_OFFRE_860026562)
				SINON
					SI (i_strcmp(pt_RES1_860026562, "VGA") == 0)
					ALORS
						VGA_860026562 = 1
						i_strcpy(pt_VGA_OF_860026562, pt_OFFRE_860026562)
					FINSI
				FINSI
			FINSI
		FINSI
	FINSI
FINSI

SI (i_EnvoiReqConsTabDist(TD_VGA2_860026562, gmt_date_860026562, i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
ALORS
	#trace("erreur i_EnvoiReqConsTabDist VGA2")
	SAUT DISTRI_ERR
FINSI

erreur_860026562 = i_LireReqConsTabDist()
#trace1("RETOUR i_LireReqConsTabDist retour requette VGA2, erreur=<%d>",erreur)
SI (erreur_860026562 != 0)
ALORS
	#trace1( "erreur i_LireReqConsTabDist VGA2: <%d>", erreur)
	SAUT DISTRI_ERR
FINSI

val_860026562 = i_LireInfoECC(instVGA_860026562, 0)
SI (val_860026562 != 0)
ALORS
	erreur_860026562 = i_LireChaineInfo(val_860026562, 0, 6, pt_OPERA_860026562)

	SI (i_strcmp(pt_OPERA_860026562, g_inull))
	ALORS
		i_strcpy (pt_CodOperVG_860026562,pt_OPERA_860026562)
		b_CodOperVG_860026562 = 1
	FINSI

	SI b_CodOperVG_860026562
	ALORS
		erreur_860026562 = i_format_str2(pt_TEMP1_860026562, "%s%s", "INj", pt_CodOffreVG_860026562)
		SI ( i_strcmp( i_get_tab_field("Inter", gmt_date_860026562, pt_TEMP1_860026562),"FFMV3") == 0 )
		ALORS
			b_FFMV3_860026562 = 1
		FINSI
	FINSI

	SI b_CodOperVG_860026562
	ALORS
		erreur_860026562 = i_format_str2(pt_TEMP1_860026562, "%s%s", "INm", pt_CodOperVG_860026562)
		SI ( i_strcmp( i_get_tab_field("Inter", gmt_date_860026562, pt_TEMP1_860026562),g_inull) != 0 )
		ALORS
			b_OperNBE_860026562 = 1
		FINSI
	FINSI

	#trace2(" Resultat de i_LireChaineInfo pour la table  VGA1 (table 8) <%s>", pt_OFFRE, "")
	SI (VGA_860026562 || bVGTplus_860026562 || NM3_860026562)
	ALORS

		SI (i_strcmp(pt_OPERA_860026562, g_inull))
		ALORS
			SI NM3_860026562 == 1
			ALORS
				i_strcpy(pt_NM3_OP_860026562, pt_OPERA_860026562)
			SINON
				SI (bVGTplus_860026562 == 1)
				ALORS
					i_strcpy(pt_VGTplus_OP_860026562, pt_OPERA_860026562)
				SINON
					i_strcpy(pt_VGA_OP_860026562, pt_OPERA_860026562)
				FINSI
			FINSI
		FINSI
	FINSI
	#trace2(" Resultat de i_LireChaineInfo pour VGA2 (table3): <%s>", pt_OFFRE, "")
FINSI
#trace1("     ##### #####     NM3 <%d>",NM3)
#trace1("bVGTplus <%d>",bVGTplus)
#trace1("VGA <%d>",VGA)
#trace2("     ##### #####     pt_NM3_OF <%s>",pt_NM3_OF ,"")
#trace2("     ##### #####     pt_NM3_OP <%s>",pt_NM3_OP ,"")
#trace2("pt_VGTplus_OF <%s>",pt_VGTplus_OF ,"")
#trace2("pt_VGTplus_OP <%s>",pt_VGTplus_OP ,"")
#trace2("VGA_OP <%s>",pt_VGA_OP ,"")
#trace2("VGA_OF <%s>",pt_VGA_OF ,"")
#**********************fin interrogation table VGA

#QC683
#G4R2
##############################################################################
# Envoi Requetes Table de Distribution OPEN
##############################################################################
SI (b_CodOperVG_860026562 == 0)
ALORS
	#trace2("debut req TD_VGA1 IDUS_NUM <%s> ", pt_BUF, "")
	#trace1("    L_NDR <%d>",L_NDR)
	SI (i_EnvoiReqConsTabDist(TD_VGA1_860026562, gmt_date_860026562, i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
	ALORS
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, "erreur requette VGA1", C_Article_860026562)
		#trace("erreur i_EnvoiReqConsTabDistDouble pour VGA1 (table 8)")
		SAUT DISTRI_ERR
	FINSI

	erreur_860026562 = i_LireReqConsTabDist()
	#trace1("RETOUR i_LireReqConsTabDist retour requette VGA1, erreur=<%d>",erreur)

	SI (erreur_860026562 != 0)
	ALORS
		#trace1("erreur i_LireReqConsTabDist VGA1: <%d>", erreur)
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, "erreur i_LireReqConsTabDist VGA1 ", C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	val_860026562 = i_LireInfoECC(instOPEN_860026562, 0)

	SI (val_860026562 != 0)
	ALORS
		erreur_860026562 = i_LireChaineInfo(val_860026562, 0, 6, pt_OFFRE_860026562)
		i_strcpy(pt_CodOffreVG_860026562,pt_OFFRE_860026562)

		SI (i_strcmp(pt_OFFRE_860026562, g_inull))
		ALORS
			#trace2("pt_OFFRE de VGA1 <%s> pour appel table CodeOffre", pt_OFFRE, "")
			erreur_860026562 = i_format_str2(pt_temp_860026562, "%s%s", "INj", pt_OFFRE_860026562)
			i_strcpy(pt_RES1_860026562, i_get_tab_field("Inter", gmt_date_860026562, pt_temp_860026562))
			#trace2("pt_RES1 table CodeOffre <%s> ", pt_RES1, "")
			SI (i_strcmp(pt_RES1_860026562, "NM3") == 0)
			ALORS
				NM3_860026562 = 1
				i_strcpy(pt_NM3_OF_860026562, pt_OFFRE_860026562)
			SINON
				SI (IDUS_IP_860026562 == 0)
				ALORS
					SI (i_strcmp(pt_RES1_860026562, "VGT+") == 0)
					ALORS
						bVGTplus_860026562 = 1
						i_strcpy(pt_VGTplus_OF_860026562, pt_OFFRE_860026562)
					SINON
						SI (i_strcmp(pt_RES1_860026562, "VGA") == 0)
						ALORS
							VGA_860026562 = 1
							i_strcpy(pt_VGA_OF_860026562, pt_OFFRE_860026562)
						FINSI
					FINSI
				FINSI
			FINSI
		FINSI
	FINSI

	SI (i_EnvoiReqConsTabDist(TD_VGA2_860026562, gmt_date_860026562, i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
	ALORS
		#trace("erreur i_EnvoiReqConsTabDist VGA2")
		SAUT DISTRI_ERR
	FINSI

	erreur_860026562 = i_LireReqConsTabDist()
	#trace1("RETOUR i_LireReqConsTabDist retour requette VGA2, erreur=<%d>",erreur)

	SI (erreur_860026562 != 0)
	ALORS
		#trace1( "erreur i_LireReqConsTabDist VGA2: <%d>", erreur)
		SAUT DISTRI_ERR
	FINSI

#QC683
	val_860026562 = i_LireInfoECC(instOPEN_860026562, 0)

	SI (val_860026562 != 0)
	ALORS
		erreur_860026562 = i_LireChaineInfo(val_860026562, 0, 6, pt_OPERA_860026562)
		SI (i_strcmp(pt_OPERA_860026562, g_inull))
		ALORS
			i_strcpy (pt_CodOperVG_860026562,pt_OPERA_860026562)
			b_CodOperVG_860026562 = 1
		FINSI

		SI b_CodOperVG_860026562
		ALORS
			erreur_860026562 = i_format_str2(pt_TEMP1_860026562, "%s%s", "INj", pt_CodOffreVG_860026562)
			SI ( i_strcmp( i_get_tab_field("Inter", gmt_date_860026562, pt_TEMP1_860026562),"FFMV3") == 0 )
			ALORS
				b_FFMV3_860026562 = 1
			FINSI
		FINSI

		SI b_CodOperVG_860026562
		ALORS
			erreur_860026562 = i_format_str2(pt_TEMP1_860026562, "%s%s", "INm", pt_CodOperVG_860026562)
			SI ( i_strcmp( i_get_tab_field("Inter", gmt_date_860026562, pt_TEMP1_860026562),g_inull) != 0 )
			ALORS
				b_OperNBE_860026562 = 1
			FINSI
		FINSI

		#trace2(" Resultat de i_LireChaineInfo pour la table  VGA1 (table 8) <%s>", pt_OFFRE, "")

		SI (VGA_860026562 || bVGTplus_860026562 || NM3_860026562)
		ALORS

			SI (i_strcmp(pt_OPERA_860026562, g_inull))
			ALORS
				SI NM3_860026562 == 1
				ALORS
					i_strcpy(pt_NM3_OP_860026562, pt_OPERA_860026562)
				SINON
					SI (bVGTplus_860026562 == 1)
					ALORS
						i_strcpy(pt_VGTplus_OP_860026562, pt_OPERA_860026562)
					SINON
						i_strcpy(pt_VGA_OP_860026562, pt_OPERA_860026562)
					FINSI
				FINSI
			FINSI
		FINSI
		#trace2(" Resultat de i_LireChaineInfo pour VGA2 (table3): <%s>", pt_OFFRE, "")
	FINSI
	#trace1("     ##### #####     NM3 <%d>",NM3)
#QC683
	#trace1("OPEN: bVGTplus <%d>",bVGTplus)
	#trace1("OPEN: VGA <%d>",VGA)
	#trace2("OPEN: pt_NM3_OF <%s>",pt_NM3_OF ,"")
	#trace2("OPEN: pt_NM3_OP <%s>",pt_NM3_OP ,"")
	#trace2("OPEN: pt_VGTplus_OF <%s>",pt_VGTplus_OF ,"")
	#trace2("OPEN: pt_VGTplus_OP <%s>",pt_VGTplus_OP ,"")
	#trace2("OPEN: VGA_OP <%s>",pt_VGA_OP ,"")
	#trace2("OPEN: VGA_OF <%s>",pt_VGA_OF ,"")
	#**********************fin interrogation table VGA (VGAIP)
FINSI
#/G4R2

##############################################################################
# Envoi Requetes Table de Distribution VGAIP
##############################################################################
SI (b_CodOperVG_860026562 == 0)
ALORS
	#trace2("debut req TD_VGA1 IDUS_NUM <%s> ", pt_BUF, "")
	#trace1("    L_NDR <%d>",L_NDR)
	SI (i_EnvoiReqConsTabDist(TD_VGA1_860026562, gmt_date_860026562, i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
	ALORS
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, "erreur requette VGA1", C_Article_860026562)
		#trace("erreur i_EnvoiReqConsTabDistDouble pour VGA1 (table 8)")
		SAUT DISTRI_ERR
	FINSI

	erreur_860026562 = i_LireReqConsTabDist()
	#trace1("RETOUR i_LireReqConsTabDist retour requette VGA1, erreur=<%d>",erreur)

	SI (erreur_860026562 != 0)
	ALORS
		#trace1("erreur i_LireReqConsTabDist VGA1: <%d>", erreur)
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, "erreur i_LireReqConsTabDist VGA1 ", C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	val_860026562 = i_LireInfoECC(instVGAIP_860026562, 0)

	SI (val_860026562 != 0)
	ALORS
		erreur_860026562 = i_LireChaineInfo(val_860026562, 0, 6, pt_OFFRE_860026562)
		i_strcpy(pt_CodOffreVG_860026562,pt_OFFRE_860026562)

		SI (i_strcmp(pt_OFFRE_860026562, g_inull))
		ALORS
			#trace2("pt_OFFRE de VGA1 <%s> pour appel table CodeOffre", pt_OFFRE, "")
			erreur_860026562 = i_format_str2(pt_temp_860026562, "%s%s", "INj", pt_OFFRE_860026562)
			i_strcpy(pt_RES1_860026562, i_get_tab_field("Inter", gmt_date_860026562, pt_temp_860026562))
			#trace2("pt_RES1 table CodeOffre <%s> ", pt_RES1, "")
			SI (i_strcmp(pt_RES1_860026562, "NM3") == 0)
			ALORS
				NM3_860026562 = 1
				i_strcpy(pt_NM3_OF_860026562, pt_OFFRE_860026562)
			SINON
				SI (IDUS_IP_860026562 == 0)
				ALORS
					SI (i_strcmp(pt_RES1_860026562, "VGT+") == 0)
					ALORS
						bVGTplus_860026562 = 1
						i_strcpy(pt_VGTplus_OF_860026562, pt_OFFRE_860026562)
					SINON
						SI (i_strcmp(pt_RES1_860026562, "VGA") == 0)
						ALORS
							VGA_860026562 = 1
							i_strcpy(pt_VGA_OF_860026562, pt_OFFRE_860026562)
						FINSI
					FINSI
				FINSI
			FINSI
		FINSI
	FINSI

	SI (i_EnvoiReqConsTabDist(TD_VGA2_860026562, gmt_date_860026562, i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
	ALORS
		#trace("erreur i_EnvoiReqConsTabDist VGA2")
		SAUT DISTRI_ERR
	FINSI

	erreur_860026562 = i_LireReqConsTabDist()
	#trace1("RETOUR i_LireReqConsTabDist retour requette VGA2, erreur=<%d>",erreur)

	SI (erreur_860026562 != 0)
	ALORS
		#trace1( "erreur i_LireReqConsTabDist VGA2: <%d>", erreur)
		SAUT DISTRI_ERR
	FINSI

	val_860026562 = i_LireInfoECC(instVGAIP_860026562, 0)

	SI (val_860026562 != 0)
	ALORS
		erreur_860026562 = i_LireChaineInfo(val_860026562, 0, 6, pt_OPERA_860026562)
		SI (i_strcmp(pt_OPERA_860026562, g_inull))
		ALORS
			i_strcpy (pt_CodOperVG_860026562,pt_OPERA_860026562)
			b_CodOperVG_860026562 = 1
		FINSI

		SI b_CodOperVG_860026562
		ALORS
			erreur_860026562 = i_format_str2(pt_TEMP1_860026562, "%s%s", "INj", pt_CodOffreVG_860026562)
			SI ( i_strcmp( i_get_tab_field("Inter", gmt_date_860026562, pt_TEMP1_860026562),"FFMV3") == 0 )
			ALORS
				b_FFMV3_860026562 = 1
			FINSI
		FINSI

		SI b_CodOperVG_860026562
		ALORS
			erreur_860026562 = i_format_str2(pt_TEMP1_860026562, "%s%s", "INm", pt_CodOperVG_860026562)
			SI ( i_strcmp( i_get_tab_field("Inter", gmt_date_860026562, pt_TEMP1_860026562),g_inull) != 0 )
			ALORS
				b_OperNBE_860026562 = 1
			FINSI
		FINSI

		#trace2(" Resultat de i_LireChaineInfo pour la table  VGA1 (table 8) <%s>", pt_OFFRE, "")

		SI (VGA_860026562 || bVGTplus_860026562 || NM3_860026562)
		ALORS

			SI (i_strcmp(pt_OPERA_860026562, g_inull))
			ALORS
				SI NM3_860026562 == 1
				ALORS
					i_strcpy(pt_NM3_OP_860026562, pt_OPERA_860026562)
				SINON
					SI (bVGTplus_860026562 == 1)
					ALORS
						i_strcpy(pt_VGTplus_OP_860026562, pt_OPERA_860026562)
					SINON
						i_strcpy(pt_VGA_OP_860026562, pt_OPERA_860026562)
					FINSI
				FINSI
			FINSI
		FINSI
		#trace2(" Resultat de i_LireChaineInfo pour VGA2 (table3): <%s>", pt_OFFRE, "")
	FINSI
	#trace1("     ##### #####     NM3 <%d>",NM3)
	#trace1("VGAIP: bVGTplus <%d>",bVGTplus)
	#trace1("VGAIP: VGA <%d>",VGA)
	#trace2("VGAIP: pt_NM3_OF <%s>",pt_NM3_OF ,"")
	#trace2("VGAIP: pt_NM3_OP <%s>",pt_NM3_OP ,"")
	#trace2("VGAIP: pt_VGTplus_OF <%s>",pt_VGTplus_OF ,"")
	#trace2("VGAIP: pt_VGTplus_OP <%s>",pt_VGTplus_OP ,"")
	#trace2("VGAIP: VGA_OP <%s>",pt_VGA_OP ,"")
	#trace2("VGAIP: VGA_OF <%s>",pt_VGA_OF ,"")
	#**********************fin interrogation table VGA (VGAIP)
FINSI

# Determination si demandeur SIP premiere ligne ( demandeur appartient au LARNPF SIP)
instSIP_860026562 = i_LireInstanceECC(C_InstSIP_860026562)

SI (!instSIP_860026562)
ALORS
	trace("Pas d'instance pour referentiel SIP")
	code_errone_860026562 = 0xA0B1
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartout, "", 3, code_errone_860026562, C_InstSIP_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

instOPT_860026562 = i_LireInstanceECC(C_instOPT_860026562)

SI (!instOPT_860026562)
ALORS
	#trace2( "__FILE__:__LINE__ erreur i_LireInstanceECC: <%s>", C_instOPT,"")
	code_errone_860026562 = 0xA0B1
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartout, "", 3, code_errone_860026562, C_instOPT_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

SI (i_EnvoiReqConsTabDist(TD_Fixe, gmt_date_860026562,i_get_art_fieldptr(g_iartout, $TconvNE::IDUS_NUM) , L_NDR_860026562, 0, 1) != 0)
ALORS
	trace("erreur i_EnvoiReqConsTabDist TD_FIXE SIP E//")
	code_errone_860026562 = 0xA0C1
	erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartout, "", 3, code_errone_860026562, "FIXE", C_Article_860026562)
	SAUT DISTRI_ERR
SINON
#DRE G4R5 Suppression acces TDATODEBI
#	#-----------------------------------------------------------
#	# Determine si la date gmt_date est egale ou posteriereure a celle
#	# retournee par la table TDATODEBI
#	#------------------------------------------------------------
#	trace1 ("<<__LINE__ >> gmt_date = %d ---------",gmt_date)
#	i_strcpy (pt_datODEBI,i_get_tab_field("TDATODEBI", gmt_date, "ODEBI"))
#	erreur = i_set_art_str (g_iartout13,$Conversion::DATE_STR,pt_datODEBI)
#	date_table = i_get_art_field(g_iartout13, $Conversion::DATE_ASC)
#	trace2 ("<< __LINE__>> pt_datODEBI = %s --------",pt_datODEBI,"")
#	trace1 ("<< __LINE__>>  date_table = %d ----------",date_table)
#
#	SI gmt_date >= date_table
#	ALORS
#		b_DATODEBI = 1
#	FINSI
#	#trace1 ("<<__LINE__>>  b_DATODEBI = %d -----------",b_DATODEBI)
#
#\DRE G4R5

	#--------------------------
	# 	FE
	#--------------------------
	instFE_860026562 = i_LireInstanceECC(C_InstFE_860026562)

	SI (!instFE_860026562)
	ALORS
		trace("instFE nul !")
		code_errone_860026562 = 0xA0B1
		erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstFE_860026562, C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	#---------------------
	# 	FERPV
	#----------------------
	instFERPV_860026562 = i_LireInstanceECC(C_InstFERPV_860026562)
	SI (!instFERPV_860026562)
	ALORS
		trace("instFERPV nul !")
		code_errone_860026562 = 0xA0B1
		erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstFERPV_860026562, C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI
	# Fin recherche instances ECC FE/FERPV

	erreur_860026562 = i_LireReqConsTabDist()
	#trace1("RETOUR i_LireReqConsTabDist (TD_Fixe), erreur=<%d>",erreur)
	SI (erreur_860026562 != 0)
	ALORS
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, C_REFMAJ2G_860026562, C_Article_860026562)
		SAUT DISTRI_ERR
	SINON
		val_860026562 = i_LireInfoECC(instFERPV_860026562, 0)
#DRE G4R3C5 QC746 Ajout test retour val
		SI (val_860026562 != 0)
		ALORS
			i_strcpy(pt_TYPOFFRE_860026562, " ")
			i_strcpy(pt_InfoCompl_860026562, " ")
			erreur_860026562 = i_LireChaineInfo(val_860026562, 0, 1, pt_TYPOFFRE_860026562)
			erreur_860026562 = i_LireChaineInfo(val_860026562, 1, 2, pt_InfoCompl_860026562)

			SI (i_strcmp(pt_InfoCompl_860026562,"25") == 0 && i_strcmp(pt_TYPOFFRE_860026562,"6") == 0)
			ALORS
				TYPAR_BIV_SIP_860026562 = 1
			FINSI

			SI (i_strcmp(pt_InfoCompl_860026562, "23") == 0 && !b_FFMV3_860026562)
			ALORS
				TYPAR_SIPFE_860026562 = 1
				trace1("***********dans FERPV TYPAR_SIPFE=%d************",TYPAR_SIPFE_860026562)
			SINON
				val_860026562 = i_LireInfoECC(instFE_860026562,0)
#DRE G4R3C5 QC746 Ajout test retour val
				SI (val_860026562 != 0)
				ALORS
					i_strcpy(pt_InfoCompl_860026562, " ")
					erreur_860026562 = i_LireChaineInfo(val_860026562, 0, 2, pt_InfoCompl_860026562)

					SI (i_strcmp(pt_InfoCompl_860026562, "23" ) == 0 &&  !b_FFMV3_860026562)
					ALORS
						TYPAR_SIPFE_860026562 = 1
						trace1("**********dans FE TYPAR_SIPFE=%d************",TYPAR_SIPFE_860026562)
					FINSI
				FINSI
			FINSI
		FINSI
	FINSI
FINSI

# SI TYPAR_SIPFE == 1 pas besoin d'interroger NPF SIP

SI ( TYPAR_SIPFE_860026562 == 0)
ALORS
	SI (i_EnvoiReqConsTabDist(TD_SIP_860026562, gmt_date_860026562, i_get_art_fieldptr(g_iartout, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
	ALORS
		trace("erreur i_EnvoiReqConsTabDist SIP")
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartout, "", 3, code_errone_860026562, "erreur i_EnvoiReqConsTabDist SIP ", C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	erreur_860026562 = i_LireReqConsTabDist()

	SI (erreur_860026562 != 0)
	ALORS
		trace1("erreur i_LireReqConsTabDist SIP: <%d>", erreur_860026562)
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, "erreur i_LireReqConsTabDist SIP", C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	instECCv_860026562 = i_LireEntierECCv(instSIP_860026562)
	res_860026562 = i_LireInfoECC(instSIP_860026562, instECCv_860026562)

	SI (res_860026562 != 0)
	ALORS
		b_NPF_SIP_860026562 = 1
		erreur_860026562 = i_set_art_field(g_iartout13, $Conversion::BassinFacN, instECCv_860026562)
		erreur_860026562 = i_get_art_str(g_iartout13, $Conversion::BassinFacA, pt_SIP_ECC_860026562)
		erreur_860026562 = i_format_str2(pt_CLE_860026562, "%s%s", C_pref_cle_860026562, pt_SIP_ECC_860026562)
		i_strcpy(pt_basTRAFIC_860026562, i_get_tab_field("Inter", dpivot_860026562, pt_CLE_860026562))
	SINON
		instECCv_860026562 = i_LireEntierECCv(instOPT_860026562)
		res_860026562 = i_LireInfoECC(instOPT_860026562, instECCv_860026562)
		#trace1("__FILE__:__LINE__  Retour de i_LireInfoECC OPT = <%d>",erreur)

		SI (res_860026562 != 0 && !b_FFMV3_860026562)
		ALORS
			b_NPF_OPT_860026562 = 1
			erreur_860026562 = i_set_art_field(g_iartout13, $Conversion::BassinFacN, instECCv_860026562)
			erreur_860026562 = i_get_art_str(g_iartout13, $Conversion::BassinFacA, pt_OPT_ECC_860026562)
			erreur_860026562 = i_format_str2(pt_CLE_860026562, "%s%s", C_pref_cle_860026562, pt_OPT_ECC_860026562)
			i_strcpy(pt_basTRAFIC_860026562, i_get_tab_field("Inter", dpivot_860026562, pt_CLE_860026562))
			erreur_860026562 = i_LireImsiInfo( res_860026562, 0, 5, pt_OPT_RTC_860026562 )
			i_strcpy(pt_IDUS_NDRTC_860026562, pt_OPT_RTC_860026562)
			#trace2("<<__LINE__>> Resultat de i_LireImsiInfo pt_OPT_RTC : <%s>", pt_OPT_RTC, "")
		SINON
			b_NPF_OPT_860026562 = 0
			i_strcpy(pt_OPT_RTC_860026562," ")
		FINSI
	FINSI
FINSI

# idus_inf
########################################
idus_inf_860026562 = i_get_art_field(g_iartout, $TconvNE::IDUS_INF)

# natach
########################################
natach_860026562 = i_get_art_field(g_iartout, $TconvNE::NATACH)

# REROUTAGE_ACCOMPAGNE
########################################

SI ((idus_inf_860026562 & 0x01) == 1)
ALORS
	REROUTAGE_ACCOMPAGNE_860026562 = 1
FINSI

# SCP/SRP ou CPS
########################################
#QC778
idsv_860026562 = i_get_art_field(g_iartout, $TconvNE::IDSV)
#idsv = i_get_art_field(g_iartout, $TconvNE::IDSV)

#SI ((( idsv > 0 ) && ( idsv < 10 )) || idsv == 18 || idsv == 20)
#ALORS
#	SCP = 1
#SINON
#	SRP = 1
#FINSI

# G4R5/
erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDSV, pt_IDSV_860026562)
i_strcpy(pt_temp_860026562, i_get_tab_field("TIDSV", gmt_date_860026562, pt_IDSV_860026562))

SI ( i_strcmp(pt_temp_860026562, g_inull) != 0 )
ALORS
	SI (i_strcmp(pt_temp_860026562,"1") == 0 )
	ALORS
		SRP_860026562 = 1
		i_strcpy(pt_TYPE_SERV_860026562,"SRP")
	SINON
		SI (i_strcmp(pt_temp_860026562,"2") == 0 )
		ALORS
			SCP_860026562 = 1
			i_strcpy(pt_TYPE_SERV_860026562,"SCP")
		SINON
			SI (i_strcmp(pt_temp_860026562,"3") == 0 )
			ALORS
				CPS_860026562 = 1
				i_strcpy(pt_TYPE_SERV_860026562,"CPS")
			FINSI
		FINSI
	FINSI
FINSI

# SRP_Tiers
########################################
# Booleen Si [ SRP et FD/DETR/INF bit E = 1] alors Vraie Sinon Faux
SRP_Tiers_860026562 = 0
bitE_860026562 = 0
res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR_INF)
# Recuperation de l'octet E
bitE_860026562 = i_get_bit_val(res_860026562, 4)

SI (SRP_860026562 == 1) && (bitE_860026562 == 1)
ALORS
	SRP_Tiers_860026562 = 1
FINSI

erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_temp_860026562)
#trace2("IDUS_NUM <%s>",pt_temp,"")
i_get_sub_str(pt_temp_860026562, 0, 1, pt_temp_860026562)
i_get_sub_str(pt_temp_860026562, 0, 0, pt_temp2_860026562)

SI (b_NPF_SIP_860026562 == 1)
ALORS
	IDUS_IP_860026562 = 0
SINON
	#SI ((i_strcmp(pt_temp, C_PREF_MLV87) == 0) || (i_strcmp(pt_temp2, C_PREF_MLV9) == 0)) && ((natach & 0x80) == 0 && (natach & 0x02)== 0)
	#G4R5C8 QC802
	SI ( (i_strcmp(pt_temp_860026562, C_PREF_MLV87_860026562) == 0) || (i_strcmp(pt_temp2_860026562, C_PREF_MLV9_860026562) == 0) ) && ((natach_860026562 & 0x80) == 0) && !( i_valid_field_n(g_iartout, $TconvNE::IPER_NUM))
	ALORS
		IDUS_IP_860026562 = 1
	FINSI
FINSI

# CPS_SPORTABILITE : test sur $TconvNE::DETR1_INT == 0010 ou sinon si $TconvNE::DETR_INT == 0010
########################################
SI (i_valid_field_n(g_iartout, $TconvNE::DETR1_NUM))
ALORS
	detr1_int_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR1_INT)

	SI ( (detr1_int_860026562 & 0x30) == 0x10 )
	ALORS
		CPS_SPORTABILITE_860026562 = 1
	FINSI
SINON
	detr_int_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR_INT)

	SI ( (detr_int_860026562 & 0x30 ) == 0x10 )
	ALORS
		CPS_SPORTABILITE_860026562 = 1
	FINSI
FINSI

# SCP_SPORTABILITE : test sur $TconvNE::DETR1_INT == 0010 ou sinon si $TconvNE::DETR_INT == 0010
########################################
SI SCP_860026562
ALORS
	SI (i_valid_field_n(g_iartout, $TconvNE::DETR1_INT))
	ALORS
		res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR1_INT)
	SINON
		res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR_INT)
	FINSI
	res_860026562 = res_860026562 / 0x1000

	SI (res_860026562==2)
	ALORS
		SCP_SPORTABILITE_860026562 = 1
		#trace("SCP_SPORTABILITE VRAI DETR1_NUM")
	FINSI
FINSI

# EPORTABILITE_SRPLA
########################################
SI (i_valid_field_n(g_iartout, $TconvNE::DEDEINI_NUM))
ALORS
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDEINI_NUM, pt_temp_860026562)
	i_get_sub_str(pt_temp_860026562, 0, 4, pt_temp2_860026562)
	i_get_sub_str(pt_temp_860026562, 3, 4, pt_XY_860026562)

	SI  (i_strcmp(pt_temp2_860026562, C_PREF1_SRPLA_EPORT_860026562) == 0 ) || (i_strcmp(pt_temp2_860026562, C_PREF2_SRPLA_EPORT_860026562) == 0)
	ALORS
		EPORTABILITE_SRPLA_860026562 = 1
		SRP_EPORTABILITE_860026562 = 1
		SAUT FIN_SRP_EPORTABILITE
	FINSI
FINSI

erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE_NUM, pt_temp_860026562)
i_get_sub_str(pt_temp_860026562, 0, 4, pt_temp2_860026562)
i_get_sub_str(pt_temp_860026562, 3, 4, pt_XY_860026562)

SI  (i_strcmp(pt_temp2_860026562, C_PREF1_SRPLA_EPORT_860026562) == 0) || (i_strcmp(pt_temp2_860026562, C_PREF2_SRPLA_EPORT_860026562) == 0)
ALORS
	EPORTABILITE_SRPLA_860026562 = 1
	SRP_EPORTABILITE_860026562 = 1
	SAUT FIN_SRP_EPORTABILITE
FINSI

# SRP_EPORTABILITE /SRP_SPORTABILITE
########################################
SI SRP_860026562
ALORS
	SI (i_valid_field_n(g_iartout, $TconvNE::DEDEINI_NUM))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDEINI_NUM, pt_temp_860026562)
		i_get_sub_str(pt_temp_860026562, 0, 2, pt_temp2_860026562)

		SI  (i_strcmp(pt_temp2_860026562, C_PREF1_SRP_SPORT_860026562) == 0)
		ALORS
			#On verifie que NUM, qui commence par 842, a un code FT, soit 08
			i_get_sub_str(pt_temp_860026562, 3, 4, pt_XY_860026562)

			SI (i_strcmp(pt_XY_860026562, C_PREF2_SPORT_860026562) == 0)
			ALORS
				SRP_EPORTABILITE_860026562 = 1
			FINSI
		FINSI
	FINSI

	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE_NUM, pt_temp_860026562)
	# On verifie que NUM commence par 842
	#trace2("SRP_EPORTABILITE DEDE_NUM = <%s> ", pt_temp,"")
	i_get_sub_str(pt_temp_860026562, 0, 2, pt_temp2_860026562)

	SI  (i_strcmp(pt_temp2_860026562, C_PREF1_SRP_SPORT_860026562) == 0)
	ALORS
		# On verifie que NUM, qui commence par 842, a un code FT, soit 08
		i_get_sub_str(pt_temp_860026562, 3, 4, pt_XY_860026562)

		SI (i_strcmp(pt_XY_860026562, C_PREF2_SPORT_860026562) == 0)
		ALORS
			SRP_EPORTABILITE_860026562 = 1
			#trace("SRP_EPORTABILITE VRAI")
		FINSI
	FINSI

	POINT FIN_SRP_EPORTABILITE

	# le test sur la portabilite sortante SRP se fait
	# sur le champ DETR1_INT si present sinon sur le champ DETR_INT

	SI (i_valid_field_n(g_iartout, $TconvNE::DETR1_INT))
	ALORS
		res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR1_INT)
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR1_NUM, pt_temp_860026562)
		trace2("SRP_SPORTABILITE DETR1_NUM = <%s> ", pt_temp_860026562, "")
	SINON
		res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR_INT)
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR_NUM, pt_temp_860026562)
		trace2("SRP_SPORTABILITE DETR_NUM = <%s> ", pt_temp_860026562, "")
	FINSI
	res_860026562 = res_860026562 / 0x1000

	SI (res_860026562==2)
	ALORS
		SRP_SPORTABILITE_860026562 = 1
	FINSI

	i_get_sub_str(pt_temp_860026562, 0, 2, pt_temp2_860026562)

	SI (i_strcmp(pt_temp2_860026562, C_PREF1_SRP_SPORT_860026562) == 0)
	ALORS
		i_get_sub_str(pt_temp_860026562, 3, 4, pt_XY_860026562)
	FINSI
FINSI

#PREFIXE_CENTAURE
SI SRP_SPORTABILITE_860026562
ALORS
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR_NUM, pt_temp_860026562)
	#trace2("DETR_NUM = <%s> ", pt_temp,"")

	SI  (i_strplcmp(pt_temp_860026562, C_PREF1_SRP_SPORT_860026562,0,3) == 0)
	ALORS
		# On verifie que DETR_NUM commence par 842
		i_get_sub_str(pt_temp_860026562, 0, 4, pt_PREFIXE_CENTAURE_860026562)
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR_NUM,pt_NIDAV_CENTAURE_860026562)
	SINON
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR1_NUM, pt_temp_860026562)

		SI  (i_strplcmp(pt_temp_860026562, C_PREF1_SRP_SPORT_860026562,0,3) == 0)
		ALORS
			# On verifie que DETR1_NUM commence par 842
			i_get_sub_str(pt_temp_860026562, 0, 4, pt_PREFIXE_CENTAURE_860026562)
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR1_NUM,pt_NIDAV_CENTAURE_860026562)
		FINSI
	FINSI
FINSI

# REROUT_TYPE
########################################
REROUT_TYPE_860026562 = i_get_art_field(g_iartout, $TconvNE::REROUT_TYPE)

# cptx
########################################
SI i_valid_field_n(g_iartin, $TconvNE::T3cptx)
ALORS
	cptx_860026562 = i_get_art_field(g_iartout, $TconvNE::CPTX)
FINSI

# EFFICACE calcul des variables
########################################
duree_860026562 =  i_get_art_field(g_iartout, $TconvNE::DUREE)
DURCONV_860026562 = (duree_860026562 + 9) / 10
#trace1("DURCONV duree <%d> en s pour SRP",DURCONV)

SI i_valid_field_n(g_iartin, $TconvNE::DURACC)
ALORS
	duracc_860026562 = i_get_art_field(g_iartout, $TconvNE::DURACC)
FINSI

SI i_valid_field_n(g_iartin, $TconvNE::DURAUT)
ALORS
	duraut_860026562 = i_get_art_field(g_iartout, $TconvNE::DURAUT)
FINSI

# SRP_FACTURABLE/SCP_FACTURABLE
########################################
itx_860026562 = i_get_art_field(g_iartout, $TconvNE::ITX)

# Pour natach, on masque avec 86 car on doit tester les bits A, F et G (valeur attendue 010)
# Pour natach, on masque avec 86 car on doit tester les bits A, F et G (valeur attendue 010)
# G3R22 QC501 QC552
SI ((natach_860026562 & 0x86) == 0x04)
ALORS
	SI SCP_860026562
	ALORS
		SCP_FACTURABLE_860026562 = 1
	SINON
		# G4R6C4 QC820 #
		#SI !REROUTAGE_ACCOMPAGNE
		SI SRP_860026562 && !REROUTAGE_ACCOMPAGNE_860026562
		ALORS
			SI i_valid_field_n(g_iartout, $TconvNE::SVTR)
			ALORS
				SI ((g_iartout.SVTR[0] == 0x15) || (g_iartout.SVTR[0] == 0x09))
				ALORS
					SI !i_valid_field_n(g_iartout, $TconvNE::T3enap)
					ALORS
						res_860026562 = i_get_art_field(g_iartout, $TconvNE::INEP)
						res1_860026562 = i_get_art_field(g_iartout, $TconvNE::INEC)
						erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::HDCONVN, pt_BUF_860026562)
						SI ( ( res_860026562 == 0 && res1_860026562 == 0 ) || i_strcmp (pt_BUF_860026562, "FFFFFF") != 0 )
						ALORS
							SRP_FACTURABLE_860026562 = 1
						FINSI
					SINON
						SRP_FACTURABLE_860026562 = 1
					FINSI
				FINSI
			SINON
				SI !i_valid_field_n(g_iartout, $TconvNE::T3enap)
				ALORS
					res_860026562 = i_get_art_field(g_iartout, $TconvNE::INEP)
					res1_860026562 = i_get_art_field(g_iartout, $TconvNE::INEC)
					erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::HDCONVN, pt_BUF_860026562)
					SI ( ( res_860026562 == 0 && res1_860026562 == 0 ) || i_strcmp (pt_BUF_860026562, "FFFFFF") != 0 )
					ALORS
						SRP_FACTURABLE_860026562 = 1
					FINSI
				SINON
					SRP_FACTURABLE_860026562 = 1
				FINSI
			FINSI
		FINSI
	FINSI
FINSI
#trace1("__FILE__:__LINE__ ## TEST ## ======> Valeur de SRP_FACTURABLE : <%d> #### ", SRP_FACTURABLE)
#trace1("__FILE__:__LINE__ ## TEST ## ======> Valeur de SCP_FACTURABLE : <%d> #### ", SCP_FACTURABLE)
# \G3R22 QC501 QC552

# CCD calcule en traitement, dans ajout CE
########################################
CCD_860026562 = i_get_art_field(g_iartout, $TconvNE::CCD)

SI (i_valid_field_n(g_iartout, $TconvNE::ACE_N1))
ALORS
	CODCIR_860026562 = i_get_art_field(g_iartout, $TconvNE::ACE_N1)
	erreur_860026562 = i_supprChamp(g_iartout, "T4ACE_N1")
SINON
	CODCIR_860026562 = -1
FINSI

SI (CCD_860026562 == 27)
ALORS
	b118PTD_860026562 = 1
FINSI

SI CCD_860026562 == 28
ALORS
	b_FRT_Kiosque_860026562 = 1
FINSI

#=============================
########################################
# 		MER_Kiosque_DC1
########################################
MER_Kiosque_DC1_860026562 = 0

SI b_FRT_Kiosque_860026562 == 1
ALORS
	SI i_valid_field_n(g_iartout, $TconvNE::SEQ)
	ALORS
		seq_860026562 = i_get_art_field(g_iartout, $TconvNE::SEQ)
		SI (seq_860026562 == 2)
		ALORS
			SI (i_valid_field_n(g_iartout, $TconvNE::FINSER_CAUSE))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::FINSER_CAUSE)
				SI res_860026562 == 0
				ALORS
					MER_Kiosque_DC1_860026562 = 1
				FINSI
			FINSI
		FINSI
	FINSI
FINSI

########################################
# 		MER_Kiosque_DC2
########################################
MER_Kiosque_DC2_860026562 = 0

SI b_FRT_Kiosque_860026562 == 1
ALORS
	SI i_valid_field_n(g_iartout, $TconvNE::OADC_CAU)
	ALORS
		cause_860026562 = i_get_art_field(g_iartout, $TconvNE::OADC_CAU)
		SI (cause_860026562 == 2) || (cause_860026562 == 7) || (cause_860026562 == 9) || (cause_860026562 == 10)
		ALORS
			SI (i_valid_field_n(g_iartout, $TconvNE::INEP))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::INEP)
				SI res_860026562 == 0
				ALORS
					SI (i_valid_field_n(g_iartout, $TconvNE::INEC))
					ALORS
						res_860026562 = i_get_art_field(g_iartout, $TconvNE::INEC)
						SI res_860026562 == 0
						ALORS
							MER_Kiosque_DC2_860026562 = 1
						FINSI
					FINSI
				FINSI
			FINSI
		FINSI
	FINSI
FINSI

# NB_UT
########################################
# Item 118tiers
# On ne se preoccupe pas de savoir si on revient de correlation (ce qui pourrait provoquer une 2eme fois le sommage de NUAA/NUTC) car une fois
# qu on a pris en compte NUAA/NUTC, NBUT n est plus nul
NB_UTini_860026562 = i_get_art_field(g_iartout, $TconvNE::NBUT)

NB_UT_860026562 = i_get_art_field(g_iartout, $TconvNE::NBUT)
# NB_UT a ete calcule et l article mis a jour (champ NBUT) avant envoi a correl
# Il est donc inutile de rederouler l'algo ci_dessous au retour de correlation

SI (RETOUR_CORR_860026562 == 0)
ALORS
	SI b_FRT_Kiosque_860026562 == 1
	ALORS
		SI MER_Kiosque_DC2_860026562 == 1
		ALORS
			SI (i_valid_field_n(g_iartout, $TconvNE::T3cptx))
			ALORS
				NB_UT_860026562 = NB_UT_860026562 + i_get_art_field(g_iartout, $TconvNE::CPTX)
			FINSI

			SI (i_valid_field_n(g_iartout, $TconvNE::T3trabo))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::NUTC)
				res1_860026562 = i_get_art_field(g_iartout, $TconvNE::NUAA)
				NB_UT_860026562 = NB_UT_860026562 + res_860026562 + res1_860026562
			FINSI
		FINSI
	SINON
		SI (i_valid_field_n(g_iartout, $TconvNE::T3cptx))
		ALORS
			NB_UT_860026562 = i_get_art_field(g_iartout, $TconvNE::CPTX)
		SINON
			SI (NB_UT_860026562 == 0)
			ALORS
				SI ((i_valid_field_n(g_iartout, $TconvNE::NUTC)) && (i_valid_field_n(g_iartout, $TconvNE::NUAA)))
				ALORS
					res_860026562 = i_get_art_field(g_iartout, $TconvNE::NUTC)
					res1_860026562 = i_get_art_field(g_iartout, $TconvNE::NUAA)
					NB_UT_860026562 = res_860026562 + res1_860026562
				SINON
					NB_UT_860026562 = 0
				FINSI
			FINSI
		FINSI
	FINSI
FINSI

# DEDE_NUM_FACT
########################################
Long_Dede_Num_Fact_860026562 = 0
erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE_NUM_N, pt_DEDE_NUM_FACT_860026562)

SI b_FRT_Kiosque_860026562 == 1
ALORS
	SI (MER_Kiosque_DC2_860026562 == 1)
	ALORS
		SI (cause_860026562 == 2) || (cause_860026562 == 7)
		ALORS
			SI i_valid_field_n(g_iartout, $TconvNE::DEDE1_NUM) == 1
			ALORS
				erreur_860026562 = i_get_art_str(g_iartout,$TconvNE::DEDE1_NUM, pt_DEDE_NUM_FACT_860026562)
			FINSI
		SINON
			SI (cause_860026562 == 9) || (cause_860026562 == 10)
			ALORS
				SI i_valid_field_n(g_iartout, $TconvNE::DETR1_NUM_N) == 1
				ALORS
					erreur_860026562 = i_get_art_str(g_iartout,$TconvNE::DETR1_NUM_N, pt_DEDE_NUM_FACT_860026562)
				FINSI
			FINSI
		FINSI
	FINSI
FINSI

Long_Dede_Num_Fact_860026562 = i_strlen(pt_DEDE_NUM_FACT_860026562)

#CCD
########################################

SI SRP_860026562 == 1
ALORS
	SI b_FRT_Kiosque_860026562 == 1
	ALORS
		cause_860026562 = i_get_art_field(g_iartout, $TconvNE::OADC_CAU)
		SI (cause_860026562 == 2) || (cause_860026562 == 7) || (cause_860026562 == 9) || (cause_860026562 == 10)
		ALORS
			SI (i_valid_field_n(g_iartout, $TconvNE::INEP))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::INEP)
				SI res_860026562 == 0
				ALORS
					i_strcpy(pt_IDUS_NORM_860026562, "**00")
					lg_860026562 = i_strlen(pt_DEDE_NUM_FACT_860026562)

					erreur_860026562 = i_memcpy_art_field_n(g_icopo, $Tcopo::NDR, pt_IDUS_NORM_860026562, 5)
					erreur_860026562 = i_memcpy_art_field_n(g_icopo, $Tcopo::NDE, pt_DEDE_NUM_FACT_860026562, lg_860026562+1)

					# Recuperation de la date de debut de conversation
					# Il faut trouver la date de debut de conversation en AAMMJJhhmmss
					# avec HDCONV (hhmmss) et ICAR (AAMMJJhhmmss) ??????

					sdate_conv_860026562 = i_concat_date(g_iartout, $TconvNE::DATE, $TconvNE::HDCONV, 0)

					# Initialisation de l'interface "proc_copo" et calcul taxation
					# Initialisation de l'interface "proc_copo" et calcul taxation
					g_icopo.TAXE   = 0
					g_icopo.CREDIT = 0
					erreur_860026562 = i_set_art_date(g_icopo, sdate_conv_860026562)
					g_icopo.DUREE  = 0
					g_icopo.CODE   = CODE_AUDIO_860026562
					g_icopo.CATEG  = CATEG_AUDIO_860026562
					g_icopo.SUP[0] = 0
					g_icopo.SUP[1] = 0
					g_icopo.SUP[2] = 0
					g_icopo.SUP[3] = 0
					g_icopo.SUP[4] = 0
					g_icopo.SUP[RES_CLDEST_860026562] = 0xff

					erreur_860026562 = i_comptage( g_icopo, BASE_AUDIO_860026562, sdate_conv_860026562 )

					SI (   erreur_860026562 == 0 )
					ALORS
						CCD_860026562 = g_icopo.SUP[RES_CLDEST_860026562]
						typeCTR_860026562 = g_icopo.SUP[RES_TYPCTR_860026562]
						i_strcpy(pt_NORM_860026562,pt_DEDE_NUM_FACT_860026562)
					FINSI
				FINSI
			FINSI
		FINSI
	FINSI
FINSI

#####################################################################
# 	              Traitement C+S appelant
#G4R6 lot3
#G4R6 QC824 #
#i_strcpy(pt_TYPE_EDIT, " ")
SI SRP_860026562 == 1
ALORS
	SI (typeCTR_860026562==TYPCTR_Fact_RI_860026562)
	ALORS
		b_Fact_CPS_RI_860026562 = 1
		i_strcpy(pt_TEMP1_860026562, i_get_tab_field( "TDATCPS", gmt_date_860026562, C_DATCPS_860026562 ))

		erreur_860026562 = i_set_art_str (g_iartout13,$Conversion::DATE_STR,pt_TEMP1_860026562)
		Date_CPS_860026562 = i_get_art_field(g_iartout13, $Conversion::DATE_ASC)
		i_strcpy(pt_NDE_860026562,pt_NORM_860026562)

		SI ddebut_860026562 < Date_CPS_860026562
		ALORS
			erreur_860026562 = i_format_str2(pt_MESSAGE_860026562," AR <%s> avec date DC inferieure a la date d'activation <%s> de la facturation CPS",pt_NDE_860026562,pt_TEMP1_860026562)
			code_errone_860026562 = 0xA080
			code_errone_860026562 = code_errone_860026562 + EFFICACE_860026562
			erreur_860026562 = i_PlvMessEmettre( 8599, 1, g_iartin,"", 3,code_errone_860026562, C_Article_860026562, pt_MESSAGE_860026562 )
			SAUT DISTRI_ELM
		SINON
			#######################################
			#  Soumission de la requete de consultation d'une table de distribution ALICE
			#######################################

			SI i_strplcmp (pt_NDE_860026562,"0",0,1) == 0
			ALORS
				i_get_sub_str(pt_NDE_860026562,1,-1,pt_NDE_860026562)
			FINSI
			longueur_860026562 = i_conv_ascii_dcb (pt_NDE_860026562, pt_TEMP1_860026562)
			SI (i_EnvoiReqConsTabDist( TD_SVA_860026562,gmt_date_860026562,pt_TEMP1_860026562,longueur_860026562,0,1) != 0)
			ALORS
				#trace("Erreur i_EnvoiReqConsTabDist ALICE")
				bREDISTMAJ2G_860026562 = 1
				i_strcpy(pt_LIBELREDIST_860026562,"Echec sur i_EnvoiReqConsTabDistDouble ALICE ")
			FINSI

			#######################################
			# Recherche de l'instance ECC ALICE
			#######################################
			instALICE_860026562 = i_LireInstanceECC(C_INST_ALICE_860026562)
			SI (!instALICE_860026562)
			ALORS
				#trace("Pas d'instance pour ALICE !")
				erreur_860026562 = i_PlvMessEmettre(8501,1,g_iartin,"",3,C_INST_ALICE_860026562,C_Article_860026562,g_ieec)
				SAUT DISTRI_ERR
			FINSI
			#trace1("instALICE  =<%d>",instALICE)

			#######################################
			# Lecture Resultat requete ALICE
			#######################################
			erreur_860026562 = i_LireReqConsTabDist()
			#trace1("RETOUR i_LireReqConsTabDist retour requette ALICE, erreur=<%d>",erreur)
			SI ( erreur_860026562 != 0 )
			ALORS
				#trace1( "Erreur i_LireReqConsTabDist ALICE: <%d>", erreur)
				bREDISTMAJ2G_860026562 = 1
				i_strcpy(pt_LIBELREDIST_860026562,"Echec sur i_LireReqConsTabDistDouble ALICE ")
			FINSI
			val_860026562 = i_LireInfoECC( instALICE_860026562, 0 )

			SI (val_860026562 != 0)
			ALORS
				# AR present dans ALICE
				erreur_860026562 = i_LireChaineInfo( val_860026562, 0, 4, pt_BUF_860026562 )
				SI i_strcmp(pt_BUF_860026562,"") != 0
				ALORS
					i_strcpy(pt_CODE_TARIF_860026562,pt_BUF_860026562)
					b_ALICE_860026562 = 1
				SINON
					# info complementaire CODE_TARIF vide
					bREDISTMAJ2G_860026562 = 1
					erreur_860026562 = i_format_str2(pt_LIBELREDIST_860026562," AR <%s> trouve dans LAR ALICE mais aucune info complementaire valorisee",pt_NDE_860026562,0)
				FINSI

				erreur_860026562 = i_LireChaineInfo( val_860026562, 4, 1, pt_BUF_860026562 )
				SI i_strcmp(pt_BUF_860026562,"") != 0
				ALORS
					i_strcpy(pt_TYPE_EDIT_860026562,pt_BUF_860026562)
					b_ALICE_860026562 = 1
				SINON
					# info complementaire TYPE_EDIT vide
					bREDISTMAJ2G_860026562 = 1
					erreur_860026562 = i_format_str2(pt_LIBELREDIST_860026562," AR <%s> trouve dans LAR ALICE mais aucune info complementaire valorisee",pt_NDE_860026562,0)
				FINSI
			SINON
				bREDISTMAJ2G_860026562 = 1
				erreur_860026562 = i_format_str2(pt_LIBELREDIST_860026562," AR <%s> non trouve dans ALICE",pt_NDE_860026562,0)
			FINSI
		FINSI
	FINSI
FINSI
#/G4R6 lot3

# DEDE_INF
########################################
SI Long_Dede_Num_Fact_860026562 > 0
ALORS
	SI Long_Dede_Num_Fact_860026562 < 7
	ALORS
		DEDE_INF_860026562 = 0
	SINON
		SI b_FRT_Kiosque_860026562 == 1 && ((i_get_art_field(g_iartout, $TconvNE::DETR1_INF) & 0xC0) == 0xC0)
		ALORS
			DEDE_INF_860026562 = 192
		SINON
			DEDE_INF_860026562 = 130
		FINSI
	FINSI
FINSI

SI SRP_EPORTABILITE_860026562 && !EPORTABILITE_SRPLA_860026562
ALORS
	CCD_REEL_860026562 = 212
SINON
	SI SRP_SPORTABILITE_860026562
	ALORS
		CCD_REEL_860026562 = 213
	SINON
		CCD_REEL_860026562 = CCD_860026562
	FINSI
FINSI
erreur_860026562 = i_set_art_field(g_iartout, $TconvNE::CCD, CCD_REEL_860026562)
erreur_860026562 = i_set_art_field(g_iartout13, $Conversion::CODCIRDR, CODCIR_860026562)

# DEDE_NUM
########################################
erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE_NUM_N, pt_DEDE_NUM_860026562)
lg_860026562 = i_strlen(pt_DEDE_NUM_860026562)
erreur_860026562 = i_resize_tlv(g_iartout, "T4dede_n", "DEDE_NUM_N", lg_860026562*4)
#trace2("****** DEDE_NUM_N = %s *********",pt_DEDE_NUM,"")
#trace1("****** lg = %d **************",lg)

# DEDE_NUM
# DEDEini_NUM
# DEDEini2_NUM
########################################

SI i_valid_field_n(g_iartin, $TconvNE::T3dedeini)
ALORS
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDEINI_NUM_N, pt_DEDEini_NUM_860026562)
SINON
	i_strcpy(pt_DEDEini_NUM_860026562, "")
FINSI

# G4R5 QC785
SI i_valid_field_n(g_iartin, $TconvNE::T3dedeini2)
ALORS
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDEINI2_NUM_N, pt_DEDEini2_NUM_860026562)
SINON
	i_strcpy(pt_DEDEini2_NUM_860026562, "")
FINSI

# ICAR
########################################
ICAR_ORIG_860026562 = i_get_art_field(g_iartout, $TconvNE::DATE)
erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::HDCONVN, pt_BUF_860026562)

SI duree_860026562 > 0 && i_strcmp(pt_BUF_860026562, "FFFFFF") != 0
ALORS
	ICAR_C_860026562 = i_concat_date(g_iartout, $TconvNE::DATE, $TconvNE::HDCONV, 0)
SINON
	ICAR_C_860026562 = ddebut_860026562
FINSI
zone_860026562 = i_DHgetZoneID(NUMTABSEL_860026562, g_iartout)

SI (zone_860026562 >= 0)
ALORS
	ICAR_860026562 = i_DHgetLocalTime(NUMTAB_METRO_860026562, zone_860026562, ICAR_C_860026562)
SINON
	ICAR_860026562 = ICAR_C_860026562
FINSI

# CAX
########################################
CAX_860026562 = 1

# dede_reroute
########################################
dede_reroute_860026562 = i_get_art_field(g_iartout, $TconvNE::DEDE_REROUTE)

# ref
########################################
SI i_valid_field_n(g_iartin, $TconvNE::T3enap)
ALORS
	ref_860026562 = (i_get_art_field(g_iartout, $TconvNE::REF)) & 0xFF
SINON
	ref_860026562 = 255
FINSI

# pt_SGTQS
i_strcpy(pt_SGTQS_860026562,i_LireEECSGTQS(g_ieec))

# Recalcul de DEDE_NUM et par consequent de DEDE_INF
SI (TAG_Accueil_860026562 == 1)
ALORS
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDEINI_NUM_N, pt_DEDE_NUM_FACT_860026562)
	DEDE_INF_860026562 = 0
FINSI

#CORR_TAG
########################################
SI  SRP_FACTURABLE_860026562 && i_valid_field_n(g_iartin, $TconvNE::T3enap) && TAG_Accueil_860026562
ALORS
	SI i_valid_field_n(g_iartout, $TconvNE::SEQ)
	ALORS
		seq_860026562 = i_get_art_field(g_iartout, $TconvNE::SEQ)
		SI (seq_860026562 != 3)
		ALORS
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::HDCONVN, pt_BUF_860026562)
			SI !( (seq_860026562 & 1) != 1 && i_strcmp(pt_BUF_860026562, "FFFFFF") == 0 )
			ALORS
				CORR_TAG_860026562 = 1
			FINSI
		FINSI
	FINSI
FINSI

# SRP_CORR
########################################
SI ( RETOUR_CORR_860026562 == 1 )
ALORS
	SRP_CORR_860026562 = 0
SINON
	SI  SRP_FACTURABLE_860026562 && i_valid_field_n(g_iartin, $TconvNE::T3enap) && !SRP_EPORTABILITE_860026562 && !CORR_TAG_860026562
	ALORS
		SRP_CORR_860026562 = 1
	SINON
		SRP_CORR_860026562 = 0
	FINSI
FINSI

# CALCUL DE L'EFFICACITE
SI (duree_860026562 != 0 || duracc_860026562 != 0 || duraut_860026562 != 0 || cptx_860026562 != 0)
ALORS
	EFFICACE_860026562 = 1
FINSI

SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
ALORS
	VARDATE_860026562 = i_get_art_field(g_iartout,$TconvNE::VARDATE)
	VARDATEFIN_860026562 = i_get_art_field(g_iartout,$TconvNE::VARDATEFIN)
	DateLocaleRetourCorr_860026562 = i_DHgetLocalTime(NUMTAB_METRO_860026562, zone_860026562, VARDATE_860026562)
	# Recalcul de l'efficacite en retour de correlation des TAG
	CUMUL_DUREE_860026562 = VARDATEFIN_860026562 - VARDATE_860026562
	SI CUMUL_DUREE_860026562 > 0
	ALORS
		EFFICACE_860026562 = 1
	FINSI
FINSI

########################################
# 	CREATION DE L'ENVELOPPE
########################################
erreur_860026562 = i_add_opt ("Elibap")

erreur_860026562 = i_set_attr_val_n($Elibap::numzone, zone_860026562)

hdfin_860026562 = i_get_art_field(g_iartin, $TconvNE::dfin)
erreur_860026562 = i_set_attr_val_n($Elibap::Hdfin, hdfin_860026562)

hduree_860026562 = i_get_art_field(g_iartin, $TconvNE::dduree)
erreur_860026562 = i_set_attr_val_n($Elibap::Hduree, hduree_860026562)

# On ajoute le champ OPT_DURCOM uniquement pour garantir la compatibilite avec l'ancienne chaine AUDIOTEL,
# a savoir que les cas d'articles de sortie pour FE et TRAFIC sont specifiques (suffixes par _durcom)
# et que les meta-champs associes a ces articles font appel a ce champ de l'enveloppe
erreur_860026562 = i_set_attr_val_n($Elibap::OPT_DURCOM, hduree_860026562)

erreur_860026562 = i_set_attr_val_n($Elibap::CT2, 0x01)
res_860026562 = g_iartin.IDUS_NUM[0]
erreur_860026562 = i_set_attr_val_n($Elibap::IDUS1, res_860026562)

SI (idsv_860026562 == UIFS_860026562)
ALORS
	# cas NUM-DEDE > 9 digits (800xxxxxxxx)
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE_NUM, pt_BUF_860026562)
	lg_860026562 = i_strlen(pt_BUF_860026562)

	SI (lg_860026562 > 9)
	ALORS
		article_uifs_860026562 = 1
	SINON
		article_uifs_860026562 = 0
	FINSI
FINSI
erreur_860026562 = i_set_attr_val_n($Elibap::UIFS, article_uifs_860026562)

detr_int_860026562 = i_get_art_field(g_iartin, $TconvNE::DETR_INT)
erreur_860026562 = i_set_attr_val_n($Elibap::INT_DETR, detr_int_860026562)
erreur_860026562 = i_set_attr_val_n($Elibap::DATE_M, ICAR_860026562)
erreur_860026562 = i_set_attr_str_n($Elibap::Nom_EEC, pt_SGTQS_860026562)

#DRE G4R5
# Ajout du type de service SRP SCP, CPS
erreur_860026562 = i_set_attr_str_n( $Elibap::TYPE, pt_TYPE_SERV_860026562)

# Ajout de l'efficacite
# Recuperation de l'efficacite dans l'enveloppe Elibap pour metachamp c_eff
# G4R5 QC778 inversion de la valeur efficace

# DC Efficace => valeur = 0 (voir cfg_eff.dat)
valeur_860026562 = 1
SI SCP_860026562
ALORS
	SI (duree_860026562 != 0 || duraut_860026562 != 0 || cptx_860026562 != 0)
	ALORS
		#Efficace
		valeur_860026562 = 0
	FINSI
FINSI

SI SRP_860026562
ALORS
	SI (duree_860026562 != 0)
	ALORS
		#Efficace
		valeur_860026562 = 0
	FINSI
FINSI

SI CPS_860026562
ALORS
	SI (duree_860026562 != 0 || duraut_860026562 != 0)
	ALORS
		#Efficace
		valeur_860026562 = 0
	FINSI
FINSI
erreur_860026562 = i_set_attr_val_n($Elibap::C_EFF, valeur_860026562)

valeur_860026562 = 0
#\DRE G4R5

SI (b_NPF_SIP_860026562 == 1)
ALORS
	i_strcpy(pt_TETRIS_compte_860026562, "")
	b_TETRIS_TRAFBSS_860026562 = 0
	b_TETRIS_FU_860026562  = 0
	i_strcpy(pt_TETRIS_RTC_860026562, "")
	i_strcpy(pt_NDRTC_860026562, "")
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_IDUS_NDRTC_860026562)
	bREDISTIP_860026562 = 0
	V1S_860026562 = 0
	MLV_860026562 = 0
SINON
	SI (TYPAR_SIPFE_860026562 == 0)
	ALORS
		SI (b_NPF_OPT_860026562 == 1)
		ALORS
			i_strcpy(pt_TETRIS_compte_860026562,"" )
			b_TETRIS_TRAFBSS_860026562 = 0
			b_TETRIS_FU_860026562  = 0
			i_strcpy(pt_TETRIS_RTC_860026562, "")
			i_strcpy(pt_NDRTC_860026562, "")
			i_strcpy(pt_IDUS_NDRTC_860026562, pt_OPT_RTC_860026562)
			bREDISTIP_860026562 = 0
			V1S_860026562 = 0
			MLV_860026562 = 0
		SINON
			b_TETRIS_TRAFBSS_860026562 = 0
			i_strcpy(pt_TETRIS_compte_860026562, " ")
			# ajout du critere !b_FFMV3 pour interro le ref BSS
			SI (NM3_860026562 == 0 && b_FFMV3_860026562 == 0)
			ALORS
				instBSS_860026562 = i_LireInstanceECC(C_InstBSS_860026562)
				#trace1("instBSS=<%d>",instBSS)
				SI (!instBSS_860026562)
				ALORS
					trace("Pas d'instance pour referentiel BSS ")
					code_errone_860026562 = 0xA0B1
					erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3,code_errone_860026562, C_InstBSS_860026562, C_Article_860026562)
					SAUT DISTRI_ERR
				FINSI

				# pt_TETRIS_compte
				#trace1(" i_EnvoiReqConsTabDist table BSS =<%d>",TD_BSS)
				#trace1("    date  =<%d>",gmt_date)
				#trace2(" IDUS_NUM <%s>",pt_temp,"")
				#trace1("    L_NDR =<%d>",L_NDR)
				SI (i_EnvoiReqConsTabDist(TD_BSS_860026562, gmt_date_860026562,i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
				ALORS
					trace("erreur i_EnvoiReqConsTabDist BSS")
					SAUT DISTRI_ERR
				FINSI

				# Recherche instance NPF durant lecture referentiel...
				instNPF_860026562 = i_LireInstanceECC(C_InstNPF_860026562)
				#trace1("    instNPF=<%d>",instNPF)
				SI (!instNPF_860026562)
				ALORS
					trace("Pas d'instance pour referentiel NPF ")
					code_errone_860026562 = 0xA0B1
					erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstNPF_860026562, C_Article_860026562)
					SAUT DISTRI_ERR
				FINSI

				erreur_860026562 = i_LireReqConsTabDist()
				#trace1("RETOUR i_LireReqConsTabDist BSS, erreur=<%d>",erreur)
				SI ( erreur_860026562 != 0 )
				ALORS
					trace1( "erreur i_LireReqConsTabDist BSS: <%d>", erreur_860026562)
					SAUT DISTRI_ERR
				FINSI

				res_860026562 = i_LireInfoECC(instBSS_860026562, 0)
				#trace1(" res de i_LireInfoECC BSS =0x<%x>",res)
				SI ( res_860026562 != 0)
				ALORS
					b_TETRIS_TRAFBSS_860026562 = 1
					erreur_860026562 = i_LireImsiInfo(res_860026562, 0, 8, pt_TETRIS_compte_860026562)

					L_COMPTE_NPF_860026562 = i_conv_ascii_dcb(pt_TETRIS_compte_860026562, pt_COMPTE_NPF_860026562)
					#trace1(" i_EnvoiReqConsTabDist table NPF =<%d>",TD_NPF)
					#trace1("    date  =<%d>",gmt_date)
					#trace2("    pt_TETRIS_compte <%s>",pt_TETRIS_compte, "")
					#trace1("    L_COMPTE_NPF =<%d>",L_COMPTE_NPF)
					#trace2("    verif pt_TETRIS_RTC  <%s>",pt_TETRIS_RTC, "")
					SI (L_COMPTE_NPF_860026562 > 0)
					ALORS
						res_860026562 = i_EnvoiReqConsTabDist(TD_NPF_860026562, gmt_date_860026562, pt_COMPTE_NPF_860026562, L_COMPTE_NPF_860026562, 0, 1)
						SI (res_860026562 != 0)
						ALORS
							trace1("erreur i_EnvoiReqConsTabDist NPF %d - alarme a emettre", res_860026562)
							SAUT DISTRI_ERR
						SINON
							res_860026562 = i_LireReqConsTabDist()
							#trace1("RETOUR i_LireReqConsTabDist NPF, erreur=<%d>",erreur)
							instECCv_860026562 = i_LireEntierECCv( instNPF_860026562 )
							res_860026562 = i_LireInfoECC(instNPF_860026562, instECCv_860026562)
							#trace1("RETOUR i_LireInfoECC instNPF, erreur=<%d>",res)
							SI (res_860026562 != 0)
							ALORS
								#FU et TETRIS_RTC
								erreur_860026562=i_LireChaineInfo(res_860026562, 5, 1, pt_CODE_FU_860026562)
								SI !i_strcmp(pt_CODE_FU_860026562, C_FU_860026562)
								ALORS
									b_TETRIS_FU_860026562 = 1
								FINSI
								erreur_860026562 = i_LireImsiInfo( res_860026562,0,5,pt_TETRIS_RTC_860026562)
								i_strcpy(pt_IDUS_NDRTC_860026562, pt_TETRIS_RTC_860026562)
							SINON
								erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_IDUS_NDRTC_860026562)
								#BSS et NPF pas en phase donc alarme et on continu....
								erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_temp_860026562)
								# trop de messages 7719 -> mise en commentaire des ligne pour l alarme 7719
								# erreur = i_PlvMessEmettre(7719,2,g_iartin,"",3,C_Article ,pt_temp,pt_TETRIS_compte)
							FINSI
						FINSI
					FINSI
				FINSI
			FINSI
#trace1("G2R2Cw    b_TETRIS_TRAFBSS =<%d>",b_TETRIS_TRAFBSS)
#trace2("G2R2Cw    Resultat BSS : pt_TETRIS_compte : <%s>", pt_TETRIS_compte, "")
#trace1("G2R2Cw    b_TETRIS_FU =<%d>",b_TETRIS_FU)
#trace2("G2R2Cw    Resultat NPF : pt_TETRIS_RTC : <%s>", pt_TETRIS_RTC, "")

##########################################################################
# Recherche instances 42L
##########################################################################
			inst42L_860026562 = i_LireInstanceECC(C_Inst42L_860026562)

			SI (!inst42L_860026562)
			ALORS
				#trace("Pas d'instance pour 42L !")
				code_errone_860026562 = 0xA0B1
				erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_Inst42L_860026562, C_Article_860026562)
				SAUT DISTRI_ERR
			FINSI

			#trace1("inst42L=<%d>",inst42L)

##############################################################################
# Envoi Requetes Table de Distribution 42L
##############################################################################
			#NDRTC
			SI (i_EnvoiReqConsTabDist(TD_42L, gmt_date_860026562, i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
			ALORS
				code_errone_860026562 = 0xA0C1
				erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, C_REF42L_860026562, C_Article_860026562)
				trace("erreur i_EnvoiReqConsTabDist")
				SAUT DISTRI_ERR
			FINSI

			erreur_860026562 = i_LireReqConsTabDist()
			#trace1("RETOUR i_LireReqConsTabDist, erreur=<%d>", erreur)
			SI (erreur_860026562 != 0)
			ALORS
				#trace1("erreur i_LireReqConsTabDist: <%d>", erreur)
				code_errone_860026562 = 0xA0C1
				erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, C_REF42L_860026562, C_Article_860026562)
				SAUT DISTRI_ERR
			FINSI
			erreur_860026562 = i_LireChaineECCv(inst42L_860026562, pt_CODE_DEUR_860026562)
			#trace1("Retour de i_LireChaineECCv = <%d>",erreur)
			SI (erreur_860026562 != 0)
			ALORS
				#trace1( "erreur i_LireChaineECCv : <%d>", erreur)
				i_strcpy(pt_CODE_DEUR_860026562, "D")
			SINON
				#trace2("==== Resultat de pt_CODE_DEUR : <%s>", pt_CODE_DEUR, "")
				SI (i_strcmp(pt_CODE_DEUR_860026562, "M") == 0)
				ALORS
					MLV_860026562 = 1
				SINON
					V1S_860026562 = 1
				FINSI
			FINSI

			instECCv_860026562 = i_LireEntierECCv(inst42L_860026562)
			res_860026562 = i_LireInfoECC(inst42L_860026562, instECCv_860026562)

			SI b_TETRIS_TRAFBSS_860026562 == 0
			ALORS
				SI (res_860026562 != 0)
				ALORS
					erreur_860026562 = i_LireImsiInfo(res_860026562, 0, 5, pt_NDRTC_860026562)
					B_APPEL_BANIP_860026562 = 1
					i_strcpy(pt_IDUS_NDRTC_860026562, pt_NDRTC_860026562)
					erreur_860026562 = i_LireChaineInfo(res_860026562, 5, 1, pt_Support_860026562)
					SI (i_strcmp (pt_Support_860026562, "F") == 0)
					ALORS
						SIP_Fibre_860026562 = 1
					FINSI
					#trace2(" Resultat de i_LireImsiInfo : <%s>", pt_NDRTC, "")
				SINON
					#SI (IDUS_IP == 1) && (SCP == 0) && (EPORTABILITE_SRPLA == 0) && (SRP_FACTURABLE == 1)
					SI (IDUS_IP_860026562 == 1) && (SCP_860026562 == 0)&& !CPS_860026562 && (EPORTABILITE_SRPLA_860026562 == 0) && (SRP_FACTURABLE_860026562 == 1)
					ALORS
						code_errone_860026562 = 0xA0B1
						i_strcpy(pt_LIBELREDIST_860026562, "IDUS_NUM IP inconnu de BANIP")
						bREDISTIP_860026562 = 1
						i_strcpy(pt_NDRTC_860026562," ")
					SINON
						erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_IDUS_NDRTC_860026562)
					FINSI
				FINSI
			FINSI
			#trace2(" pt_IDUS_NDRTC <%s>",pt_IDUS_NDRTC, "" )
		FINSI
	FINSI
FINSI

# SUP
########################################
SI (V1S_860026562 || b_NPF_SIP_860026562)
ALORS
	SUP_860026562 = 6
SINON
	SI MLV_860026562 == 1
	ALORS
		SUP_860026562 = 4
	SINON
		SI (b_TETRIS_FU_860026562 || b_NPF_OPT_860026562 )
		ALORS
			SUP_860026562 = 6
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::SUP)
			SI (res_860026562 == 0x00)
			ALORS
				SUP_860026562 = 1
			SINON
				SI (res_860026562 == 0x03)
				ALORS
					SUP_860026562 = 2
				SINON
					SI (res_860026562 == 0x02)
					ALORS
						SUP_860026562 = 3
					SINON
						SUP_860026562 = 0
					FINSI
				FINSI
			FINSI
		FINSI
	FINSI
FINSI

#####################################################################################
# Controle presence et recuperation de l'instance du referentiel VGA
#########################################################################################
instVGA_860026562 = i_LireInstanceECC(INST_VGA_860026562)
SI (!instVGA_860026562)
ALORS
	#trace("erreur Pas d'instance pour VGA!")
	code_errone_860026562 = 0xA0C1
	erreur_860026562 = i_PlvMessEmettre(8607,2,g_iartin,"",3,code_errone_860026562,"VGA",C_Article_860026562)
	SAUT DISTRI_ERR
FINSI
#trace1("instVGA =<%d>",instVGA)

##############################################################################
# Envoi Requetes Table de Distribution VGA
##############################################################################
SI (IDUS_IP_860026562 == 0)
ALORS
	#trace2("debut req TD_VGA1 IDUS_NUM <%s> ", pt_BUF, "")
	#trace1("    L_NDR <%d>",L_NDR)
	SI (i_EnvoiReqConsTabDist(TD_VGA1_860026562, gmt_date_860026562, i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
	ALORS
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, "erreur requette VGA1", C_Article_860026562)
		#trace("erreur i_EnvoiReqConsTabDistDouble pour VGA1 (table 8)")
		SAUT DISTRI_ERR
	FINSI

	erreur_860026562 = i_LireReqConsTabDist()
	#trace1("RETOUR i_LireReqConsTabDist retour requette VGA1, erreur=<%d>",erreur)
	SI (erreur_860026562 != 0)
	ALORS
		#trace1("erreur i_LireReqConsTabDist VGA1: <%d>", erreur)
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, "erreur i_LireReqConsTabDist VGA1 ", C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	val_860026562 = i_LireInfoECC(instVGA_860026562, 0)
	SI (val_860026562 != 0)
	ALORS
		erreur_860026562 = i_LireChaineInfo(val_860026562, 0, 6, pt_OFFRE_860026562)
		SI (i_strcmp(pt_OFFRE_860026562, g_inull))
		ALORS
			#trace2("pt_OFFRE de VGA1 <%s> pour appel table CodeOffre", pt_OFFRE, "")
			erreur_860026562 = i_format_str2(pt_temp_860026562, "%s%s", "INj", pt_OFFRE_860026562)
			i_strcpy(pt_RES1_860026562, i_get_tab_field("Inter", gmt_date_860026562, pt_temp_860026562))
			#trace2("pt_RES1 table CodeOffre <%s> ", pt_RES1, "")
			SI (i_strcmp(pt_RES1_860026562, "VGT+") == 0)
			ALORS
				bVGTplus_860026562 = 1
				i_strcpy(pt_VGTplus_OF_860026562, pt_OFFRE_860026562)
			SINON
				SI (i_strcmp(pt_RES1_860026562, "VGA") == 0)
				ALORS
					VGA_860026562 = 1
					i_strcpy(pt_VGA_OF_860026562, pt_OFFRE_860026562)
				FINSI
			FINSI
		FINSI
	FINSI
	#trace2(" Resultat de i_LireChaineInfo pour la table  VGA1 (table 8) <%s>", pt_OFFRE, "")
	SI (VGA_860026562 == 1 || bVGTplus_860026562 == 1)
	ALORS
		#trace2("debut req TD_VGA2 IDUS_NUM <%s> ", pt_BUF, "")
		#trace1("L_NDR <%d>",L_NDR)
		SI (i_EnvoiReqConsTabDist(TD_VGA2_860026562, gmt_date_860026562, i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
		ALORS
			#trace("erreur i_EnvoiReqConsTabDist VGA2")
			SAUT DISTRI_ERR
		FINSI

		erreur_860026562 = i_LireReqConsTabDist()
		#trace1("RETOUR i_LireReqConsTabDist retour requette VGA2, erreur=<%d>",erreur)
		SI (erreur_860026562 != 0)
		ALORS
			#trace1( "erreur i_LireReqConsTabDist VGA2: <%d>", erreur)
			SAUT DISTRI_ERR
		FINSI

		val_860026562 = i_LireInfoECC(instVGA_860026562, 0)
		SI (val_860026562 != 0)
		ALORS
			erreur_860026562 = i_LireChaineInfo(val_860026562, 0, 6, pt_OPERA_860026562)
			SI (i_strcmp(pt_OPERA_860026562, g_inull))
			ALORS
				SI (bVGTplus_860026562 == 1)
				ALORS
					i_strcpy(pt_VGTplus_OP_860026562, pt_OPERA_860026562)
				SINON
					i_strcpy(pt_VGA_OP_860026562, pt_OPERA_860026562)
				FINSI
			FINSI
		FINSI
		#trace2(" Resultat de i_LireChaineInfo pour VGA2 (table3): <%s>", pt_OFFRE, "")
	FINSI
FINSI
#trace1("bVGTplus <%d>",bVGTplus)
#trace1("VGA <%d>",VGA)
#trace2("pt_VGTplus_OF <%s>",pt_VGTplus_OF ,"")
#trace2("pt_VGTplus_OP <%s>",pt_VGTplus_OP ,"")
#trace2("VGA_OP <%s>",pt_VGA_OP ,"")
#trace2("VGA_OF <%s>",pt_VGA_OF ,"")
#**********************fin interrogation table VGA

############################################################################
# Recherche Instances des ECC (TRAFIC et SC)
############################################################################

#---------------------------------------------------------------------------
# 	TRAFIC / DELTA MINUTE
#---------------------------------------------------------------------------
instTRAFIC_860026562 = i_LireInstanceECC(C_InstTRAFIC_860026562)
instDM_860026562 = instTRAFIC_860026562

SI (!instTRAFIC_860026562)
ALORS
	trace("instTRAFIC nul !")
	code_errone_860026562 = 0xA0B1
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstTRAFIC_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

#---------------------------------------------------------------------------
# 	SUIVI CONSO
#---------------------------------------------------------------------------
instSC_860026562 = i_LireInstanceECC(C_InstSC_860026562)

SI (!instSC_860026562)
ALORS
	trace("instSC nul !")
	code_errone_860026562 = 0xA0B1
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstSC_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

############################################################################
# Envoi requetes Table de Distribution
# A faire uniquement si l eventuel appel a BSS ou 42L est OK avec pt_IDUS_NDRTC
############################################################################
SI ((bREDISTIP_860026562 == 0) && (b_NPF_SIP_860026562 == 0))
ALORS
	# Interroger LAR FE/FERPV avec IDUS_N

	# Interrogation de MAJ2G avec IDUS_NDRTC
	lg_ND_RTC_860026562 = i_conv_ascii_dcb(pt_IDUS_NDRTC_860026562, pt_adr_NDRTC_860026562)
	#trace2("req TD_Inter NDRTC : <%s> ", pt_IDUS_NDRTC, "")
	#trace1("    lg_ND_RTC <%d>",lg_ND_RTC)
	erreur_860026562 = i_EnvoiReqConsTabDistDouble(TD_Fixe, TD_Inter, gmt_date_860026562, pt_adr_NDRTC_860026562, lg_ND_RTC_860026562, lg_ND_RTC_860026562, 1, 0, 1)
	SI ( erreur_860026562 !=0 )
	ALORS
		#trace1("erreur i_EnvoiReqConsTabDist (TD_Inter): %d", erreur)
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, C_REFMAJ2G_860026562, C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	erreur_860026562 = i_LireReqConsTabDist()
	#trace1("RETOUR i_LireReqConsTabDist (TD_Inter), erreur=<%d>",erreur)
	SI (erreur_860026562 != 0)
	ALORS
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, C_REFMAJ2G_860026562, C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI
	res_860026562 = i_LireInfoECC(instTRAFIC_860026562, 0)
	SI (res_860026562 != 0)
	ALORS
		# Recup du code CFR
		erreur_860026562 = i_LireChaineInfo(res_860026562, 0, 3, pt_InfoCompl_860026562)
		arTRAFIC_860026562 = 1
		# Recup du code CFR
		res_860026562 = i_LireInfoECC(instTRAFIC_860026562, 0)
		dizaine_860026562 = i_LireEntierInfo(res_860026562, 0, 1)
		unite_860026562 = i_LireEntierInfo(res_860026562, 1, 1)
		cfr_860026562 = (dizaine_860026562 & 0x0F) * 10 + (unite_860026562 & 0x0F)
		#trace1("__FILE__:__LINE__ ======> code CFR : <%d> ", cfr)
	FINSI

	res_860026562 = i_LireInfoECC(instSC_860026562, 0)
	SI (res_860026562 != 0)
	ALORS
		arSC_860026562 = 1
	FINSI

	# Interrogation LAR FE/FERPV avec IDUS_N
	erreur_860026562 = i_EnvoiReqConsTabDist(TD_Fixe, gmt_date_860026562, i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1)
	SI ( erreur_860026562 !=0 )
	ALORS
		#trace1("erreur i_EnvoiReqConsTabDist (TD_Fixe): %d", erreur)
		code_errone_860026562 = 0xA0C1
		erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, "FIXE", C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI
FINSI

############################################################################
# Recherche Instances des ECC (suite)
############################################################################

#---------------------------------------------------------------------------
# 	SYMPHONIE
#---------------------------------------------------------------------------
instSYMPHONIE_860026562 = i_LireInstanceECC(C_InstSYMP_860026562)

SI (!instSYMPHONIE_860026562)
ALORS
	trace("instSYMPHONIE nul !")
	code_errone_860026562 = 0xA0B1
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstSYMP_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

#---------------------------------------------------------------------------
# 	16XCONV
#---------------------------------------------------------------------------
inst16XCONV_860026562 = i_LireInstanceECC(C_Inst16XCONV_860026562)

SI (!inst16XCONV_860026562)
ALORS
	trace("inst16XCONV nul !")
	code_errone_860026562 = 0xA0B1
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_Inst16XCONV_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

#---------------------------------------------------------------------------
# 	ANDROMEDE
#---------------------------------------------------------------------------
instANDROMERI_860026562 = i_LireInstanceECC(C_InstANDROMERI_860026562)

SI (!instANDROMERI_860026562)
ALORS
	trace("instANDROMERI nul !")
	code_errone_860026562 = 0xA0B1
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstANDROMERI_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

#---------------------------------------------------------------------------
# 	EVE
#---------------------------------------------------------------------------


#---------------------------------------------------------------------------
# 	TRAFBSS1 / TRAFBSS2
#---------------------------------------------------------------------------
instTRAFBSS1_860026562 = i_LireInstanceECC(C_InstTRAFBSS1_860026562)
#trace1("instTRAFBSS1=<%d>",instTRAFBSS1)

SI (!instTRAFBSS1_860026562)
ALORS
	#trace("Pas d'instance pour TRAFBSS1!")
	code_errone_860026562 = 0xA0B1
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstTRAFBSS1_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

instTRAFBSS2_860026562 = i_LireInstanceECC(C_InstTRAFBSS2_860026562)
#trace1("instTRAFBSS2=<%d>",instTRAFBSS2)

SI (!instTRAFBSS2_860026562)
ALORS
	#trace("Pas d'instance pour TRAFBSS2!")
	code_errone_860026562 = 0xA0B1
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstTRAFBSS2_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

#---------------------------------------------------------------------------
# 	CENTAUREVG
#---------------------------------------------------------------------------
instCENTAUREVG_860026562 = i_LireInstanceECC(C_InstCENTVG_860026562)
#trace1("instCENTAUREVG=<%d>",instCENTAUREVG)

SI (!instCENTAUREVG_860026562)
ALORS
	#trace("Pas d'instance pour CENTAUREVG!")
	code_errone_860026562 = 0xA0B0
	code_errone_860026562 = code_errone_860026562 + EFFICACE_860026562
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstCENTVG_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

#--------------------
# 	CENTAUREDEA
#-------------------
instCENTAUREDEA_860026562 = i_LireInstanceECC(C_InstCENTDEA_860026562)

SI (!instCENTAUREDEA_860026562)
ALORS
	#trace("Pas d'instance pour CENTAUREDEA!")
	code_errone_860026562 = 0xA0B0
	code_errone_860026562 = code_errone_860026562 + EFFICACE_860026562
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstCENTDEA_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

#G3R24
#--------------------
# 	DQD
#-------------------
instDQD_860026562 = i_LireInstanceECC(C_InstDQD_860026562)

SI (!instDQD_860026562)
ALORS
	#trace("Pas d'instance pour DQD!")
	code_errone_860026562 = 0xA0B0
	code_errone_860026562 = code_errone_860026562 + EFFICACE_860026562
	erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_InstDQD_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

#G4R2
#--------------------------------------
# RECHERCHE instance COME
#--------------------------------------
instCOME_860026562 = i_LireInstanceECC(C_InstCOME_860026562)

SI (!instCOME_860026562)
ALORS
	code_errone_860026562 = 0xA0B0
	code_errone_860026562 = code_errone_860026562 + EFFICACE_860026562
	erreur_860026562 = i_PlvMessEmettre(8601,2,g_iartin,"",3, code_errone_860026562, C_InstCOME_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI

#--------------------------------------
# RECHERCHE instance ELIGIBLE
#--------------------------------------
instELIG_860026562 = i_LireInstanceECC(C_InstELIG_860026562)

SI (!instELIG_860026562)
ALORS
	code_errone_860026562 = 0xA0B0
	code_errone_860026562 = code_errone_860026562 + EFFICACE_860026562
	erreur_860026562 = i_PlvMessEmettre(8601,2,g_iartin,"",3, code_errone_860026562, C_InstELIG_860026562, C_Article_860026562)
	SAUT DISTRI_ERR
FINSI


# Traitement du retour du referentiel
########################################
# L appel a ete realise uniquement si BANIP n a pas pose de probleme
SI(b_NPF_SIP_860026562 == 1)
ALORS
	arTRAFIC_860026562 = 1
SINON
	SI (bREDISTIP_860026562 == 0)
	ALORS
		erreur_860026562 = i_LireReqConsTabDist()
		#trace1("RETOUR i_LireReqConsTabDist (TD_Fixe), erreur=<%d>",erreur)
		SI (erreur_860026562 != 0)
		ALORS
			code_errone_860026562 = 0xA0C1
			erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, C_REFMAJ2G_860026562, C_Article_860026562)
			SAUT DISTRI_ERR
		FINSI

		SI (b_TETRIS_TRAFBSS_860026562 == 0)
		ALORS
			res_860026562 = i_LireInfoECC(instFE_860026562, 0)
			SI (res_860026562 != 0)
			ALORS
				arFE_860026562 = 1
				erreur_860026562=i_LireChaineInfo(res_860026562,0,2,pt_InfoComplFE_860026562)
				SI ( i_strcmp(pt_InfoComplFE_860026562,"20") == 0 || i_strcmp(pt_InfoComplFE_860026562,"23") == 0 || i_strcmp(pt_InfoComplFE_860026562,"25") == 0)
				ALORS
					TYPAR_FE_860026562=1
				FINSI
			FINSI
		FINSI

		res_860026562 = i_LireInfoECC(instFERPV_860026562, 0)
		SI (res_860026562 != 0)
		ALORS
			erreur_860026562 = i_LireChaineInfo(res_860026562, 0, 3, pt_InfoCompl_FERPV_860026562)
			i_get_sub_str(pt_InfoCompl_FERPV_860026562, 0, 0, pt_Info_FERPV_860026562)
			SI ( i_strcmp(pt_Info_FERPV_860026562, "1") == 0)
			ALORS
				i_strcpy(pt_service_860026562,"1")
			SINON
				SI (i_strcmp(pt_Info_FERPV_860026562, "2") == 0)
				ALORS
					i_strcpy(pt_service_860026562,"2")
					SERVICE_860026562 = 2
				SINON
					i_strcpy(pt_service_860026562,"4")
					SERVICE_860026562 = 4
				FINSI
			FINSI
			arFERPV_860026562 = 1
			i_get_sub_str(pt_InfoCompl_FERPV_860026562, 1, 2, pt_Info_ETEL_860026562)
			SI ( i_strcmp(pt_Info_ETEL_860026562,"20") == 0 || i_strcmp(pt_Info_ETEL_860026562,"23") == 0 || i_strcmp(pt_Info_ETEL_860026562,"25") == 0)
			ALORS
				TYPAR_ETEL_860026562 = 1
			FINSI
		FINSI

		#G4R2
		res_860026562 = i_LireInfoECC(instCOME_860026562, 0)
		SI (res_860026562 != 0)
		ALORS
			arCome_860026562 = 1
			#G4R2 QC695
			#erreur = i_LireChaineInfo(res, 0, 6, pt_NDI_COME)
			erreur_860026562 = i_LireImsiInfo(res_860026562, 0, 6, pt_NDI_COME_860026562)
		SINON
			res_860026562 = i_LireInfoECC(instELIG_860026562, 0)
			SI (res_860026562 != 0)
			ALORS
				arElig_860026562 = 1
				#G4R2 QC695
				#erreur = i_LireChaineInfo(res, 0, 6, pt_NDI_COME)
				erreur_860026562 = i_LireImsiInfo(res_860026562, 0, 6, pt_NDI_COME_860026562)
			FINSI
		FINSI
	FINSI
FINSI

#trace1("SRP_FACTURABLE <%d>",SRP_FACTURABLE)
#trace1("EFFICACE <%d>",EFFICACE)
#trace1("SRP_CORR <%d>",SRP_CORR)
#trace1("RETOUR_CORR <%d>",RETOUR_CORR)
#trace1("SRP_EPORTABILITE <%d>",SRP_EPORTABILITE)
#trace1("b_TETRIS_TRAFBSS <%d>",b_TETRIS_TRAFBSS)
#trace1("b_TETRIS_FU <%d>",b_TETRIS_FU)
#trace1("bREDISTIP <%d>",bREDISTIP)

SI ( SRP_FACTURABLE_860026562 && EFFICACE_860026562 && ( ( !SRP_CORR_860026562 && !CORR_TAG_860026562 ) || RETOUR_CORR_860026562 ) && !SRP_EPORTABILITE_860026562
&& b_TETRIS_TRAFBSS_860026562 == 1 && b_TETRIS_FU_860026562 == 0 && !NM3_860026562 && bREDISTIP_860026562 == 0 && !b_NPF_OPT_860026562 && !b_FFMV3_860026562 )
ALORS
	b_TRAFBSScritCOM_860026562 = 1
FINSI
#trace1("b_TRAFBSScritCOM <%d>", b_TRAFBSScritCOM)

##########################
# TARIF pour BSS avec TYPCOM
# TYPCOM calcule en traitement, dans ajout CE
SI (i_valid_field_n(g_iartout, $TconvNE::ACE_N2))
ALORS
	TYPCOM_860026562 = i_get_art_field(g_iartout, $TconvNE::ACE_N2)
	erreur_860026562 = i_supprChamp(g_iartout, "T4ACE_N2")
	SI (TYPCOM_860026562 == 83 || TYPCOM_860026562 == 98)
	ALORS
		TYPCOM_fct_860026562 = 1
	FINSI
FINSI

SI b_TRAFBSScritCOM_860026562 == 1
ALORS
	TYPCOM_860026562 = -1
	CODCIR_860026562 = -1
	Appel_BNC_860026562 = 0
	SI (TAG_Accueil_860026562 == 1)
	ALORS
		SI i_valid_field_n(g_iartout, $TconvNE::DEDEINI_NUM_N) == 1
		ALORS
			erreur_860026562 = i_get_art_str(g_iartout,$TconvNE::DEDEINI_NUM_N, pt_DEDEINI_NUM_N_860026562)
			Appel_BNC_860026562 = 1
		FINSI
	SINON
		SI (MER_Kiosque_DC2_860026562 == 1)
		ALORS
			SI (cause_860026562 == 2) || (cause_860026562 == 7)
			ALORS
				SI i_valid_field_n(g_iartout, $TconvNE::DEDE1_NUM) == 1
				ALORS
					erreur_860026562 = i_get_art_str(g_iartout,$TconvNE::DEDE1_NUM, pt_DEDEINI_NUM_N_860026562)
					Appel_BNC_860026562 = 1
				FINSI
			SINON
				SI (cause_860026562 == 9) || (cause_860026562 == 10)
				ALORS
					SI i_valid_field_n(g_iartout, $TconvNE::DETR1_NUM_N) == 1
					ALORS
						erreur_860026562 = i_get_art_str(g_iartout,$TconvNE::DETR1_NUM_N, pt_DEDEINI_NUM_N_860026562)
						Appel_BNC_860026562 = 1
					FINSI
				FINSI
			FINSI
		SINON
			erreur_860026562 = i_get_art_str(g_iartout,$TconvNE::DEDE_NUM_N, pt_DEDEINI_NUM_N_860026562)
			Appel_BNC_860026562 = 1
		FINSI
	FINSI

	SI Appel_BNC_860026562 == 1
	ALORS
		lg_860026562 = i_strlen(pt_DEDEINI_NUM_N_860026562)
		SI (lg_860026562 > 6)
		ALORS
			# on est dans le cas d un NAS de type ZABPQMCDU : on ajoute un 0 devant pour la normalisation
			erreur_860026562 = i_format_str2(pt_DEDEini_DIST_N_860026562, "%s%s", "0", pt_DEDEINI_NUM_N_860026562)
		SINON
			# on est dans le cas d un NAS court : on recopie DEDE_NUM_N tel quel pour l appel a la BNC
			i_strcpy(pt_DEDEini_DIST_N_860026562, pt_DEDEINI_NUM_N_860026562)
		FINSI

		i_strcpy(pt_IDUS_NORM_860026562, "**00")
		lg_860026562 = i_strlen(pt_DEDEini_DIST_N_860026562)

		erreur_860026562 = i_memcpy_art_field_n(g_icopo, $Tcopo::NDR, pt_IDUS_NORM_860026562, 5)
		erreur_860026562 = i_memcpy_art_field_n(g_icopo, $Tcopo::NDE, pt_DEDEini_DIST_N_860026562, lg_860026562+1)

		# Recuperation de la date de debut de conversation
		# Il faut trouver la date de debut de conversation en AAMMJJhhmmss
		# avec HDCONV (hhmmss) et ICAR (AAMMJJhhmmss) ??????

		sdate_conv_860026562 = i_concat_date(g_iartout, $TconvNE::DATE, $TconvNE::HDCONV, 0)

		# Initialisation de l'interface "proc_copo" et calcul taxation
		g_icopo.TAXE   = 0
		g_icopo.CREDIT = 0
		erreur_860026562 = i_set_art_date(g_icopo, sdate_conv_860026562)
		g_icopo.DUREE  = 0
		g_icopo.CODE   = CODE_AUDIO_860026562
		g_icopo.CATEG  = CATEG_AUDIO_860026562
		g_icopo.SUP[0] = 0
		g_icopo.SUP[1] = 0
		g_icopo.SUP[2] = 0
		g_icopo.SUP[3] = 0
		g_icopo.SUP[4] = 0
		g_icopo.SUP[RES_CLDEST_860026562] = 0xff

		erreur_860026562 = i_comptage( g_icopo, BASE_AUDIO_860026562, sdate_conv_860026562 )

		SI (   erreur_860026562 == 0 )
		ALORS
			#TARIF pour BSS avec TYPCOM
			TYPCOM_860026562 = g_icopo.SUP[RES_TYPCOM_860026562]
			CODCIR_860026562 = g_icopo.SUP[RES_CODCIR_860026562]
		FINSI

		SI (TYPCOM_860026562 == 83 || TYPCOM_860026562 == 98)
		ALORS
			TYPCOM_fct_860026562 = 1
		FINSI
	FINSI
FINSI

################################
# Evolution du booleen b_arretfct_centaure
# ccd-reel=213 => SRP_SPORTABILITE
SI ((TYPCOM_fct_860026562 && CCD_860026562 == 24 && bitE_860026562 == 1) || SRP_SPORTABILITE_860026562)
ALORS
	b_arretfct_centaure_860026562 = 1
FINSI

SI (b_TRAFBSScritCOM_860026562 == 1)
ALORS
	# TARIF : libelle du CCD
	# TARIF pour BSS avec TYPCOM
	#trace1("**************** TYPCOM = %d", TYPCOM)
	erreur_860026562 = i_set_art_field(g_iartout13, $Conversion::BNC_SUP, TYPCOM_860026562)
	erreur_860026562 = i_get_art_str(g_iartout13, $Conversion::BNC_SUP, pt_BUF_860026562)
	i_strcpy(pt_TARIF_860026562, i_get_tab_field("ft_tar_ccd", gmt_date_860026562, pt_BUF_860026562))
	#trace2("**************** TARIF  = %s", pt_TARIF, "")

	# TRAFIC : libelle du CODCIR demande
	erreur_860026562 = i_set_art_field(g_iartout13, $Conversion::CODCIRDR, CODCIR_860026562)
	erreur_860026562 = i_get_art_str(g_iartout13, $Conversion::CODCIRDA, pt_BUF_860026562)

	SI (g_iartout13.CODCIRDA[0] == 0)
	ALORS
		SI (g_iartout13.CODCIRDA[1] == 0)
		ALORS
			i_get_sub_str(pt_BUF_860026562,2, 5, pt_BUF_860026562)
		SINON
			i_get_sub_str(pt_BUF_860026562, 1, 5, pt_BUF_860026562)
		FINSI
	SINON
		i_get_sub_str(pt_BUF_860026562, 0, 5, pt_BUF_860026562)
	FINSI
	#trace2("appel table lib_ct avec CODCIR <%s>",pt_BUF,"")
	i_strcpy(pt_TRAFIC_860026562, i_get_tab_field("ft_lib_ct", gmt_date_860026562, pt_BUF_860026562))
	#trace2("**************** TRAFIC  = %s", pt_TRAFIC, "")
FINSI

############################################################################
# Criteres d envoi aux ECC
# Remarques : - la correlation est vue comme une ECC
############################################################################

########################################
# 		Andromede
########################################
SI (SRP_860026562 && i_valid_field_n(g_iartout, $TconvNE::IPER_NUM) && (cpt_RDT_860026562 == 0) && !RETOUR_CORR_860026562)
ALORS
	bANDRO_860026562 = 1
	erreur_860026562 = i_AjouterCouranteECC(instANDROMERI_860026562)
FINSI

########################################
# 		BSS
########################################
SI ((b_NPF_SIP_860026562 == 0) && (b_TRAFBSScritCOM_860026562 == 1))
ALORS
	SI(i_strplcmp(pt_TETRIS_compte_860026562, "1", 0, 1) == 0)
	ALORS
		i_strcpy(pt_ECCFACT_860026562, C_TRAFBSS1FACT_860026562)
		erreur_860026562 = i_AjouterCouranteECC(instTRAFBSS1_860026562)
		#trace("TRAFBSS1 sera alimentee")
		bTrafBSS1_860026562 = 1
		#G4R6 QC822 #
		SI ( typeCTR_860026562==TYPCTR_Fact_RI_860026562 && !b_ALICE_860026562 )
		ALORS
			bREDISTMAJ2G_860026562 = 0
		FINSI
	SINON
		i_strcpy(pt_ECCFACT_860026562, C_TRAFBSS2FACT_860026562)
		erreur_860026562 =  i_AjouterCouranteECC(instTRAFBSS2_860026562)
		#trace("TRAFBSS2 sera alimentee")
		bTrafBSS2_860026562 = 1
		#G4R6 QC822 #
		SI ( typeCTR_860026562==TYPCTR_Fact_RI_860026562 && !b_ALICE_860026562 )
		ALORS
			bREDISTMAJ2G_860026562 = 0
		FINSI
	FINSI
FINSI

########################################
# 		EVE
########################################


########################################
# 		16XCONV ou 16XCONVCPS
########################################
#G4R5 QC781
SI ( cpt_RDT_860026562 == 0 ) &&
( ( CPS_860026562 && !CPS_SPORTABILITE_860026562 )
|| ( SCP_860026562 && !SCP_SPORTABILITE_860026562 )
|| ( SRP_860026562 && !SRP_SPORTABILITE_860026562 && !RETOUR_CORR_860026562 && !SRP_Tiers_860026562 && !b118PTD_860026562 ) )
ALORS
	b16XCONV_860026562 = 1

#G4R6 QC822 #
	SI SCP_860026562 || CPS_860026562
	ALORS
		i_strcpy(pt_ECCFACT_860026562, C_16XFACT_860026562)
	FINSI
	erreur_860026562 = i_AjouterCouranteECC(inst16XCONV_860026562)
FINSI

# FCT => Supprimee

########################################
# 		COME FERPV ET ELIGIBLE
########################################
#G4R2
SI ( SRP_FACTURABLE_860026562 && EFFICACE_860026562 && !SRP_EPORTABILITE_860026562 && !VGA_860026562 && !bVGTplus_860026562 && !NM3_860026562 && !V1S_860026562
&& b_TETRIS_TRAFBSS_860026562 == 0 && b_NPF_SIP_860026562 == 0 && !b_NPF_OPT_860026562 )
ALORS
	b_FERPV_COME_860026562 = 1
FINSI

SI b_FERPV_COME_860026562
ALORS
	SI arCome_860026562
	ALORS
		bCome_860026562 = 1
	SINON
		SI arElig_860026562
		ALORS
			bElig_860026562 = 1
		SINON
			SI ( arFERPV_860026562 || TYPAR_SIPFE_860026562 )
			ALORS
				# QC721
				b_FERPV_860026562 = 1
			FINSI
		FINSI
	FINSI
FINSI

########################################
# 		FERPV
########################################

#SI ( SRP_FACTURABLE && EFFICACE && !SRP_EPORTABILITE && ( arFERPV || TYPAR_SIPFE == 1 )
#  && !VGA && !bVGTplus && !NM3 && !V1S && b_TETRIS_TRAFBSS == 0 && b_NPF_SIP == 0 && !b_NPF_OPT )
#ALORS
#	b_FERPV = 1
#FINSI

SI (SRP_FACTURABLE_860026562 && EFFICACE_860026562 && b_OperNBE_860026562 && (bVGTplus_860026562 || b_FFMV3_860026562))
ALORS
	b_FERPV_NBE_860026562 = 1
FINSI

#G4R2 + QC721
#SI (b_FERPV || b_FERPV_NBE)
#G4R6 lot 3 : C+S appelant
#SI ( b_FERPV || bElig || b_FERPV_NBE)
SI ( b_FERPV_860026562 || bElig_860026562 || b_FERPV_NBE_860026562) && !(b_Fact_CPS_RI_860026562 && !b_ALICE_860026562)
ALORS
	# Recup du code CFR
	SI arTRAFIC_860026562
	ALORS
		SI ( ( !SRP_CORR_860026562 && !CORR_TAG_860026562 ) || RETOUR_CORR_860026562 )
		ALORS
			#res = i_LireInfoECC(instTRAFIC, 0)
			#dizaine = i_LireEntierInfo(res, 0, 1)
			#unite = i_LireEntierInfo(res, 1, 1)
			#cfr = (dizaine & 0x0F) * 10 + (unite & 0x0F)
			#trace1("__FILE__:__LINE__ ======> code CFR : <%d> ", cfr)
			erreur_860026562 = i_set_attr_val_n( $Elibap::CFR, cfr_860026562)
			bFERPV_860026562 = 1

			SI b_FERPV_860026562
			ALORS
				i_strcpy(pt_ECCFACT_860026562, C_FEFACT_860026562)
			FINSI
			erreur_860026562 = i_AjouterCouranteECC(instFERPV_860026562)
		FINSI
	SINON
		SI(TYPAR_SIPFE_860026562 == 0)
		ALORS
			code_errone_860026562 = 0xA0B1
			erreur_860026562 = i_format_str2(pt_LIBELREDIST_860026562,"%s%s", "Indicatif inconnu de MAJ2G : ", pt_IDUS_NDRTC_860026562)
			bREDISTMAJ2G_860026562 = 1
			#trace1("__FILE__:__LINE__ ===FERPV===> code bREDISTMAJ2G : <%d> ", bREDISTMAJ2G)
		FINSI
	FINSI
FINSI

########################################
# 		COME
########################################
#G4R6 lot 3 : C+S appelant
#SI bCome && ( ( !SRP_CORR && !CORR_TAG ) || RETOUR_CORR )
SI bCome_860026562 && ( ( !SRP_CORR_860026562 && !CORR_TAG_860026562 ) || RETOUR_CORR_860026562 ) && !(b_Fact_CPS_RI_860026562 && !b_ALICE_860026562)
ALORS
	i_strcpy(pt_ECCFACT_860026562, C_COMEFACT_860026562)
	erreur_860026562 = i_AjouterCouranteECC(instCOME_860026562)
SINON
	bCome_860026562 = 0
FINSI

########################################
# 		ELIGIBLE
########################################
#G4R6 lot 3 : C+S appelant
#SI bElig && ( ( !SRP_CORR && !CORR_TAG ) || RETOUR_CORR )
SI bElig_860026562 && ( ( !SRP_CORR_860026562 && !CORR_TAG_860026562 ) || RETOUR_CORR_860026562 ) && !(b_Fact_CPS_RI_860026562 && !b_ALICE_860026562)
ALORS
	instCOM_ELIG_860026562 = i_LireInstanceECC(C_InstCOM_ELIG_860026562)
	SI (!instCOM_ELIG_860026562)
	ALORS
		code_errone_860026562 = 0xA0B0
		code_errone_860026562 = code_errone_860026562 + EFFICACE_860026562
		erreur_860026562 = i_PlvMessEmettre(8601,2,g_iartin,"",3, code_errone_860026562, C_InstCOM_ELIG_860026562, C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	i_strcpy(pt_ECCFACT_860026562, C_FEFACT_860026562)
	erreur_860026562 = i_AjouterCouranteECC(instCOM_ELIG_860026562)
SINON
	bElig_860026562 = 0
FINSI

########################################
# 		FE
########################################
#G4R6 lot 3 : C+S appelant
#SI ( SRP_FACTURABLE && EFFICACE && !SRP_EPORTABILITE && !bFERPV && TYPAR_SIPFE == 0 && !TYPAR_BIV_SIP && arFE && !VGA && !bVGTplus && !NM3 && !V1S && b_TETRIS_TRAFBSS == 0 && b_NPF_SIP == 0 && !b_NPF_OPT )
SI ( SRP_FACTURABLE_860026562 && EFFICACE_860026562 && !SRP_EPORTABILITE_860026562 && !bFERPV_860026562 && TYPAR_SIPFE_860026562 == 0 && !TYPAR_BIV_SIP_860026562 && arFE_860026562 && !VGA_860026562
&& !bVGTplus_860026562 && !NM3_860026562 && !V1S_860026562 && b_TETRIS_TRAFBSS_860026562 == 0 && b_NPF_SIP_860026562 == 0 && !b_NPF_OPT_860026562 )  && !(b_Fact_CPS_RI_860026562 && !b_ALICE_860026562)
ALORS
	# Recup du code CFR
	SI arTRAFIC_860026562
	ALORS
		SI ( ( !SRP_CORR_860026562 && !CORR_TAG_860026562 ) || RETOUR_CORR_860026562 )
		ALORS
			#res = i_LireInfoECC(instTRAFIC, 0)
			#dizaine = i_LireEntierInfo(res, 0, 1)
			#unite = i_LireEntierInfo(res, 1, 1)
			#cfr = (dizaine & 0x0F) * 10 + (unite & 0x0F)
			#trace1("__FILE__:__LINE__ ======> code CFR : <%d> ", cfr)
			erreur_860026562 = i_set_attr_val_n( $Elibap::CFR, cfr_860026562)
			bFE_860026562 = 1
			i_strcpy(pt_ECCFACT_860026562, C_FEFACT_860026562)
			erreur_860026562 = i_AjouterCouranteECC(instFE_860026562)
		FINSI
	SINON
		code_errone_860026562 = 0xA0B1
		erreur_860026562 = i_format_str2(pt_LIBELREDIST_860026562,"%s%s", "Indicatif inconnu de MAJ2G : ", pt_IDUS_NDRTC_860026562)
		bREDISTMAJ2G_860026562 = 1
		#trace1("__FILE__:__LINE__ ===FE===> code bREDISTMAJ2G : <%d> ", bREDISTMAJ2G)
	FINSI
FINSI

########################################
# 		TRAFIC
########################################
#G4R2
#G4R6 lot 3 : C+S appelant
#SI ( SRP_FACTURABLE && EFFICACE && ( ( ( !SRP_CORR && !CORR_TAG ) || RETOUR_CORR ) && !SRP_EPORTABILITE
# G4R7 Lot3 QC830
#SI ( SRP_FACTURABLE && EFFICACE && ( ( ( !SRP_CORR && !CORR_TAG ) || RETOUR_CORR ) && !SRP_EPORTABILITE  && !(b_Fact_CPS_RI && !b_ALICE)
#&& ( bREDISTIP == 0 ) && !bFERPV && !bCome && !bElig && !bFE && b_TRAFBSScritCOM == 0 )
#|| ( b_FERPV_NBE && ( ( !SRP_CORR && !CORR_TAG ) || RETOUR_CORR ) ) )
#ALORS
# G4R8 QC859 ajout bREDISTIP
SI 
 (  SRP_FACTURABLE_860026562 
 && EFFICACE_860026562 
 &&
  ( 
   ( 
    ( ( !SRP_CORR_860026562 && !CORR_TAG_860026562 ) || RETOUR_CORR_860026562 ) 
    && !SRP_EPORTABILITE_860026562 
    && !b_TRAFBSScritCOM_860026562
    && !bTrafBSS1_860026562 
    && !bTrafBSS2_860026562 
    && ( bREDISTIP_860026562 == 0 ) 
    && !bFERPV_860026562 
    && !bCome_860026562 
    && !bElig_860026562 
    && !bFE_860026562 )
  || ( b_FERPV_NBE_860026562 && ( ( !SRP_CORR_860026562 && !CORR_TAG_860026562 ) || RETOUR_CORR_860026562 ) ) )
 && !( b_Fact_CPS_RI_860026562 && !b_ALICE_860026562 ) )
ALORS
	SI arTRAFIC_860026562
	ALORS
		SI(b_NPF_SIP_860026562 == 0)
		ALORS
			erreur_860026562 = i_format_str2(pt_basTRAFIC_860026562, "TRAF%s", pt_InfoCompl_860026562, 0)
		FINSI

		instTRAFIC_860026562 = i_LireInstanceECC(pt_basTRAFIC_860026562)
		SI (!instTRAFIC_860026562)
		ALORS
			code_errone_860026562 = 0xA0B1
			erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, pt_basTRAFIC_860026562, C_Article_860026562)
			SAUT DISTRI_ERR
		SINON
			bTRAFIC_860026562 = 1
			i_strcpy(pt_ECCFACT_860026562, pt_basTRAFIC_860026562)
			erreur_860026562 = i_AjouterCouranteECC(instTRAFIC_860026562)
		FINSI
	SINON
		code_errone_860026562 = 0xA0B1
		erreur_860026562 = i_format_str2(pt_LIBELREDIST_860026562,"%s%s", "Indicatif inconnu de MAJ2G : ", pt_IDUS_NDRTC_860026562)
		bREDISTMAJ2G_860026562 = 1
		#trace1("__FILE__:__LINE__ ===TRAFIC===> code bREDISTMAJ2G : <%d> ", bREDISTMAJ2G)
	FINSI
FINSI

########################################
# 		DELTA MINUTE
########################################
SI (bFE_860026562)
ALORS
	erreur_860026562 = i_format_str2(pt_DM_860026562, "DM%s", pt_InfoCompl_860026562, 0)
	instDM_860026562 = i_LireInstanceECC(pt_DM_860026562)
	SI (!instDM_860026562)
	ALORS
		code_errone_860026562 = 0xA0B1
		erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, pt_DM_860026562, C_Article_860026562)
		SAUT DISTRI_ERR
	SINON
		bDM_860026562 = 1
		erreur_860026562 = i_AjouterCouranteECC(instDM_860026562)
	FINSI
FINSI

########################################
# 		CENTAUREVG
########################################
#G4R2
#G4R6 lot 3 : C+S appelant
# G4R7 Lot3 QC830
#SI ( ( VGA || bVGTplus || NM3 || b_FFMV3 ) && SRP_FACTURABLE && EFFICACE
#SI ( ( VGA || bVGTplus || NM3 || b_FFMV3 ) && SRP_FACTURABLE && EFFICACE  && !(b_Fact_CPS_RI && !b_ALICE)
#&& ( ( ( !SRP_CORR && !CORR_TAG ) || RETOUR_CORR ) && !SRP_EPORTABILITE && !b_TRAFBSScritCOM
#&& !bFERPV && !bCome && !bElig && !bFE )
#|| ( b_FERPV_NBE && ( ( !SRP_CORR && !CORR_TAG ) || RETOUR_CORR ) ) )
#ALORS
SI 
 ( VGA_860026562 || bVGTplus_860026562 || NM3_860026562 || b_FFMV3_860026562 ) 
&& SRP_FACTURABLE_860026562 
&& EFFICACE_860026562 
&& 
 (
  ( ( ( !SRP_CORR_860026562 && !CORR_TAG_860026562 ) || RETOUR_CORR_860026562 ) 
  && !SRP_EPORTABILITE_860026562 
  && !b_TRAFBSScritCOM_860026562
  && !bTrafBSS1_860026562 
  && !bTrafBSS2_860026562 
  && !bFERPV_860026562 
  && !bCome_860026562 
  && !bElig_860026562 
  && !bFE_860026562 )
 || ( b_FERPV_NBE_860026562 && ( ( !SRP_CORR_860026562 && !CORR_TAG_860026562 ) || RETOUR_CORR_860026562 ) ) ) 
&& !( b_Fact_CPS_RI_860026562 && !b_ALICE_860026562 )
ALORS
	bCENTVG_860026562 = 1
	erreur_860026562 = i_AjouterCouranteECC(instCENTAUREVG_860026562)
FINSI

########################################
#CENTAUREDEA
########################################
# G3R23C2 QC560
#G4R6 lot 3 : C+S appelant  +QC826
#SI ( EFFICACE && b_arretfct_centaure && SRP_FACTURABLE
SI ( EFFICACE_860026562 && b_arretfct_centaure_860026562 && SRP_FACTURABLE_860026562 && !(b_Fact_CPS_RI_860026562 && !b_ALICE_860026562)
  && ( !SRP_CORR_860026562 || RETOUR_CORR_860026562 ) 
  && !( TAG_Accueil_860026562 && TAG_gratuit_860026562 ) 
  && ( bREDISTIP_860026562 == 0 ) && ( cpt_RDT_860026562 == 0 ) )
ALORS
	bCENTDEA_860026562 = 1
	erreur_860026562 = i_AjouterCouranteECC(instCENTAUREDEA_860026562)
FINSI

########################################
# 		SUIVI CONSO
########################################
SI ( SRP_FACTURABLE_860026562 && ( bTrafBSS1_860026562 || bTrafBSS2_860026562 ))
ALORS
	bSC_860026562 = 1
	erreur_860026562 = i_AjouterCouranteECC(instSC_860026562)
FINSI

########################################
# 		SYMPHONIE
########################################
SI (bREDISTIP_860026562 == 1)
ALORS
	RETOUR_CORR_860026562 = 0
FINSI
#trace1("bREDISTIP    <%d> ", bREDISTIP)
#trace1("bREDISTMAJ2G <%d> ", bREDISTMAJ2G)
#trace1("cpt_RDT      <%d> ", cpt_RDT)
#trace1("RETOUR_CORR  <%d> ", RETOUR_CORR)

SI ( ( ( bREDISTIP_860026562 == 0 ) && ( bREDISTMAJ2G_860026562 == 0 ) ) || ( cpt_RDT_860026562 == 2 ) ) && ( RETOUR_CORR_860026562 == 0 )
ALORS
	bSYMPHONIE_860026562 = 1
	erreur_860026562 = i_AjouterCouranteECC(instSYMPHONIE_860026562)
FINSI

#G3R24
########################################
# 		DQD
########################################
#G4R8 QC861
#SI (cpt_RDT == 2) && ( ( bREDISTIP == 1 ) || ( bREDISTMAJ2G == 1 ) )
SI (cpt_RDT_860026562 == 2) && ( bREDISTIP_860026562 == 1 )
ALORS
	bDQD_860026562 = 1
	erreur_860026562 = i_AjouterCouranteECC(instDQD_860026562)
FINSI

#====================================================
# Envoi en Correlation
#====================================================
#trace1("__FILE__:__LINE__ ======> code SRP_CORR : <%d> ", SRP_CORR)
#trace1("__FILE__:__LINE__ ======> code CORR_TAG : <%d> ", CORR_TAG)
#trace1("__FILE__:__LINE__ ======> code bREDISTIP : <%d> ", bREDISTIP)
#trace1("__FILE__:__LINE__ ======> code bREDISTMAJ2G : <%d> ", bREDISTMAJ2G)
SI ( SRP_CORR_860026562 == 1 || CORR_TAG_860026562 == 1 ) && ( bREDISTIP_860026562 == 0 && bREDISTMAJ2G_860026562 == 0 ) && !RETOUR_CORR_860026562
ALORS
	SI CORR_TAG_860026562 == 1
	ALORS
		erreur_860026562 = i_dup_art_id(g_iartin, g_iartout14)
		# Mise a jour des champs utilises en correlation
		erreur_860026562 = i_ajoutChampNum(g_iartout14, $TconvNE::T3correl,$TconvNE::GRATUIT,1)

		erreur_860026562 = i_set_art_field(g_iartout14, $TconvNE::TYPE,0)

		sdate_860026562 = i_get_art_field(g_iartin, $TconvNE::DATE)
		erreur_860026562 = i_set_art_field(g_iartout14, $TconvNE::VARDATE,sdate_860026562)

		erreur_860026562 = i_set_art_field(g_iartout14, $TconvNE::VARDATEFIN,datefin_860026562)

		sdate_860026562 = i_concat_date(g_iartin, $TconvNE::DATE, $TconvNE::HDCONV, 0)
		erreur_860026562 = i_set_art_field(g_iartout14, $TconvNE::VARHDCONV,sdate_860026562)

		res_860026562 = i_get_art_field(g_iartin, $TconvNE::REF)
		erreur_860026562 = i_set_art_field(g_iartout14,$TconvNE::VARENAPREF,res_860026562)

		res_860026562 = i_get_art_field(g_iartin, $TconvNE::SEQ)
		erreur_860026562 = i_set_art_field(g_iartout14,$TconvNE::VARENAPSEQ,res_860026562)

		SI ( TAG_gratuit_860026562 == 1 )
		ALORS
			erreur_860026562 = i_set_art_field(g_iartout14, $TconvNE::GRATUIT,0x02)
		SINON
			erreur_860026562 = i_set_art_field(g_iartout14, $TconvNE::GRATUIT,0x01)
		FINSI

		#trace("preparation Envoi en Correlation TAG")
		i_strcpy(pt_cascorr_860026562, C_CASCORR2_860026562)
		#*********** recherche des 4 derniers chiffres du numero ***************
		nelem_860026562 = g_iartout14.IDUS_NUM!NELEM
		val_860026562=g_iartout14.IDUS_NUM[nelem_860026562-1]
		#trace1("__FILE__:__LINE__ ======> code val : <%d> ", val)
		SI (val_860026562 ==15 )
		ALORS
			nelem_860026562=nelem_860026562 - 1
		FINSI
		nelem_860026562 = nelem_860026562 - 1
		id_corr_860026562 = (g_iartout14.IDUS_NUM[nelem_860026562-1]) + (g_iartout14.IDUS_NUM[nelem_860026562-2] * 10) + 65536 * ( (g_iartout14.IDUS_NUM[nelem_860026562-3]) + (g_iartout14.IDUS_NUM[nelem_860026562-4]) * 10 )
		#trace1("__FILE__:__LINE__ ======> code	id_corr	: <%d> ", id_corr)

		erreur_860026562 = i_initialiserPrmCorr(g_iartout14)
		erreur_860026562 = i_ajouterPrmCorr(g_iartout14, pt_cascorr_860026562, id_corr_860026562)
		erreur_860026562 = i_set_art_field(g_iartout14, $TconvNE::NBUT, NB_UT_860026562)
		erreur_860026562 = i_stocke_art(g_iartout14, 0, PT_CORRELE, 0)
		erreur_860026562 = i_set_art_field(g_iartout14, $TconvNE::NBUT, NB_UTini_860026562)
	SINON
		#trace("preparation Envoi en Correlation SRP")
		i_strcpy(pt_cascorr_860026562, C_CASCORR1_860026562)
		#*********** recherche des 4 derniers chiffres du numero ***************
		nelem_860026562 = g_iartin.IDUS_NUM!NELEM
		val_860026562=g_iartin.IDUS_NUM[nelem_860026562-1]
		#trace1("__FILE__:__LINE__ ======> code val : <%d> ", val)
		SI (val_860026562 ==15 )
		ALORS
			nelem_860026562=nelem_860026562 - 1
		FINSI

		nelem_860026562 = nelem_860026562 - 1
		id_corr_860026562 = (g_iartin.IDUS_NUM[nelem_860026562-1]) + (g_iartin.IDUS_NUM[nelem_860026562-2] * 10) + 65536 *( (g_iartin.IDUS_NUM[nelem_860026562-3]) + (g_iartin.IDUS_NUM[nelem_860026562-4]) * 10 )
		#trace1("__FILE__:__LINE__ ======> code	id_corr	:	<%d> ",	id_corr)

		erreur_860026562 = i_initialiserPrmCorr(g_iartin)
		erreur_860026562 = i_ajouterPrmCorr(g_iartin, pt_cascorr_860026562, id_corr_860026562)
		erreur_860026562 = i_set_art_field(g_iartin, $TconvNE::NBUT, NB_UT_860026562)
		erreur_860026562 = i_stocke_art(g_iartin, 0, PT_CORRELE, 0)
		erreur_860026562 = i_set_art_field(g_iartin, $TconvNE::NBUT, NB_UTini_860026562)
	FINSI
FINSI

#====================================================
# Test d'envoi en Elimine des DC Accueil Gratuit
# 	1) BSS ne veut pas les DC gratuits
# 	2) Envoi des DC Gratuits a CentaureVG, Trafic, FE, FERPV si pretes a recevoir
#		 (info: date en table externe "TAG_Application", resultat: "TAG_"appli)
#====================================================

#trace1("__FILE__:__LINE__ ======> code RETOUR_CORR : <%d> ", RETOUR_CORR)
#trace1("__FILE__:__LINE__ ======> code TAG_Accueil : <%d> ", TAG_Accueil)
#trace1("__FILE__:__LINE__ ======> code TAG_gratuit : <%d> ", TAG_gratuit)

#1)------------
# BSS ne veut pas les DC gratuit
SI TAG_Accueil_860026562 && TAG_gratuit_860026562
ALORS
	bTrafBSS1_860026562 = 0
	bTrafBSS2_860026562 = 0
FINSI

#2)-----------------
# Dans le cas des DC Mono gratuit, envoi a Symphonie et 16X
SI TAG_Accueil_860026562 && TAG_gratuit_860026562
ALORS
	# Dans le cas de DC Multi (en retour de correlation) envoi en elimine car deja envoye a symphonie et 16x au premier passage
	SI RETOUR_CORR_860026562
	ALORS
		# Y a t il une ECC de fact prete
		SI bCENTVG_860026562 + bTRAFIC_860026562 + bFERPV_860026562 + bFE_860026562 == 0
		ALORS
			SAUT DISTRI_ELM
		FINSI
	FINSI
FINSI

############################################################################
# Mises au format pour les applications de sortie
############################################################################

# Partie commune a plusieurs applis
#G4R5 Lot2

#G4R5 DRE
#Recherche de la date locale dans le cas de Numero IP (commencant par 976 dont le delandeur est a la reunion ou mayotte
date_locale_860026562 = ICAR_860026562
erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_temp_860026562)
res_860026562 = i_strplcmp (pt_temp_860026562,"976",0,3)
SI res_860026562 == 0
ALORS
	SI (zone_860026562 == 4)
	ALORS
		SI B_APPEL_BANIP_860026562 == 0
		ALORS
			##########################################################################
			# Recherche instances 42L
			##########################################################################
			inst42L_860026562 = i_LireInstanceECC(C_Inst42L_860026562)

			SI (!inst42L_860026562)
			ALORS
				#trace("Pas d'instance pour 42L !")
				code_errone_860026562 = 0xA0B1
				erreur_860026562 = i_PlvMessEmettre(8601, 2, g_iartin, "", 3, code_errone_860026562, C_Inst42L_860026562, C_Article_860026562)
				SAUT DISTRI_ERR
			FINSI

			#NDRTC
			SI (i_EnvoiReqConsTabDist(TD_42L, gmt_date_860026562, i_get_art_fieldptr(g_iartin, $TconvNE::IDUS_NUM), L_NDR_860026562, 0, 1) != 0)
			ALORS
				code_errone_860026562 = 0xA0C1
				erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, C_REF42L_860026562, C_Article_860026562)
				trace("erreur i_EnvoiReqConsTabDist")
				SAUT DISTRI_ERR
			FINSI

			erreur_860026562 = i_LireReqConsTabDist()
			#trace1("RETOUR i_LireReqConsTabDist, erreur=<%d>", erreur)
			SI (erreur_860026562 != 0)
			ALORS
				#trace1("erreur i_LireReqConsTabDist: <%d>", erreur)
				code_errone_860026562 = 0xA0C1
				erreur_860026562 = i_PlvMessEmettre(8607, 2, g_iartin, "", 3, code_errone_860026562, C_REF42L_860026562, C_Article_860026562)
				SAUT DISTRI_ERR
			FINSI
			instECCv_860026562 = i_LireEntierECCv(inst42L_860026562)
			res_860026562 = i_LireInfoECC(inst42L_860026562, instECCv_860026562)

			SI (res_860026562 != 0)
			ALORS
				erreur_860026562 = i_LireImsiInfo(res_860026562, 0, 5, pt_NDRTC_MAY_860026562)
				#trace2(" Resultat de i_LireImsiInfo : <%s>", pt_NDRTC_MAY, "")
			FINSI
		FINSI

		SI B_APPEL_BANIP_860026562 == 0
		ALORS
			taille_860026562= i_conv_ascii_dcb (pt_NDRTC_MAY_860026562, pt_BUF_860026562)
		SINON
			taille_860026562= i_conv_ascii_dcb (pt_NDRTC_860026562, pt_BUF_860026562)
		FINSI
		SI taille_860026562 != 0
		ALORS
			erreur_860026562 = i_memcpy_art_field_n(g_iartout13, $Conversion::NDR, pt_BUF_860026562, taille_860026562)
			zone_860026562 = i_DHgetZoneID(C_NUMTABSEL_1_860026562, g_iartout13)
			erreur_860026562 = i_set_attr_val_n($Elibap::numzone, zone_860026562)

			SI zone_860026562 == 5
			ALORS
				date_locale_860026562 = i_DHgetLocalTime(NUMTAB_METRO_860026562, zone_860026562, ICAR_C_860026562)
				SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
				ALORS
					DateLocaleRetourCorr_860026562 = i_DHgetLocalTime(NUMTAB_METRO_860026562, zone_860026562, VARDATE_860026562)
				FINSI
			FINSI
		FINSI
	FINSI
FINSI

#DUR
# Calcul des CSV
#G4R2
#SI (bTRAFIC || bFE || bFERPV || bDM || b_TRAFBSScritCOM)
SI (bTRAFIC_860026562 || bFE_860026562 || bFERPV_860026562 || bCome_860026562 || bElig_860026562 || bDM_860026562 || b_TRAFBSScritCOM_860026562)
ALORS
	SI i_valid_field_n(g_iartout, $TconvNE::SEQ)
	ALORS
		SI MER_Kiosque_DC1_860026562 == 1 || MER_Kiosque_DC2_860026562 == 1
		ALORS
			NB_CSV_860026562 = 1
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE_NUM, pt_BUF_860026562)

			SI (i_strplcmp ( pt_BUF_860026562, "000118", 0, 6) == 0)
			ALORS
				i_get_sub_str(pt_BUF_860026562, 3, -1, pt_BUF_860026562)
			FINSI

			SI MER_Kiosque_DC2_860026562 == 1
			ALORS
				erreur_860026562 = i_format_str2(pt_BUF2_860026562,"%s%s", "12", pt_BUF_860026562)
			SINON
				erreur_860026562 = i_format_str2(pt_BUF2_860026562,"%s%s", "22", pt_BUF_860026562)
			FINSI
			i_strcpy(pt_OP_CSV_860026562, OP_CSV_860026233("KI", pt_BUF2_860026562, i_get_art_field(g_iartout, $TconvNE::dpivot)))
			i_strcpy(pt_C_CSV_860026562, C_CSV_860026233("KI", pt_BUF2_860026562, i_get_art_field(g_iartout, $TconvNE::dpivot)))
			erreur_860026562 = i_format_str2(pt_CodeTable_860026562, "%s%s", "KI", pt_BUF2_860026562)
		SINON
			seq_860026562 = i_get_art_field(g_iartout, $TconvNE::SEQ)

			SI (seq_860026562 == 2)
			ALORS
				NB_CSV_860026562 = 0
				i_strcpy(pt_OP_CSV_860026562, OP_CSV_860026233("CV", "00", i_get_art_field(g_iartout, $TconvNE::dpivot)))
				i_strcpy(pt_C_CSV_860026562, C_CSV_860026233("CV", "00", i_get_art_field(g_iartout, $TconvNE::dpivot)))
				i_strcpy(pt_CodeTable_860026562, "CV00")
			SINON
				SI i_valid_field_n(g_iartout, $TconvNE::OADC_CAU)
				ALORS
					cause_860026562 = i_get_art_field(g_iartout, $TconvNE::OADC_CAU)
				FINSI

				SI (cause_860026562 < 13) && (cause_860026562 != 4) && (cause_860026562 != 6)
				ALORS
					NB_CSV_860026562 = 1
					erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::OADC_CAU, pt_BUF_860026562)
					erreur_860026562 = i_format_str2(pt_BUF2_860026562,"%s%s", "00", pt_BUF_860026562)
					i_get_sub_str(pt_BUF2_860026562, -2, -1, pt_BUF2_860026562)
					i_strcpy(pt_OP_CSV_860026562, OP_CSV_860026233("CV", pt_BUF2_860026562, i_get_art_field(g_iartout, $TconvNE::dpivot)))
					i_strcpy(pt_C_CSV_860026562, C_CSV_860026233("CV", pt_BUF2_860026562, i_get_art_field(g_iartout, $TconvNE::dpivot)))
					erreur_860026562 = i_format_str2(pt_CodeTable_860026562, "%s%s", "CV", pt_BUF2_860026562)
				SINON
					NB_CSV_860026562 = 0
					i_strcpy(pt_OP_CSV_860026562, OP_CSV_860026233("CV", "00", i_get_art_field(g_iartout, $TconvNE::dpivot)))
					i_strcpy(pt_C_CSV_860026562, C_CSV_860026233("CV", "00", i_get_art_field(g_iartout, $TconvNE::dpivot)))
					i_strcpy(pt_CodeTable_860026562, "CV00")
				FINSI
			FINSI
		FINSI
	SINON
		NB_CSV_860026562 = 0
		i_strcpy(pt_OP_CSV_860026562, OP_CSV_860026233("CV", "00", i_get_art_field(g_iartout, $TconvNE::dpivot)))
		i_strcpy(pt_C_CSV_860026562, C_CSV_860026233("CV", "00", i_get_art_field(g_iartout, $TconvNE::dpivot)))
		i_strcpy(pt_CodeTable_860026562, "CV00")
	FINSI

	SI ((i_strcmp(pt_OP_CSV_860026562, g_inull) == 0) || (i_strcmp(pt_C_CSV_860026562, g_inull) == 0))
	ALORS
		code_errone_860026562 = 0xA0A1
		erreur_860026562 = i_PlvMessEmettre(8605, 2, g_iartin, "", 3, code_errone_860026562, C_ArtCSV_860026562, pt_CodeTable_860026562)
		SAUT DISTRI_ERR
	FINSI
FINSI
#trace1("MISE AU FORMAT **cpt_RDT <%d> ", cpt_RDT )
#trace1("MISE AU FORMAT       bEVE <%d> ", bEVE)
#trace1("MISE AU FORMAT   b16XCONV <%d> ", b16XCONV )
#
#trace1("MISE AU FORMAT        bFE <%d> ", bFE )
#trace1("MISE AU FORMAT     bFERPV <%d> ", bFERPV)
#trace1("MISE AU FORMAT        bDM <%d> ", bDM)
#trace1("MISE AU FORMAT        bSC <%d> ", bSC)
#trace1("MISE AU FORMAT bSYMPHONIE <%d> ", bSYMPHONIE )
#trace1("MISE AU FORMAT    bTRAFIC <%d> ", bTRAFIC)
#trace1("MISE AU FORMAT    b_TRAFBSScritCOM <%d> ", b_TRAFBSScritCOM)

########################################
# 		TRAFBSS
########################################
SI (bTrafBSS1_860026562 == 1 || bTrafBSS2_860026562 == 1)
ALORS
	#trace("Duplication vers TRAFBSS")
	SI (i_dup_art_dest(g_iartout, g_iartout2, C_TRAFBSS_860026562))
	ALORS
		#trace("erreur de i_dup_art_dest")
		code_errone_860026562 = 0xA0D1
		erreur_860026562 = i_PlvMessEmettre(8602, 2, g_iartin, "", 3, code_errone_860026562, C_TRAFBSS_860026562, C_Article_860026562)
		SAUT  DISTRI_ERR
	FINSI

	#DOMAINE
	erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::DOMAINE, "10")

	#SERVICE
	erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::SERVICE, "21")

	#IDUS_INF
	erreur_860026562 = i_set_art_field(g_iartout2, $TtrafBSS::IDUS_INF, idus_inf_860026562)

	#champ E par fic dup

	#champ IDUS_NUM
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
	i_get_sub_str(pt_BUF_860026562, 0, 8, pt_BUF_860026562)
	erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::IDUS_NUM, pt_BUF_860026562)

	# Champ DEDE_INF
	erreur_860026562 = i_set_art_field(g_iartout2, $TtrafBSS::DEDE_INF, DEDE_INF_860026562)

	#champ DEDE_NUM
	erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::DEDE_NUM, pt_DEDE_NUM_FACT_860026562)

	# Champ ICAR
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout2, $TtrafBSS::DATE, DateLocaleRetourCorr_860026562)
	SINON
#		erreur = i_set_art_field(g_iartout2, $TtrafBSS::DATE, ICAR)
		erreur_860026562 = i_set_art_field(g_iartout2, $TtrafBSS::DATE, date_locale_860026562)
	FINSI

	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout2, $TtrafBSS::DUREE, VARDATEFIN_860026562 - VARDATE_860026562)
	SINON
		erreur_860026562 = i_set_art_field(g_iartout2, $TtrafBSS::DUREE, DURCONV_860026562)
	FINSI

	#champ TAX
	erreur_860026562 = i_set_art_field(g_iartout2, $TtrafBSS::TAX, NB_UT_860026562)

	#champ CAX
	erreur_860026562 = i_set_art_field(g_iartout2, $TtrafBSS::CAX, CAX_860026562)

	#champ REF
	erreur_860026562 = i_set_art_field(g_iartout2, $TtrafBSS::REF, ref_860026562)

	#champ MES1
	i_strcpy (pt_temp_860026562, "255")
	erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::MES1, pt_temp_860026562)

	#champ MES2
	erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::MES2, pt_temp_860026562)

	# Champ NB_CSV
	erreur_860026562 = i_set_art_field(g_iartout2, $TtrafBSS::NB_CSV, NB_CSV_860026562)

	# Champ C_CSV1 et OP_CSV1
	SI (NB_CSV_860026562 > 0)
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::C_CSV1, pt_C_CSV_860026562 )
		erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::OP_CSV1, pt_OP_CSV_860026562 )
	FINSI

	#champ STY par fic dup
	#champ COCA par fic dup
	#champ COCAV par fic dup
	#champ IDAV_INF par fic dup
	#champ IDAV_NUM par fic dup

	# Champ SGTQS
	erreur_860026562=i_set_art_str(g_iartout2, $TtrafBSS::SGTQS, pt_SGTQS_860026562)

	#Champ MNEMO
	SI(i_valid_field_n(g_iartout, $TconvNE::MNEMO))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::MNEMO, pt_temp_860026562)
		erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::MNEMO, pt_temp_860026562)
	SINON
		i_strcpy (pt_temp_860026562, " ")
		erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::MNEMO, pt_temp_860026562)
	FINSI
	#
	#champ CLASSDEST
	erreur_860026562 = i_set_art_field(g_iartout2, $TtrafBSS::CLASSDEST, CCD_REEL_860026562)

	# champs OFFRE et OPERATEUR
	SI (bVGTplus_860026562 == 1)
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::OFFRE, pt_VGTplus_OF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::OPERATEUR, pt_VGTplus_OP_860026562)
	SINON
		SI (VGA_860026562 == 1)
		ALORS
			erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::OFFRE, pt_VGA_OF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::OPERATEUR, pt_VGA_OP_860026562)
		FINSI
	FINSI

	#champ COMPTWANA
	erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::COMPTWANA, pt_TETRIS_compte_860026562)

	#champ TYPETRAFIC
	erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::TYPETRAFIC, pt_TRAFIC_860026562)

	#champ TYPETARIF
	erreur_860026562 = i_set_art_str(g_iartout2, $TtrafBSS::TYPETARIF, pt_TARIF_860026562)

	#champ ZONE1 par fic dup
	#champ ZONE2 par fic dup
FINSI

########################################
# 		ANDROMEDE
########################################
SI bANDRO_860026562 == 1
ALORS
	#trace("Duplication vers ANDROMEDE")
	SI ( i_dup_art_dest(g_iartout,g_iartout12,C_TandromeRI_860026562) )
	ALORS
		#trace("erreur de i_dup_art_dest")
		code_errone_860026562 = 0xA0D1
		erreur_860026562 = i_PlvMessEmettre(8602, 2, g_iartin, "", 3, code_errone_860026562, C_TandromeRI_860026562, C_Article_860026562)
		SAUT  DISTRI_ERR
	FINSI

	# Champ OFFRE
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::OFFRE, "TAG   ")

	# Champ IDSV
	# ===============================================================#
	# Changement de fonction pour calculer le champ $TandromeRI::IDSV
	# utiliser num_hex_str au lieu de convNum_Str
	#=================================================================#

	valeur_860026562  = i_get_art_field(g_iartout, $TconvNE::IDSV)
	#trace1("------------ valeur = %d ---------------",valeur)
	pt_BUF_860026562 = num_hex_str_860026233(valeur_860026562)
	i_get_sub_str(pt_BUF_860026562,-2,-1,pt_BUF_860026562)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::IDSV, pt_BUF_860026562)
	#trace2("---------pt_BUF = %s -----------------",pt_BUF,"")

	# Champ CPCS
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::CPCS, 4)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::CPCS, pt_BUF_860026562)

	# Champ CCAS
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::CCAS, 4)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::CCAS, pt_BUF_860026562)

	# Champ NATACH
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::NATACH, 2)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::NATACH, pt_BUF_860026562)

	# Champ DEDE_INF
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::DEDE_INF, 2)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DEDE_INF, pt_BUF_860026562)

	# Champ DEDE1
	SI (i_valid_field_n(g_iartout, $TconvNE::DEDE1_NUM))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE1_NUM, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DEDE1, pt_BUF_860026562)
	FINSI

	# Champ DEDEini
	SI (i_valid_field_n(g_iartout, $TconvNE::DEDEINI_NUM))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDEINI_NUM, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DEDEini, pt_BUF_860026562 )
	FINSI

	# Champ DETR_INT
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::DETR_INT, 4)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DETR_INT, pt_BUF_860026562)

	# Champ DETR_INF
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::DETR_INF, 2)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DETR_INF, pt_BUF_860026562)

	# Champ DETR_NUM
	SI (i_valid_field_n(g_iartout, $TconvNE::DETR_NUM_N))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR_NUM_N, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DETR_NUM, pt_BUF_860026562)
	FINSI

	# Champ DETR1_INT
	SI (i_valid_field_n(g_iartout, $TconvNE::DETR1_INT))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::DETR1_INT, 4)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DETR1_INT, pt_BUF_860026562)
	FINSI

	# Champ DETR1_INF
	SI (i_valid_field_n(g_iartout, $TconvNE::DETR1_INF))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::DETR1_INF, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DETR1_INF, pt_BUF_860026562)
	FINSI

	# Champ DETR1_NUM
	SI (i_valid_field_n(g_iartout, $TconvNE::DETR1_NUM_N))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR1_NUM_N, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DETR1_NUM, pt_BUF_860026562)
	FINSI

	# Champ DETN_INF
	SI (i_valid_field_n(g_iartout, $TconvNE::DETN_INF))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::DETN_INF, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DETN_INF, pt_BUF_860026562)
	FINSI

	# Champ DETN_NUM
	SI (i_valid_field_n(g_iartout, $TconvNE::DETN_NUM))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETN_NUM, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DETN_NUM, pt_BUF_860026562)
	FINSI

	# Champ DETD_INF
	SI (i_valid_field_n(g_iartout, $TconvNE::DETD_INF))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::DETD_INF, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DETD_INF, pt_BUF_860026562)
	FINSI

	# Champ DETD_NUM
	SI (i_valid_field_n(g_iartout, $TconvNE::DETD_NUM))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETD_NUM, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DETD_NUM, pt_BUF_860026562)
	FINSI

	# Champ IDUS_INF
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::IDUS_INF, 2)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::IDUS_INF, pt_BUF_860026562)

	# Champ ICCM_INF
	SI (i_valid_field_n(g_iartout, $TconvNE::ICCM_INF))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::ICCM_INF, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::ICCM_INF, pt_BUF_860026562)
	FINSI

	# Champ ICCM_NUM
	SI (i_valid_field_n(g_iartout, $TconvNE::ICCM_NUM))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::ICCM_NUM, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::ICCM_NUM, pt_BUF_860026562)
	FINSI

	# Champ CDPO
	SI (i_valid_field_n(g_iartout, $TconvNE::CDPO))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::CDPO, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::CDPO, pt_BUF_860026562)
	FINSI

	# Champ CPTX
	SI (i_valid_field_n(g_iartout, $TconvNE::CPTX))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::CPTX, 4)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::CPTX, pt_BUF_860026562)
	FINSI

	# Champ TMV1
	SI (i_valid_field_n(g_iartout, $TconvNE::TMV1))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::TMV1, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::TMV1, pt_BUF_860026562)
	FINSI

	# Champ TMV2
	SI (i_valid_field_n(g_iartout, $TconvNE::TMV2))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::TMV2, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::TMV2, pt_BUF_860026562)
	FINSI

	# Champ DURP
	SI (i_valid_field_n(g_iartout, $TconvNE::DURP))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DURP, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DURP, pt_BUF_860026562)
	FINSI

	# Champ DURACC
	SI (i_valid_field_n(g_iartout, $TconvNE::DURACC))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DURACC, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DURACC, pt_BUF_860026562)
	FINSI

	# Champ DURAUT
	SI (i_valid_field_n(g_iartout, $TconvNE::DURAUT))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DURAUT, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DURAUT, pt_BUF_860026562)
	FINSI

	# Champ CDEUR
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::CDEUR, 2)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::CDEUR, pt_BUF_860026562)

	# Champ INEP
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::INEP, 2)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::INEP, pt_BUF_860026562)

	# Champ HDCONV
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::HDCONVN, pt_BUF_860026562)
	# trace2("TconvNE::HDCONVN : >%s< ",pt_BUF,"")
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::HDCONV, pt_BUF_860026562)

	# Champ INEC
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::INEC, 2)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::INEC, pt_BUF_860026562)

	# Champ TAP
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::TAP, 4)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::TAP, pt_BUF_860026562)

	# Champ SUP
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::SUP, 2)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::SUP, pt_BUF_860026562)

	# Champ ITX
	pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::ITX, 2)
	erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::ITX, pt_BUF_860026562)

	# Champ ZAA
	SI ( i_valid_field_n(g_iartout, $TconvNE::ZAA) )
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::ZAA, 4)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::ZAA, pt_BUF_860026562)
	FINSI

	# Champ ZCT
	SI (i_valid_field_n(g_iartout, $TconvNE::ZCT))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::ZCT, 4)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::ZCT, pt_BUF_860026562)
	FINSI

	# Champ ZDT
	SI (i_valid_field_n(g_iartout, $TconvNE::ZDT))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::ZDT, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::ZDT, pt_BUF_860026562)
	FINSI

	# Champ ZRG
	SI (i_valid_field_n(g_iartout, $TconvNE::ZRG))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::ZRG, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::ZRG, pt_BUF_860026562)
	FINSI

	# Champ NCCONF
	SI (i_valid_field_n(g_iartout, $TconvNE::NCC))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::NCC,pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::NCCONF, pt_BUF_860026562)
	FINSI

	# Champ PLT
	SI (i_valid_field_n(g_iartout, $TconvNE::PLT))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::PLT, 4)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::PLT, pt_BUF_860026562)
	FINSI

	# Champ DATE_DEB
	SI (i_valid_field_n(g_iartout, $TconvNE::DEBUT))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEBUT, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::DATE_DEB, pt_BUF_860026562)
	FINSI

	# Champ CPAYS
	SI (i_valid_field_n(g_iartout, $TconvNE::CPAYS))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::CPAYS, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::CPAYS, pt_BUF_860026562)
	FINSI

	# Champ IDPCS
	SI (i_valid_field_n(g_iartout, $TconvNE::IDPCS))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDPCS, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::IDPCS, pt_BUF_860026562)
	FINSI

	# Champ REFC
	SI (i_valid_field_n(g_iartout, $TconvNE::REFC))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::REFC, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::REFC, pt_BUF_860026562)
	FINSI

	# Champ SVTR  1 a 5
	SI (i_valid_field_n(g_iartout, $TconvNE::SVTR))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::SVTR, pt_BUF_860026562)
		i_get_sub_str(pt_BUF_860026562,0,9,pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::SVTR, pt_BUF_860026562)
	FINSI

	# Champ MNEMO
	SI (i_valid_field_n(g_iartout, $TconvNE::MNEMO))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::MNEMO, pt_BUF_860026562)
		i_get_sub_str(pt_BUF_860026562,0,20,pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::MNEMO, pt_BUF_860026562)
	FINSI

	# Champ REF
	SI (i_valid_field_n(g_iartout, $TconvNE::REF))
	ALORS
		ref_860026562 = i_get_art_field(g_iartout, $TconvNE::REF)
		erreur_860026562 = i_set_art_field(g_iartout13, $Conversion::REF_NUM, ref_860026562)
		erreur_860026562 = i_get_art_str(g_iartout13, $Conversion::REF_TAB, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::REF, pt_BUF_860026562)
	FINSI

	# Champ SEQ
	SI (i_valid_field_n(g_iartout, $TconvNE::SEQ))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::SEQ, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::SEQ, pt_BUF_860026562)
	FINSI

	# Champ NUTC
	SI (i_valid_field_n(g_iartout, $TconvNE::NUTC))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::NUTC, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::NUTC, pt_BUF_860026562)
	FINSI

	# Champ NUAA
	SI (i_valid_field_n(g_iartout, $TconvNE::NUAA))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::NUAA, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::NUAA, pt_BUF_860026562)
	FINSI

	# Champ TRAD
	SI (i_valid_field_n(g_iartout, $TconvNE::TRAD))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::TRAD, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::TRAD, pt_BUF_860026562)
	FINSI

	# Champ LINK_APPEL
	SI (i_valid_field_n(g_iartout, $TconvNE::APPEL))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::APPEL, 6)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::LINK_APPEL, pt_BUF_860026562)
	FINSI

	# Champ LINK_NOEUD
	SI (i_valid_field_n(g_iartout, $TconvNE::NOEUD))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::NOEUD, 4)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::LINK_NOEUD, pt_BUF_860026562)
	FINSI

	# Champ IPER_INF
	SI (i_valid_field_n(g_iartout, $TconvNE::IPER_INF))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::IPER_INF, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::IPER_INF, pt_BUF_860026562)
	FINSI

	# Champ IPER_NUM
	SI (i_valid_field_n(g_iartout, $TconvNE::IPER_NUM))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IPER_NUM,pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::IPER_NUM, pt_BUF_860026562)
	FINSI

	# Champ OADC_CAU
	SI ( i_valid_field_n(g_iartout, $TconvNE::OADC_CAU))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::OADC_CAU, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::OADC_CAU, pt_BUF_860026562)
	FINSI

	# Champ FINSER_CAU
	SI (i_valid_field_n(g_iartout, $TconvNE::FINSER_CAUSE))
	ALORS
		pt_BUF_860026562 = convNum_Str_860026233(g_iartout, $TconvNE::FINSER_CAUSE, 2)
		erreur_860026562 = i_set_art_str(g_iartout12, $TandromeRI::FINSER_CAU, pt_BUF_860026562)
	FINSI
FINSI

########################################
# 		EVE
########################################

########################################
# 		16XCONV
########################################
SI b16XCONV_860026562
ALORS
	SI SCP_860026562 || SRP_860026562
	ALORS
		#trace("Duplication vers 16XCONV")
		SI (i_dup_art_dest(g_iartout,g_iartout7,C_T16xCONV_860026562))
		ALORS
			trace("erreur de i_dup_art_dest")
			code_errone_860026562 = 0xA0D1
			erreur_860026562 = i_PlvMessEmettre(8602, 2, g_iartout, "", 3, code_errone_860026562, C_T16xCONV_860026562, C_Article_860026562)
			SAUT  DISTRI_ERR
		FINSI

		#champ DATE : on passe par Conversion pour avoir le bon format
		erreur_860026562 = i_set_art_field(g_iartout13, $Conversion::GLA2_ICAR, ICAR_ORIG_860026562 )
		erreur_860026562 = i_get_art_str(g_iartout13, $Conversion::GLA2_ICARA, pt_BUF_860026562)
		i_get_sub_str(pt_BUF_860026562, 2, -1, pt_BUF2_860026562)
		erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::GLA2_ICAR, pt_BUF2_860026562)

		# champ HFAPP
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::HFAPPN,pt_HFAPP_860026562)
		SI !(i_strcmp(pt_HFAPP_860026562,"FFFFFF"))
		ALORS
			i_strcpy(pt_HFAPP_860026562,"      ")
		FINSI

		erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::GLA2_HFAPP, pt_HFAPP_860026562)

		# Champ DEDE_NUM
		SI dede_reroute_860026562
		ALORS
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE1_NUM, pt_BUF_860026562)
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE_NUM_N, pt_BUF_860026562)
		FINSI
		Max_0dede16X_860026562 = i_strlen(pt_BUF_860026562)
		#trace2("dede16X avant FO1440 <%s> ", pt_BUF, "")
		#trace1("Max_0dede16X <%d> ", Max_0dede16X)
		Num_0dede16X_860026562 = 0
		POINT BOUCLE_0dede16X
		SI ( i_strplcmp(pt_BUF_860026562, "0", Num_0dede16X_860026562, 1) == 0)
		ALORS
			Num_0dede16X_860026562 = Num_0dede16X_860026562 + 1
			SAUT BOUCLE_0dede16X
		FINSI
		i_get_sub_str(pt_BUF_860026562, Num_0dede16X_860026562, Max_0dede16X_860026562, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::DEDE_NUM, pt_BUF_860026562)

		# Champ DEDE1_NUM
		SI !(i_valid_field_n(g_iartout, $TconvNE::DEDE1_NUM))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::DEDE1_NUM, 0x40)
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE1_NUM,pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::DEDE1_NUM, pt_BUF_860026562)
			Max_0dede16X_860026562 = i_strlen(pt_BUF_860026562)
			Num_0dede16X_860026562 = 0
			POINT BOUCLE_0dede1_16X
			SI (i_strplcmp(pt_BUF_860026562, "0", Num_0dede16X_860026562, 1) == 0)
			ALORS
				Num_0dede16X_860026562 = Num_0dede16X_860026562 + 1
				SAUT BOUCLE_0dede1_16X
			FINSI
			i_get_sub_str(pt_BUF_860026562, Num_0dede16X_860026562, Max_0dede16X_860026562, pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::DEDE1_NUM, pt_BUF_860026562)
		FINSI

		# Champ DEDEini_NUM
		erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::DEDEini_NUM, pt_DEDEini_NUM_860026562)

		# Champ DETR_INT
		gvi_860026562 = (i_get_attr_val_n($Elibap::INT_DETR) / 0x1000)
		res_860026562 = (i_get_art_field(g_iartin, $TconvNE::DETR_INT_PAY) & 0xF0FF) + (gvi_860026562 * 0x100)
		erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::DETR_INT, res_860026562)

		# Champ DETR_INF
		SI (i_valid_field_n(g_iartout, $TconvNE::DETR_INF_PAY))
		ALORS
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR_INF_PAY)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::DETR_INF, res_860026562)
		FINSI

		# Champ DETR_NUM
		SI (i_valid_field_n(g_iartout, $TconvNE::DETR_NUM_PAY))
		ALORS
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR_NUM_PAY, pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::DETR_NUM, pt_BUF_860026562)
		FINSI

		# Champ DETR1_INT
		SI ( i_valid_field_n(g_iartout, $TconvNE::DETR1_INT) )
		ALORS
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR1_INT)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::DETR1_INT, res_860026562)
		FINSI

		# Champ DETR1_INF
		SI (i_valid_field_n(g_iartout, $TconvNE::DETR1_INF_N))
		ALORS
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR1_INF_N)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::DETR1_INF, res_860026562)
		FINSI

		# Champ DETR1_NUM
		SI !(i_valid_field_n(g_iartout, $TconvNE::DETR1_NUM_N))
		ALORS
			trace("NUM_DETR1 absent !")
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::DETR1_NUM, 0x40)
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR1_NUM_N, pt_BUF_860026562)
			trace("NUM_DETR1 present !")
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::DETR1_NUM, pt_BUF_860026562)
		FINSI

		# Champ DETN_INF
		SI (i_valid_field_n(g_iartout, $TconvNE::DETN_INF))
		ALORS
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETN_INF)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::DETN_INF, res_860026562)
		FINSI

		# Champ DETN_NUM
		SI !(i_valid_field_n(g_iartout, $TconvNE::DETN_NUM))
		ALORS
			trace("DETN absent !")
			erreur_860026562=i_memset_field_n(g_iartout7, $T16xCONV::DETN_NUM, 0x40)
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETN_NUM, pt_BUF_860026562)
			trace("DETN present !")
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::DETN_NUM, pt_BUF_860026562)
		FINSI

		# Champ DETD_INF
		SI (i_valid_field_n(g_iartout, $TconvNE::DETD_INF))
		ALORS
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETD_INF)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::DETD_INF, res_860026562)
		FINSI

		# Champ DETD_NUM
		SI !(i_valid_field_n(g_iartout, $TconvNE::DETD_NUM))
		ALORS
			trace("DETD absent !")
			erreur_860026562=i_memset_field_n(g_iartout7, $T16xCONV::DETD_NUM, 0x40)
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETD_NUM, pt_BUF_860026562)
			trace("DETD present !")
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::DETD_NUM, pt_BUF_860026562)
		FINSI

		# Champ IDUS_NUM
		SI (V1S_860026562 || MLV_860026562 || b_TETRIS_FU_860026562 || b_NPF_OPT_860026562 )
		ALORS
			SI (i_strcmp(pt_IDUS_NDRTC_860026562, g_inull) != 0)
			ALORS
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::IDUS_NUM, pt_IDUS_NDRTC_860026562)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::IDUS_NUM, pt_BUF_860026562)
			FINSI
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::IDUS_NUM, pt_BUF_860026562)
		FINSI

		# Champ ICCM_INF
		SI (i_valid_field_n(g_iartout, $TconvNE::ICCM_INF))
		ALORS
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::ICCM_INF)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::ICCM_INF, res_860026562)
		FINSI

		# Champ ICCM_NUM
		SI !(i_valid_field_n(g_iartout, $TconvNE::ICCM_NUM))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::ICCM_NUM, 0x40)
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::ICCM_NUM, pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::ICCM_NUM, pt_BUF_860026562)
		FINSI

		# Champ CDPO
		SI !(i_valid_field_n(g_iartout, $TconvNE::CDPO))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::CDPO, 0x40)
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::CDPO, pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::CDPO, pt_BUF_860026562)
		FINSI

		# Champ CPTX
		SI !(i_valid_field_n(g_iartout, $TconvNE::CPTX))
		ALORS
			erreur_860026562=i_memset_field_n(g_iartout7, $T16xCONV::CPTX, 0xF0)
		SINON
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::CPTX, cptx_860026562)
		FINSI

		# Champ MV_TMV1
		SI (i_valid_field_n(g_iartout, $TconvNE::TMV1))
		ALORS
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::TMV1)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::MV_TMV1, res_860026562)
		FINSI

		# Champ MV_TMV2
		SI (i_valid_field_n(g_iartout, $TconvNE::TMV2))
		ALORS
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::TMV2)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::MV_TMV2, res_860026562)
		FINSI

		# Champ MV_DURP
		SI !(i_valid_field_n(g_iartout, $TconvNE::DURP))
		ALORS
			erreur_860026562=i_memset_field_n(g_iartout7, $T16xCONV::MV_DURP, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::DURP)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::MV_DURP, res_860026562)
		FINSI

		# Champ MV_DURACC
		SI !(i_valid_field_n(g_iartout, $TconvNE::DURACC))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::MV_DURACC, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::DURACC)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::MV_DURACC, res_860026562)
		FINSI

		# Champ MV_DURAUT
		SI !(i_valid_field_n(g_iartout, $TconvNE::DURAUT))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::MV_DURAUT, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::DURAUT)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::MV_DURAUT, res_860026562)
		FINSI

		#Champ TLA_HDCONV
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::HDCONVN, pt_BUF_860026562)
		SI (i_strcmp(pt_BUF_860026562, "FFFFFF"))
		ALORS
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::TLA_HDCONV, pt_BUF_860026562)
		FINSI

		# Champ TLA_TAP (Conversion binaire de l'octet 1 (0 a 255) dans TAP1
		#		(Conversion binaire de l'octet 2 (0 a 255) dans TAP2
		SI (i_valid_field_n(g_iartout, $TconvNE::TAP))
		ALORS
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::TAP)
			res1_860026562 = res_860026562 / 0x100
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::TLA_TAP1, res1_860026562)
			res1_860026562 = res_860026562 & 0xFF
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::TLA_TAP2, res1_860026562)
		FINSI

		# Champ DECGEO_ZAA
		SI !(i_valid_field_n(g_iartout, $TconvNE::ZAA))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::DECGEO_ZAA, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::ZAA)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::DECGEO_ZAA, res_860026562)
		FINSI

		# Champ DECGEO_ZCT
		SI !(i_valid_field_n(g_iartout, $TconvNE::ZCT))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::DECGEO_ZCT, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::ZCT)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::DECGEO_ZCT, res_860026562)
		FINSI

		# Champ DECGEO_ZDT
		SI !(i_valid_field_n(g_iartout, $TconvNE::ZDT))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::DECGEO_ZDT, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::ZDT)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::DECGEO_ZDT, res_860026562)
		FINSI

		# Champ DECGEO_ZRG
		SI !(i_valid_field_n(g_iartout, $TconvNE::ZRG))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::DECGEO_ZRG, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::ZRG)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::DECGEO_ZRG, res_860026562)
		FINSI

		# Champ PLT
		SI (i_valid_field_n(g_iartout, $TconvNE::PLT))
		ALORS
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::PLT)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::PLT, res_860026562)
		FINSI

		# Champ RDIP_DATE
		SI !(i_valid_field_n(g_iartout, $TconvNE::DEBUT))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::RDIP_DATE, 0x40)
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEBUT, pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::RDIP_DATE, pt_BUF_860026562)
		FINSI

		# Champ RDIP_CPAYS
		SI (i_valid_field_n(g_iartout, $TconvNE::CPAYS))
		ALORS
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::CPAYS, pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::RDIP_CPAYS, pt_BUF_860026562)
		SINON
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::RDIP_CPAYS, "0033")
		FINSI

		# Champ RDIP_IDPCS
		SI !(i_valid_field_n(g_iartout, $TconvNE::IDPCS))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::RDIP_IDPCS, 0x40)
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDPCS, pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::RDIP_IDPCS, pt_BUF_860026562)
		FINSI

		# Champ RDIP_REFC
		SI !(i_valid_field_n(g_iartout, $TconvNE::REFC))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::RDIP_REFC, 0x40)
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::REFC,pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::RDIP_REFC, pt_BUF_860026562)
		FINSI

		# Champ LISTE_SVTR1 a 10
		SI ( i_valid_field_n(g_iartout, $TconvNE::SVTR))
		ALORS
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::SVTR,pt_BUF_860026562)
			Max_SVTR_860026562 = i_strlen(pt_BUF_860026562) / 2
			Num_SVTR_860026562 = 0
			Ind_SVTR_860026562 = i_get_field_num(g_iartout7,"LISTE_SVTR1")
			POINT BOUCLE_SVTR
			erreur_860026562 = i_set_art_field(g_iartout7, Ind_SVTR_860026562 + Num_SVTR_860026562, g_iartout.SVTR[Num_SVTR_860026562])
			Num_SVTR_860026562 = Num_SVTR_860026562 + 1
			SI (Num_SVTR_860026562 < Max_SVTR_860026562)
			ALORS
				SAUT BOUCLE_SVTR
			FINSI
		FINSI

		# Champ ENAP_REF
		SI !(i_valid_field_n(g_iartout, $TconvNE::REF))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::ENAP_REF, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::REF)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::ENAP_REF, res_860026562)
		FINSI

		# Champ ENAP_SEQ
		SI !(i_valid_field_n(g_iartout, $TconvNE::SEQ))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::ENAP_SEQ, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::SEQ)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::ENAP_SEQ, res_860026562)
		FINSI

		# Champ TRABO_NUTC
		SI !(i_valid_field_n(g_iartout, $TconvNE::NUTC))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::TRABO_NUTC, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::NUTC)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::TRABO_NUTC, res_860026562)
		FINSI

		# Champ TRABO_NUAA
		SI !(i_valid_field_n(g_iartout, $TconvNE::NUAA))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::TRABO_NUAA, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::NUAA)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::TRABO_NUAA, res_860026562)
		FINSI

		# Champ TRAD
		SI (i_valid_field_n(g_iartout, $TconvNE::TRAD))
		ALORS
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::TRAD)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::TRAD, res_860026562)
		FINSI

		# Champ IPER_INF
		SI !(i_valid_field_n(g_iartout, $TconvNE::IPER_INF))
		ALORS
			erreur_860026562=i_set_art_field(g_iartout7, $T16xCONV::IPER_INF, 0x00)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::IPER_INF)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::IPER_INF, res_860026562)
		FINSI

		# Champ IPER_NUM
		SI b_CodOperVG_860026562
		ALORS
			erreur_860026562 = i_set_art_str(g_iartout13, $Conversion::IPER_NUM, pt_CodOperVG_860026562)
			g_iartout13.IPER_NUMDCB[0] = 0
			erreur_860026562 = i_dup_chp_1val(g_iartout13,g_iartout7, $Conversion::IPER_NUMDCB, $T16xCONV::IPER_NUM)
		SINON
			SI !(i_valid_field_n(g_iartout, $TconvNE::IPER_NUM))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::IPER_NUM, 0x40)
			SINON
				erreur_860026562 = i_dup_chp_1val(g_iartin,g_iartout7, $TconvNE::IPER_NUM, $T16xCONV::IPER_NUM)
			FINSI
		FINSI

		# Champ CCDEUR
		SI !(i_valid_field_n(g_iartout, $TconvNE::CODCIRDR))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::CCDEUR, 0x40)
		SINON
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::CODCIRDR, pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::CCDEUR, pt_BUF_860026562)
		FINSI

		# Champ CCD
		res_860026562 = CCD_860026562
		SI (res_860026562 == 0xff)
		ALORS
			res_860026562 = 0
		FINSI
		erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::CCD, res_860026562)

		# Champ VCDR2
		SI !(i_valid_field_n(g_iartout, $TconvNE::TAX1))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::VCDR2, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::TAX1)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::VCDR2, res_860026562)
		FINSI

		# Champ VCDR3
		SI !(i_valid_field_n(g_iartout, $TconvNE::TAX2))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::VCDR3, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::TAX2)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::VCDR3, res_860026562)
		FINSI

		# Champ VMV1_1
		SI !(i_valid_field_n(g_iartout, $TconvNE::VMV1_1))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::VMV1_1, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::VMV1_1)
			SI (res_860026562 == 0xff)
			ALORS
				res_860026562 = 0
			FINSI
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::VMV1_1, res_860026562)
		FINSI

		# Champ VMV1_2
		SI !(i_valid_field_n(g_iartout, $TconvNE::VMV1_2))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::VMV1_2, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::VMV1_2)
			SI (res_860026562 == 0xff)
			ALORS
				res_860026562 = 0
			FINSI
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::VMV1_2, res_860026562)
		FINSI

		# Champ VMV1_3
		SI !(i_valid_field_n(g_iartout, $TconvNE::VMV1_3))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::VMV1_3, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::VMV1_3)
			SI (res_860026562 == 0xff)
			ALORS
				res_860026562 = 0
			FINSI
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::VMV1_3, res_860026562)
		FINSI

		# Champ VMV2_1
		SI !(i_valid_field_n(g_iartout, $TconvNE::VMV2_1))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::VMV2_1, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::VMV2_1)
			SI (res_860026562 == 0xff)
			ALORS
				res_860026562 = 0
			FINSI
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::VMV2_1, res_860026562)
		FINSI

		# Champ VMV2_2
		SI !(i_valid_field_n(g_iartout, $TconvNE::VMV2_2))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::VMV2_2, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::VMV2_2)
			SI (res_860026562 == 0xff)
			ALORS
				res_860026562 = 0
			FINSI
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::VMV2_2, res_860026562)
		FINSI

		# Champ VMV2_3
		SI !(i_valid_field_n(g_iartout, $TconvNE::VMV2_3))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::VMV2_3, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::VMV2_3)
			SI (res_860026562 == 0xff)
			ALORS
				res_860026562 = 0
			FINSI
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::VMV2_3, res_860026562)
		FINSI

		# Champ DURFACT
		SI !(i_valid_field_n(g_iartout, $TconvNE::DURFACT))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::DURFACT, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::DURFACT)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::DURFACT, res_860026562)
		FINSI

		# Champ OADC_CAU
		SI !(i_valid_field_n(g_iartout, $TconvNE::OADC_CAU))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::OADC_CAU, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::OADC_CAU)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::OADC_CAU, res_860026562)
		FINSI

		# Champ FINSER_CAU
		SI !(i_valid_field_n(g_iartout, $TconvNE::FINSER_CAUSE))
		ALORS
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::FINSER, 0xF0)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::FINSER_CAUSE)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONV::FINSER, res_860026562)
		FINSI

		# Champ NDIP
		SI (IDUS_IP_860026562 || b_NPF_SIP_860026562 || TYPAR_SIPFE_860026562 || b_TETRIS_TRAFBSS_860026562 || V1S_860026562 || MLV_860026562)
		ALORS
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONV::NDIP, pt_BUF_860026562)
		SINON
			erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONV::NDIP, 0x40)
		FINSI
	SINON
		SI CPS_860026562
		ALORS
			#trace("Duplication vers 16XCONVCPS")
			SI (i_dup_art_dest(g_iartout,g_iartout7,C_T16xCONVCPS_860026562))
			ALORS
				trace("erreur de i_dup_art_dest")
				code_errone_860026562 = 0xA0D1
				erreur_860026562 = i_PlvMessEmettre(8602, 2, g_iartout, "", 3, code_errone_860026562, C_T16xCONVCPS_860026562, C_Article_860026562)
				SAUT  DISTRI_ERR
			FINSI

			#champ DATE : on passe par Conversion pour avoir le bon format
			erreur_860026562 = i_set_art_field(g_iartout13, $Conversion::GLA2_ICAR, ICAR_ORIG_860026562 )
			erreur_860026562 = i_get_art_str(g_iartout13, $Conversion::GLA2_ICARA, pt_BUF_860026562)
			i_get_sub_str(pt_BUF_860026562, 2, -1, pt_BUF2_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::GLA2_ICAR, pt_BUF2_860026562)

			# champ HFAPP
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::HFAPPN,pt_HFAPP_860026562)
			SI !(i_strcmp(pt_HFAPP_860026562,"FFFFFF"))
			ALORS
				i_strcpy(pt_HFAPP_860026562,"      ")
			FINSI
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::GLA2_HFAPP, pt_HFAPP_860026562)

			# Champ DEDE_NUM
			SI dede_reroute_860026562
			ALORS
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE1_NUM, pt_BUF_860026562)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE_NUM_N, pt_BUF_860026562)
			FINSI
			Max_0dede16X_860026562 = i_strlen(pt_BUF_860026562)
			#trace2("dede16X avant FO1440 <%s> ", pt_BUF, "")
			#trace1("Max_0dede16X <%d> ", Max_0dede16X)
			Num_0dede16X_860026562 = 0
			POINT CPSBOUCLE_0dede16X
			SI ( i_strplcmp(pt_BUF_860026562, "0", Num_0dede16X_860026562, 1) == 0)
			ALORS
				Num_0dede16X_860026562 = Num_0dede16X_860026562 + 1
				SAUT CPSBOUCLE_0dede16X
			FINSI
			i_get_sub_str(pt_BUF_860026562, Num_0dede16X_860026562, Max_0dede16X_860026562, pt_BUF_860026562)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::DEDE_NUM, pt_BUF_860026562)

			# Champ DEDE1_NUM
			SI !(i_valid_field_n(g_iartout, $TconvNE::DEDE1_NUM))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::DEDE1_NUM, 0x40)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEDE1_NUM,pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::DEDE1_NUM, pt_BUF_860026562)
				Max_0dede16X_860026562 = i_strlen(pt_BUF_860026562)
				Num_0dede16X_860026562 = 0
				POINT CPSBOUCLE_0dede1_16X
				SI (i_strplcmp(pt_BUF_860026562, "0", Num_0dede16X_860026562, 1) == 0)
				ALORS
					Num_0dede16X_860026562 = Num_0dede16X_860026562 + 1
					SAUT CPSBOUCLE_0dede1_16X
				FINSI
				i_get_sub_str(pt_BUF_860026562, Num_0dede16X_860026562, Max_0dede16X_860026562, pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::DEDE1_NUM, pt_BUF_860026562)
			FINSI

			# Champ DEDEini_NUM
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::DEDEini_NUM, pt_DEDEini_NUM_860026562)

			# Champ DEDEini2_NUM
			#SI i_valid_field_n(g_iartin, $TconvNE::T3dedeini2)
			#ALORS
			# G4R5 QC785
			#erreur = i_get_art_str(g_iartout, $TconvNE::DEDEINI2_NUM, pt_DEDEini2_NUM)
			erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::DEDEini2_NUM, pt_DEDEini2_NUM_860026562)
			#FINSI

			# Champ DETR_INT
##### G4R6 QC805 #####
			#gvi = (i_get_attr_val_n($Elibap::INT_DETR) / 0x1000)
			#res = (i_get_art_field(g_iartin, $TconvNE::DETR_INT_PAY) & 0xF0FF) + (gvi * 0x100)
			res_860026562 = i_get_art_field(g_iartin, $TconvNE::DETR_INT)
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::DETR_INT, res_860026562)
##### G4R6 QC805 #####

			# Champ DETR_INF
			SI (i_valid_field_n(g_iartout, $TconvNE::DETR_INF_PAY))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR_INF_PAY)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::DETR_INF, res_860026562)
			FINSI

			# Champ DETR_NUM
			SI (i_valid_field_n(g_iartout, $TconvNE::DETR_NUM_PAY))
			ALORS
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR_NUM_PAY, pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::DETR_NUM, pt_BUF_860026562)
			FINSI

			# Champ DETR1_INT
			SI ( i_valid_field_n(g_iartout, $TconvNE::DETR1_INT) )
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR1_INT)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::DETR1_INT, res_860026562)
			FINSI

			# Champ DETR1_INF
			SI (i_valid_field_n(g_iartout, $TconvNE::DETR1_INF_N))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETR1_INF_N)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::DETR1_INF, res_860026562)
			FINSI

			# Champ DETR1_NUM
			SI !(i_valid_field_n(g_iartout, $TconvNE::DETR1_NUM_N))
			ALORS
				trace("NUM_DETR1 absent !")
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::DETR1_NUM, 0x40)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETR1_NUM_N, pt_BUF_860026562)
				trace("NUM_DETR1 present !")
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::DETR1_NUM, pt_BUF_860026562)
			FINSI

			# Champ DETN_INF
			SI (i_valid_field_n(g_iartout, $TconvNE::DETN_INF))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETN_INF)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::DETN_INF, res_860026562)
			FINSI

			# Champ DETN_NUM
			SI !(i_valid_field_n(g_iartout, $TconvNE::DETN_NUM))
			ALORS
				trace("DETN absent !")
				erreur_860026562=i_memset_field_n(g_iartout7, $T16xCONVCPS::DETN_NUM, 0x40)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETN_NUM, pt_BUF_860026562)
				trace("DETN present !")
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::DETN_NUM, pt_BUF_860026562)
			FINSI

			# Champ DETD_INF
			SI (i_valid_field_n(g_iartout, $TconvNE::DETD_INF))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::DETD_INF)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::DETD_INF, res_860026562)
			FINSI

			# Champ DETD_NUM
			SI !(i_valid_field_n(g_iartout, $TconvNE::DETD_NUM))
			ALORS
				trace("DETD absent !")
				erreur_860026562=i_memset_field_n(g_iartout7, $T16xCONVCPS::DETD_NUM, 0x40)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DETD_NUM, pt_BUF_860026562)
				trace("DETD present !")
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::DETD_NUM, pt_BUF_860026562)
			FINSI

			# Champ IDUS_NUM
			SI (V1S_860026562 || MLV_860026562 || b_TETRIS_FU_860026562 || b_NPF_OPT_860026562 )
			ALORS
				SI (i_strcmp(pt_IDUS_NDRTC_860026562, g_inull) != 0)
				ALORS
					erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::IDUS_NUM, pt_IDUS_NDRTC_860026562)
				SINON
					erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
					erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::IDUS_NUM, pt_BUF_860026562)
				FINSI
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::IDUS_NUM, pt_BUF_860026562)
			FINSI

			# Champ ICCM_INF
			SI (i_valid_field_n(g_iartout, $TconvNE::ICCM_INF))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::ICCM_INF)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::ICCM_INF, res_860026562)
			FINSI

			# Champ ICCM_NUM
			SI !(i_valid_field_n(g_iartout, $TconvNE::ICCM_NUM))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::ICCM_NUM, 0x40)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::ICCM_NUM, pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::ICCM_NUM, pt_BUF_860026562)
			FINSI

			# Champ CDPO
			SI !(i_valid_field_n(g_iartout, $TconvNE::CDPO))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::CDPO, 0x40)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::CDPO, pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::CDPO, pt_BUF_860026562)
			FINSI

			# Champ MV_TMV1
			SI (i_valid_field_n(g_iartout, $TconvNE::TMV1))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::TMV1)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::MV_TMV1, res_860026562)
			FINSI

			# Champ MV_TMV2
			SI (i_valid_field_n(g_iartout, $TconvNE::TMV2))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::TMV2)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::MV_TMV2, res_860026562)
			FINSI

			# Champ MV_DURP
			SI !(i_valid_field_n(g_iartout, $TconvNE::DURP))
			ALORS
				erreur_860026562=i_memset_field_n(g_iartout7, $T16xCONVCPS::MV_DURP, 0xF0)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::DURP)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::MV_DURP, res_860026562)
			FINSI

			# Champ MV_DURACC
			SI !(i_valid_field_n(g_iartout, $TconvNE::DURACC))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::MV_DURACC, 0xF0)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::DURACC)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::MV_DURACC, res_860026562)
			FINSI

			# Champ MV_DURAUT
			SI !(i_valid_field_n(g_iartout, $TconvNE::DURAUT))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::MV_DURAUT, 0xF0)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::DURAUT)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::MV_DURAUT, res_860026562)
			FINSI

			#Champ TLA_HDCONV
			erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::HDCONVN, pt_BUF_860026562)
			SI (i_strcmp(pt_BUF_860026562, "FFFFFF"))
			ALORS
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::TLA_HDCONV, pt_BUF_860026562)
			FINSI

			# Champ TLA_TAP (Conversion binaire de l'octet 1 (0 a 255) dans TAP1
			#		(Conversion binaire de l'octet 2 (0 a 255) dans TAP2
			SI (i_valid_field_n(g_iartout, $TconvNE::TAP))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::TAP)
				res1_860026562 = res_860026562 / 0x100
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::TLA_TAP1, res1_860026562)
				res1_860026562 = res_860026562 & 0xFF
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::TLA_TAP2, res1_860026562)
			FINSI

			# Champ DECGEO_ZAA
			SI !(i_valid_field_n(g_iartout, $TconvNE::ZAA))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::DECGEO_ZAA, 0xF0)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::ZAA)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::DECGEO_ZAA, res_860026562)
			FINSI

			# Champ DECGEO_ZCT
			SI !(i_valid_field_n(g_iartout, $TconvNE::ZCT))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::DECGEO_ZCT, 0xF0)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::ZCT)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::DECGEO_ZCT, res_860026562)
			FINSI

			# Champ DECGEO_ZDT
			SI !(i_valid_field_n(g_iartout, $TconvNE::ZDT))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::DECGEO_ZDT, 0xF0)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::ZDT)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::DECGEO_ZDT, res_860026562)
			FINSI

			# Champ DECGEO_ZRG
			SI !(i_valid_field_n(g_iartout, $TconvNE::ZRG))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::DECGEO_ZRG, 0xF0)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::ZRG)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::DECGEO_ZRG, res_860026562)
			FINSI

			# Champ PLT
			SI (i_valid_field_n(g_iartout, $TconvNE::PLT))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::PLT)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::PLT, res_860026562)
			FINSI

			# Champ RDIP_DATE
			SI !(i_valid_field_n(g_iartout, $TconvNE::DEBUT))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::RDIP_DATE, 0x40)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::DEBUT, pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::RDIP_DATE, pt_BUF_860026562)
			FINSI

			# Champ RDIP_CPAYS
			SI (i_valid_field_n(g_iartout, $TconvNE::CPAYS))
			ALORS
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::CPAYS, pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::RDIP_CPAYS, pt_BUF_860026562)
			SINON
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::RDIP_CPAYS, "0033")
			FINSI

			# Champ RDIP_IDPCS
			SI !(i_valid_field_n(g_iartout, $TconvNE::IDPCS))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::RDIP_IDPCS, 0x40)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDPCS, pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::RDIP_IDPCS, pt_BUF_860026562)
			FINSI

			# Champ RDIP_REFC
			SI !(i_valid_field_n(g_iartout, $TconvNE::REFC))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::RDIP_REFC, 0x40)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::REFC,pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::RDIP_REFC, pt_BUF_860026562)
			FINSI

			# Champ LISTE_SVTR1 a 10
			SI ( i_valid_field_n(g_iartout, $TconvNE::SVTR))
			ALORS
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::SVTR,pt_BUF_860026562)
				Max_SVTR_860026562 = i_strlen(pt_BUF_860026562) / 2
				Num_SVTR_860026562 = 0
				Ind_SVTR_860026562 = i_get_field_num(g_iartout7,"LISTE_SVTR1")
				POINT CPSBOUCLE_SVTR
				erreur_860026562 = i_set_art_field(g_iartout7, Ind_SVTR_860026562 + Num_SVTR_860026562, g_iartout.SVTR[Num_SVTR_860026562])
				Num_SVTR_860026562 = Num_SVTR_860026562 + 1
				SI (Num_SVTR_860026562 < Max_SVTR_860026562)
				ALORS
					SAUT CPSBOUCLE_SVTR
				FINSI
			FINSI

			# Champ ENAP_REF
			SI !(i_valid_field_n(g_iartout, $TconvNE::REF))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::ENAP_REF, 0xF0)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::REF)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::ENAP_REF, res_860026562)
			FINSI

			# Champ ENAP_SEQ
			SI !(i_valid_field_n(g_iartout, $TconvNE::SEQ))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::ENAP_SEQ, 0xF0)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::SEQ)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::ENAP_SEQ, res_860026562)
			FINSI

			# Champ TRAD
			SI (i_valid_field_n(g_iartout, $TconvNE::TRAD))
			ALORS
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::TRAD)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::TRAD, res_860026562)
			FINSI

			# Champ IPER_INF
			SI !(i_valid_field_n(g_iartout, $TconvNE::IPER_INF))
			ALORS
				erreur_860026562=i_set_art_field(g_iartout7, $T16xCONVCPS::IPER_INF, 0x00)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::IPER_INF)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::IPER_INF, res_860026562)
			FINSI

			# Champ IPER_NUM
			SI b_CodOperVG_860026562
			ALORS
				erreur_860026562 = i_set_art_str(g_iartout13, $Conversion::IPER_NUM, pt_CodOperVG_860026562)
				g_iartout13.IPER_NUMDCB[0] = 0
				erreur_860026562 = i_dup_chp_1val(g_iartout13,g_iartout7, $Conversion::IPER_NUMDCB, $T16xCONVCPS::IPER_NUM)
			SINON
				SI !(i_valid_field_n(g_iartout, $TconvNE::IPER_NUM))
				ALORS
					erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::IPER_NUM, 0x40)
				SINON
					erreur_860026562 = i_dup_chp_1val(g_iartin,g_iartout7, $TconvNE::IPER_NUM, $T16xCONVCPS::IPER_NUM)
				FINSI
			FINSI

			# Champ CCDEUR
			SI !(i_valid_field_n(g_iartout, $TconvNE::CODCIRDR))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::CCDEUR, 0x40)
			SINON
				erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::CODCIRDR, pt_BUF_860026562)
				erreur_860026562 = i_set_art_str(g_iartout7, $T16xCONVCPS::CCDEUR, pt_BUF_860026562)
			FINSI

			# Champ CCD
			res_860026562 = CCD_860026562
			SI (res_860026562 == 0xff)
			ALORS
				res_860026562 = 0
			FINSI
			erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::CCD, res_860026562)

			# Champ OADC_CAU
			SI !(i_valid_field_n(g_iartout, $TconvNE::OADC_CAU))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::OADC_CAU, 0xF0)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::OADC_CAU)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::OADC_CAU, res_860026562)
			FINSI

			# Champ FINSER_CAU
			SI !(i_valid_field_n(g_iartout, $TconvNE::FINSER_CAUSE))
			ALORS
				erreur_860026562 = i_memset_field_n(g_iartout7, $T16xCONVCPS::FINSER, 0xF0)
			SINON
				res_860026562 = i_get_art_field(g_iartout, $TconvNE::FINSER_CAUSE)
				erreur_860026562 = i_set_art_field(g_iartout7, $T16xCONVCPS::FINSER, res_860026562)
			FINSI
		FINSI
	FINSI
FINSI

########################################
# 		FE
########################################
# Remarque : pour la mise au format FE, on duplique l'article en Tfe (article generique FE) et non pas en Tfe_durcom (article dedie Audiotel).
# Cet article sera neanmoins identifie en Tfe_durcom par l'IECC en raison de la valeur 21 du champ SERVICE.
# Le codage de Tfe et Tfe_durcom etant identique (aux metachamps pres) et l'enveloppe Elibap etant enrichie avec OPT_DURCOM, on peut indifferemment travailler sur l'un ou l'autre en distribution.
# De cette maniere, a terme, lorsque la chaine Audiotel aura entierement migre, il sera possible de retirer simplement du parametrage les objets (cas d'article et algo) specifiques Audiotel.
# Attention, lors de ce nettoyage, il faudra aussi modifier l'arbre de reco Dfe.
SI bFE_860026562
ALORS
	#trace("Duplication vers FE")
	SI(i_dup_art_dest(g_iartout, g_iartout4, C_Tfe_860026562))
	ALORS
		trace( "erreur de duplication de TconvNE vers Tfe" )
		code_errone_860026562 = 0xA0D1
		erreur_860026562 = i_PlvMessEmettre(8602, 2, g_iartout, "", 3, code_errone_860026562, C_Tfe_860026562, C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	# Champ SERVICE
	erreur_860026562 = i_set_art_str(g_iartout4, $Tfe::SERVICE, "21")

	# Champ IDUS_INF
	SI (idus_inf_860026562 & 0x80)
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout4, $Tfe::IDUS_INF, 192)
	SINON
		erreur_860026562 = i_set_art_field(g_iartout4, $Tfe::IDUS_INF, 128)
	FINSI

	# Champ IDUS_NUM
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
	erreur_860026562 = i_set_art_str(g_iartout4, $Tfe::IDUS_NUM, pt_BUF_860026562)

	# Champ DEDE_INF
	erreur_860026562 = i_set_art_field(g_iartout4, $Tfe::DEDE_INF, DEDE_INF_860026562)

	# Champ DEDE_NUM
	erreur_860026562 = i_set_art_str(g_iartout4, $Tfe::DEDE_NUM, pt_DEDE_NUM_FACT_860026562)

	# Champ DATE
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout4,$Tfe::DATE, DateLocaleRetourCorr_860026562)
	SINON
#		erreur = i_set_art_field(g_iartout4,$Tfe::DATE, ICAR)
		erreur_860026562 = i_set_art_field(g_iartout4,$Tfe::DATE, date_locale_860026562)
	FINSI

	# Champ DUREE
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout4, $Tfe::DUREE, VARDATEFIN_860026562 - VARDATE_860026562)
	SINON
		erreur_860026562 = i_set_art_field(g_iartout4, $Tfe::DUREE, DURCONV_860026562)
	FINSI

	# Champ CAX
	erreur_860026562 = i_set_art_field(g_iartout4, $Tfe::CAX, CAX_860026562)

	# Champ TAX
	erreur_860026562 = i_set_art_field(g_iartout4, $Tfe::TAX, NB_UT_860026562)


	# Champ SUP
	erreur_860026562 = i_set_art_field(g_iartout4, $Tfe::SUP, SUP_860026562)

	# Champ REF
	erreur_860026562 = i_set_art_field(g_iartout4, $Tfe::REF, ref_860026562)

	### Champ NB_CSV
	erreur_860026562 = i_set_art_field(g_iartout4, $Tfe::NB_CSV, NB_CSV_860026562)

	# Champ C_CSVi et OP_CSVi:
	SI (NB_CSV_860026562 > 0)
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout4, $Tfe::C_CSV1, pt_C_CSV_860026562)
		erreur_860026562 = i_set_art_str(g_iartout4, $Tfe::OP_CSV1, pt_OP_CSV_860026562)
	FINSI

	# Champ MNEMO
	SI( i_valid_field_n( g_iartout, $TconvNE::MNEMO ) )
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::MNEMO, pt_temp_860026562)
		erreur_860026562 = i_set_art_str(g_iartout4, $Tfe::MNEMO, pt_temp_860026562)
	FINSI

	# Champ CLASSDEST CCD
	erreur_860026562 = i_set_art_field(g_iartout4, $Tfe::CLASSDEST, CCD_REEL_860026562)

	# Champ TAG
	SI TAG_Accueil_860026562
	ALORS
		SI TAG_gratuit_860026562
		ALORS
			erreur_860026562 = i_set_art_str(g_iartout4, $Tfe::TAG, "1")
		SINON
			erreur_860026562 = i_set_art_str(g_iartout4, $Tfe::TAG, "2")
		FINSI
	FINSI

	# G4R6 Lot3
	# TYPE_EDIT
	erreur_860026562=i_set_art_str(g_iartout4, $Tfe::TYPE_EDIT, pt_TYPE_EDIT_860026562)

	# CODE_TARIF
	erreur_860026562=i_set_art_str(g_iartout4, $Tfe::CODE_TARIF, pt_CODE_TARIF_860026562)
	# \G4R6 Lot3

FINSI

# FCT => Supprimee

########################################
# 		FERPV
########################################
SI bFERPV_860026562
ALORS
	#trace("Duplication vers FERPV")
	SI(i_dup_art_dest(g_iartout, g_iartout11, C_Tfe_rpv_860026562))
	ALORS
		trace( "erreur de duplication de Tauddce vers Tfe_rpv")
		code_errone_860026562 = 0xA0D1
		erreur_860026562 = i_PlvMessEmettre(8602, 2, g_iartout, "", 3, code_errone_860026562, C_Tfe_rpv_860026562, C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	# Champ SERVICE
	SI (b_OperNBE_860026562 && (bVGTplus_860026562 || b_FFMV3_860026562))
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::SERVICE, "8")
	SINON
		SI (TYPAR_SIPFE_860026562 == 1 || TYPAR_BIV_SIP_860026562 == 1)
		ALORS
			erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::SERVICE, "6")
		SINON
			erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::SERVICE, pt_service_860026562)
		FINSI
	FINSI

	# SOURCE
	SI (b_OperNBE_860026562 && (bVGTplus_860026562 || b_FFMV3_860026562))
	ALORS
		erreur_860026562=i_set_art_str(g_iartout11, $Tfe_rpv::SOURCE, "19")
	SINON
		SI (TYPAR_SIPFE_860026562 == 1)
		ALORS
			erreur_860026562=i_set_art_str(g_iartout11, $Tfe_rpv::SOURCE, "16")
		SINON
			SI (TYPAR_BIV_SIP_860026562 == 1)
			ALORS
				erreur_860026562=i_set_art_str(g_iartout11, $Tfe_rpv::SOURCE, "18")
			SINON
				erreur_860026562=i_set_art_str(g_iartout11, $Tfe_rpv::SOURCE, "03")
			FINSI
		FINSI
	FINSI

	# Champ NUMDDR
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
	erreur_860026562 = i_format_str2(pt_BUF2_860026562,"0%s", pt_BUF_860026562, 0)
	erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::NUMDDR, pt_BUF2_860026562)

	# Champ NUMDDE
	# valorisation du champ NUMDDE avec le numero demande sans faire des controles sur DEDE_INF.
	erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::NUMDDE, pt_DEDE_NUM_FACT_860026562)

	# Champ DEBUT
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1  && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout11,$Tfe_rpv::DEBUT, DateLocaleRetourCorr_860026562)
	SINON
#		erreur = i_set_art_field(g_iartout11,$Tfe_rpv::DEBUT, ICAR)
		erreur_860026562 = i_set_art_field(g_iartout11,$Tfe_rpv::DEBUT, date_locale_860026562)
	FINSI

	# Champ DUREE
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1  && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout11, $Tfe_rpv::DUREE, VARDATEFIN_860026562 - VARDATE_860026562)
	SINON
		erreur_860026562 = i_set_art_field(g_iartout11, $Tfe_rpv::DUREE, DURCONV_860026562)
	FINSI

	# Champ NBUT
	erreur_860026562 = i_set_art_field(g_iartout11,$Tfe_rpv::NBUT, NB_UT_860026562)

	# Champ CANAL
	erreur_860026562 = i_set_art_field(g_iartout11, $Tfe_rpv::CANAL, ref_860026562)

	#TYPACCRI
	SI (TYPAR_SIPFE_860026562 == 1)
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::TYPACCRI,"1")
	SINON
		erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::TYPACCRI,"")
	FINSI

	#NATAPPRI
	SI (TYPAR_SIPFE_860026562 == 1)
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::NATAPPRI,"1")
	SINON
		erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::NATAPPRI,"0")
	FINSI

	# Champ NB_CSV
	erreur_860026562 = i_set_art_field(g_iartout11, $Tfe_rpv::NBCOD, NB_CSV_860026562)

	# Champ C_CSV et OP_CSV
	SI (NB_CSV_860026562 > 0)
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::C_CSV1, pt_C_CSV_860026562)
		erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::OP_CSV1, pt_OP_CSV_860026562)
	FINSI

	# CCD avec CCD_REEL
	erreur_860026562 = i_set_art_field(g_iartout13, $Conversion::CCD, CCD_REEL_860026562)
	erreur_860026562 = i_get_art_str( g_iartout13, $Conversion::CCD, pt_BUF_860026562 )
	erreur_860026562 = i_format_str2( pt_BUF2_860026562, "%s%s", "000", pt_BUF_860026562)
	i_get_sub_str (pt_BUF2_860026562, -3, -1,pt_BUF2_860026562)
	erreur_860026562=i_set_art_str( g_iartout11, $Tfe_rpv::CCD, pt_BUF2_860026562 )

	# Champ TAG
	SI TAG_Accueil_860026562
	ALORS
		SI TAG_gratuit_860026562
		ALORS
			erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::TAG, "1")
		SINON
			erreur_860026562 = i_set_art_str(g_iartout11, $Tfe_rpv::TAG, "2")
		FINSI
	FINSI

	#champ INFDDE
	# ajout du champ INFDDE valorise avec DEDE_INF + QC428
	#trace1("<<__LINE__>> -------DEDE_INF_800008563=%d------------",DEDE_INF_800008563)
	erreur_860026562 = i_set_art_field(g_iartout13, $Conversion::INF, DEDE_INF_860026562)
	erreur_860026562 = i_get_art_str( g_iartout13, $Conversion::INF, pt_BUF_860026562 )
	erreur_860026562 = i_format_str2( pt_BUF2_860026562, "%s%s", "000", pt_BUF_860026562)
	i_get_sub_str (pt_BUF2_860026562, -3, -1,pt_BUF2_860026562)
	erreur_860026562=i_set_art_str( g_iartout11, $Tfe_rpv::INFDDE, pt_BUF2_860026562)

	# G4R6 Lot3
	# TYPE_EDIT
	erreur_860026562=i_set_art_str(g_iartout11, $Tfe_rpv::TYPE_EDIT, pt_TYPE_EDIT_860026562)

	# CODE_TARIF
	erreur_860026562=i_set_art_str(g_iartout11, $Tfe_rpv::CODE_TARIF, pt_CODE_TARIF_860026562)
	# \G4R6 Lot3
FINSI

#G4R2
########################################
# COME ou ELIGIBLE
########################################
SI( bCome_860026562 || bElig_860026562 )
ALORS
	SI ( i_dup_art_tab(g_iartout,g_iartout14,C_Tcome_860026562) )
	ALORS
		#trace("ERREUR de duplication")
		code_errone_860026562 = 0xA0D0
		code_errone_860026562 = code_errone_860026562 + EFFICACE_860026562
		erreur_860026562 = i_PlvMessEmettre(8602,2,g_iartin,"",3,code_errone_860026562,C_Tcome_860026562,C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	#T3t1 	T3t1.1		type				:-	:-	:MSET :FF:1
	erreur_860026562= i_set_art_field(g_iartout14,$Tcome::type,0xA7)

	#T3t1.3		idemet		33009100001FFFFFFF
	taille_860026562 = i_conv_ascii_dcb("33009100002FFFFFFF", pt_TEMP1_860026562)
	erreur_860026562=i_memcpy_art_field_n(g_iartout14,$Tcome::idemet,pt_TEMP1_860026562,taille_860026562)

	#T3t1.4		IMSI		444444444444444F
	taille_860026562 = i_conv_ascii_dcb("444444444444444F", pt_TEMP1_860026562)
	erreur_860026562=i_memcpy_art_field_n(g_iartout14,$Tcome::IMSI,pt_TEMP1_860026562,taille_860026562)

	#T3t1.5		DATE		CallStartTimeStamp AAAAMMJJHHMMSS (DCB,m)
	#T3t1.6		DUREE		Call Duration  (BIN,m)
	TYPE_860026562 = i_get_art_field(g_iartout,$TconvNE::TYPE)
	SI TYPE_860026562 != 0 && RETOUR_CORR_860026562 && CORR_TAG_860026562
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout14, $Tcome::DATE,ICAR_C_860026562)
		erreur_860026562 = i_set_art_field(g_iartout14, $Tcome::DUREE,VARDATEFIN_860026562 - VARDATE_860026562)
	SINON
#		erreur = i_set_art_field(g_iartout14, $Tcome::DATE,ICAR)
		erreur_860026562 = i_set_art_field(g_iartout14, $Tcome::DATE,date_locale_860026562)
		erreur_860026562 = i_set_art_field(g_iartout14, $Tcome::DUREE,DURCONV_860026562)
	FINSI

	#T3t1.8		tlserv		Teleservice (HEX,m)	QC704
	SI TAG_Accueil_860026562
	ALORS
		SI TAG_gratuit_860026562
		ALORS
			erreur_860026562 = i_set_art_field(g_iartout14, $Tcome::tlserv, 0x2)
		SINON
			erreur_860026562 = i_set_art_field(g_iartout14, $Tcome::tlserv, 0x1)
		FINSI
	FINSI

	#T3t1.16	nbUT		:-	:-	:MSET :FF:4		Number of UT  (BIN,m)
	erreur_860026562 = i_set_art_field(g_iartout14, $Tcome::nbUT,NB_UT_860026562)

	#QC696
	#T3t1.18	couleur
	#SI SRP_SPORTABILITE
	#ALORS
	#	erreur = i_set_art_field(g_iartout14, $Tcome::couleur,0x1F)
	#FINSI

	#T3t2		idpart				:-	:-	:MSET :FF:19
	i_get_sub_str(pt_DEDE_NUM_FACT_860026562, 0, 1, pt_temp2_860026562)
	SI  (i_strcmp(pt_temp2_860026562, "33") != 0)
	ALORS
		erreur_860026562 = i_format_str2(pt_TEMP1_860026562,"%s%s","33",pt_DEDE_NUM_FACT_860026562)
	FINSI
	taille_860026562 = i_conv_ascii_dcb(pt_TEMP1_860026562, pt_temp2_860026562)
	erreur_860026562=i_memcpy_art_field_n(g_iartout14,$Tcome::idpart,pt_temp2_860026562,taille_860026562)
	erreur_860026562 = i_resize_tlv(g_iartout14,"T3t2","idpart",taille_860026562*8)

	#T3t4		MSISDN				:-	:-	:MSET :FF:19
	erreur_860026562 = i_format_str2(pt_TEMP1_860026562,"%s%s","33",pt_NDI_COME_860026562)
	taille_860026562 = i_conv_ascii_dcb(pt_TEMP1_860026562, pt_temp2_860026562)
	erreur_860026562=i_memcpy_art_field_n(g_iartout14,$Tcome::MSISDN,pt_temp2_860026562,taille_860026562)
	erreur_860026562 = i_resize_tlv(g_iartout14,"T3t4","MSISDN",taille_860026562*8)

	#T3t24		MailMsOrEntity		:-	:-	:MSET :20:127
	SI (i_valid_field_n(g_iartout, $TconvNE::IDUS_NUM))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_temp2_860026562)
		erreur_860026562 = i_format_str2(pt_TEMP1_860026562,"%s%s","33",pt_temp2_860026562)
		erreur_860026562=i_set_art_str(g_iartout14,$Tcome::MailMsOrEntity,pt_TEMP1_860026562)
		taille_860026562 = i_strlen(pt_TEMP1_860026562)
		erreur_860026562 = i_resize_tlv(g_iartout14,"T3t24","MailMsOrEntity",taille_860026562)
	FINSI

	#T3t30	T4t30.1		timeInCE			:-	:-	:MSET :00:7
	date_audit_860026562 = i_date_audit()
	erreur_860026562 = i_set_art_field(g_iartout14, $Tcome::timeInCE,date_audit_860026562)

	#T3t35	T4t35.2		occurenceNb			:-	:-	:MSET :FF:1
	erreur_860026562 = i_set_art_field(g_iartout14, $Tcome::occurenceNb, NB_CSV_860026562)

	#T3t58				GASCII				:-	:-	:MSET :20:50 QC704
	#G4R4 QC756
	SI NB_CSV_860026562 > 0
	ALORS
		erreur_860026562 = i_format_str2(pt_BUF_860026562,"%s%s",pt_C_CSV_860026562,"   ")
		i_get_sub_str(pt_BUF_860026562, 0, 2, pt_C_CSV_860026562)
		trace2("__FILE__:__LINE__ ## TEST ## ======> pt_C_CSV <%s> #### ",pt_C_CSV_860026562 ,"")
		i_strcpy(pt_BUF_860026562,pt_C_CSV_860026562)

		erreur_860026562 = i_format_str2(pt_BUF2_860026562,"%s%s",pt_OP_CSV_860026562," ")
		i_get_sub_str(pt_BUF2_860026562, 0, 1, pt_OP_CSV_860026562)
		trace2("__FILE__:__LINE__ ## TEST ## ======> pt_OP_CSV <%s> #### ",pt_OP_CSV_860026562 ,"")
		i_strcpy(pt_BUF2_860026562,pt_OP_CSV_860026562)

		erreur_860026562 = i_format_str2(pt_temp2_860026562,"%s%s",pt_BUF_860026562,pt_BUF2_860026562)
		erreur_860026562 = i_set_art_str(g_iartout14, $Tcome::GASCII,pt_temp2_860026562)
		erreur_860026562 = i_resize_tlv (g_iartout14, "T3t58","GASCII", i_strlen(pt_temp2_860026562) )
	SINON
		erreur_860026562 = i_supprChamp(g_iartout14, "T3t58")
		#trace(" suppression du champ  T3t58 ")
	FINSI

	# G4R6 Lot3
	# TYPE_EDIT
	SI i_strcmp(pt_TYPE_EDIT_860026562," ") != 0
	ALORS
		erreur_860026562 = i_ajoutChampNum(g_iartout14, $Tcome::T3t72,$Tcome::TYPE_EDIT,0)
		erreur_860026562=i_set_art_str(g_iartout14, $Tcome::TYPE_EDIT, pt_TYPE_EDIT_860026562)
	FINSI

	# CODE_TARIF
	SI i_strcmp(pt_CODE_TARIF_860026562,"    ") != 0
	ALORS
		erreur_860026562 = i_ajoutChampNum(g_iartout14, $Tcome::T3t73,$Tcome::CODE_TARIF,0)
		erreur_860026562=i_set_art_str(g_iartout14, $Tcome::CODE_TARIF, pt_CODE_TARIF_860026562)
	FINSI
	# /G4R6 Lot3
FINSI

########################################
# TRAFIC
########################################
# Remarque : pour la mise au format TRAFIC, dans le cas d'un NON IDUS_SRP_NDIP, on duplique l'article en TtraficN (article generique TRAFIC) et non pas en Ttrafic_durcom (article dedie Audiotel).
# Cet article sera neanmoins identifie en Ttrafic_durcom par l'IECC en raison de la valeur 51 du champ DOMAINE.
# Le codage de Ttrafic et Ttrafic_durcom etant identique (aux metachamps pres) et l'enveloppe Elibap etant enrichie avec OPT_DURCOM, on peut indifferemment travailler sur l'un ou l'autre en distribution.
# De cette maniere, a terme, lorsque la chaine Audiotel aura entierement migre, il sera possible de retirer simplement du parametrage les objets (cas d'article et algo) specifiques Audiotel.
# Attention, lors de ce nettoyage, il faudra aussi modifier l'arbre de reco Dtrafic.

SI bTRAFIC_860026562
ALORS
	#trace("Duplication vers TRAFIC")
	SI (i_dup_art_dest(g_iartout, g_iartout2, C_TtraficN_860026562))
	ALORS
		trace( "erreur de duplication de TconvNE vers TtraficN")
		code_errone_860026562 = 0xA0D1
		erreur_860026562 = i_PlvMessEmettre(8602, 2, g_iartout, "", 3, code_errone_860026562, C_TtraficN_860026562, C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	# Champ DOMAINE
	SI ((i_strcmp(pt_NDRTC_860026562, g_inull) != 0) || b_TETRIS_FU_860026562 || b_NPF_SIP_860026562 || b_NPF_OPT_860026562 )
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::DOMAINE, "10")
	SINON
		erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::DOMAINE, "51")
	FINSI

	# Champ SERVICE
	SI (V1S_860026562 || b_NPF_SIP_860026562 || b_NPF_OPT_860026562)
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::SERVICE, "06")
	SINON
		SI MLV_860026562
		ALORS
			erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::SERVICE, "69")
		SINON
			SI b_TETRIS_FU_860026562
			ALORS
				erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::SERVICE, "06")
			SINON
				erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::SERVICE, "21")
			FINSI
		FINSI
	FINSI

	# Champ IDUS_INF
	erreur_860026562 = i_set_art_field(g_iartout2, $TtraficN::IDUS_INF, idus_inf_860026562)

	# Champ IDUS_NUM
#DRE G4R5
#	SI ((b_NPF_SIP == 1) || (SIP_Fibre != 0) || (V1S == 1 && b_DATODEBI == 1))
	SI ( (b_NPF_SIP_860026562 == 1) || (SIP_Fibre_860026562 != 0) || (V1S_860026562 == 1) )
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
		i_get_sub_str(pt_BUF_860026562, 0, 9, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::IDUS_NUM, pt_BUF_860026562)
	SINON
		erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::IDUS_NUM,pt_IDUS_NDRTC_860026562)
	FINSI

	# Champ DEDE_INF
	erreur_860026562 = i_set_art_field(g_iartout2, $TtraficN::DEDE_INF, DEDE_INF_860026562)

	# Champ DEDE_NUM
	erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::DEDE_NUM, pt_DEDE_NUM_FACT_860026562)

	# Champ DATE
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout2,$TtraficN::DATE, DateLocaleRetourCorr_860026562)
	SINON
#		erreur = i_set_art_field(g_iartout2,$TtraficN::DATE, ICAR)
		erreur_860026562 = i_set_art_field(g_iartout2,$TtraficN::DATE, date_locale_860026562)
	FINSI

	# Champ DUREE
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout2, $TtraficN::DUREE, VARDATEFIN_860026562 - VARDATE_860026562)
	SINON
		erreur_860026562 = i_set_art_field(g_iartout2, $TtraficN::DUREE, DURCONV_860026562)
	FINSI

	# Champ CAX
	erreur_860026562 = i_set_art_field(g_iartout2, $TtraficN::CAX, CAX_860026562)

	# Champ TAX
	erreur_860026562 = i_set_art_field(g_iartout2, $TtraficN::TAX, NB_UT_860026562)

	# Champ NDS_NUM
#DRE G4R5
#	SI (MLV || b_TETRIS_FU || (V1S && b_DATODEBI == 0) || b_NPF_OPT)
#G4R5 QC783
#	SI ( MLV || b_TETRIS_FU || V1S || b_NPF_OPT )
	SI ( MLV_860026562 || b_TETRIS_FU_860026562 || b_NPF_OPT_860026562 )
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
		i_get_sub_str(pt_BUF_860026562, 0, 9, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::NDS_NUM, pt_BUF_860026562)
	FINSI

	# Champ SUP
	erreur_860026562 = i_set_art_field(g_iartout2, $TtraficN::SUP, SUP_860026562)

	# Champ REF
	erreur_860026562 = i_set_art_field(g_iartout2, $TtraficN::REF, ref_860026562)

	# Champ NB_CSV
	erreur_860026562 = i_set_art_field(g_iartout2, $TtraficN::NB_CSV, NB_CSV_860026562)

	# Champ C_CSV1 et OP_CSV1
	SI (NB_CSV_860026562 > 0)
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout2,  $TtraficN::C_CSV1, pt_C_CSV_860026562)
		erreur_860026562 = i_set_art_str(g_iartout2,  $TtraficN::OP_CSV1, pt_OP_CSV_860026562)
	SINON
		erreur_860026562 = i_memset_field_n(g_iartout2, $TtraficN::C_CSV1, 0x40)
		erreur_860026562 = i_memset_field_n(g_iartout2, $TtraficN::OP_CSV1, 0x40)
	FINSI

	# Champ SGTQS
	erreur_860026562=i_set_art_str(g_iartout2, $TtraficN::SGTQS, pt_SGTQS_860026562)

	# Champ MNEMO
	SI (i_valid_field_n(g_iartout, $TconvNE::MNEMO))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::MNEMO, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::MNEMO, pt_BUF_860026562)
	FINSI

	# champs CLASSDEST
	erreur_860026562 = i_set_art_field(g_iartout2, $TtraficN::CLASSDEST, CCD_REEL_860026562)

	# champs OFFRE et OPERATEUR
	SI (b_CodOperVG_860026562 == 1)
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::OFFRE, pt_CodOffreVG_860026562)
		erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::OPERATEUR, pt_CodOperVG_860026562)
	FINSI

	# Champ TAG
	SI TAG_Accueil_860026562
	ALORS
		SI TAG_gratuit_860026562
		ALORS
			erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::TAG, "1")
		SINON
			erreur_860026562 = i_set_art_str(g_iartout2, $TtraficN::TAG, "2")
		FINSI
	FINSI

	# G4R6 Lot3
	# TYPE_EDIT
	erreur_860026562=i_set_art_str(g_iartout2, $TtraficN::TYPE_EDIT, pt_TYPE_EDIT_860026562)

	# CODE_TARIF
	erreur_860026562=i_set_art_str(g_iartout2, $TtraficN::CODE_TARIF, pt_CODE_TARIF_860026562)
	# \G4R6 Lot3
FINSI

########################################
# 		DELTA MINUTE
########################################
SI bDM_860026562
ALORS
	#trace("Duplication vers DELTA MINUTE")
	SI(i_dup_art_dest(g_iartout, g_iartout6, C_Tdelta_minute_860026562))
	ALORS
		trace("erreur de duplication de TconvNE vers Tdelta_minute")
		code_errone_860026562 = 0xA0D1
		erreur_860026562 = i_PlvMessEmettre(8602, 2, g_iartout, "", 3, code_errone_860026562, C_Tdelta_minute_860026562, C_Article_860026562)
		SAUT DISTRI_ERR
	FINSI

	# Champ DOMAINE
	erreur_860026562 = i_set_art_str(g_iartout6, $Tdelta_minute::DOMAINE, "51")

	# Champ SERVICE
	erreur_860026562 = i_set_art_str(g_iartout6, $Tdelta_minute::SERVICE, "21")

	# Champ IDUS_INF
	erreur_860026562 = i_set_art_field(g_iartout6, $Tdelta_minute::IDUS_INF, idus_inf_860026562)

	# Champ IDUS_NUM
	i_get_sub_str(pt_IDUS_NDRTC_860026562, 0, 8, pt_BUF_860026562)
	erreur_860026562 = i_set_art_str(g_iartout6, $Tdelta_minute::IDUS_NUM, pt_IDUS_NDRTC_860026562)

	# Champ DEDE_INF
	erreur_860026562 = i_set_art_field(g_iartout6, $Tdelta_minute::DEDE_INF, DEDE_INF_860026562)

	# Champ DEDE_NUM
	erreur_860026562 = i_set_art_str(g_iartout6, $Tdelta_minute::DEDE_NUM, pt_DEDE_NUM_FACT_860026562)

	# Champ DATE
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout6,$Tdelta_minute::DATE, DateLocaleRetourCorr_860026562)
	SINON
#		erreur = i_set_art_field(g_iartout6, $Tdelta_minute::DATE, ICAR)
		erreur_860026562 = i_set_art_field(g_iartout6, $Tdelta_minute::DATE, date_locale_860026562)
	FINSI

	# Champ DUREE
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout6, $Tdelta_minute::DUREE, VARDATEFIN_860026562 - VARDATE_860026562)
	SINON
		erreur_860026562 = i_set_art_field(g_iartout6, $Tdelta_minute::DUREE, DURCONV_860026562)
	FINSI

	# Champ CAX
	erreur_860026562 = i_set_art_field(g_iartout6, $Tdelta_minute::CAX, CAX_860026562)

	# Champ TAX
	erreur_860026562 = i_set_art_field(g_iartout6, $Tdelta_minute::TAX, NB_UT_860026562)

	# Champ NDS_NUM
	SI (  (i_strcmp(pt_NDRTC_860026562, g_inull) != 0) ||(b_TETRIS_FU_860026562 == 1)  )
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM,pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout6, $Tdelta_minute::NDS_NUM, pt_BUF_860026562)
	FINSI

	# Champ SUP
	erreur_860026562 = i_set_art_field(g_iartout6, $Tdelta_minute::SUP, SUP_860026562)

	# Champ REF
	erreur_860026562 = i_set_art_field(g_iartout6, $Tdelta_minute::REF, ref_860026562)

	# Champ NB_CSV
	erreur_860026562 = i_set_art_field(g_iartout6, $Tdelta_minute::NB_CSV, NB_CSV_860026562)

	# Champ C_CSV1 et OP_CSV1
	SI (NB_CSV_860026562 > 0)
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout6, $Tdelta_minute::C_CSV1, pt_C_CSV_860026562 )
		erreur_860026562 = i_set_art_str(g_iartout6, $Tdelta_minute::OP_CSV1, pt_OP_CSV_860026562 )
	SINON
		erreur_860026562 = i_memset_field_n(g_iartout6, $Tdelta_minute::C_CSV1, 0x40)
		erreur_860026562 = i_memset_field_n(g_iartout6, $Tdelta_minute::OP_CSV1, 0x40)
	FINSI

	# Champ SGTQS
	erreur_860026562=i_set_art_str(g_iartout6, $Tdelta_minute::SGTQS, pt_SGTQS_860026562)

	# Champ MNEMO
	SI (i_valid_field_n(g_iartout, $TconvNE::MNEMO))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::MNEMO, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout6, $Tdelta_minute::MNEMO, pt_BUF_860026562)
	FINSI
FINSI

########################################
# 		SUIVI CONSO
########################################
SI bSC_860026562
ALORS
	#trace("Duplication vers E_BILL")
	SI (i_dup_art_dest(g_iartout, g_iartout3, C_TscTconvNE_860026562))
	ALORS
		erreur_860026562 = i_PlvMessEmettre(8502, 2, g_iartin, "", 3,C_TscTconvNE_860026562, C_Article_860026562, g_ieec)
		SAUT DISTRI_ERR
	FINSI

	#T1
	erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::T1, 0x1A)

	#L1
	# modif longueur suite ajout champs CSi et NDS_NUM
	erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::L1, 0x70)

	#T2
	erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::T2, 2)

	# Champ IDUS_NUM FO2331 mettre NDRTC qd NPF_OPT
	# - Suppression de la condition V1S == 1
	SI (b_TRAFBSScritCOM_860026562 || b_NPF_SIP_860026562)
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
		i_get_sub_str(pt_BUF_860026562, 0, 8, pt_BUF_860026562)
	SINON
		i_get_sub_str(pt_IDUS_NDRTC_860026562, 0, 8, pt_BUF_860026562)
	FINSI
	erreur_860026562 = i_set_art_str(g_iartout3, $TscTconvNEB::IDUS_NUM, pt_BUF_860026562)

	#ICAR
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout3,$TscTconvNEB::DATE, DateLocaleRetourCorr_860026562)
	SINON
#		erreur = i_set_art_field(g_iartout3, $TscTconvNEB::DATE, ICAR)
		erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::DATE, date_locale_860026562)
	FINSI

	#DUREE
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::DUREE, VARDATEFIN_860026562 - VARDATE_860026562)
	SINON
		erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::DUREE, DURCONV_860026562)
	FINSI

	#TAX
	erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::TAX, NB_UT_860026562)

	#DEDE_INF
	erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::DEDE_INF, DEDE_INF_860026562)

	#DEDE_NUM
	i_replace_str(pt_DEDE_NUM_FACT_860026562, "ABC", "A*#", pt_BUF_860026562)
	erreur_860026562 = i_set_art_str(g_iartout3,$TscTconvNEB::DEDE_NUM, pt_BUF_860026562)

	#T1_TYPE
	erreur_860026562 = i_set_art_str(g_iartout3, $TscTconvNEB::T1_TYPE, "00")

	#CAX
	SI(V1S_860026562 || b_NPF_SIP_860026562 || b_TETRIS_FU_860026562 || b_NPF_OPT_860026562)
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::CAX_SUP, 6)
	SINON
		SI MLV_860026562
		ALORS
			erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::CAX_SUP, 4)
		SINON
			res_860026562 = i_get_art_field(g_iartout, $TconvNE::SUP)
			SI (res_860026562 == 0x00)
			ALORS
				erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::CAX_SUP, 1)
			SINON
				SI (res_860026562 == 0x03)
				ALORS
					erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::CAX_SUP, 2)
				SINON
					SI (res_860026562 == 0x02)
					ALORS
						erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::CAX_SUP, 3)
					SINON
						erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::CAX_SUP, 0)
					FINSI
				FINSI
			FINSI
		FINSI
	FINSI

	# champs COCA
	erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::COCA, CCD_REEL_860026562)

	#REF
	SI (i_valid_field_n( g_iartout, $TconvNE::T3enap))
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout3, $TscTconvNEB::REF, ref_860026562)
	FINSI

	# Conv_AULA_S13F5.doc CI Platine FTSA -E-BILL - V7.7.doc
	# CS1
	erreur_860026562 = i_format_str2(pt_CSV_860026562, "%s%s", pt_C_CSV_860026562, pt_OP_CSV_860026562)
	erreur_860026562 = i_set_art_str(g_iartout3, $TscTconvNEB::CS1, pt_CSV_860026562)

	# NDS_NUM FO2331 ajout cas NPF_OPT
	SI (b_TETRIS_FU_860026562 || V1S_860026562 || b_NPF_OPT_860026562)
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
		i_get_sub_str(pt_BUF_860026562, 0, 8, pt_BUF_860026562)
		erreur_860026562 = i_set_art_str(g_iartout3, $TscTconvNEB::NDS_NUM, pt_BUF_860026562)
	SINON
		erreur_860026562 = i_set_art_str(g_iartout3, $TscTconvNEB::NDS_NUM, 0x20)
	FINSI

	#ECC_FACT
# DRE G4R5 QC790
#	SI ( b_NPF_OPT == 1 )
#	ALORS
#		i_strcpy(pt_ECCFACT, "TRAFOPT")
#	FINSI
#	erreur = i_set_art_str(g_iartout3, $TscTconvNEB::ECC_FACT, pt_ECCFACT)

	i_strcpy(pt_BUF_860026562,pt_ECCFACT_860026562)
	SI b_NPF_OPT_860026562 == 1
	ALORS
		SI bTRAFIC_860026562 == 1
		ALORS
			i_strcpy(pt_BUF_860026562,"TRAFOPT")
		FINSI
	FINSI
	erreur_860026562 = i_set_art_str(g_iartout3, $TscTconvNEB::ECC_FACT, pt_BUF_860026562)
# \DRE G4R5 QC790

	#CCNDE
	SI CODCIR_860026562 != -1
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout13, $Conversion::CODCIRDR, CODCIR_860026562)
		erreur_860026562=i_get_art_str(g_iartout13, $Conversion::CODCIRDA,pt_buffer_860026562)
		SI (g_iartout13.CODCIRDA[2] > 9)
		ALORS
			i_get_sub_str(pt_buffer_860026562,2,5,pt_buffer_860026562)
		SINON
			i_get_sub_str(pt_buffer_860026562,1,5,pt_buffer_860026562)
		FINSI
		erreur_860026562 = i_set_art_str(g_iartout3, $TscTconvNEB::CCNDE, pt_buffer_860026562)
	SINON
		erreur_860026562 = i_set_art_str(g_iartout3, $TscTconvNEB::CCNDE, "     ")
	FINSI

	# TAG
	SI ( TAG_Accueil_860026562)
	ALORS
		SI ( TAG_gratuit_860026562 )
		ALORS
			erreur_860026562 = i_set_art_str(g_iartout3, $TscTconvNEB::TAG, "1")
		SINON
			erreur_860026562 = i_set_art_str(g_iartout3, $TscTconvNEB::TAG, "2")
		FINSI
	SINON
		erreur_860026562 = i_set_art_str(g_iartout3, $TscTconvNEB::TAG, " ")
	FINSI
FINSI

########################################
# 		CENTAUREVG
########################################

SI bCENTVG_860026562
ALORS
	#trace("Duplication vers CENTAUREVG")
	SI (i_dup_art_dest(g_iartin,g_iartout10,C_TcentaureVG_860026562))
	ALORS
		code_errone_860026562 = 0xA0D0
		code_errone_860026562 = code_errone_860026562 + EFFICACE_860026562
		erreur_860026562 = i_PlvMessEmettre(8602, 2, g_iartin, "", 3, code_errone_860026562, C_TcentaureVG_860026562, C_Article_860026562)
		SAUT  DISTRI_ERR
	FINSI

	# DOMAINE
	erreur_860026562=i_set_art_str(g_iartout10, $TcentaureVG::DOMAINE, "51")

	# SERVICE
	erreur_860026562=i_set_art_str(g_iartout10, $TcentaureVG::SERVICE, "21")

	# Champ C_CSVi et OP_CSVi
	erreur_860026562 = i_set_art_str(g_iartout10, $TcentaureVG::C_CSV1, pt_C_CSV_860026562 )
	erreur_860026562 = i_set_art_str(g_iartout10, $TcentaureVG::OP_CSV1, pt_OP_CSV_860026562 )

	# champ SGTQS
	erreur_860026562=i_set_art_str(g_iartout10, $TcentaureVG::SGTQS, pt_SGTQS_860026562)

	# Champ ICAR
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout10,$TcentaureVG::ICAR, DateLocaleRetourCorr_860026562)
	SINON
#		erreur = i_set_art_field(g_iartout10, $TcentaureVG::ICAR, ICAR)
		erreur_860026562 = i_set_art_field(g_iartout10, $TcentaureVG::ICAR, date_locale_860026562)
	FINSI

	#champ SUP
	erreur_860026562 = i_set_art_field(g_iartout10, $TcentaureVG::SUP, SUP_860026562)

	#champ REF
	erreur_860026562 = i_set_art_field(g_iartout10, $TcentaureVG::REF, ref_860026562)

	#champ nb_csv
	erreur_860026562 = i_set_art_field(g_iartout10, $TcentaureVG::nb_csv, NB_CSV_860026562)

	#champ IDUS_NUM
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
	i_get_sub_str(pt_BUF_860026562, 0, 8, pt_BUF_860026562)
	erreur_860026562 = i_set_art_str(g_iartout10, $TcentaureVG::IDUS_NUM, pt_BUF_860026562)

	# Champ DEDE_INF
	erreur_860026562 = i_set_art_field(g_iartout10, $TcentaureVG::DEDE_INF, DEDE_INF_860026562)

	#champ DEDE_NUM
	erreur_860026562 = i_set_art_str(g_iartout10, $TcentaureVG::DEDE_NUM, pt_DEDE_NUM_FACT_860026562)

	#champ STY
	i_strcpy(pt_STY_860026562, "FF")
	erreur_860026562 = i_set_art_str(g_iartout10, $TcentaureVG::STY, pt_STY_860026562)

	# champs OFFRE et OPERATEUR G2R2Cu avec VGTplus
	SI b_CodOperVG_860026562
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout10, $TcentaureVG::OFFRE, pt_CodOffreVG_860026562)
		erreur_860026562 = i_set_art_str(g_iartout10, $TcentaureVG::OPERATEUR, pt_CodOperVG_860026562)
	FINSI

	#champ DUREE, TAXE et CAX
	SI RETOUR_CORR_860026562 == 1 && CORR_TAG_860026562 == 1 && TYPE_860026562 != 0
	ALORS
		erreur_860026562 = i_set_art_field(g_iartout10, $TcentaureVG::DUR, VARDATEFIN_860026562 - VARDATE_860026562)
	SINON
		erreur_860026562 = i_set_art_field(g_iartout10, $TcentaureVG::DUR, DURCONV_860026562)
	FINSI

	# Champ TAX
	erreur_860026562 = i_set_art_field(g_iartout10, $TcentaureVG::TAX, NB_UT_860026562)

	# Champ CAX
	erreur_860026562 = i_set_art_field(g_iartout10, $TcentaureVG::CAX, CAX_860026562)

	#Champ MNEMO
	SI(i_valid_field_n(g_iartout, $TconvNE::MNEMO))
	ALORS
		erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::MNEMO, pt_temp_860026562)
		erreur_860026562 = i_set_art_str(g_iartout10, $TcentaureVG::MNEMO, pt_temp_860026562)
	SINON
		i_strcpy(pt_temp_860026562, " ")
		erreur_860026562 = i_set_art_str(g_iartout10, $TcentaureVG::MNEMO, pt_temp_860026562)
	FINSI

	# Champ TAG
	SI TAG_Accueil_860026562
	ALORS
		SI TAG_gratuit_860026562
		ALORS
			erreur_860026562 = i_set_art_str(g_iartout10, $TcentaureVG::TAG, "1")
		FINSI
	FINSI

	# G4R6 Lot3
	# TYPE_EDIT
	erreur_860026562=i_set_art_str(g_iartout10, $TcentaureVG::TYPE_EDIT, pt_TYPE_EDIT_860026562)

	# CODE_TARIF
	erreur_860026562=i_set_art_str(g_iartout10, $TcentaureVG::CODE_TARIF, pt_CODE_TARIF_860026562)
	# \G4R6 Lot3
FINSI

########################################
# 		CENTAUREDEA
########################################
SI (bCENTDEA_860026562)
ALORS
	#trace("Duplication vers CENTAUREDEA")
	SI (i_dup_art_dest(g_iartin,g_iartout9,C_TcentaureDEA_860026562))
	ALORS
		code_errone_860026562 = 0xA0D0
		code_errone_860026562 = code_errone_860026562 + EFFICACE_860026562
		erreur_860026562 = i_PlvMessEmettre(8602, 2, g_iartin, "", 3, code_errone_860026562, C_TcentaureDEA_860026562, C_Article_860026562)
		SAUT  DISTRI_ERR
	FINSI

	#Champ DATE
#	erreur = i_set_art_field(g_iartout9, $TcentaureDEA::DATE, ICAR)
	erreur_860026562 = i_set_art_field(g_iartout9, $TcentaureDEA::DATE, date_locale_860026562)

	# Champ IIDUS
	erreur_860026562 = i_set_art_field(g_iartout9, $TcentaureDEA::IIDUS, idus_inf_860026562)

	#Champ NIDUS
	erreur_860026562 = i_get_art_str(g_iartout, $TconvNE::IDUS_NUM, pt_BUF_860026562)
	i_get_sub_str(pt_BUF_860026562, 0, 8, pt_BUF_860026562)
	erreur_860026562 = i_set_art_str(g_iartout9, $TcentaureDEA::NIDUS, pt_BUF_860026562)

	#Champ NDEDE
	erreur_860026562 = i_set_art_str(g_iartout9, $TcentaureDEA::NDEDE, pt_DEDE_NUM_FACT_860026562)

	#Champ IDEDE
	erreur_860026562 = i_set_art_field(g_iartout9, $TcentaureDEA::IDEDE, DEDE_INF_860026562)

	#Champ NIDAV
	SI  (i_strcmp(pt_PREFIXE_CENTAURE_860026562, "") != 0)
	ALORS
		erreur_860026562 = i_set_art_str(g_iartout9, $TcentaureDEA::NIDAV, pt_NIDAV_CENTAURE_860026562)
	SINON
		erreur_860026562 = i_set_art_str(g_iartout9, $TcentaureDEA::NIDAV, pt_DEDE_NUM_FACT_860026562)
	FINSI
	##DEDE_NUM remplace par DEDE_NUM_FACT

	#Champ NICOM
	erreur_860026562 = i_set_art_str(g_iartout9, $TcentaureDEA::NICOM, "SVAITX")

	#Champ REF
	erreur_860026562 = i_set_art_field(g_iartout9, $TcentaureDEA::REF, ref_860026562)

	#Champ DUR
	erreur_860026562 = i_set_art_field(g_iartout9, $TcentaureDEA::DUREE, DURCONV_860026562)

	#Champ TAX
	erreur_860026562 = i_set_art_field(g_iartout9, $TcentaureDEA::TAX, NB_UT_860026562)

	#Champ CDSGTQS
	erreur_860026562=i_set_art_str(g_iartout9, $TcentaureDEA::CDSGTQS, pt_SGTQS_860026562)

	# G4R6 Lot3
	# TYPE_EDIT
	erreur_860026562=i_set_art_str(g_iartout9, $TcentaureDEA::TYPE_EDIT, pt_TYPE_EDIT_860026562)

	# CODE_TARIF
	erreur_860026562=i_set_art_str(g_iartout9, $TcentaureDEA::CODE_TARIF, pt_CODE_TARIF_860026562)
	# \G4R6 Lot3
FINSI

#######################################
# 		SYMPHONIE
#######################################
SI bSYMPHONIE_860026562
ALORS

	SI (i_valid_field_n(g_iartout, $TconvNE::T3correl))
	ALORS
		erreur_860026562 = i_supprChamp(g_iartout, "T3correl")
	FINSI

	SI (i_valid_field_n(g_iartout, $TconvNE::T4ACE_N1))
	ALORS
		erreur_860026562 = i_supprChamp(g_iartout, "T4ACE_N1")
	FINSI

	SI (i_valid_field_n(g_iartout, $TconvNE::T4ACE_N2))
	ALORS
		erreur_860026562 = i_supprChamp(g_iartout, "T4ACE_N2")
	FINSI

	SI (i_dup_art_id(g_iartout, g_iartout8))
	ALORS
		erreur_860026562 = i_PlvMessEmettre(8502, 2, g_iartin, "", 3, "pour Symphonie", C_Article_860026562, g_ieec)
		SAUT DISTRI_ERR
	FINSI

	SI (i_rename_art(g_iartout8, C_TsymTconvNE_860026562))
	ALORS
		erreur_860026562 = i_PlvMessEmettre(8502, 2, g_iartin, "", 3, "pour Symphonie", C_Article_860026562, g_ieec)
		SAUT DISTRI_ERR
	FINSI

# G4R5 QC785
	#DEDEINI2_NUM

	#DEDEINI_NUM
	SI (i_valid_field_n(g_iartout, $TconvNE::DEDEINI_NUM))
	ALORS
		res_860026562 = i_get_art_field(g_iartout, $TconvNE::DEDEINI_PREF)
		SI (res_860026562 > 0 && res_860026562 < 4)
		ALORS
			lg_860026562 = (g_iartout.DEDEINI_NUM_N!NELEM) * 4
			erreur_860026562 = i_resize_tlv(g_iartout8, "T3dedeini", "DEDEINI_NUM", lg_860026562)
			erreur_860026562 = i_dup_chp_1val(g_iartout, g_iartout8, $TsymTconvNE::DEDEINI_NUM_N, $TsymTconvNE::DEDEINI_NUM)
		FINSI
	FINSI

	SI (i_valid_field_n(g_iartout8, $TsymTconvNE::DEDEINI_NUM))
	ALORS
		lg_860026562 = (g_iartout.DEDEINI_NUM_N!NELEM)
		SI lg_860026562 < 7
		ALORS
			erreur_860026562 = i_get_art_str(g_iartout8, $TsymTconvNE::DEDEINI_NUM,pt_BUF_860026562)
			lg_860026562= i_strlen ( pt_BUF_860026562)
			#trace1("__FILE__:__LINE__ ======> code lg : <%d> ", lg)
			Indice_860026562 = 0
			POINT BOUCLE_DEDEINI_NUM
			SI (g_iartout8.DEDEINI_NUM[Indice_860026562] == 0)
			ALORS
				Indice_860026562 = Indice_860026562 + 1
				SAUT BOUCLE_DEDEINI_NUM
			FINSI

			#trace1("__FILE__:__LINE__ ======> code Indice : <%d> ", Indice)
			SI Indice_860026562 > 0
			ALORS
				erreur_860026562 = i_supp_quart_num($TsymTconvNE::DEDEINI_NUM, 0, Indice_860026562, 0x0f, g_iartout8, g_iartout8)
			FINSI
			erreur_860026562 = i_resize_tlv(g_iartout8, "T3dedeini", "DEDEINI_NUM", (lg_860026562 - Indice_860026562)*4)
		FINSI
	FINSI

	#DEDE_NUM
	SI dede_reroute_860026562
	ALORS
		lg_860026562 = (g_iartout.DEDE1_NUM!NELEM) * 4
		erreur_860026562 = i_resize_tlv(g_iartout8, "T3dede", "DEDE_NUM", lg_860026562)
		erreur_860026562 = i_dup_chp_1val(g_iartout8, g_iartout8, $TsymTconvNE::DEDE1_NUM, $TsymTconvNE::DEDE_NUM)
	SINON
		res_860026562 = i_get_art_field(g_iartout, $TconvNE::DEDE_PREF)
		SI (res_860026562 > 0 && res_860026562 < 4)
		ALORS
			lg_860026562 = (g_iartout.DEDE_NUM_N!NELEM)*4
			erreur_860026562 = i_resize_tlv(g_iartout8, "T3dede", "DEDE_NUM", lg_860026562)
			erreur_860026562 = i_dup_chp_1val(g_iartout8, g_iartout8, $TsymTconvNE::DEDE_NUM_N, $TsymTconvNE::DEDE_NUM)
		FINSI
	FINSI

	SI (i_valid_field_n(g_iartout8, $TsymTconvNE::DEDE_NUM))
	ALORS
		lg_860026562 = (g_iartout.DEDE_NUM_N!NELEM)
		SI lg_860026562 < 7
		ALORS
			erreur_860026562 = i_get_art_str(g_iartout8, $TsymTconvNE::DEDE_NUM,pt_BUF_860026562)
			lg_860026562= i_strlen ( pt_BUF_860026562)
			#trace1("__FILE__:__LINE__ ======> code lg : <%d> ", lg)
			Indice_860026562 = 0
			POINT BOUCLE_DEDE_NUM
			SI (g_iartout8.DEDE_NUM[Indice_860026562] == 0)
			ALORS
				Indice_860026562 = Indice_860026562 + 1
				SAUT BOUCLE_DEDE_NUM
			FINSI

			#trace1("__FILE__:__LINE__ ======> code Indice : <%d> ", Indice)
			SI Indice_860026562 > 0
			ALORS
				erreur_860026562 = i_supp_quart_num($TsymTconvNE::DEDE_NUM, 0, Indice_860026562, 0x0f, g_iartout8, g_iartout8)
			FINSI
			erreur_860026562 = i_resize_tlv(g_iartout8, "T3dede", "DEDE_NUM", (lg_860026562 - Indice_860026562)*4)
		FINSI
	FINSI

	#DETR_INF et DETR_NUM
	lg_860026562 = (g_iartout.DETR_NUM_PAY!NELEM)*4
	erreur_860026562 = i_dup_chp_1val(g_iartout8, g_iartout8, $TsymTconvNE::DETR_INF_N, $TsymTconvNE::DETR_INF)
	erreur_860026562 = i_resize_tlv(g_iartout8, "T3detr", "DETR_NUM", lg_860026562)
	erreur_860026562 = i_dup_chp_1val(g_iartout8, g_iartout8, $TsymTconvNE::DETR_NUM_PAY, $TsymTconvNE::DETR_NUM)

	#DETR1_INF et DETR1_NUM
	SI i_valid_field_n(g_iartout8, $TsymTconvNE::DETR1_NUM)
	ALORS
		lg_860026562 = (g_iartout.DETR1_NUM_N!NELEM) * 4
		erreur_860026562 = i_dup_chp_1val(g_iartout8, g_iartout8, $TsymTconvNE::DETR1_INF_N, $TsymTconvNE::DETR1_INF)
		erreur_860026562 = i_resize_tlv(g_iartout8, "T3detr1", "DETR1_NUM", lg_860026562)
		erreur_860026562 = i_dup_chp_1val(g_iartout8, g_iartout8, $TsymTconvNE::DETR1_NUM_N, $TsymTconvNE::DETR1_NUM)
	FINSI

	#SGTQS
	erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4sgtqs,$TsymTconvNE::SGTQS, 1)
	erreur_860026562 = i_set_art_str(g_iartout8, $TsymTconvNE::SGTQS, pt_SGTQS_860026562)

	#ECCFACT
	erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4eccfact,$TsymTconvNE::ECCFACT, 1)
# DRE G4R5 QC790
#	SI b_NPF_OPT
#	ALORS
#		i_strcpy(pt_ECCFACT, "TRAFOPT")
#	FINSI
#	erreur = i_set_art_str(g_iartout8, $TsymTconvNE::ECCFACT, pt_ECCFACT)

	i_strcpy(pt_BUF_860026562,pt_ECCFACT_860026562)
	SI b_NPF_OPT_860026562 == 1
	ALORS
		SI bTRAFIC_860026562 == 1
		ALORS
			i_strcpy(pt_BUF_860026562,"TRAFOPT")
		FINSI
	FINSI
	erreur_860026562 = i_set_art_str(g_iartout8, $TsymTconvNE::ECCFACT, pt_BUF_860026562)
# \DRE G4R5 QC790

	#ND_RTC_42L
	SI !bREDISTIP_860026562
	ALORS
		SI (i_strcmp(pt_NDRTC_860026562, g_inull) != 0)
		ALORS
			erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4ND_RTC_42L,$TsymTconvNE::ND_RTC_42L, 1)
			erreur_860026562 = i_set_art_str(g_iartout8, $TsymTconvNE::ND_RTC_42L, pt_NDRTC_860026562)
		SINON
			SI b_TETRIS_FU_860026562
			ALORS
				erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4ND_RTC_42L,$TsymTconvNE::ND_RTC_42L, 1)
				erreur_860026562 = i_set_art_str(g_iartout8, $TsymTconvNE::ND_RTC_42L, pt_TETRIS_RTC_860026562)
			SINON
				SI b_NPF_OPT_860026562
				ALORS
					erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4ND_RTC_42L,$TsymTconvNE::ND_RTC_42L, 1)
					erreur_860026562 = i_set_art_str(g_iartout8, $TsymTconvNE::ND_RTC_42L, pt_OPT_RTC_860026562)
				FINSI
			FINSI
		FINSI
	FINSI

	#Champs optionnels OPE_VGA et OFF_VGA
	SI b_CodOperVG_860026562
	ALORS
		# Champ OPE_VGA
		erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4OPEVGA, $TsymTconvNE::OPE_VGA, 0)
		erreur_860026562 = i_set_art_str(g_iartout8, $TsymTconvNE::OPE_VGA, pt_CodOperVG_860026562)

		# Champ OFF_VGA
		erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4OFFVGA, $TsymTconvNE::OFF_VGA, 0)
		erreur_860026562 = i_set_art_str(g_iartout8, $TsymTconvNE::OFF_VGA, pt_CodOffreVG_860026562)
	FINSI

	# DATE_LOCALE
	erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4DATELOCALE, $TsymTconvNE::DATE_LOCALE, 0)
#	erreur = i_set_art_field(g_iartout8, $TsymTconvNE::DATE_LOCALE, ICAR)
	erreur_860026562 = i_set_art_field(g_iartout8, $TsymTconvNE::DATE_LOCALE, date_locale_860026562)
	#trace(" ***** Ajout date locale pour symphonie ***** ")

	# NBCOD
	SI NB_CSV_860026562 > 0
	ALORS
		erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4nbcod,$TsymTconvNE::NBCOD,0)
		erreur_860026562 = i_set_art_field( g_iartout8,$TsymTconvNE::NBCOD,1)
		# CSV
		erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4csv,$TsymTconvNE::CSV,0)
		# on veut c_csv cadre a gauche et op_csv cadre a droite
		erreur_860026562 = i_format_str2(pt_BUF_860026562,"%s%s",pt_C_CSV_860026562, "  ")
		i_get_sub_str(pt_BUF_860026562, 0, 1, pt_BUF_860026562)
		erreur_860026562 = i_format_str2(pt_BUF2_860026562,"%s%s",pt_BUF_860026562,pt_OP_CSV_860026562)
		erreur_860026562 = i_set_art_str( g_iartout8,$TsymTconvNE::CSV,pt_BUF2_860026562)
	FINSI

	# G4R6 Lot3
	# TYPE_EDIT
	SI i_strcmp(pt_TYPE_EDIT_860026562," ") != 0
	ALORS
		erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4type_edit,$TsymTconvNE::TYPE_EDIT,0)
		erreur_860026562=i_set_art_str(g_iartout8, $TsymTconvNE::TYPE_EDIT, pt_TYPE_EDIT_860026562)
	FINSI

	# CODE_TARIF
	SI i_strcmp(pt_CODE_TARIF_860026562,"    ") != 0
	ALORS
		erreur_860026562 = i_ajoutChampNum(g_iartout8, $TsymTconvNE::T4code_tarif,$TsymTconvNE::CODE_TARIF,0)
		erreur_860026562=i_set_art_str(g_iartout8, $TsymTconvNE::CODE_TARIF, pt_CODE_TARIF_860026562)
	FINSI
	# /G4R6 Lot3

	# Suppression des champs utilises en interne parametrage
	erreur_860026562 = i_supprChamp(g_iartout8, "T4dede_n")
	erreur_860026562 = i_supprChamp(g_iartout8, "T4dedeini_n")
# G4R5 QC785
	erreur_860026562 = i_supprChamp(g_iartout8, "T4dedeini2_n")
	#erreur = i_supprChamp(g_iartout8, "T4dede_n")
	erreur_860026562 = i_supprChamp(g_iartout8, "T4detr_pay")
	erreur_860026562 = i_supprChamp(g_iartout8, "T4detr1_n")
	erreur_860026562 = i_supprChamp(g_iartout8, "T4detr_n")
	erreur_860026562 = i_supprChamp(g_iartout8, "T4rerout_type")
	erreur_860026562 = i_supprChamp(g_iartout8, "T4oadc")
FINSI

#G3R24
#######################################
# 		DQD
#######################################
SI bDQD_860026562
ALORS

	SI (i_dup_art_id(g_iartin, g_iartout5))
	ALORS
		erreur_860026562 = i_PlvMessEmettre(8502, 2, g_iartin, "", 3, "pour DQD", C_Article_860026562, g_ieec)
		SAUT DISTRI_ERR
	FINSI

	#G3R24 QC587
	SI (i_valid_field_n(g_iartout5, $TconvNE::T3correl))
	ALORS
		erreur_860026562 = i_supprChamp(g_iartout5, "T3correl")
	FINSI

	SI (i_valid_field_n(g_iartout5, $TconvNE::T3ajout))
	ALORS
		erreur_860026562 = i_supprChamp(g_iartout5, "T3ajout")
	FINSI

	SI (i_rename_art(g_iartout5, C_TdqdTconvNE_860026562))
	ALORS
		erreur_860026562 = i_PlvMessEmettre(8502, 2, g_iartin, "", 3, "pour DQD", C_Article_860026562, g_ieec)
		SAUT DISTRI_ERR
	FINSI
FINSI

############################################################################
# Emission vers IECC et/ou REDISTRI
############################################################################
SI b16XCONV_860026562
ALORS
	#trace("emission vers 16XCONV")
	res_860026562 = i_stocke_art_iecc(g_iartout7, inst16XCONV_860026562)
FINSI

SI bANDRO_860026562
ALORS
	#trace("emission vers ANDROMERI")
	res_860026562 = i_stocke_art_iecc(g_iartout12, instANDROMERI_860026562)
FINSI

SI bFE_860026562
ALORS
	#trace("emission vers FE")
	res_860026562 = i_stocke_art_iecc(g_iartout4, instFE_860026562)
FINSI

# G4R2
SI bCome_860026562
ALORS
	#trace("emission vers FERPV")
	res_860026562 = i_stocke_art_iecc(g_iartout14, instCOME_860026562)
FINSI

SI bElig_860026562
ALORS
	#trace("emission vers FERPV")
	res_860026562 = i_stocke_art_iecc(g_iartout14, instCOM_ELIG_860026562)
FINSI

SI bFERPV_860026562
ALORS
	#trace("emission vers FERPV")
	res_860026562 = i_stocke_art_iecc(g_iartout11, instFERPV_860026562)
FINSI

SI bTRAFIC_860026562
ALORS
	#trace("emission vers TRAFIC")
	res_860026562 = i_stocke_art_iecc(g_iartout2, instTRAFIC_860026562)
FINSI

#---------------------------------------------------------------------------
# TRAFBSS1
#---------------------------------------------------------------------------
SI (bTrafBSS1_860026562 == 1)
ALORS
	#trace("emission vers TRAFBSS1")
	res_860026562 = i_stocke_art_iecc(g_iartout2, instTRAFBSS1_860026562)
FINSI
#---------------------------------------------------------------------------
# TRAFBSS2
#---------------------------------------------------------------------------
SI (bTrafBSS2_860026562 == 1)
ALORS
	#trace("emission vers TRAFBSS2")
	res_860026562 = i_stocke_art_iecc(g_iartout2, instTRAFBSS2_860026562)
FINSI

SI bCENTVG_860026562
ALORS
	#trace("emission vers CENTAUREVG")
	res_860026562 = i_stocke_art_iecc(g_iartout10, instCENTAUREVG_860026562)
FINSI

SI bCENTDEA_860026562
ALORS
	#trace("emission vers CENTAUREDEA")
	res_860026562 = i_stocke_art_iecc(g_iartout9, instCENTAUREDEA_860026562)
FINSI

SI bDM_860026562
ALORS
	#trace("emission vers DM")
	res_860026562 = i_stocke_art_iecc(g_iartout6, instDM_860026562)
FINSI

SI bSC_860026562
ALORS
	#trace("emission vers SC")
	res_860026562 = i_stocke_art_iecc(g_iartout3, instSC_860026562)
FINSI

# FCT => Supprimee

SI bSYMPHONIE_860026562
ALORS
	#trace("emission vers SYMPHONIE")
	res_860026562 = i_stocke_art_iecc(g_iartout8, instSYMPHONIE_860026562)
FINSI

#G3R24
SI bDQD_860026562
ALORS
	#trace("emission vers DQD")
	res_860026562 = i_stocke_art_iecc(g_iartout5, instDQD_860026562)
	bREDISTIP_860026562 = 0
	bREDISTMAJ2G_860026562 = 0
FINSI

SI (bREDISTIP_860026562 == 1) || (bREDISTMAJ2G_860026562 == 1)
ALORS
	SAUT DISTRI_REDIST
FINSI

RETOUR TRAIT_OK

###########################################################################
# Stockage en elimine
###########################################################################

POINT DISTRI_ELM

trace( "__FILE__:__LINE__ : Fin du Pcode de distribution : Stockage en ELIMINE" )

res_860026562 = i_stocke_art( g_iartin, 0, PT_ELIMINE, 0 )

RETOUR TRAIT_OK

############################################################################
# Stockage en Errone
############################################################################

POINT DISTRI_ERR

trace( "Pcode de distribution: TconvNE => ENVOI EN ERRONE")

res_860026562 = i_make_art_rej(g_iartin, g_iartout7, code_errone_860026562)
res_860026562 = i_stocke_art(g_iartout7, 0, PT_ERRONE, 0)

RETOUR TRAIT_OK

############################################################################
# Stockage en Redistribution
############################################################################

POINT DISTRI_REDIST

trace( "__FILE__:__LINE__ - STOCKAGE EN REDISTRIBUTION" )

# On emet le message d erreur uniquement au 1er passage
#G3R24
SI ((cpt_RDT_860026562 == 0) && (bREDISTMAJ2G_860026562 == 1))
ALORS
	erreur_860026562 = i_PlvMessEmettre(8503, 2, g_iartin, "", 3, pt_LIBELREDIST_860026562, C_TconvNE_860026562, pt_SGTQS_860026562)
FINSI

erreur_860026562 = i_stocke_art(g_iartin, 0, PT_REDIST|RD_TABLE5, 0)

RETOUR TRAIT_OK
#------------------------ FIN TconvNE_dis.src -------------------------------------------------------
