EcritureService :: GetEcrituresByCompteGeneral

The POST method, is used to retrieve data.

The list of necessary parameters for sending a query:

  • string compteGeneral

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:

{"compteGeneral":"4010000","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->compteGeneral = "4010000";

$data->periode = new stdClass();
$data->periode = null;

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

$data->periode->Debut = '/Date(1354741200000+0100)/';
$data->periode->Fin = '/Date(1427745600000+0100)/';
$data->periode->EstCloturee = true;

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

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

$json_data = json_encode($data);

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

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

$response = json_decode($result);

Result:

Array
(
    [0] => stdClass Object
        (
            [Id] => 382
            [CodeJournal] => RAN
            [NumeroPiece] => 0000035
            [DateEcriture] => /Date(1420059600000+0300)/
            [DateSaisie] => /Date(1423947600000+0300)/
            [DateEcheance] => /Date(1424034000000+0300)/
            [NumeroFacture] => 
            [Reference] => 
            [Intitule] => RAN au 01/01
            [CompteGeneral] => 4010000
            [CompteGeneralContrepartie] => 8900000
            [NumeroTiers] => JASER
            [NumeroTiersContrepartie] => 
            [Montant] => 26756.61
            [Sens] => 1
            [Parite] => 0
            [MontantDevise] => 0
            [IdDevise] => 0
            [CodeTaxe] => 
            [IdReglement] => 1
            [EstLettree] => 
            [Lettre] => 
            [InfosLibres] => Array
                (
                    [0] => stdClass Object
                        (
                            [Name] => Controle date echeance
                            [Type] => 3
                            [Size] => 0
                            [EstCalculee] => 1
                            [Value] => 
                        )

                )

        )

    [1] => stdClass Object
        (
            [Id] => 383
            [CodeJournal] => RAN
            [NumeroPiece] => 0000035
            [DateEcriture] => /Date(1420059600000+0300)/
            [DateSaisie] => /Date(1423947600000+0300)/
            [DateEcheance] => /Date(1427745600000+0400)/
            [NumeroFacture] => 
            [Reference] => 
            [Intitule] => RAN au 01/01
            [CompteGeneral] => 4010000
            [CompteGeneralContrepartie] => 8900000
            [NumeroTiers] => MANDR
            [NumeroTiersContrepartie] => 
            [Montant] => 15000
            [Sens] => 0
            [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] => 
                        )

                )

        )
)