• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/integrations/report/handlers/treatment.php
  • Класс: BitrixImOpenLinesIntegrationsReportHandlersTreatment
  • Вызов: Treatment::getPreparedDemoRow
protected function getPreparedDemoRow($row)
{

	/** @var DropDown $whatWillCalculate */
	$whatWillCalculate = $this->getFormElement('calculate');
	$whatWillCalculateValue = $whatWillCalculate->getValue();
	$result = array();
	switch ($whatWillCalculateValue)
	{
		case self::WHAT_WILL_CALCULATE_ALL_TREATMENT_BY_HOUR:
			$result['value'] = $row['first_treatment_qty'] + $row['repeated_treatment_qty'];
			break;
		case self::WHAT_WILL_CALCULATE_ALL:
			$result['value'] = $row['first_treatment_qty'] + $row['repeated_treatment_qty'];
			break;
		case self::WHAT_WILL_CALCULATE_FIRST:
			$result['value'] = $row['first_treatment_qty'];
			break;
		case self::WHAT_WILL_CALCULATE_DUPLICATE:
			$result['value'] = $row['repeated_treatment_qty'];
			break;
		case self::WHAT_WILL_CALCULATE_POSITIVE_MARK:
			$result['value'] = $row['positive_qty'];
			break;
		case self::WHAT_WILL_CALCULATE_ANSWERED:
			$result['value'] = $row['answered_qty'];
			break;
		case self::WHAT_WILL_CALCULATE_ALL_APPOINTED:
			$result['value'] = $row['answered_qty'] + $row['skipped_qty'];
			break;
		case self::WHAT_WILL_CALCULATE_SKIPPED:
			$result['value'] = $row['skipped_qty'];
			break;
		case self::WHAT_WILL_CALCULATE_NEGATIVE_MARK:
			$result['value'] = $row['negative_qty'];
			break;
		case self::WHAT_WILL_CALCULATE_WITHOUT_MARK:
			$result['value'] = $row['without_mark_qty'];
			break;
		case self::WHAT_WILL_CALCULATE_ALL_MARK:
			$result['value'] = $row['positive_qty'] + $row['negative_qty'];
			break;
		case self::WHAT_WILL_CALCULATE_CONTENTMENT:
			$result['value'] = floor( ($row['positive_qty'] / ($row['positive_qty'] + $row['negative_qty'])) * 100);
			break;
	}

	return $result;
}