-
Notifications
You must be signed in to change notification settings - Fork 53
/
queryInvoiceData.php
39 lines (25 loc) · 1007 Bytes
/
queryInvoiceData.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
include("config.php");
try {
$config = new NavOnlineInvoice\Config($apiUrl, $userData, $softwareData);
$reporter = new NavOnlineInvoice\Reporter($config);
$invoiceNumberQuery = [
"invoiceNumber" => "T20190001",
"invoiceDirection" => "OUTBOUND",
];
// Lekérdezés
$invoiceDataResult = $reporter->queryInvoiceData($invoiceNumberQuery);
print "Query results XML elem:\n";
var_dump($invoiceDataResult);
// Számla kézi dekódolása
$invoice = NavOnlineInvoice\InvoiceOperations::convertToXml($invoiceDataResult->invoiceData, $invoiceDataResult->compressedContentIndicator);
// Számla:
var_dump($invoice);
// *** VAGY ***
// Lekérdezés és számla automatikus dekódolása
$invoice = $reporter->queryInvoiceData($invoiceNumberQuery, true); // 2. paraméter jelzi az automatikus dekódolást
// Számla:
var_dump($invoice);
} catch(Exception $ex) {
print get_class($ex) . ": " . $ex->getMessage();
}