Skip to content

Commit d3e261c

Browse files
Merge branch 'feature/purchaseOrdersV2' into 'master'
getPurchaseOrdersV2 now has support for request.purchaseOrderNumber and request.extPurchaseOrderId See merge request mpluskassa/mplus-api-client-deprecated!49
2 parents abe4825 + e6bddff commit d3e261c

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Mplusqapiclient.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class MplusQAPIclient
44
{
5-
const CLIENT_VERSION = '1.32.0';
5+
const CLIENT_VERSION = '1.33.0';
66
const WSDL_TTL = 300;
77

88
var $MIN_API_VERSION_MAJOR = 0;
@@ -2834,10 +2834,10 @@ public function getPurchaseOrders($syncMarker, $fromOrderDate, $throughOrderDate
28342834

28352835
//----------------------------------------------------------------------------
28362836

2837-
public function getPurchaseOrdersV2($syncMarker, $fromOrderDate, $throughOrderDate, $fromDeliveryDate=null, $throughDeliveryDate=null, $branchNumbers=null, $employeeNumbers=null, $relationNumbers=null, $articleNumbers=null, $articleTurnoverGroups=null, $articlePluNumbers=null, $articleBarcodes=null, $syncMarkerLimit=null, $attempts=0)
2837+
public function getPurchaseOrdersV2($syncMarker, $fromOrderDate, $throughOrderDate, $fromDeliveryDate=null, $throughDeliveryDate=null, $branchNumbers=null, $employeeNumbers=null, $relationNumbers=null, $articleNumbers=null, $articleTurnoverGroups=null, $articlePluNumbers=null, $articleBarcodes=null, $syncMarkerLimit=null, $purchaseOrderNumber=null, $extPurchaseOrderId=null, $attempts=0)
28382838
{
28392839
try {
2840-
$result = $this->client->getPurchaseOrdersV2($this->parser->convertGetPurchaseOrdersRequest($syncMarker, $fromOrderDate, $throughOrderDate, $fromDeliveryDate, $throughDeliveryDate, $branchNumbers, $employeeNumbers, $relationNumbers, $articleNumbers, $articleTurnoverGroups, $articlePluNumbers, $articleBarcodes, $syncMarkerLimit));
2840+
$result = $this->client->getPurchaseOrdersV2($this->parser->convertGetPurchaseOrdersRequest($syncMarker, $fromOrderDate, $throughOrderDate, $fromDeliveryDate, $throughDeliveryDate, $branchNumbers, $employeeNumbers, $relationNumbers, $articleNumbers, $articleTurnoverGroups, $articlePluNumbers, $articleBarcodes, $syncMarkerLimit, $purchaseOrderNumber, $extPurchaseOrderId));
28412841
if($this->returnRawResult) {
28422842
return $result;
28432843
}
@@ -2846,7 +2846,7 @@ public function getPurchaseOrdersV2($syncMarker, $fromOrderDate, $throughOrderDa
28462846
$msg = $e->getMessage();
28472847
if (false !== stripos($msg, 'Could not connect to host') and $attempts < 3) {
28482848
sleep(1);
2849-
return $this->getPurchaseOrdersV2($syncMarker, $fromFinancialDate, $throughFinancialDate, $fromDeliveryDate, $throughDeliveryDate, $branchNumbers, $employeeNumbers, $relationNumbers, $articleNumbers, $articleTurnoverGroups, $articlePluNumbers, $articleBarcodes, $syncMarkerLimit, $attempts+1);
2849+
return $this->getPurchaseOrdersV2($syncMarker, $fromOrderDate, $throughOrderDate, $fromDeliveryDate, $throughDeliveryDate, $branchNumbers, $employeeNumbers, $relationNumbers, $articleNumbers, $articleTurnoverGroups, $articlePluNumbers, $articleBarcodes, $syncMarkerLimit, $purchaseOrderNumber, $extPurchaseOrderId, $attempts+1);
28502850
} else {
28512851
throw new MplusQAPIException('SoapFault occurred: '.$msg, 0, $e);
28522852
}
@@ -7888,7 +7888,7 @@ public function convertGetPackingSlipsByOrderRequest($orderId)
78887888

78897889
//----------------------------------------------------------------------------
78907890

7891-
public function convertGetPurchaseOrdersRequest($syncMarker, $fromOrderDate, $throughOrderDate, $fromDeliveryDate, $throughDeliveryDate, $branchNumbers, $employeeNumbers, $relationNumbers, $articleNumbers, $articleTurnoverGroups, $articlePluNumbers, $articleBarcodes, $syncMarkerLimit)
7891+
public function convertGetPurchaseOrdersRequest($syncMarker, $fromOrderDate, $throughOrderDate, $fromDeliveryDate, $throughDeliveryDate, $branchNumbers, $employeeNumbers, $relationNumbers, $articleNumbers, $articleTurnoverGroups, $articlePluNumbers, $articleBarcodes, $syncMarkerLimit, $purchaseOrderNumber=null, $extPurchaseOrderId=null)
78927892
{
78937893
$fromOrderDate = is_null($fromOrderDate)?null:$this->convertMplusDate($fromOrderDate, 'fromOrderDate');
78947894
$throughOrderDate = is_null($throughOrderDate)?null:$this->convertMplusDate($throughOrderDate, 'throughOrderDate');
@@ -7917,6 +7917,12 @@ public function convertGetPurchaseOrdersRequest($syncMarker, $fromOrderDate, $th
79177917
}
79187918

79197919
$array = array();
7920+
if (!is_null($purchaseOrderNumber) and !empty($purchaseOrderNumber)) {
7921+
$array['purchaseOrderNumber'] = $this->convertYearNumber($purchaseOrderNumber);
7922+
}
7923+
elseif (!is_null($extPurchaseOrderId) and !empty($extPurchaseOrderId)) {
7924+
$array['extPurchaseOrderId'] = $extPurchaseOrderId;
7925+
}
79207926
if ( ! is_null($syncMarker)) {
79217927
$array['syncMarker'] = (int)$syncMarker;
79227928
if ( ! is_null($syncMarkerLimit) and $syncMarkerLimit > 0) {

0 commit comments

Comments
 (0)