API RF DUPOBJRECX

Version ACE : 1.4  

Package : Standard

Sous-programme Basic : gnc_rf_dup_objet_rec_egx

Fonctionnalité :SCE Mobile
Schémas d’entrée et de sortie : voir en fin de document.
Cette API permet de supprimer ou de dupliquer les mouvements de stock associés à un objet de stock donné.

API imbriquées : aucune.

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

RAS.

Paramétrage (PPE)

LRFLOP -

Cas d'erreur

CODE PARAMÈTRES DESCRIPTION
0/ "ELT_PASTRO" lobjstk , lobjstk.typtie, w_lobjstk.sigtie, w_lobjstk.idobj The stock object is not found.
0/ "ELT_PASTRO" lobjstk , lobjstk.typtie, w_lobjstk.sigtie, w_lobjstk.numrec The stock object is not found.
0/"ERR_SUPPR" lobjstk , lobjstk.sigtie, w_lobjstk2.typtie, w_lobjstk2.idobj The stock object is not successfully deleted.
0/"MES_LIBRE" "Nombre d'objets à supprimer trop élevé" Too many stock objects to be deleted.
0/ "ELT_PASTRO" lcfgrec , lcfgrec.typtie, w_lcfgrec.sigtie The reception configuration data are not found
0/"MES_LIBRE" "Aucun mouvement EE sur l'objet origine" The ‘EE’ movement for the original stock object is not found.
0/"ERR_CREAT" lmvtstk The stock movement is not successfully created.
0   The stock object is not successfully updated.

Détail de l'API

Read the parameter ‘LRFLOP’.

If the reference of the stock object to be created is presented (idobjcre) and the number of the stock objects to be created is different from ‘1’.

The number of the stock objects to be created is initialized with ‘1’.

Read the stock object data (LOBJSTK) with the input parameters (‘typdep’, ‘sigdep’ and ‘idobj’).

If the stock object does not exist, the API returns an error code 0 and an error message “ELT_PASTRO”.

If there are stock objects to be deleted (nbobj < 0) and the value of the parameter field N5 of the parameter ‘LRFLOP’ is great than 0 and less or equal than 20.

Delete the stock objects (LOBJSTK) up to the number of the objects to be deleted, with the same reception number (LOBJSTK.numrec), the same product (LOBJSTK.codpro) and with a value in the parameterized field referred by the parameter field N5 equal to the input parameter ‘idobj’.

The stock object ID (LOBJSTK.idobj) of the first deleted object is copied in the output parameter ParamOut1.

If the deletion is not successful, the API returns an error code 0 and an error message “ERR_SUPR”.

If after the deletion of all stock objects corresponding to the parameters the number of the stock objects to be deleted is still not reached, the API returns an error code 0 and an error message “MES_LIBRE”.

The API returns a code 1.

Read the configuration table of the reception management (LCFGREC) with the input parameters (‘typdep’, ‘sigdep’), as so to determine the product code for the unloading object.

If the reading is not successful, the API returns an error code 0 and an error message “ELT_PASTRO”.

If the identifier of the stock object to be created is presented (idobjcre is not empty).

Read the stock object data (LOBJSTK) with the input parameters (‘typdep’, ‘sigdep’ and ‘idobjcre’).

If the stock object data is found.

If it is an unloading object (lobjstk2.codpro = lcfgrec.codpro).

The object is deleted.

If the deletion is not successful, the API returns an error code 0 and error message “ERR_SUPPR”.

Otherwise.

The API returns an error code 0 and error message “ELT_PASTRO”.

Read the first ‘EE’ (LMVTSTK.sensmvt = ‘E’, lmvtstk.typmvt = ‘E’) stock movement for the object ‘idobj’ (lmvtstk.idobj = ‘idobj’).

If no movement is found, the API returns an error code 0 and error message “MES_LIBRE”.

Create new stock movements (up till the number of the stock objects to be created ‘nbobj’) using the ‘EE’ movement as a reference. At least one new stock movement is created.

If the ‘idobjcre’ parameter is not empty the movements are created with that object, with a new stock object ID otherwise.

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

Read the stock object data (LOBJSTK) for the object ID with which the movement is created.

If the number of the stock objects to be created is great than 1 and the value of the parameter field N5 of the parameter ‘LRFLOP’ is great than 0 and less or equal than 20.

Store the stock object identifier in the parameterized field referred by the parameter field N5.

Update the duplication object ID for the new created object (LOBJSTK.idobjdup) with the stock object ID used for the creation of the movement.

If the update is not successful, the API returns an error code 0.

Paramètres en entrée

NOM DU PARAMÈTRE FORMAT OBLIGATOIRE REMARQUE
typdep Char(3) O Depot type
sigdep Char(12) O Depot ID
Idobj Char(18) O Stock object ID
nbobj Number N Number of the stock object to be created (nbobj >0) or to be deleted (nbobj <0)
Idobjcre Char(18) N Stock object ID to be created

Paramètres en sortie

NOM DU PARAMÈTRE FORMAT REMARQUE
ParamOut1 Char(18) The stock object ID of the first created OR deleted object.