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
| Sablier()
// Recupération de l'Id Article
nIdart est un entier
L_phraseSQL est une chaîne = "SELECT * FROM T_article "
SELON COMBO_Critere
CAS 1 // CODE BARRE
L_phraseSQL+= "WHERE code_barre ="+"'"+SAI_Critere+"'"
CAS 2 // Code Article
L_phraseSQL+= "WHERE Réf_article LIKE " +"'%"+ SAI_Critere+"%'"
CAS 3 // Designation
L_phraseSQL+= "WHERE Description LIKE " +"'%"+ SAI_Critere+"%'"
AUTRE CAS
FIN
//Info(L_phraseSQL)
L_sdReq,M_sdReq sont des Sources de Données
SI PAS HExécuteRequêteSQL(L_sdReq,hRequêteInterruptible,L_phraseSQL) ALORS
Erreur("ERREUR Requête T_Articles "+HErreurInfo(hErrComplet))
SINON
TableSupprimeTout(TABLE_Historiq)
POUR TOUT L_sdReq DEPUISDEBUT
nIdart= L_sdReq.id_article
M_phraseSQL est une chaîne="SELECT Ligne_commande.Id_article,Ligne_commande.qte_article,Ligne_commande.prix_euro,Ligne_commande.prix_vte,Ligne_commande.px_cfa_ut,Ligne_commande.tot_couts,"+RC+...
"Entete_facture.Num_fact,Entete_facture.Date_fact"+RC+...
"FROM Ligne_commande INNER JOIN Entete_facture"+RC+...
"ON (Ligne_commande.Num_fact=Entete_facture.Num_fact)"+RC
M_phraseSQL+= " WHERE Entete_facture.Date_fact BETWEEN '"+SC_SélectionPériode.SAI_DateDébut+"' AND '"+SC_SélectionPériode.SAI_DateFin+"'"
M_phraseSQL+= " AND Ligne_commande.Id_article = "+nIdart
// info(M_phraseSQL)
SI PAS HExécuteRequêteSQL(M_sdReq,hRequêteInterruptible,M_phraseSQL) ALORS
Erreur("ERREUR Requête Ligne_commande "+HErreurInfo(hErrComplet))
SINON
TableAjoute(TABLE_Historiq,M_sdReq.Date_fact+TAB+...
M_sdReq.Num_fact+TAB+...
L_sdReq.Description+TAB+...
M_sdReq.qte_article+TAB+...
M_sdReq.prix_euro+TAB+...
M_sdReq.prix_vte+TAB+...
M_sdReq.px_cfa_ut+TAB+...
M_sdReq.tot_couts)
FIN
FIN
FIN
HAnnuleDéclaration(L_sdReq)
HAnnuleDéclaration(M_sdReq)
Sablier(Faux) |
Partager