DocumentService :: InsertLigneDocumentList

The POST method, is used to retrieve data.

The list of parameters is not mandatory to request:

  • List<LigneDocument> ligneList,
  • bool useSageProcess = true

Returns data as JSON, for use in PHP, you need to convert JSON in StdClass PHP (PHP function: json_decode ()).

Input parameters:

{
  "ligneList": [
    {
      "ligneDocument": {
        "__type": "LigneArticle:http://www.proconsult.lu/WebServices100",
        "Id": 0,
        "TypeDocument": 1,
        "Domaine": 1,
        "NumeroDocument": "BC000284444",
        "NumeroDocumentBC": "",
        "NumeroDocumentBL": "",
        "NumeroDocumentPL": "",
        "Date": "/Date(1425343400000+0100)/",
        "DateBC": "/Date(1425343400000+0100)/",
        "DateBL": "/Date(-2208492400000+0100)/",
        "DatePL": "/Date(-2208492400000+0100)/",
        "NumeroLigne": 0,
        "Designation": "Location de parure5",
        "InfosLibres": [
          {
            "Name": "Unit\u00e9 de colisage",
            "Type": 21,
            "Size": 0,
            "EstCalculee": false,
            "Value": null
          },
          {
            "Name": "Colisage",
            "Type": 3,
            "Size": 0,
            "EstCalculee": false,
            "Value": null
          }
        ],
        "RefArticle": "BRAAR110",
        "IdGamme1": 0,
        "IdGamme2": 0,
        "DateLivraison": "/Date(1426201200000+0100)/",
        "PrixUnitaire": 145,
        "PrixUnitaireBC": 0,
        "PrixRevientUnitaire": 0,
        "PrixUnitaireTTC": 174,
        "PrixUnitaireDevise": 0,
        "MontantHT": 251.2,
        "MontantTTC": 251.2,
        "CMUP": 0,
        "Quantite": 3,
        "QuantiteBC": 3,
        "QuantiteBL": 0,
        "QuantitePL": 3,
        "PoidsNet": 0,
        "PoidsBrut": 0,
        "Conditionnement": "Jour1",
        "QuantiteConditionnement": 3,
        "RefFournisseur": "",
        "RefArticleCompose": null,
        "SectionAnalytique": "950BIJO1",
        "EstValorise": true,
        "EstNomenclature": false,
        "LigneTTC": 0,
        "IdDepot": 0,
        "IdCollaborateur": 10,
        "RemiseType1": 1,
        "RemiseValeur1": 12,
        "RemiseType2": 0,
        "RemiseValeur2": 0,
        "RemiseType3": 0,
        "RemiseValeur3": 0,
        "CodeTaxe1": "C20",
        "CodeTaxe2": null,
        "CodeTaxe3": null,
        "Taux1": 20,
        "Taux2": 0,
        "Taux3": 0,
        "IdEmplacement": 0,
        "TexteSupplementaire": null,
        "NumLotSerie": null,
        "ComplementLotSerie": null,
        "DatePeremption": "/Date(-2208992400000+0100)/",
        "DateFabrication": "/Date(-2208992400000+0100)/"
      }
    }
  ]
}

Example:

require (__DIR__ . '/service/LigneDocument.php');
require (__DIR__ . '/service/InfoLibre.php');

use services\LigneDocument;
use services\Webservices100;
use services\InfoLibre;

// add parameters
$infoL1 = new InfoLibre();
$infoL1->setName("Unité de colisage");
$infoL1->setSize(0);
$infoL1->setType(21);
$infoL1->setEstCalculee(false);
$infoL1->setValue();

$infoL2 = new InfoLibre();
$infoL2->setName("Colisage");
$infoL2->setSize(0);
$infoL2->setType(3);
$infoL2->setEstCalculee(false);
$infoL2->setValue();


$lingeD = new LigneDocument();
$lingeD->setType("LigneArticle:http://www.proconsult.lu/WebServices100");
$lingeD->setId(0);
$lingeD->setTypeDocument(1);
$lingeD->setDomaine(1);
$lingeD->setNumeroDocument("BC000284444");
$lingeD->setNumeroDocumentBC("");
$lingeD->setNumeroDocumentBL("");
$lingeD->setNumeroDocumentPL("");
$lingeD->setDate("/Date(1425343400000+0100)/");
$lingeD->setDateBC("/Date(1425343400000+0100)/");
$lingeD->setDateBL("/Date(-2208492400000+0100)/");
$lingeD->setDatePL("/Date(-2208492400000+0100)/");
$lingeD->setNumeroLigne(0);
$lingeD->setDesignation("Location de parure5");
$lingeD->setRefArticle("BRAAR110");
$lingeD->setIdGamme1(0);
$lingeD->setIdGamme2(0);

$lingeD->setDateLivraison("/Date(1426201200000+0100)/");
$lingeD->setPrixUnitaire(145);
$lingeD->setPrixUnitaireBC(0);
$lingeD->setPrixRevientUnitaire(0);
$lingeD->setPrixUnitaireTTC(174);
$lingeD->setPrixUnitaireDevise(0);
$lingeD->setMontantHT(251.2);
$lingeD->setMontantTTC(251.2);
$lingeD->setCMUP(0);
$lingeD->setQuantite(3);
$lingeD->setQuantiteBC(3);
$lingeD->setQuantiteBL(0);
$lingeD->setQuantitePL(3);
$lingeD->setPoidsNet(0);

$lingeD->setPoidsBrut(0);
$lingeD->setConditionnement("Jour1");
$lingeD->setQuantiteConditionnement(3);
$lingeD->setRefFournisseur("");
$lingeD->setRefArticleCompose();
$lingeD->setSectionAnalytique("950BIJO1");
$lingeD->setEstValorise(true);
$lingeD->setEstNomenclature(false);
$lingeD->setLigneTTC(0);
$lingeD->setIdDepot(0);
$lingeD->setIdCollaborateur(10);
$lingeD->setRemiseType1(1);
$lingeD->setRemiseValeur1(12);
$lingeD->setRemiseType2(0);
$lingeD->setRemiseValeur2(0);
$lingeD->setRemiseType3(0);
$lingeD->setRemiseValeur3(0);
$lingeD->setCodeTaxe1("C20");
$lingeD->setCodeTaxe2();
$lingeD->setCodeTaxe3();
$lingeD->setTaux1(20);
$lingeD->setTaux2(0);
$lingeD->setTaux3(0);
$lingeD->setIdEmplacement(0);
$lingeD->setTexteSupplementaire();
$lingeD->setNumLotSerie();
$lingeD->setComplementLotSerie();
$lingeD->setDatePeremption("/Date(-2208992400000+0100)/");
$lingeD->setDateFabrication("/Date(-2208992400000+0100)/");

$lingeD->setInfosLibres([$infoL1->getResponse(), $infoL2->getResponse()]);

$data = new stdClass();
$data->ligneDocument = new stdClass();
$data->ligneDocument = $lingeD->getResponse();

$ligneList = new stdClass();
$ligneList->ligneList[] = $data;

$json_data = json_encode($ligneList, JSON_UNESCAPED_SLASHES);

$url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/DocumentService/rest/InsertLigneDocumentList';

// Send requests to receive data
$result = WebServices100::getData($url, $json_data);

$response= json_decode($result);

Result:

Array of LigneDocument