22
33class 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