1
0
mirror of synced 2025-01-20 01:41:40 +03:00

Bugfix. correct item array for generated items, created from admin inteface

This commit is contained in:
tikijian 2014-09-11 14:58:53 +04:00
parent 6624be556e
commit a67fbd3a2f

View File

@ -1234,7 +1234,7 @@ 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']))->Fetch();
if ($pr) if ($pr)
$pr = $pr['PURCHASING_PRICE']; $pr = $pr['PURCHASING_PRICE'];
else else
@ -1248,6 +1248,10 @@ class ICrmOrderActions
'comment' => $p['NOTES'], '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 it is canceled product don't send price
if (!$propCancel) { if (!$propCancel) {
$item['initialPrice'] = (double) $p['PRICE'] + (double) $p['DISCOUNT_PRICE']; $item['initialPrice'] = (double) $p['PRICE'] + (double) $p['DISCOUNT_PRICE'];
@ -1481,4 +1485,4 @@ class ICrmOrderActions
if($location = $dbLocation->Fetch()) if($location = $dbLocation->Fetch())
return $location['ID']; return $location['ID'];
} }
} }