Skip to content

Commit

Permalink
Merge branch 'master' into 'master'
Browse files Browse the repository at this point in the history
v1.10.0: Added parameter `receipt.includeOrderReferences` to `getReceipts()`

See merge request mpluskassa/mplus-api-client!5
  • Loading branch information
Eelke Klein committed Oct 29, 2018
2 parents f8def9f + 5303efc commit 21872c1
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Mplusqapiclient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class MplusQAPIclient
{
const CLIENT_VERSION = '1.9.1';
const CLIENT_VERSION = '1.10.0';


var $MIN_API_VERSION_MAJOR = 0;
Expand Down Expand Up @@ -1878,10 +1878,10 @@ public function deliverInterbranchShipment($interbranchShipmentNumber, $branchNu

//----------------------------------------------------------------------------

public function getReceipts($syncMarker, $fromFinancialDate, $throughFinancialDate, $branchNumbers=null, $employeeNumbers=null, $relationNumbers=null, $articleNumbers=null, $articleTurnoverGroups=null, $articlePluNumbers=null, $articleBarcodes=null, $supplierRelationNumbers=null, $syncMarkerLimit=null, $attempts=0)
public function getReceipts($syncMarker, $fromFinancialDate, $throughFinancialDate, $branchNumbers=null, $employeeNumbers=null, $relationNumbers=null, $articleNumbers=null, $articleTurnoverGroups=null, $articlePluNumbers=null, $articleBarcodes=null, $supplierRelationNumbers=null, $syncMarkerLimit=null, $includeOrderReferences=null, $attempts=0)
{
try {
$result = $this->client->getReceipts($this->parser->convertGetReceiptsRequest($syncMarker, $syncMarkerLimit, $fromFinancialDate, $throughFinancialDate, $branchNumbers, $employeeNumbers, $relationNumbers, $articleNumbers, $articleTurnoverGroups, $articlePluNumbers, $articleBarcodes, $supplierRelationNumbers));
$result = $this->client->getReceipts($this->parser->convertGetReceiptsRequest($syncMarker, $syncMarkerLimit, $fromFinancialDate, $throughFinancialDate, $branchNumbers, $employeeNumbers, $relationNumbers, $articleNumbers, $articleTurnoverGroups, $articlePluNumbers, $articleBarcodes, $supplierRelationNumbers, $includeOrderReferences));
return $this->parser->parseGetReceiptsResult($result);
} catch (SoapFault $e) {
$msg = $e->getMessage();
Expand Down Expand Up @@ -5260,7 +5260,7 @@ public function convertGetShiftsRequest($fromFinancialDate, $throughFinancialDat

//----------------------------------------------------------------------------

public function convertGetReceiptsRequest($syncMarker, $syncMarkerLimit, $fromFinancialDate, $throughFinancialDate, $branchNumbers, $employeeNumbers, $relationNumbers, $articleNumbers, $articleTurnoverGroups, $articlePluNumbers, $articleBarcodes, $supplierRelationNumbers)
public function convertGetReceiptsRequest($syncMarker, $syncMarkerLimit, $fromFinancialDate, $throughFinancialDate, $branchNumbers, $employeeNumbers, $relationNumbers, $articleNumbers, $articleTurnoverGroups, $articlePluNumbers, $articleBarcodes, $supplierRelationNumbers, $includeOrderReferences)
{
$fromFinancialDate = is_null($fromFinancialDate)?null:$this->convertMplusDate($fromFinancialDate, 'fromFinancialDate');
$throughFinancialDate = is_null($throughFinancialDate)?null:$this->convertMplusDate($throughFinancialDate, 'throughFinancialDate');
Expand Down Expand Up @@ -5310,6 +5310,14 @@ public function convertGetReceiptsRequest($syncMarker, $syncMarkerLimit, $fromFi
$request['supplierRelationNumbers'] = array_values($supplierRelationNumbers);
}

if (!is_null($includeOrderReferences)) {
if (is_bool($includeOrderReferences)) {
$request['includeOrderReferences'] = $includeOrderReferences;
} else {
throw new MplusQAPIException('Supplied value for `includeOrderReferences` is not a valid boolean.');
}
}

$object = arrayToObject(array('request'=>$request));
return $object;
} // END convertGetReceiptsRequest()
Expand Down

0 comments on commit 21872c1

Please sign in to comment.