EcritureService :: GetEcrituresByTiers

The POST method, is used to retrieve data.

The list of necessary parameters for sending a query:

  • string numeroTiers.

The list of parameters is not mandatory to request:

  • Periode periode,
  • List<Order> orders
  • int pageNumber
  • int rowsPerPage

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

Input parameters:

{"numeroTiers":"ECLAT","periode":{"Debut":"/Date(1354741200000+0100)/","Fin":"/Date(1427745600000+0100)/","EstCloturee":true},"orders":[{"Id":"Desc"}],"pageNumber":0,"rowsPerPage":0}

Example:

require (__DIR__ . '/service/WebServices100.php');

use services\WebServices100;

// add parameters
$data = new stdClass();
$data->numeroTiers = "ECLAT";

$data->periode = new stdClass();

$dateDebut = new DateTime("2013-01-01");
$dateFin = new DateTime("2013-12-31");

$data->periode->Debut = '/Date('.$dateDebut.'000+0300)/';
$data->periode->Fin = '/Date('.$dateFin.'000+0400)/';
$data->periode->EstCloturee = true;


$orders = new stdClass();
$orders->Id = 'Desc';

$data->orders[] = $orders;
$data->pageNumber = 0;
$data->rowsPerPage = 0;

$json_data = json_encode($data, JSON_UNESCAPED_SLASHES);

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

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

$response = json_decode($result);

Result:

Array
(
    [0] => stdClass Object
        (
            [Id] => 152
            [CodeJournal] => ACH
            [NumeroPiece] => 0000303
            [DateEcriture] => /Date(1426366800000+0300)/
            [DateSaisie] => /Date(1354741200000+0300)/
            [DateEcheance] => /Date(1431547200000+0400)/
            [NumeroFacture] => EC5499
            [Reference] => KLJKJ001
            [Intitule] => Facture n° EC5499
            [CompteGeneral] => 4010000
            [CompteGeneralContrepartie] => 
            [NumeroTiers] => ECLAT
            [NumeroTiersContrepartie] => 
            [Montant] => 18431.81
            [Sens] => 1
            [Parite] => 0
            [MontantDevise] => 0
            [IdDevise] => 0
            [CodeTaxe] => 
            [IdReglement] => 4
            [EstLettree] => 
            [Lettre] => 
            [InfosLibres] => Array
                (
                    [0] => stdClass Object
                        (
                            [Name] => Controle date echeance
                            [Type] => 3
                            [Size] => 0
                            [EstCalculee] => 1
                            [Value] => 
                        )

                )

        )

    [1] => stdClass Object
        (
            [Id] => 59
            [CodeJournal] => ACH
            [NumeroPiece] => 0000301
            [DateEcriture] => /Date(1421787600000+0300)/
            [DateSaisie] => /Date(1354741200000+0300)/
            [DateEcheance] => /Date(1426971600000+0300)/
            [NumeroFacture] => EC5487
            [Reference] => LKP001
            [Intitule] => Facture n° EC5487
            [CompteGeneral] => 4010000
            [CompteGeneralContrepartie] => 
            [NumeroTiers] => ECLAT
            [NumeroTiersContrepartie] => 
            [Montant] => 1824.67
            [Sens] => 1
            [Parite] => 0
            [MontantDevise] => 0
            [IdDevise] => 0
            [CodeTaxe] => 
            [IdReglement] => 4
            [EstLettree] => 
            [Lettre] => 
            [InfosLibres] => Array
                (
                    [0] => stdClass Object
                        (
                            [Name] => Controle date echeance
                            [Type] => 3
                            [Size] => 0
                            [EstCalculee] => 1
                            [Value] => 
                        )

                )

        )
)