Bugfix. correct item array for generated items, created from admin inteface
This commit is contained in:
parent
6624be556e
commit
a67fbd3a2f
@ -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'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user