1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
|
Public Function F_UTL_VERIF_TOUT(str_Id_Attribut As String, str_Valeur_Champ As String) As Boolean
'*******************************************************************************
'* F_UTL_VERIF_TOUT
'*
'* paramètres : str_Id_Attribut String (Identifiant de l'attribut)
'* str_Valeur_Champ String (Valeur de l'attribut)
'*
'* rôle : Verifie l'existence, la longueur et le format d'un champ a partir du code attribut du référencement
'*
'*******************************************************************************
'* Création : 15/04/2008 : VMA
'* Modification : 11/12/2008 : GKA
'* F_UTL_VERIF_TOUT: générique
'
'*******************************************************************************
'* Attention!! Ne pas mettre de spécifique dans cette fonction
'*******************************************************************************
'
On Error GoTo Err_F_UTL_VERIF_TOUT
Dim int_Numero_Err As Integer
Dim str_Reponse As Variant
Dim boo_Obligatoire As Boolean
Dim lng_Longueur_Champ As Long
Dim str_Id_Format As String
Dim str_Nom_Champ As String
Dim frm As Form
str_Nom_Champ = DLookup("A_ATR_LIBELLE_DONNEE", "[T_REF_ATTRIBUT]", "[A_ATR_ID]=""" & str_Id_Attribut & """")
str_Reponse = DLookup("A_ATR_OBLIGATOIRE", "[T_REF_ATTRIBUT]", "[A_ATR_ID]=""" & str_Id_Attribut & """")
If str_Id_Attribut = 25148 Or str_Id_Attribut = 25147 Then
If str_Id_Attribut = 25148 Then
If Forms![F_UTL_COLLECTE]![SFB].Form![A_SEM_C_SER_MET_STOCK].value = "O" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
End If
If str_Id_Attribut = 25147 Then
If Forms![F_UTL_COLLECTE]![SFB].Form![A_SEM_C_SER_MET_STOCK] = "N" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
End If
End If
If IsNull(str_Reponse) Then
int_Numero_Err = 1
GoTo Err_F_UTL_VERIF_TOUT_GESTION_ERREUR
Else
If str_Reponse = "o" Then boo_Obligatoire = True
' modifier le referencement obligatoire en boolean
End If
'Debut specifique SA/ MMA-->322
If str_Id_Attribut = "25250" Then
If Forms![F_UTL_COLLECTE]![SFB].Form![A_AAA_C_C_KOSTL].value = "O" Or Forms![F_UTL_COLLECTE]![SFB].Form![A_AAA_C_C_PRCTR].value = "O" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
'
' If Forms![F_UTL_CREATION]![SFA].Form![*c Centre de profit].Value = "O" Or Forms![F_UTL_CREATION]![SFA].Form![*c Centre de coût].Value = "O" Then
' str_Reponse = "o"
' boo_Obligatoire = True
'
' End If
End If
' Début Spécifique EJ_ENTETE
If str_Id_Attribut = "24327" Or str_Id_Attribut = "24326" Or str_Id_Attribut = "24328" Or str_Id_Attribut = "24397" Or str_Id_Attribut = "24325" Or str_Id_Attribut = "24330" Or str_Id_Attribut = "24331" Or str_Id_Attribut = "24332" Or str_Id_Attribut = "24334" Then
Set frm = F_UTL_FORM()
If frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMU" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMX" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMT" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMBC" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMPX" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMPT" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMPC" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
ElseIf str_Id_Attribut = "25363" Then
Set frm = F_UTL_FORM()
If frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMU" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMX" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMT" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMBC" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMPX" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMPT" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMPC" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZBC" Or frm("A_DEJ_C_E8_PROCESS_TYPE") = "ZMPU" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
End If
'AMG
If str_Id_Attribut = "26808" Or str_Id_Attribut = "26809" Or str_Id_Attribut = "26810" Or str_Id_Attribut = "26812" Then 'str_Id_Attribut = "26806" Or str_Id_Attribut = "26803" Or str_Id_Attribut = "26805" Or str_Id_Attribut = "26804" Or str_Id_Attribut = "26875" Or : Enlever suite Ano 7929
Set frm = F_UTL_FORM()
If frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMU" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMX" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMT" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMBC" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMPX" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMPT" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMPC" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
ElseIf str_Id_Attribut = "26983" Then
Set frm = F_UTL_FORM()
If frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMU" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMX" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMT" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMBC" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMPX" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMPT" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMPC" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZBC" Or frm("A_DEQ_C_E8_PROCESS_TYPE") = "ZMPU" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
End If
'ACL
If str_Id_Attribut = "26339" Or str_Id_Attribut = "26338" Or str_Id_Attribut = "26340" Or str_Id_Attribut = "26409" Or str_Id_Attribut = "26337" Or str_Id_Attribut = "26342" Or str_Id_Attribut = "26343" Or str_Id_Attribut = "26344" Or str_Id_Attribut = "26346" Then
Set frm = F_UTL_FORM()
If frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMU" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMX" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMT" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMBC" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMPX" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMPT" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMPC" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
ElseIf str_Id_Attribut = "26517" Then
Set frm = F_UTL_FORM()
If frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMU" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMX" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMT" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMBC" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMPX" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMPT" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMPC" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZBC" Or frm("A_DEA_C_E8_PROCESS_TYPE") = "ZMPU" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
End If
' Fin Spécifique EJ_ENTETE
'Début Spécifique EJ_POSTE
If str_Id_Attribut = "26702" Then ' pour C_L13_DELIV_DATE pour NDL ACL AMG 20100119
Set frm = F_UTL_FORM()
If Left(frm("A_DEB_C_L22_PS_IPT"), 4) = "Z_LG" Then
str_Reponse = "o"
boo_Obligatoire = True
Else
str_Reponse = "n"
boo_Obligatoire = False
End If
End If
If str_Id_Attribut = "24399" Then ' pour C_L13_DELIV_DATE pour NDL ACL AMG 20100119
Set frm = F_UTL_FORM()
If Left(frm("A_DER_C_L22_PS_IPT"), 4) = "Z_LG" Then
str_Reponse = "o"
boo_Obligatoire = True
Else
str_Reponse = "n"
boo_Obligatoire = False
End If
End If
If str_Id_Attribut = "27168" Then ' pour C_L13_DELIV_DATE pour NDL ACL AMG 20100119
Set frm = F_UTL_FORM()
If Left(frm("A_DES_C_L22_PS_IPT"), 4) = "Z_LG" Then
str_Reponse = "o"
boo_Obligatoire = True
Else
str_Reponse = "n"
boo_Obligatoire = False
End If
End If
If str_Id_Attribut = "24405" Or str_Id_Attribut = "24408" Or str_Id_Attribut = "24406" Or str_Id_Attribut = "24409" Or str_Id_Attribut = "24435" Or str_Id_Attribut = "24421" Or str_Id_Attribut = "24433" Or str_Id_Attribut = "24412" Or str_Id_Attribut = "24413" Or str_Id_Attribut = "24449" Or str_Id_Attribut = "24411" Or str_Id_Attribut = "24412" Or str_Id_Attribut = "24414" Or str_Id_Attribut = "24416" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
'Code option
If str_Id_Attribut = "24407" Then
Set frm = F_UTL_FORM()
If frm("A_DER_C_L22_PS_IPT") = "Z_LI_TC" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
End If
If str_Id_Attribut = "27174" Or str_Id_Attribut = "27177" Or str_Id_Attribut = "27175" Or str_Id_Attribut = "27178" Or str_Id_Attribut = "27204" Or str_Id_Attribut = "27190" Or str_Id_Attribut = "27202" Or str_Id_Attribut = "27181" Or str_Id_Attribut = "27182" Or str_Id_Attribut = "27125" Or str_Id_Attribut = "27180" Or str_Id_Attribut = "27181" Or str_Id_Attribut = "27185" Then 'Suite ano 7919 : Or str_Id_Attribut = "27183"
str_Reponse = "o"
boo_Obligatoire = True
End If
' 'Forme de prix : cma
If str_Id_Attribut = "27183" Then
Set frm = F_UTL_FORM()
If frm("A_DES_C_L22_PS_IPT") = "Z_LG" Then
str_Reponse = "o"
boo_Obligatoire = True
Else
str_Reponse = "n"
boo_Obligatoire = False
End If
End If
'Code option
If str_Id_Attribut = "27176" Then
Set frm = F_UTL_FORM()
If frm("A_DES_C_L22_PS_IPT") = "Z_LI_TC" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
End If
If str_Id_Attribut = "26708" Or str_Id_Attribut = "26711" Or str_Id_Attribut = "26709" Or str_Id_Attribut = "26712" Or str_Id_Attribut = "26738" Or str_Id_Attribut = "26724" Or str_Id_Attribut = "26736" Or str_Id_Attribut = "26715" Or str_Id_Attribut = "26716" Or str_Id_Attribut = "26659" Or str_Id_Attribut = "26714" Or str_Id_Attribut = "26715" Or str_Id_Attribut = "26717" Or str_Id_Attribut = "26719" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
'Code option
If str_Id_Attribut = "26710" Then
Set frm = F_UTL_FORM()
If frm("A_DEB_C_L22_PS_IPT") = "Z_LI_TC" Then
str_Reponse = "o"
boo_Obligatoire = True
End If
End If
'Fin Spécifique EJ_POSTE
If F_SOC_VERIF_EXISTENCE(str_Valeur_Champ, boo_Obligatoire) = False Then
Call F_UTL_MESSAGE("E030", 2, str_Nom_Champ)
F_UTL_VERIF_TOUT = True
Else
If str_Valeur_Champ = "" Then
F_UTL_VERIF_TOUT = False
Else
str_Reponse = DLookup("A_ATR_LONGUEUR", "[T_REF_ATTRIBUT]", "[A_ATR_ID]=""" & str_Id_Attribut & """")
If IsNull(str_Reponse) Then
Debug.Print "L'attribut ayant " & str_Nom_Champ & " pour code n'a pas de longueur dans le referencement."
Else
lng_Longueur_Champ = str_Reponse
End If
If F_SOC_VERIF_LONGUEUR(lng_Longueur_Champ, str_Valeur_Champ) = False Then
Call F_UTL_MESSAGE("E008", 3, str_Nom_Champ, lng_Longueur_Champ)
F_UTL_VERIF_TOUT = True
Else
str_Reponse = DLookup("A_ATR_FOR_ID", "[T_REF_ATTRIBUT]", "[A_ATR_ID]=""" & str_Id_Attribut & """")
'Début Spécifique EJ_POSTE
If str_Id_Attribut = "24437" Then
Set frm = F_UTL_FORM()
If frm("A_DER_C_L9_UNIT") = "DEV" Then
str_Reponse = "56"
ElseIf frm("A_DER_C_L9_UNIT") = "ST" Then
str_Reponse = "57"
End If
End If
If str_Id_Attribut = "27206" Then
Set frm = F_UTL_FORM()
If frm("A_DES_C_L9_UNIT") = "DEV" Then
str_Reponse = "56"
ElseIf frm("A_DES_C_L9_UNIT") = "ST" Then
str_Reponse = "57"
End If
End If
If str_Id_Attribut = "26740" Then
Set frm = F_UTL_FORM()
If frm("A_DEB_C_L9_UNIT") = "DEV" Then
str_Reponse = "56"
ElseIf frm("A_DEB_C_L9_UNIT") = "ST" Then
str_Reponse = "57"
End If
End If
'Fin Spécifique EJ_POSTE
'Début spécifique Budget "15889"
If str_Id_Attribut = "15889" Then
Set frm = F_UTL_FORM()
If F_FRM_GEN_VALEUR_PAR_PROPRIETE(frm, "A_CBA_S_CODE_SERVICE") = "CENTRAL" Then
str_Reponse = "n"
boo_Obligatoire = False
End If
End If
'Fin spécifique Budget
If IsNull(str_Reponse) Then
Debug.Print "L'attribut ayant " & str_Nom_Champ & " pour code n'a pas d'identifiant de format dans le referencement."
Else
str_Id_Format = str_Reponse
End If
If F_SOC_VERIF_FORMAT(str_Valeur_Champ, str_Id_Format, str_Id_Attribut) = False Then
F_UTL_VERIF_TOUT = True
' Else
' If Screen.ActiveForm.Name = "F_UTL_CREATION" Then ' TODO pour l'instant pour copier coller uniquement
' If F_SOC_VERIF_PRESENCE_LISTE(str_Valeur_Champ, str_Id_Attribut) = False Then
' F_UTL_VERIF_TOUT = True
' End If
' End If
End If
End If
End If
End If
Exit_F_UTL_VERIF_TOUT:
On Error Resume Next
Set frm = Nothing
Exit Function
Err_F_UTL_VERIF_TOUT:
Select Case Err.Number
Case 94
' Call F_UTL_MESSAGE("E009", 2, str_Nom_Champ) ' A décommenter après le test suite ano 7919
Case Else
Call F_UTL_MESSAGE("E001", 3, Err.Number, Err.Description, " M_SOC_UTL_CONTROLE_FORMAT::F_UTL_VERIF_TOUT")
End Select
Resume Exit_F_UTL_VERIF_TOUT
Resume
Err_F_UTL_VERIF_TOUT_GESTION_ERREUR:
Select Case int_Numero_Err
Case 1
Debug.Print "ERREUR" & "L'attribut ayant " & str_Nom_Champ & " pour code n'a pas de valeur pour obligatoire dans le referencement."
Call F_UTL_MESSAGE("E004", 2, str_Nom_Champ)
End Select
F_UTL_VERIF_TOUT = False
End Function |