• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/cashbox/checkmanager.php
  • Класс: BitrixSaleCashboxCheckManager
  • Вызов: CheckManager::collate
static function collate($entity)
{
	$map = array();

	if ($entity instanceof SalePayment)
	{
		$order = self::getOrder($entity);

		/** @var SalePaySystemService $service */
		$service = $entity->getPaySystem();
		if ($entity->isPaid() &&
			($service->getField("CAN_PRINT_CHECK") == "Y") &&
			($entity->getSum() == $order->getPrice())
		)
		{
			$checkEntities[] = $entity;

			$shipmentCollection = $order->getShipmentCollection();
			/** @var SaleShipment $shipment */
			foreach ($shipmentCollection as $shipment)
			{
				if (!$shipment->isSystem())
					$checkEntities[] = $shipment;
			}

			$map[] = array("TYPE" => SellCheck::getType(), "ENTITIES" => $checkEntities, "RELATED_ENTITIES" => array());
		}
	}

	return $map;
}