• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/invoice/internals/invoicediscount.php
  • Класс: Bitrix\Crm\Invoice\Internals\InvoiceDiscountTable
  • Вызов: InvoiceDiscountTable::calculateHash
static function calculateHash($discount)
{
	$hash = false;
	if (!empty($discount) && is_array($discount))
	{
		$fields = array();
		foreach (self::$requiredFields as $fieldName)
		{
			if (!isset($discount[$fieldName]))
				return $hash;
			$fields[$fieldName] = (
				is_array($discount[$fieldName])
				? $discount[$fieldName]
				: trim((string)$discount[$fieldName])
			);
		}
		if (!empty($fields))
			$hash = md5(serialize($fields));
	}
	return $hash;
}