API RF MAJ_MIS

Version ACE : 1.4  

Package : Standard

Nom de la gnc : gnc_rf_maj_cnx_mission

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

Cette API permet d’enregistrer la mission logistique RF dans un historique et de la supprimer. Si la mission RF est polyvalente, la mission RF suivante est débloquée.

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
1 Le traitement de l’API s’est déroulé avec succès.
0 Un problème est survenu empêchant le traitement de l’API.

Cas d’erreur

CODE PARAMÈTRES DESCRIPTION
0/ ELT_PASTRO Lmis La mission n’est pas trouvée

Processus, contrôles et règles de gestion

ETAPE DESCRIPTION DU PROCESSUS
1 Historisation de la mission passée en paramètre.
2 Suppression de la mission passée en paramètre.
  Pour les missions polyvalentes (type 14), après historisation de la mission, l’API dégèle la mission suivante et génère les mouvements associés.
Détail :

If the Mission ID input parameter is not filled, the API returns the error code 0 and the error message «ELT_PASTRO».

Read the depot (TIE table) for the operator.

Read the input RF mission data (LMIS table) with the input parameter (idmission).

If the input RF mission is found and its type is movement (lmis.ltypact = 3 and lmis.idmvt not empty).

Check whether the input RF mission is of mass type. (Search for another RF mission on the same stock movement (lmis.idmvt)).

If the input RF mission is of mass type.

If the input RF mission is on a stock object (lmis.idobj not empty) and the found RF mission on the same movement is not on a stock object (lmis.idobj is empty) and the found RF mission on the same movement is in status ‘created’ (lmis.statut = ‘1’) or ‘blocked’ (lmis.statut = ‘2’).

Delete the input RF mission.

If the input RF mission is not on a stock object (lmis.idobj is empty) and the found RF mission on the same movement is on a stock object (lmis.idobj not empty) and the found RF mission on the same movement is in status ‘not automatically affected’ (lmis.statut = ‘6’).

The API returns the code 1.

Save the input RF mission data (LHSTMIS).

If the status of the input RF mission is running (lmis.statut = ‘5’), it is saved with status closed (lhstmis.statut = ‘8’), otherwise the status is not changed.

The current equipment for the operator is saved in the history table (lhstequ.prfequip = lopr.prfequip, lhstequ.idequip = lopr.idequip).

If the input RF mission has no end date (lmis.datfinmis) or end time (lmis.heufinmis), the current date and time are saved in history table (lhstmis.datfinmis, lhstmis.heufinmis).

If the input RF mission is polyvalent (lmis.ltypact = 14), the next RF mission is unblocked.

Save the stock identifier for the previous RF mission.

If the stock object identifier for the previous RF mission is not empty (lmis.idobjsup not empty).

Save the stock identifier.

Otherwise

Read the input stock movement (LMVTSTK) for the input RF mission. (sensmvt = ‘E’, typmvt = lmis.typmvt, idmvt = lmis.idmvt).

If the parent stock object identifier for the movement is presented (lmvtstk.idobjpere).

Save the stock identifier.

Else if the logistic stock parcel identifier is presented (lmvtstk.idobjcol).

Save the stock identifier.

Else

Save the stock identifier for the movement (lmvtstk.idobj).

Read the next RF mission (LMIS) with (idmission = lmis.idmissuiv).

If the next RF mission is found.

If the next RF mission is in status ‘blocked’ (lmis.statut = ‘9’).

Change the status of the next RF mission to ‘created’ (lmis.statut = ‘1’).

If there is not transfer order for the next RF mission (lmis.identite = ‘0’).

Call the function gnc_gener_mvt_transfert, as so to create a complete transfer movement for the stock identifier previously saved to the store and address pointed in the next RF mission (lmis.codmagdst, lmis.adrempdst).

Call the function gnc_polymis_creer_OT, as so to create a transfer order.

Otherwise.

Call the function gnc_gener_mvt_transfert, as so to create a complete transfer movement for the stock identifier previously saved to the store and address pointed in the next RF mission (lmis.codmagdst, lmis.adrempdst).

If the status of the stored RF mission (LHSTMIS) is ‘terminated’ (lmis.statut = ‘8’).

Delete the input RF mission.

Paramètres en entrée

NOM DU PARAMÈTRE TYPE FORMAT TAILLE OBL O/N REMARQUE
Idmission CHAR   10 O Identifiant de la mission

Paramètres en sortie

Aucun.