From a67fbd3a2f8857dad975f0507951f20afa4b613d Mon Sep 17 00:00:00 2001 From: tikijian Date: Thu, 11 Sep 2014 14:58:53 +0400 Subject: [PATCH] Bugfix. correct item array for generated items, created from admin inteface --- intaro.intarocrm/classes/general/ICrmOrderActions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index 592a192c..1a8761dc 100755 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -1234,7 +1234,7 @@ class ICrmOrderActions $propCancel = (int)$propCancel['VALUE']; } - $pr = CCatalogProduct::GetList(array('ID' => $p['PRODUCT_ID']))->Fetch(); + $pr = CCatalogProduct::GetList(array(), array('ID' => $p['PRODUCT_ID']))->Fetch(); if ($pr) $pr = $pr['PURCHASING_PRICE']; else @@ -1248,6 +1248,10 @@ class ICrmOrderActions 'comment' => $p['NOTES'], ); + //if this item generated through admin interface, then unset productId + if(empty($pr)) + unset($item['productId']); + //if it is canceled product don't send price if (!$propCancel) { $item['initialPrice'] = (double) $p['PRICE'] + (double) $p['DISCOUNT_PRICE']; @@ -1481,4 +1485,4 @@ class ICrmOrderActions if($location = $dbLocation->Fetch()) return $location['ID']; } -} \ No newline at end of file +}