DIAPASON 05
Breadcrumbs

Exemple (GFD) ENR-ACT-ENT Commandes Commerciales


Création d’une entête de Commande Commerciale, suivi de la création d’une ligne dans cette commande :


COMMENTAIRE : "Création Entête"

CREATION Liste WfEntAct :

PRENDRE WfEntAct Action = CLO."CRE"

PRENDRE WfEntAct ActCle = CLO."ACT01"

PRENDRE WfEntAct EntTEn = CLO."CDC"

PRENDRE WfEntAct EntCl1 = CLO."&1"

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar ActCle = CLO."ACT01"

PRENDRE WfEntVar EntTVa = CLO."SDE"

PRENDRE WfEntVar EntVar = CLO."CdeTypCde"

PRENDRE WfEntVar EntVaC = CLO."C"

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar ActCle = CLO."ACT01"

PRENDRE WfEntVar EntTVa = CLO."SDE"

PRENDRE WfEntVar EntVar = CLO."GesUtiRef"

PRENDRE WfEntVar EntVaC = CLO."GESVENTE"

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar ActCle = CLO."ACT01"

PRENDRE WfEntVar EntTVa = CLO."SDE"

PRENDRE WfEntVar EntVar = CLO."CliComRef"

PRENDRE WfEntVar EntVaC = CLO."COM07"

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar ActCle = CLO."ACT01"

PRENDRE WfEntVar EntTVa = CLO."SDE"

PRENDRE WfEntVar EntVar = CLO."CliGenRef"

PRENDRE WfEntVar EntVaC = CLO."CLI00349"

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar ActCle = CLO."ACT01"

PRENDRE WfEntVar EntTVa = CLO."SDE"

PRENDRE WfEntVar EntVar = CLO."CliResRef"

PRENDRE WfEntVar EntVaC = CLO."0"

FIN_BLOC

VLO.Resultat = ENR-ACT-ENT( )

POUR CHAQUE LST WfEntAct :

COMMENTAIRE : "Si création Commande OK avec « &1 », WfEntAct.ActRes contient le numéro de Commande"

VLO.Cle1 = WfEntAct.ActRes

VLO.ErrE = WfEntAct.ActErr

FIN_BLOC

COMMENTAIRE : "Création Ligne si pas d’erreur"

SI VLO.ErrE = CLO.""

EFFACER Liste WfEntAct

EFFACER Liste WfEntVar

CREATION Liste WfEntAct :

PRENDRE WfEntAct Action = CLO."CRE"

PRENDRE WfEntAct ActCle = CLO."ACT02"

PRENDRE WfEntAct EntTEn = CLO."CDC-LIG"

PRENDRE WfEntAct EntCl1 = VLO.Cle1

PRENDRE WfEntAct EntCl2 = CLO." "

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar ActCle = CLO."ACT02"

PRENDRE WfEntVar EntTVa = CLO."SDL"

PRENDRE WfEntVar EntVar = CLO."CdeLigRefArt"

PRENDRE WfEntVar EntVaC = CLO."0010"

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar ActCle = CLO."ACT02"

PRENDRE WfEntVar EntTVa = CLO."SDL"

PRENDRE WfEntVar EntVar = CLO."CdeLigQteCom"

PRENDRE WfEntVar EntVaN = CLO.3

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar ActCle = CLO."ACT02"

PRENDRE WfEntVar EntTVa = CLO."SDL"

PRENDRE WfEntVar EntVar = CLO."CdeLigDateSai"

VLO.Demain = DATEJOUR( )

VLO.Demain = CAL-DATE( DATE= VLO.Demain , NB-JOURS= CLO.1 , SENS= + )

PRENDRE WfEntVar EntVaD = VLO.Demain

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar ActCle = CLO."ACT02"

PRENDRE WfEntVar EntTVa = CLO."SDL"

PRENDRE WfEntVar EntVar = CLO."CdeLigValSta"

PRENDRE WfEntVar EntVaL = CGL.OUI

FIN_BLOC

VLO.Resultat = ENR-ACT-ENT( )

POUR CHAQUE LST WfEntAct :

VLO.ErrL = WfEntAct.ActErr

FIN_BLOC

FIN_BLOC

COMMENTAIRE : "Suppression Commande si erreur"

SI VLO.ErrE EXISTE ET <> "" OU VLO.ErrL EXISTE ET <> ""

EFFACER Liste WfEntAct

EFFACER Liste WfEntVar

CREATION Liste WfEntAct :

PRENDRE WfEntAct Action = CLO."SUP"

PRENDRE WfEntAct EntTEn = CLO."CDC"

PRENDRE WfEntAct EntCl1 = VLO.Cle1

FIN_BLOC

VLO.Resultat = ENR-ACT-ENT( )

FIN_BLO

Remarques importantes :

  1. Lors de chaque exécution de requête (GCC, GCA, GCL), l’action de mise à jour sera « ECE » pour la création de commande et « LCE » pour la création de ligne.

  2. Il est possible de donner le numéro de ligne de commande à créer via l’alimentation de la variable « SDL.CdeNumLig » par liste « WfEntVar ».

  3. Il est possible de définir la configuration de la ligne de commande lors de la création d’une ligne.