32 $fields[
"CAN_BUY"] =
'Y';
33 $fields[
"AVAILABLE_QUANTITY"] = 100000000;
40 $fields[
"AVAILABLE_QUANTITY"] =
'Y';
70 $fields[
'QUANTITY_RESERVED'] = $fields[
'QUANTITY_ADD'];
71 $fields[
'RESULT'] =
true;
83 public static function DeductProduct($fields)
86 $basketItem = $fields[
'BASKET_ITEM'];
87 $orderId = (int)$basketItem->getField(
'ORDER_ID');
88 $currency = $basketItem->getField(
'CURRENCY');
90 $propertyCollection = $basketItem->getPropertyCollection();
92 $item = $propertyCollection->getPropertyValues();
93 $sum = (float)($item[
'SUM_OF_CHARGE'][
'VALUE']) * (float)($basketItem->getQuantity());
96 $basket = $basketItem->getCollection();
97 $order = $basket->getOrder();
98 $userId = $order->getUserId();
100 $resultUpdateUserAccount = \CSaleUserAccount::UpdateAccount($userId, ($fields[
"UNDO_DEDUCTION"]===
'N'?$sum:-$sum), $currency,
"MANUAL", $orderId,
"Payment to user account");
102 if ($resultUpdateUserAccount)
104 $fields[
'RESULT'] =
true;