{*{$charts_data = '{"charts":[{"name":"min by stages","data":[{"stage_id":38,"value":12864,"over_text":"2 pcs."},{"stage_id":37,"value":0,"over_text":""},{"stage_id":36,"value":24,"over_text":"1 pcs."},{"stage_id":35,"value":0,"over_text":""}],"exists":true},{"name":"overdue now","data":[{"stage_id":38,"value":0,"base_text":"","over_text":"","sub_text":""},{"stage_id":37,"value":0,"base_text":"","over_text":"","sub_text":""},{"stage_id":36,"value":0,"base_text":"","over_text":"","sub_text":""},{"stage_id":35,"value":0,"base_text":"","over_text":"","sub_text":""}],"exists":false}],"stages":[{"id":"38","funnel_id":"8","name":"\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u0442\u0430\u043f","number":"0","limit_hours":null,"color":"#FFBCB5"},{"id":"37","funnel_id":"8","name":"\u0422\u0440\u0435\u0442\u0438\u0439 \u044d\u0442\u0430\u043f","number":"1","limit_hours":"48","color":"#E28E8B"},{"id":"36","funnel_id":"8","name":"\u0424\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u0430\u043f","number":"2","limit_hours":"240","color":"#C66161"},{"id":"35","funnel_id":"8","name":"\u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f","number":"3","limit_hours":null,"color":"#AA3438"}]}'}*}
{*{$charts_data = $charts_data|json_decode:true}*}
{$_title = "[`Deal stages`]"}
{* DATE *}
{$filter_dates = [
"30" => [
"id" => "30",
"uri" => crmHelper::getUrl(["timeframe" => 30, "start" => null, "end" => null]),
"name" => _w('Last %d day', 'Last %d days', 30),
"group_by" => "days",
"timeframe" => 30
],
"90" => [
"id" => "90",
"uri" => crmHelper::getUrl(["timeframe" => 90, "start" => null, "end" => null]),
"name" => _w('Last %d day', 'Last %d days', 90),
"group_by" => "days",
"timeframe" => 90
],
"365" => [
"id" => "365",
"uri" => crmHelper::getUrl(["timeframe" => 365, "start" => null, "end" => null]),
"name" => _w('Last %d day', 'Last %d days', 365),
"group_by" => "months",
"timeframe" => 365
],
"all" => [
"id" => "all",
"uri" => crmHelper::getUrl(["timeframe" => "all", "start" => null, "end" => null]),
"name" => "[`All time`]",
"group_by" => "months",
"timeframe" => "all"
],
"custom" => [
"id" => "custom",
"uri" => "javascript:void(0);",
"name" => "[`Select dates...`]",
"group_by" => "",
"timeframe" => "custom"
]
]}
{if $timeframe && !empty($filter_dates[$timeframe])}
{$selected_filter_date = $filter_dates[$timeframe]}
{else}
{$selected_filter_date = reset($filter_dates)}
{/if}
{if !empty($charts_data.stages)}
[`Deals count in stages now`]
{if !empty($charts_data.charts[0][0].exists)}
{else}
[`There are no data for report.`]
{/if}
{foreach $charts_data.stages as $_stage}
-
{$_stage.name|escape}
{/foreach}
{if !empty($charts_data.charts[1].exists)}
{else}
[`There are no data for report.`]
{/if}
[`Average timeout for deal in stage`]
{else}
[`There are no stages.`]
{/if}