API RF VALLINVL

  Version ACE : 1.4

Package : gnc_rf.c

Sous-programme Basic : gnc_rf_validation_ligne_inv_egx

Fonctionnalité :Inventaire
Schémas d’entrée et de sortie : voir en fin de document.

Cette API permet de mettre à jour une ligne d’inventaire.

API imbriquées : aucune.

Contraintes et limites de fonctionnement (hors périmètre)

RAS.

Paramétrage (PPE)

RAS.

Valeurs restituées par l’API

Valeur Remarque
  En retour, l’API indique un code retour pour le traitement : il y a eu une erreur ou il n’y a pas eu d’erreur.
1 Mise à jour de la ligne d’inventaire réussie.
0 Problème.

Processus, contrôles et règles de gestion

Etape description du Processus
 

Cette API met à jour l’en-tête de la ligne d’inventaire si nécessaire et met à jour l’OI s’il s’agissait de la dernière ligne à traiter.

Elle indique aussi que l’OI est terminé si c’est le cas.

 

Magasin de type réserve :

si modification qualité sur l’objet (lot, emballage, DLC ou poids), créer la table linc et passer le statut de la ligne à 3 afin que la validation traite le changement qualité.

 

Magasin de type picking avec traçabilité :

Si le lot est passé en paramètre, rechercher une ligne d’inventaire pour l’emplacement et le lot.

  • sSi elle n’existe pas :
  • Rechercher un objet de stock de l’emplacement ayant le même lot
  • Créer la ligne d’inventaire
  • ssi elle existe, cumuler ou remplacer la quantité selon le type de mise à jour.

Cas d’erreurs

Code Description
0/‘RFINV01005’ The inventory line is not successfully updated.
0/‘RFINV01006’ The execution of the function is not successful.
0/‘RFINV01007’ The inventory order is not successfully updated.
0/‘RFINV01004’ The inventory header is not found.
0/’RFINV01016’ Plan de palettisation inexistent.

Détail de l'API

Read the inventory line data (LINVL table) with the input parameters (typtie, sigtie, idoi, numcompe, numligoi, numseqlig).

Read the inventory order data (LOI table) with the input parameters (typtie, sigtie, idoi).

Validate the inventory line.

(Modify the inventory line’s ‘counting user code’ with the ‘IO’s validating user’ (uticomp = LOI.utival) , ‘counting time’ with the current time, ‘counting date’ with the current date, ‘inventory quantity’ (linvl.qteinvent) with the received parameter ‘qteunt’ and ‘physical receiving flag’ (LINVL.flgsaisie) with ‘1’).

If the modification of the inventory line does not succeed, the API returns the error code 0 and the error message ‘RFINV01005’.

If the operator is authorized to do modifications (input parameter ‘ habil_opr ’ != 0).

Read the slot address data with the corresponding third-party ID and slot address code from the inventory line (sigdep = LINVL.sigtie, codemp = LINVL.adremp).

If the received CU quantity is different from the real occupation quantity for the slot address (qteunt != EMP.occreel).

Read the inventory mode data (LMODINV table) with the corresponding inventory line’s third-party type and ID (LINVL.typtie, LINVL.sigtie) and IO’s inventory mode (LOI.modinv).

Create an adjustment movement with the following values:

(Third-party type equal to the inventory line’s third-party type (typtie = LINVL.typtie),

Third-party ID equal to the inventory line’s third-party ID (sigtie = LINVL.sigtie),

If the received CU quantity is bigger than the real occupation quantity for the slot address (qteunt > EMP.occreel).

Movement direction equal to ‘input’ direction (sensmvt = ‘E’),

Movement code equal to the inventory mode’s positive movement code (lcodmvt, w_lmodinv.codmvtpos),

Number of containers equal to the difference between the received CU quantity and the real occupation quantity for the slot address (l_nbrcnt = qteunt - EMP.occreel),

If the real occupation quantity for the slot address is bigger than the received CU quantity (EMP.occreel > qteunt).

Movement direction equal to ‘output’ direction (sensmvt = ‘S’),

Movement code equal to the inventory mode’s negative movement code (lcodmvt, w_lmodinv.codmvtneg),

Number of containers equal to the difference between the real occupation quantity for the slot address and the received CU quantity (l_nbrcnt = EMP.occreel - qteunt),

CU quantity equal to the number of containers (qteunt = nbrcnt),

Movement type equal to ‘adjustment’ (typmvt = ‘A’),

Batch ID equal to the inventory line’s inventory ID (idbch = LINVL.idinv),

Order ID equal to the inventory line’s inventory order ID (idord = LINVL.idoi),

Order line equal to the inventory line’s inventory line number (ligord = LINVL.numligoi)

Read the stock object (LOBJSTK table) with third-party type equal to the inventory line’s third-party type (typtie = LINVL.typtie), third-party ID equal to the inventory line’s third-party ID (sigtie = LINVL.sigtie) and stock object ID equal to the inventory line’s stock object ID (idobj = LINVL.idobj).

Call the function gnc_gener_mvt_ajust_xa, as so to generate the corresponding adjustment movement.

Call the function gnc_ gnc_valid_mvtstk, as so to validate the movement.

If the execution of the function is not successful, the API returns an error code 0 and an error message ‘RFINV01006’.

For each inventory line data (LINVL table) read with the input parameters (typtie, sigtie, idoi, numcompe) and with numligoi >= 1, numseqlig >= 0.

If the inventory line’s ‘counting user code’ is equal to ‘_’ (LINVL.uticomp = ‘_’).

The Inventory order is considered as not terminated.

If the inventory order is terminated.

Modify the status of the inventory order to ‘validated’ (LOI.statut = ‘9’).

Modify the validation time (LOI.heuval) and the validation date (LOI.datval) with the current time and date.

If the modification is not successful, the API returns the error code 0 and the error message ‘RFINV01007’.

Read the inventory header data (LINVE table) with the inventory order’s third-party type, third-party ID and inventory ID (LOI.typtie, LOI.sigtie and LOI.idinv).

If the inventory header is found.

Increase its number of inventory orders with one (LINVE.nboi).

Modify its status to ‘closed’ (LINVE.statut = ‘8’).

Otherwise.

The API returns an error code 0 and an error message ‘RFINV01004’.

Return the code 1.

Paramètres en entrée

Nom Description Format Obligatoire/Facultatif
typtie Le type de tiers (dépôt) Char(3) O
sigtie Le sigle du tiers Char(12) O
idoi L’identifiant de l’ordre d’inventaire Number O
numcompte Numéro de comptage en cours Number O
numligoi Numéro de la ligne d’inventaire Number O
Typmaj

Type de mise à jour

0 = mise à jour de la qté

1 = ajout sur qté existante

Number F
Qteunt Quantité en unités Number O
Codpro Code produit Char(16) O si idobj vide
Idobj Id SSCC Char(18) O si codpro vide et qteunt > 0
Cnttyp Type contenant Char (2)  
Cntcod Code contenant Char (2)  
Reflot Référence lot Char (30) F
Datlc Date limite consommation Date F
Codemb Code emballage Char(16) F
Poids Poids réel Décimal F
Flgsaisie

0- scan de plusieurs contenants en picking

1-

Char(1) F

Paramètres en sortie

Nom Description Format
ParamOut1

Indique qu’une erreur s’est produite

0 – erreur

1 – pas d’erreur

Number