1
0
mirror of synced 2025-03-24 00:53:54 +03:00

Upload purchase price in order products

This commit is contained in:
Ilyas Salikhov 2014-04-16 15:41:17 +04:00
parent 2406c71652
commit 4b5dea4263

View File

@ -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;