• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/invoice/internals/invoicediscount.php
  • Класс: Bitrix\Crm\Invoice\Internals\InvoiceDiscountTable
  • Вызов: InvoiceDiscountTable::calculateRuleHash
static function calculateRuleHash($discount)
{
	$hash = false;
	if (!empty($discount) && is_array($discount))
	{
		if (isset($discount['CONDITIONS_LIST']))
			$discount['CONDITIONS'] = $discount['CONDITIONS_LIST'];
		if (isset($discount['ACTIONS_LIST']))
			$discount['ACTIONS'] = $discount['ACTIONS_LIST'];
		if (!isset($discount['CONDITIONS']) || !isset($discount['ACTIONS']))
			return $hash;
		$fields = array(
			'CONDITIONS' => $discount['CONDITIONS'],
			'ACTIONS' => $discount['ACTIONS']
		);
		$hash = md5(serialize($fields));
	}
	return $hash;
}