• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/cashbox/checkmanager.php
  • Класс: BitrixSaleCashboxCheckManager
  • Вызов: CheckManager::isAutomaticEnabled
static function isAutomaticEnabled(SaleOrder $order)
{
	$shipmentCollection = $order->getShipmentCollection();
	if (
		(
			$shipmentCollection->count() > 2
			&& $shipmentCollection->isExistsSystemShipment()
		)
		||
		(
			$shipmentCollection->count() > 1
			&& !$shipmentCollection->isExistsSystemShipment()
		)
	)
	{
		return false;
	}

	$paymentCollection = $order->getPaymentCollection();
	if (
		(
			$paymentCollection->isExistsInnerPayment()
			&& $paymentCollection->count() > 2
		)
		||
		(
			!$paymentCollection->isExistsInnerPayment()
			&& $paymentCollection->count() > 1
		)
	)
	{
		return false;
	}

	return true;
}