Skip to content

Commit e02c7d5

Browse files
committed
Add Bestand Example
1 parent f4c93b0 commit e02c7d5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

examples/artikel-bestand.php

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
require __DIR__ . '/vendor/autoload.php';
4+
5+
use Pitwch\RestAPIWrapperProffix\Client;
6+
7+
$pxrest = new Client(
8+
'https://myserver.ch:999',
9+
'DEMO',
10+
'USR',
11+
'b62cce2fe18f7a156a9c719c57bebf0478a3d50f0d7bd18d9e8a40be2e663017',
12+
'ADR,STU',
13+
array('key'=>'112a5a90fe28b23ed2c776562a7d1043957b5b79fad242b10141254b4de59028','limit'=>1));
14+
15+
$artikel = 'PC 6'; //Set Artikelnr with blank(!)
16+
$bestand = $pxrest->get("LAG/Artikel/".rawurlencode($artikel)."/Bestand"); //Use rawurlencode() !
17+
18+
//Iterate through stocks array
19+
$stockTotal = 0;
20+
foreach ($bestand as $stock) {
21+
$stocktotal = $stockTotal + $stock->Bestand;
22+
}
23+
echo "Bestand: ".$stockTotal; //Return combined stocks

0 commit comments

Comments
 (0)