...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/entity/paymentdocumentsrepository.php
- Класс: Bitrix\Crm\Entity\objects
- Вызов: objects::calculateDocumentTotals
private function calculateDocumentTotals(array $documentList): array { $documentTotals = []; $shipmentIds = array_column($documentList, 'ID'); $shipmentBasketResult = Sale\ShipmentItem::getList([ 'select' => ['PRICE' => 'BASKET.PRICE', 'ORDER_DELIVERY_ID', 'QUANTITY'], 'filter' => ['=ORDER_DELIVERY_ID' => $shipmentIds] ]); while ($shipmentItem = $shipmentBasketResult->fetch()) { if (!isset($documentTotals[$shipmentItem['ORDER_DELIVERY_ID']])) { $documentTotals[$shipmentItem['ORDER_DELIVERY_ID']] = 0; } $documentTotals[$shipmentItem['ORDER_DELIVERY_ID']] += (float)$shipmentItem['PRICE'] * $shipmentItem['QUANTITY']; } return $documentTotals; }