1
0
mirror of synced 2024-11-26 07:16:08 +03:00

Merge branch 'purchase-price' of github.com:intarocrm/bitrix-module into 1.0.3a

This commit is contained in:
Grisha Pomadchin 2014-04-17 11:40:11 +04:00
commit 77bb3160c1

View File

@ -1225,7 +1225,13 @@ class ICrmOrderActions
$propCancel = (int)$propCancel['VALUE']; $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) if ($pr)
$pr = $pr['PURCHASING_PRICE']; $pr = $pr['PURCHASING_PRICE'];
else else
@ -1243,6 +1249,9 @@ class ICrmOrderActions
if (!$propCancel) { if (!$propCancel) {
$item['initialPrice'] = (double) $p['PRICE'] + (double) $p['DISCOUNT_PRICE']; $item['initialPrice'] = (double) $p['PRICE'] + (double) $p['DISCOUNT_PRICE'];
$item['discount'] = $p['DISCOUNT_PRICE']; $item['discount'] = $p['DISCOUNT_PRICE'];
if ($pr) {
$item['purchasePrice'] = $pr;
}
} }
$items[] = $item; $items[] = $item;