REGISTRE ENTIER erreur_800009809
REGISTRE ENTIER code_rejet_800009809
REGISTRE ENTIER IDUS_INF_800009809
REGISTRE ENTIER DEDE_INF_800009809
REGISTRE ENTIER CAX_800009809
REGISTRE ENTIER TAP_800009809
REGISTRE ENTIER TAX_800009809
REGISTRE ENTIER DUR_800009809
REGISTRE POINTEUR pt_CHAMP_ERRONE_800009809
################################################################
#
#	Tsmsf1a7dc : DC de facturation SMS fixe
#
#	RBE	02/06/2004	G2R0Cl : MAJ des codes erreurs
#	PSA	09/07/2004	G2R0Cl : utilisation de strcpy pour les pointeurs
#	06/10/2011 RHE VerifPcode
#
################################################################



pt_CHAMP_ERRONE_800009809 = "01234567890123456789"
i_strcpy(pt_CHAMP_ERRONE_800009809, "")

################################################################
#
#	Test syntaxique
#
################################################################

erreur_800009809 = i_test_art(g_iartin)
SI erreur_800009809
ALORS
	code_rejet_800009809 = 0x5071
	erreur_800009809 = i_PlvMessEmettre(7051,2,g_iartin,"",1,code_rejet_800009809,0,0)
	SAUT STOCKE_ERRONE
FINSI

################################################################
#
#	Tests semantiques
#
################################################################

# IDUS_INF
SI (i_valid_field_n(g_iartin, $Tsmsf1a7dc::IDUS_INF))
ALORS
	IDUS_INF_800009809 = i_get_art_field(g_iartin, $Tsmsf1a7dc::IDUS_INF)
	SI ( (IDUS_INF_800009809 != 0x80) && (IDUS_INF_800009809 != 0xC0))
	ALORS
		i_strcpy(pt_CHAMP_ERRONE_800009809, "IDUS_INF") 
		code_rejet_800009809 = 0x5041
		erreur_800009809 = i_PlvMessEmettre(7050,2,g_iartin,"",3,code_rejet_800009809, pt_CHAMP_ERRONE_800009809, IDUS_INF_800009809)
		SAUT STOCKE_ERRONE
	FINSI
FINSI
	
	
# DEDE_INF
SI (i_valid_field_n(g_iartin, $Tsmsf1a7dc::DEDE_INF))
ALORS
	DEDE_INF_800009809 = i_get_art_field(g_iartin, $Tsmsf1a7dc::DEDE_INF)
	SI ( (DEDE_INF_800009809 != 0x82) && (DEDE_INF_800009809 != 0xC3) && (DEDE_INF_800009809 != 0x00))
	ALORS
		i_strcpy(pt_CHAMP_ERRONE_800009809, "DEDE_INF")
		code_rejet_800009809 = 0x5041
		erreur_800009809 = i_PlvMessEmettre(7050,2,g_iartin,"",3,code_rejet_800009809, pt_CHAMP_ERRONE_800009809, DEDE_INF_800009809)
		SAUT STOCKE_ERRONE
	FINSI
FINSI


# CAX
CAX_800009809 = i_get_art_field(g_iartin, $Tsmsf1a7dc::CAX)
SI ( (CAX_800009809 < 1) || (CAX_800009809 > 5) )
ALORS
	i_strcpy(pt_CHAMP_ERRONE_800009809, "CAX")
	code_rejet_800009809 = 0x5041
	erreur_800009809 = i_PlvMessEmettre(7050,2,g_iartin,"",3,code_rejet_800009809, pt_CHAMP_ERRONE_800009809, CAX_800009809)
	SAUT STOCKE_ERRONE
FINSI	


# TAP
TAP_800009809 = i_get_art_field(g_iartin, $Tsmsf1a7dc::TAP)
SI ( (TAP_800009809 != 0x00) && (TAP_800009809 != 0x01) && (TAP_800009809 != 0xC0) && (TAP_800009809 != 0xC1) && (TAP_800009809 != 0x40) && (TAP_800009809 != 0x41) && (TAP_800009809 != 0x80) && (TAP_800009809 != 0x81))
ALORS
	i_strcpy(pt_CHAMP_ERRONE_800009809, "TAP")
	code_rejet_800009809 = 0x5041
	erreur_800009809 = i_PlvMessEmettre(7050,2,g_iartin,"",3,code_rejet_800009809, pt_CHAMP_ERRONE_800009809, TAP_800009809)
	SAUT STOCKE_ERRONE
FINSI


# TAX
TAX_800009809 = i_get_art_field(g_iartin, $Tsmsf1a7dc::TAX)
SI (TAX_800009809 != 0x00) 
ALORS
	i_strcpy(pt_CHAMP_ERRONE_800009809, "TAX")
	code_rejet_800009809 = 0x5041
	erreur_800009809 = i_PlvMessEmettre(7050,2,g_iartin,"",3,code_rejet_800009809, pt_CHAMP_ERRONE_800009809, TAX_800009809)
	SAUT STOCKE_ERRONE
FINSI


# DUR
DUR_800009809 = i_get_art_field(g_iartin, $Tsmsf1a7dc::DUR)
SI (DUR_800009809 != 0x01) 
ALORS
	i_strcpy(pt_CHAMP_ERRONE_800009809, "DUR")
	code_rejet_800009809 = 0x5041
	erreur_800009809 = i_PlvMessEmettre(7050,2,g_iartin,"",3,code_rejet_800009809, pt_CHAMP_ERRONE_800009809, DUR_800009809)
	SAUT STOCKE_ERRONE
FINSI





#==============================================================================
#	Stockage en valide
#==============================================================================

POINT   STOCKE_OK

erreur_800009809 = i_stocke_art(g_iartin, 0, PT_OK, 0)

RETOUR TRAIT_OK


#==============================================================================
#	Stockage en errone
#==============================================================================

POINT   STOCKE_ERRONE

#       trace2("Stockage en ERRONE %s", "", "")

erreur_800009809 = i_make_art_rej(g_iartin, g_iartout5, code_rejet_800009809)
erreur_800009809 = i_stocke_art(g_iartout5, 0, PT_ERRONE, 0)

RETOUR TRAIT_OK


