From 4b5dea42639269acf71266f8ce05b42ac545d7ec Mon Sep 17 00:00:00 2001 From: Ilyas Salikhov Date: Wed, 16 Apr 2014 15:41:17 +0400 Subject: [PATCH] Upload purchase price in order products --- intaro.intarocrm/classes/general/ICrmOrderActions.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index 70ddfced..059cdb1d 100755 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -1088,7 +1088,13 @@ class ICrmOrderActions $propCancel = (int)$propCancel['VALUE']; } - $pr = CCatalogProduct::GetList(array('ID' => $p['PRODUCT_ID']))->Fetch(); + $pr = CCatalogProduct::GetList( + array(), + array('ID' => $p['PRODUCT_ID']), + false, + array('nTopCount' => 1) + )->Fetch(); + if ($pr) $pr = $pr['PURCHASING_PRICE']; else @@ -1106,6 +1112,9 @@ class ICrmOrderActions if (!$propCancel) { $item['initialPrice'] = (double) $p['PRICE'] + (double) $p['DISCOUNT_PRICE']; $item['discount'] = $p['DISCOUNT_PRICE']; + if ($pr) { + $item['purchasePrice'] = $pr; + } } $items[] = $item;