Skip to main content
Skip table of contents

*FAC-CAL : Calcul de Facturation sur Lignes d’Expédition ( ENR-ACT-ENT )

Dans un tableur dynamique ou dans une requête quelconque, il est possible d’utiliser la fonction DIALOG ENR-ACT-ENT pour lancer un calcul de facture pour une liste de lignes d’expédition, pour une liste de lignes de retours clients ou pour une liste de lignes de commandes commerciales non intégrées.

Pour cela, dans DIALOG, il est nécessaire :

  • En début d'exécution de la requête de calcul de facturation (REB/FAC), d'effectuer un PC WfCDFaDe : EFFACER LISTE WfCDFaDe. END. Sinon les WfCDFaDe créés par DIAPASON sont conservés suite à l'initialisation dans WfEntVar de type LBL (obligatoire pour pouvoir faire le calcul de facturation) avec un faux numéro de facture.

  • De renseigner les listes standards WfEntAct et WfEntVar avant de lancer la fonction.

Liste WfEntAct :   (T : type de la variable; O : indique si obligatoire (valeur o) ou non)

Nom

T

Désignation

O

Commentaire

Action

C

Action à exécuter

o

Doit contenir CRE

EntTEn

C

Entité

o

Doit contenir *FAC-CAL

EntCl1

C

Clé1

o

Numéro de facture temporaire

Liste WfEntVar : (T : type de la variable; O : indique si obligatoire (valeur o) ou non)

Requête de calcul de facture (REB/CAL) à exécuter :

Nom

T

Désignation

O

Commentaire

EntTEn

C

Entité

o

Doit contenir *FAC-CAL

EntCl1

C

Clé1

o

Numéro de facture temporaire. Lien avec WfEntAct.EntCl1

EntTVa

C

Type de Variable

o

Doit contenir GEN

EntVar

C

Variable

o

Doit contenir REB

EntVaC

C

Valeur Alphanumérique

o

Requête à exécuter. Doit être une requête de type REB/FAC

Si cet enregistrement n’est pas donné, c’est la requête renseignée sur le client de facturation de la première ligne d’expédition sélectionnée qui sera exécutée, ou à défaut, la requête de calcul de facturation par défaut de DIAPASON (paramètre général PARAM-GEN/PARAMETRES/FAC-CAL)

  • Pour chaque variable critère standard ou spécifique utilisée par la requête :

Nom

T

Désignation

O

Commentaire

EntTEn

C

Entité

o

Doit contenir *FAC-CAL

EntCl1

C

Clé1

o

Numéro de facture temporaire. Lien avec WfEntAct.EntCl1

EntTVa

C

Type de Variable

o

Doit contenir SCR ou VCR

EntVar

C

Variable

o

Nom de la variable critère

EntVaC

C

Valeur Alphanumérique

Valeur du critère s’il est de type alphanumérique

EntVaN

De

Valeur Numérique

Valeur du critère s’il est de type numérique

EntVaD

Da

Valeur Date

Valeur du critère s’il est de type date

EntVaL

Lo

Valeur Logique

Valeur du critère s’il est de type logique

  • Pour chaque ligne d’expédition (ou de retour client ou de commande non intégrée) à facturer :

Numéro d’événement d’Expédition (obligatoire)

Nom

T

Désignation

O

Commentaire

EntTEn

C

Entité

o

Doit contenir *FAC-CAL

EntCl1

C

Clé 1

o

Numéro de facture temporaire. Lien avec WfEntAct.EntCl1

EntCl2

C

Clé 2

o

Numéro d’ordre de la ligne d’expédition

EntTVa

C

Type de Variable

o

Doit contenir LBL

EntVar

C

Variable

o

Doit contenir CdeExpRef

EntVaC

C

Valeur Alphanumérique

o

Numéro de l’événement d’expédition

ou R pour une ligne de retour client

ou C pour une ligne de commande non intégrée

Numéro de Commande Client (obligatoire)

Nom

T

Désignation

O

Commentaire

EntTEn

C

Entité

o

Doit contenir *FAC-CAL

EntCl1

C

Clé 1

o

Numéro de facture temporaire. Lien avec WfEntAct.EntCl1

EntCl2

C

Clé 2

o

Numéro d’ordre de la ligne d’expédition

EntTVa

C

Type de Variable

o

Doit contenir LBL

EntVar

C

Variable

o

Doit contenir CdeNumCom

EntVaC

C

Valeur Alphanumérique

o

Numéro de commande client

ou de numéro de retour client

Numéro de Ligne de Commande Client (obligatoire)

Nom

T

Désignation

O

Commentaire

EntTEn

C

Entité

O

Doit contenir *FAC-CAL

EntCl1

C

Clé 1

O

Numéro de facture temporaire. Lien avec WfEntAct.EntCl1

EntCl2

C

Clé 2

O

Numéro d’ordre de la ligne d’expédition

EntTVa

C

Type de Variable

O

Doit contenir LBL

EntVar

C

Variable

o

Doit contenir CdeNumLig

EntVaC

C

Valeur Alphanumérique

o

Numéro de ligne de commande client

ou de ligne de retour client

Quantité à Facturer (facultatif)

Nom

T

Désignation

O

Commentaire

EntTEn

C

Entité

o

Doit contenir *FAC-CAL

EntCl1

C

Clé 1

o

Numéro de facture temporaire. Lien avec WfEntAct.EntCl1

EntCl2

C

Clé 2

o

Numéro d’ordre de la ligne d’expédition

EntTVa

C

Type de Variable

o

Doit contenir LBL

EntVar

C

Variable

o

Doit contenir CdeFacQteExp

EntVaN

C

Valeur Numérique

o

Quantité à facturer

Si cet enregistrement n’est pas créé pour une ligne d’expédition, la quantité totale restant à facturer sur la ligne sera considérée.

Principe de lancement du calcul de facture :

  • Pour chaque enregistrement de WfEntAct ayant comme Action CRE et comme type d’entité *FAC-CAL, lancement de la requête de calcul de facture paramétrer dans WfEntVar (ou requête définie sur le client ou requête par défaut de DIAPASON). Cette requête reçoit :

  • Les valeurs des variables critères standards ou spécifiques données dans les enregistrements de WfEntVar ayant comme type de variable SCR ou VCR

  • L’origine du calcul dans la variable standard critère SCR.TypeDeCalcul. Dans ce contexte, elle contient la valeur SEL-DIALOG

  • Dans WfCDFaDe, les lignes d’expéditions, données dans les enregistrements de WfEntVar ayant comme type de variable LBL.

  • En sortie de requête, contrôle des listes standards WfCDFaEn, WfCDFaLi et WfCDFaDe issues de la requête et création des factures.

Exemple :

Création d’une facture pour les lignes d’expéditions de l’événement saisi dans le critère SCR.CdeExpRef , pour les lignes de retours clients non facturées du client de l’expédition et pour les lignes de commande non intégrées dans les commandes expédiées.

CREATION Liste WfEntAct :

PRENDRE WfEntAct Action = CLO.”CRE”

PRENDRE WfEntAct EntTEn = CLO.”*FAC-CAL”

PRENDRE WfEntAct EntCl1 = CLO."FAC01"

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntTVa = CLO."GEN"

PRENDRE WfEntVar EntVar = CLO.“REB”

PRENDRE WfEntVar EntVaC = CLO.”FACTURE”

FIN_BLOC.

COMMENTAIRE : /* Recherche du Client */

RECHERCHE PREMIER/SOC DTD CDExLi AVEC DTD CDExLi.CdeExpRef = SCR.CdeExpRef

ET DTD CDExLi.CdeExpValSta VRAI ET DTD CDExLi.CdeExpFacSta FAUX :

VLO.Cli = DTD CDExLi.CliGenRef

VLO.Res = DTD CDExLi.CliResRef

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntTVa = CLO."SCR"

PRENDRE WfEntVar EntVar = CLO.“CliGenRef”

PRENDRE WfEntVar EntVaC = DTD CDExLi.CliGenRef

FIN_BLOC.

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntTVa = CLO."SCR"

PRENDRE WfEntVar EntVar = CLO.“CliResRef”

PRENDRE WfEntVar EntVaC = DTD CDExLi.CliResRef

FIN_BLOC.

FIN_BLOC.

COMMENTAIRE : /* Recherche des Lignes de BL */

VLO.NumOrd = CLO.0.

POUR CHAQUE/SOC DTD CDExLi AVEC DTD CDExLi.CdeExpRef = SCR.CdeExpRef

ET DTD CDExLi.CdeExpValSta VRAI ET DTD CDExLi.CdeExpFacSta FAUX :

VLO.NumOrd = VLO.NumOrd + 1

VLO.CarOrd = CHAINE(VALEUR= VLO.NumOrd, FORMAT= E0/3)

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntCl2 = VLO.CarOrd

PRENDRE WfEntVar EntTVa = CLO.“LBL”

PRENDRE WfEntVar EntVar = CLO.“CdeExpRef”

PRENDRE WfEntVar EntVaC = DTD CDExLi.CdeExpRef

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntCl2 = VLO.CarOrd

PRENDRE WfEntVar EntTVa = CLO.“LBL”

PRENDRE WfEntVar EntVar = CLO.“CdeNumCom”

PRENDRE WfEntVar EntVaC = DTD CDExLi.CdeNumCom

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntCl2 = VLO.CarOrd

PRENDRE WfEntVar EntTVa = CLO.“LBL”

PRENDRE WfEntVar EntVar = CLO.“CdeNumLig”

PRENDRE WfEntVar EntVaC = DTD CDExLi.CdeNumLig

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntCl2 = VLO.CarOrd

PRENDRE WfEntVar EntTVa = CLO.“LBL”

PRENDRE WfEntVar EntVar = CLO.“CdeFacQteExp“

PRENDRE WfEntVar EntVaN = DTD CDExLi.CdeExpQteExp

DTD CdExLi.CdeExpQteFac.

FIN_BLOC

VLO.Trouve = CGL.FAUX

RECHERCHE PREMIER LST.Commande AVEC LST.Commande.NumCom =

DTD CDExLi.CdeNumCom

VLO.Trouve = CGL.VRAI

FIN_BLOC

SI VLO.Trouve FAUX

CREATION Liste Commande :

PRENDRE Commande NumCom = DTD CDExLi.CdeNumCom

FIN_BLOC

FIN_BLOC

FIN_BLOC

COMMENTAIRE : /* Recherche des Retours non Facturés */

POUR CHAQUE/SOC DTD CDClRt AVEC DTD CDClRt.CliResRef = VLO.Res ET

DTD CDClRt.CliGenRef = VLO.Cli ET DTD CDClRt.CdeRetVal VRAI :

POUR CHAQUE/SOC DTD CDClRd AVEC DTD CDClRd.CdeRetNum =

DTD CDClRt.CdeRetNum :

VLO.NumOrd = VLO.NumOrd + 1

VLO.CarOrd = CHAINE(VALEUR= VLO.NumOrd, FORMAT= E0/3)

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntCl2 = VLO.CarOrd

PRENDRE WfEntVar EntTVa = CLO.“LBL”

PRENDRE WfEntVar EntVar = CLO.“CdeExpRef”

PRENDRE WfEntVar EntVaC = CLO.“R”

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntCl2 = VLO.CarOrd

PRENDRE WfEntVar EntTVa = CLO.“LBL”

PRENDRE WfEntVar EntVar = CLO.“CdeNumCom”

PRENDRE WfEntVar EntVaC = DTD CDClRd.CdeRetNum

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntCl2 = VLO.CarOrd

PRENDRE WfEntVar EntTVa = CLO.“LBL”

PRENDRE WfEntVar EntVar = CLO.“CdeNumLig”

PRENDRE WfEntVar EntVaC = DTD CDClRd.CdeRetLig

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntCl2 = VLO.CarOrd

PRENDRE WfEntVar EntTVa = CLO.“LBL”

PRENDRE WfEntVar EntVar = CLO.“CdeFacQteExp“

PRENDRE WfEntVar EntVaN = DTD CDExRd.CdeRetIntQte.

FIN_BLOC

FIN_BLOC

FIN_BLOC

COMMENTAIRE : /* Recherche des Lignes de Commande non Intégrées */

POUR CHAQUE LST Commande :

POUR CHAQUE/SOC DTD CDCoLi AVEC DTD CDCoLi.CdeNumCom =

Commande.NumCom :

SI DTD CDCoLi.CdeLigTypGen = CLO.“5“

VLO.NumOrd = VLO.NumOrd + 1

VLO.CarOrd = CHAINE(VALEUR= VLO.NumOrd, FORMAT= E0/3)

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntCl2 = VLO.CarOrd

PRENDRE WfEntVar EntTVa = CLO.“LBL”

PRENDRE WfEntVar EntVar = CLO.“CdeExpRef”

PRENDRE WfEntVar EntVaC = CLO.“C”

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntCl2 = VLO.CarOrd

PRENDRE WfEntVar EntTVa = CLO.“LBL”

PRENDRE WfEntVar EntVar = CLO.“CdeNumCom”

PRENDRE WfEntVar EntVaC = DTD CDCoLi.CdeNumCom

FIN_BLOC

CREATION Liste WfEntVar :

PRENDRE WfEntVar EntTEn = CLO.“*FAC-CAL”

PRENDRE WfEntVar EntCl1 = CLO."FAC01"

PRENDRE WfEntVar EntCl2 = VLO.CarOrd

PRENDRE WfEntVar EntTVa = CLO.“LBL”

PRENDRE WfEntVar EntVar = CLO.“CdeNumLig”

PRENDRE WfEntVar EntVaC = DTD CDCoLi.CdeNumLig

FIN_BLOC

FIN_BLOC

FIN_BLOC

FIN_BLOC

VLO.Resultat = ENR-ACT-ENT( )

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.