API RF SCE_GP_017

  Version ACE : 1.3

Package : Standard gnc_sce_logis

Nom de la gnc : gnc_sce_gp_017

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

The API deconsolidates a delivery order header (LOLE) in case of selection by item. A new delivery order header is created with the lines not affected to the wave header.

API imbriquées : aucune.

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

RAS.

Paramétrage (PPE)

LOLCAR -

Processus, contrôles et règles de gestion

ETAPE DESCRIPTION DU PROCESSUS
Détail :

Read the wave header data (LVACE), which corresponds to the input parameters (‘typdep’, ‘sigdep’ and ‘idvac’).

If the wave header does not exist, the API returns an error message "ELT_PASTRO" and an error code 0.

Read the delivery order headers (LOLE) related to the wave, which corresponds to the input parameters (‘typdep’, ‘sigdep’ and ‘idvac’) ordered by ‘idol’, ‘numligol’.

If the delivery order does not exist, the API returns an error message "ELT_PASTRO" and an error code 0.

For each delivery order header found.

Read the delivery order lines (LOLL), which corresponds to the input parameters (‘typdep’, ‘sigdep’) and ‘lole.idol’.

If the delivery order line does not found, the API returns an error message "ELT_PASTRO" and an error code 0.

For each delivery order line found.

If the wave identifier for the delivery order line is not presented (loll.idvac = 0):

Create new delivery order header (LOLE) with the same values as the original delivery order header except (idol = new identifier; idvac = 0; idol_m = idol_m (from original delivery order) if idol_m > 0, idol otherwise).

If the new delivery order header is not successfully created, the API returns an error message "ERR_CREAT" and an error 0.

Create the new delivery order line (LOLL), which corresponds to the new delivery order header with the same values as the original delivery order line except (idol = the new identifier; idvac = 0; numligol = calculated.

Delete the original delivery order line data.

If the deletion does not succeed the API returns an error message “ERR_SUPPR” and an error code 0.

If the new delivery order line data is not successfully created, the API returns an error message “ERR_CREAT” and an error code 0.

Recalculate the number of the lines (nboll) of the original and the new delivery order headers.

Call the function gnc_ol_poids_vol, as so to recalculate the fields (prvpoids, prvvol, prvnbue, prvnbcol) for both headers.

If the parameter LOLCAR is active and the parameter field A1 is equal to ‘O’.

Call the function gnc_genere_lolc_supprimer, as so to delete the characteristics of the original delivery order header.

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

Call the function gnc_genere_lolc_supprimer, as so to delete the characteristics of the new delivery order header.

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

Call the function gnc_genere_lolc, as so to fill the characteristics of the initial delivery order header.

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

Call the function gnc_genere_lolc, as so to fill the characteristics of the new delivery order header.

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

Update the cumulative fields of the wave header (lvace).

(lvace.nbole1++, lvace.nboll1 += lole.nboll, lvace.poids1 += lole.prvpoids, lvace.volume1 += lole.prvvol, lvace.nbcol1 += lole.prvnbcol, lvace.nbue1 += lole.prvnbue).

If the modification of the initial delivery order header does not succeed, the API returns an error message “ERR_MODIF” and an error code 0.

If the modification of the new delivery order header does not succeed, the API returns an error message “ERR_MODIF” and an error code 0.

If the update of the cumulative fields of the wave header does not succeed, the API returns an error message “ERR_MODIF” and an error code 0.

Cas d’erreur

CODE PARAMÈTRES DESCRIPTION
0/ELT_PASTRO LOLE, lole.typtie, lole.sigtie,lole.idvac The delivery order header does not exist
0/ELT_PASTRO LOLL.typtie, loll.sigtie, loll.idol The delivery order line does not exist
0/ELT_PASTRO LVACE, lvace.typtie, lvace.sigtie, lvace.idvac The wave header does not exist
0/ERR_CREAT Lole, lole.idol, lole.statut, lole.idvac, lole.nboll, lole.idol_m Error in creation for the delivery order header.
0/ERR_CREAT Loll, loll.typtie, loll.sigtie, loll.idol, loll.numligol Error in creation for the delivery order line.
0/ERR_MODIF Lole, lole.typtie, lole.sigtie, lole.idol Error in modification for the delivery order header.
0/ERR_MODIF Lvace, lvace.typtie, lvace.sigtie, lvace.idvac Error in modification for the wave header.
0/ERR_CREAT Loll, loll.typtie, loll.sigtie, loll.idol, loll.numligol Error in creation for the delivery order line.
0   The execution of the function gnc_genere_lolc_supprimer OR gnc_genere_lolc is not successful.

Paramètres en entrée

NOM DESCRIPTION FORMAT OBLIGATOIRE/FACULTATIF
typdep Depot type Char(3) O
sigdep Depot ID Char(12) O
idvac Wave identifier Long O

Paramètres en sortie

NOM DU PARAMÈTRE TYPE FORMAT TAILLE REMARQUE
Aucun