DEFINITION domaine_OK_800009769 "Dsgns"
DEFINITION domaine_INEF_800009769 "Dsgns"
DEFINITION article_INEF_800009769 "NODESTfe6dc"
DEFINITION ic_REF_800009769 10
DEFINITION ic_CAX_cap2_800009769 25
DEFINITION ic_TAP_cap2_800009769 26
DEFINITION ic_SUP_cap2_800009769 29
DEFINITION CREJ_ERR00_800009769 0x0200
REGISTRE ENTIER code_rejet_800009769
REGISTRE ENTIER erreur_800009769
REGISTRE ENTIER stocke_date_800009769
REGISTRE ENTIER SUP_800009769
REGISTRE ENTIER CAX_800009769
REGISTRE ENTIER SCT_800009769
REGISTRE ENTIER TAP_800009769
REGISTRE ENTIER STY_800009769
REGISTRE ENTIER REF_800009769
REGISTRE ENTIER INEF_800009769
####################################################################
#	article DC VN6 sur faisceau entrant
#
# PSA	29/09/2004	FO714 : suppression cpt ANO
#	30/11/2011 RHE VerifPcode
#
#######################################################################
#
#				DECLARATIONS
#
#######################################################################

#----------------------------------------------------------------------
# GLOBAL
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# CHAMPS DE L'ARTICLE
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# DOMAINES
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# Constante liees au fichier artobj
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# CODES DE RECYCLAGE
#----------------------------------------------------------------------
# VerifPcode - RHE # 
# /VerifPcode
#----------------------------------------------------------------------
# CODES DE REJET
#----------------------------------------------------------------------
# VerifPcode - RHE # 
# VerifPcode


#######################################################################
#
#				CONTROLES
#
#######################################################################

#	trace("Article DC faisceau entrant SGN VN6")

#----------------------------------------------------------------------
# TEST DE L'ARTICLE
#----------------------------------------------------------------------
erreur_800009769 = i_test_art( g_iartin)
SI erreur_800009769
ALORS
   code_rejet_800009769 = CREJ_ERR00_800009769
   erreur_800009769 = i_PlvMessEmettre( 7550, 2, g_iartin, "", 1, code_rejet_800009769, 0, 0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x Erreur syntaxique"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 401 Verification que CAX = 0x04
#----------------------------------------------------------------------
CAX_800009769 = i_get_art_field( g_iartin, ic_CAX_cap2_800009769)
SI CAX_800009769 != 0x04
ALORS
   code_rejet_800009769 = CREJ_ERR00_800009769
   erreur_800009769 = i_PlvMessEmettre(7571,2,g_iartin,"",2,code_rejet_800009769,CAX_800009769,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (CAX = %d inconnue) "
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 402 Verification SCT = 0x26
#----------------------------------------------------------------------
SCT_800009769 = g_iartin.SCT
SI SCT_800009769  != 0x26
ALORS
   code_rejet_800009769 = CREJ_ERR00_800009769
   erreur_800009769 = i_PlvMessEmettre(7572,2,g_iartin,"",2,code_rejet_800009769,SCT_800009769,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (SCT = 0x%02x incorrect)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 306 Verification STY = 0x00
#----------------------------------------------------------------------
STY_800009769 = g_iartin.STY
SI (STY_800009769 != 0x0)
ALORS
   code_rejet_800009769 = CREJ_ERR00_800009769
   erreur_800009769 = i_PlvMessEmettre(7573,2,g_iartin,"",2,code_rejet_800009769,STY_800009769,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (STY = 0x%02x incorrect)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 307 Verification TAP = 0x00 ou 0x40
#----------------------------------------------------------------------
TAP_800009769 = i_get_art_field( g_iartin, ic_TAP_cap2_800009769)
SI ((TAP_800009769 != 0x00) && (TAP_800009769 != 0x40))
ALORS
   code_rejet_800009769 = CREJ_ERR00_800009769
   erreur_800009769 = i_PlvMessEmettre(7574,2,g_iartin,"",2,code_rejet_800009769,TAP_800009769,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN7: %04x- Err. syntaxique (champ TAP incoherent)"
   SAUT STOCKE_ERRONE
FINSI


#----------------------------------------------------------------------
# TEST 403 Verification REF < 95 (95=0x5F)
#----------------------------------------------------------------------
REF_800009769 = i_get_art_field( g_iartin, ic_REF_800009769)
SI (REF_800009769 > 0x5F)
ALORS
   code_rejet_800009769 = CREJ_ERR00_800009769
   erreur_800009769 = i_PlvMessEmettre(7575,2,g_iartin,"",1,code_rejet_800009769,0,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN6: %04x- Err. syntaxique (champ REF hors bornes)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 404 Verification SUP = 0x00
#----------------------------------------------------------------------
SUP_800009769 = i_get_art_field( g_iartin, ic_SUP_cap2_800009769)
SI (SUP_800009769 != 0x0)
ALORS
   code_rejet_800009769 = CREJ_ERR00_800009769
   erreur_800009769 = i_PlvMessEmettre(7576,2,g_iartin,"",2,code_rejet_800009769,SUP_800009769,0)
# DEST_JNL | DEST_TEEC | DEST_BASE,"DC VN6: %04x- Err. syntaxique (SUP = %d inconnue)"
   SAUT STOCKE_ERRONE
FINSI

#----------------------------------------------------------------------
# TEST 405 Verification INEF <= 99
#----------------------------------------------------------------------
INEF_800009769 = g_iartin.INEF
SI (INEF_800009769 > 99)
ALORS
   code_rejet_800009769 = CREJ_ERR00_800009769
   erreur_800009769 = i_PlvMessEmettre(7577,2,g_iartin,"",1,code_rejet_800009769,0,0)

   SAUT STOCKE_ERRONE
FINSI


#######################################################################
#
#				TRAITEMENTS
#
#######################################################################

#----------------------------------------------------------------------
# DETERMINATION DES ARTICLES INEFFICACES
#----------------------------------------------------------------------
SI ((TAP_800009769 & 0x40) == 0x40)
ALORS
   trace( "Article inefficace -> Stockage en inefficace")
   SAUT STOCKE_OK_INEF
FINSI

#######################################################################
#
#				    STOCKAGE
#
#######################################################################

#----------------------------------------------------------------------
# STOCKAGE EN EFFICACE
#----------------------------------------------------------------------


#	trace("Ajout du T3=0x7E avec CCD = 0xFF et CTT = 0xFFFF")
#erreur = i_ajout_tlv_strict(g_iartin, "T3ce", "")
#erreur = i_ajout_tlv_strict(g_iartin, "T4typtra", "")
erreur_800009769 = i_ajoutChamp(g_iartin,"T3ce","T4typtra",6)
# trace( "Stockage de l'article en Dsgns")
stocke_date_800009769 = i_get_art_stocke_date(g_iartin, DATE_PLUS_DUREE)

erreur_800009769 = i_stocke_art(g_iartin,
		      stocke_date_800009769,
		      PT_OK,
		      domaine_OK_800009769)

# trace("Fin traitement Article SGN Nodes")
RETOUR TRAIT_OK

#----------------------------------------------------------------------
# STOCKAGE EN INEFFICACE
#----------------------------------------------------------------------
POINT STOCKE_OK_INEF

# trace("Stockage de l'article en Dinef")
stocke_date_800009769 = i_get_art_stocke_date(g_iartin, DATE_PLUS_DUREE)

erreur_800009769 = i_change_art_id(g_iartin, article_INEF_800009769)

erreur_800009769 = i_stocke_art(g_iartin,
		      stocke_date_800009769,
		      PT_OK,
		      domaine_INEF_800009769)

# trace("Fin traitement Article SGN Nodes")
RETOUR TRAIT_OK

#----------------------------------------------------------------------
# STOCKAGE EN ERRONE
#----------------------------------------------------------------------
POINT STOCKE_ERRONE

# trace("Stockage de l'article en ERRONE")
stocke_date_800009769 = i_get_art_stocke_date( g_iartin, DATE_PLUS_DUREE)

erreur_800009769 = i_make_art_rej(g_iartin, g_iartout, code_rejet_800009769)

erreur_800009769 = i_stocke_art(g_iartout,
		      stocke_date_800009769,
		      PT_ERRONE,
		      domaine_OK_800009769)

# trace("Fin traitement Article SGN Nodes")
RETOUR TRAIT_OK

#######################################################################
#
#				    FIN
#
#######################################################################


