DEFINITION C_Article_800009802 "Topitml"
REGISTRE ENTIER Indicator_800009802
REGISTRE ENTIER RoleNode_800009802
REGISTRE ENTIER erreur_800009802
REGISTRE ENTIER code_rejet_800009802
################################################################
# TRAITEMENT Topitml : 	DC de facturation flux issus de la 
#			premediation CGW-IMS
################################################################
#	HISTORIQUE
# 08/08/2011 - RHE - Creation
#	05/10/2011 RHE VerifPcode
################################################################

Indicator_800009802 = -1 
# VerifPcode - RHE # Status = -1    
RoleNode_800009802 = -1 
erreur_800009802  = 0   
code_rejet_800009802 = 0

trace("[Topitml_tr] Traitement - Topitml")

################################################################
#	Controles unitaires
################################################################
#==============================================================
#champ AnswerIndic
SI (i_valid_field_n(g_iartin, $Topitml::AnswerIndicator))
ALORS
	Indicator_800009802 = i_get_art_field(g_iartin, $Topitml::AnswerIndicator)
	SI (Indicator_800009802 != 0 && Indicator_800009802 != 1 && Indicator_800009802 != 2)
	ALORS
		code_rejet_800009802 = 0x5042
		erreur_800009802 = i_PlvMessEmettre(7300,2,g_iartin,"",3,code_rejet_800009802,C_Article_800009802,Indicator_800009802)	
		SAUT STOCKE_ERRONE
	FINSI
FINSI

#champ CallStarTime
SI (!i_valid_field_n(g_iartin, $Topitml::CallStartTime))
ALORS 
		code_rejet_800009802 = 0x5072
		erreur_800009802 = i_PlvMessEmettre(7303,2,g_iartin,"",2,code_rejet_800009802,C_Article_800009802,0)	
		SAUT STOCKE_ERRONE
FINSI	

#champ RoleNode
SI (i_valid_field_n(g_iartin, $Topitml::RoleNode))
ALORS
	RoleNode_800009802 = i_get_art_field(g_iartin, $Topitml::RoleNode)
	SI (RoleNode_800009802 != 0 && RoleNode_800009802 != 1)
	ALORS
		code_rejet_800009802 = 0x5042
		erreur_800009802 = i_PlvMessEmettre(7304,2,g_iartin,"",3,code_rejet_800009802,C_Article_800009802,RoleNode_800009802)	
		SAUT STOCKE_ERRONE
	FINSI
SINON
		code_rejet_800009802 = 0x5072
		erreur_800009802 = i_PlvMessEmettre(7305,2,g_iartin,"",2,code_rejet_800009802,C_Article_800009802,0)	
		SAUT STOCKE_ERRONE
FINSI

######################################
# Stockage OK
######################################

erreur_800009802 = i_stocke_art(g_iartin, 0, PT_OK, 0)
RETOUR TRAIT_OK

######################################
#  Stockage ERRONE
######################################

POINT STOCKE_ERRONE

#trace("Stockage en ERRONE ")
erreur_800009802 = i_make_art_rej(g_iartin,g_iartout,code_rejet_800009802)
erreur_800009802 = i_stocke_art(g_iartout, 0, PT_ERRONE,0)
RETOUR TRAIT_OK
