EcritureService :: GetListEcritures
The POST method, is used to retrieve data.
The list of parameters is not mandatory to request:
- Criteria criteria,
- array 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:
- Criteria
{"criteria":
{
"__type":"CriteriaLogical:http://www.proconsult.lu/WebServices100",
"Operand1":
{
"__type":"CriteriaComparison:http://www.proconsult.lu/WebServices100",
"FieldName": "CodeJournal",
"Operator": "0",
"Value": "RAN"
},
"Operator":0
}
}
- orders
{"orders":[{"Id":"Desc"}]}- pageNumber
{pageNumber: 1}- rowsPerPage
{rowsPerPage: 10}
Example:
require (__DIR__ . '/service/Criteria.php');
use services\WebServices100;
use services\Criteria;
// add parameters
$response = new Criteria();
$response->setType('CriteriaLogical:http://www.proconsult.lu/WebServices100');
$response->setFieldName('CodeJournal');
$response->setOperator("0");
$response->setValue("RAN");
$response->setOperand(
[
'Operand1' => [
'__type' => 'CriteriaComparison:http://www.proconsult.lu/WebServices100',
'FieldName' => 'CodeJournal',
'Operator' => '0',
'Value' => 'RAN']
]
);
$url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/EcritureService/rest/GetListEcritures';
// Send requests to receive data
$result = WebServices100::getData($url, $data)));
$listContact = 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] =>
)
)
)
)