API RF SCE_GP_003

  Version ACE : 1.3

Package : Standard

gnc_up_controle_fermer_up

Nom de la gnc : gnc_sce_gp_003

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

Cette API permet de fermer une UP.

API imbriquées : aucune.

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

RAS.

Paramétrage (PPE)

RAS.

Processus, contrôles et règles de gestion

ETAPE DESCRIPTION DU PROCESSUS
  Gestion des manquants à partir de la table LUPCTL :
  • Mvt en statut ‘3’ : suppression,
  • Mvt validé : annulation de la préparation.
Traitement

Lecture de la table LUPCTL :

  • Typtie = typdep,
  • Sigtie = sigdep,
  • Idobjcol = idobjcol,
  • Flgtrt = 1,
  • Flghis = ‘0’,
  • Statut = ‘2’ (manquant).

Pour chaque enregistrement :

  • Si idmvt > 0 et mvt en statut ‘3’, supprimer le mouvement : appel de gnc_valid_mvtstk pour le mouvement concerné :
  • Val.qteval_uc = 0
  • Val.dispo = 0
  • Val.majol = 1
  • Si mvt validé (lupctl.idobj <> ‘ ‘)
  • Appel de gnc_up_non_livré avec lupctl.idobj et lupctl.qteunt
  • Historiser la ligne traitée (flghis = ‘1’)
Détail :

Look for the preparation unit archiving control data for units which are not yet archived.

(Read the table (LUPCTL) with the input parameters (typdep, sigdep, idobjcol), treatment type flag equals to 1 (flgtrt=1), archive flag equals to '0' (flghis = '0') and status equals to ‘2’ (Not in database) (statut = ‘2’).)

For each preparation unit archiving control object.

If the movement ID of the current preparation unit archiving control object is presented (idmvt > 0).

Look for the stock movement data (LMVTSTK) corresponding to the current movement ID.

(Read the table (LMVTSTK) with input parameters (typdep, sigdep), direction equals to ‘S’ (sensmvt=’S’), movement type equals to ‘S’ (typmvt=‘S’) and movement ID equals to the current movement ID.)

If the stock movement does not exist, the API returns an error message ‘ELT_PASTRO’ and returns an error code 0.

If the stock movement is addressed (statut=’3’).

Call the function gnc_valid_mvtstk, as so to delete the movement.

If the execution of the function is not successful, the API returns an error code 0.

Archive the movement.

Look for the preparation unit archiving control data corresponding to the current stock movement.

(Read the table (LUPCTL) with the input parameters (typdep, sigdep), treatement type flag equals to 1 (flgtrt=1), the logistic stock parcel ID equal to the input logistic stock parcel ID (idobjcol), the movement ID equal to the current movement ID (idmvt), the stock object ID not presented (idobj = ‘’) and order number equals to the current order number (numord).)

If the preparation unit archiving control is not found, the API returns an error message ‘ELT_PASTRO’ and returns an error code 0.

Update the archive flag to ‘1’ (flghis = ‘1’).

If the update is not successful, the API returns an error message ‘ERR_CREAT’ and returns an error code 0.

Otherwise.

If the current stock object is presented (idobj != “”).

Call the API gnc_up_non_livre, as so to treat the non delivered PU.

If the function does not succeed, the API returns an error code 0.

Archive the movement.

Look for the preparation unit archiving control data corresponding to the current stock movement.

(Read the table (LUPCTL) with input parameters (typdep, sigdep), treatment type flag equals to 1 (flgtrt=1), the logistic stock parcel ID equal to the input logistic stock parcel ID (idobjcol), the movement ID equal to the current movement ID (idmvt), the stock object ID equal to the current stock object ID (idobj) and the order number equal to the current order number (numord).)

If the preparation unit archiving control is not found, the API returns an error message ‘ELT_PASTRO’ and returns an error code 0.

Update the archive flag to ‘1’ (flghis = ‘1’).

If the update is not successful, the API returns an error message ‘ERR_CREAT’ and returns an error code 0.

Read the next preparation unit archiving control object found.

Read the logistic stock parcel data (LCOL table) with the input parameters (typdep, sigdep, idobjcol).

If the logistic stock parcel object is not found , the API returns an error message ‘ELT_PASTRO’ and returns an error code 0.

Look for the packing zone corresponding to the packing zone of the logistic stock parcel.

(Read packing zone data (lzoncol) with (lcol.sigtie, lcol.typetie, lcol.zoncol).)

If the packing zone object is not found, the API returns an error message ‘ZON_INEXIS’ and returns an error code 0.

If the validation of the packing zone is not automatic (valauto = ‘0’).

Update the status of the logistic stock parcel object to ‘valid preparation’ (lcol.statut = ‘4’).

Otherwise.

Update the status of the logistic stock parcel object to ‘valid parcel’ (lcol.statut = ‘5’).

Return the code 1.

Cas d'erreur

CODE PARAMÈTRES DESCRIPTION
0 / ELT_PASTRO LMVTSTK The stock movement does not exist.
0   The function gnc_valid_mvtstk does not succeed.
0 / ELT_PASTRO LUPCTL The preparation unit archiving control is not found.
0 / ERR_CREAT LUPCTL The update of the preparation unit archiving control is not successful.
0   The function gnc_up_non_livre does not succeed.
0 / ELT_PASTRO LCOL The logistic stock parcel object is not found.
0 / ZON_INEXIS   The packing zone object is not found.

Paramètres en entrée

NOM DESCRIPTION FORMAT OBLIGATOIRE/FACULTATIF
typdep Type dépôt Char (3) O
sigdep Sigle dépôt Char (12) O
idobjcol UP Char (18) O

Paramètres en sortie

NOM DU PARAMÈTRE TYPE FORMAT TAILLE REMARQUE
Aucun.