Commit 2f8623b7 authored by aecres's avatar aecres

- Working on details report for revenue-by-dept

parent 7f9fb9c8
......@@ -57,6 +57,8 @@ Ext.onReady(function () {
dateFormat: 'j M y',
constraint: false,
step: [Ext.Date.MONTH, 1],
// fromDate: new Date('2019-01-01'),
toDate: new Date('@axis_to_date@'),
label: {rotate: {degrees: 315}}
}],
series: @series_list_json;noquote@
......
......@@ -64,9 +64,26 @@ foreach dept $dept_list {
xField: 'Date', yField: '$dept',
axis: 'left',
highlight: {size: 7, radius: 7},
listeners: {
'itemclick': function(item, event) {
var date = item.value\[0\].toISOString().substring(0,10);
var value = item.value\[1\];
var dept = item.series.yField;
var url = '/intranet-reporting-dashboard/revenue-by-dept-details';
url = url + '?date='+date;
url = url +'&dept='+dept +'&dept_sql=[im_quotejson $diagram_dept_sql]';
window.open(url, '_blank');
}
},
tips: { width: 200, renderer: function(storeItem, item) {
this.setTitle('$dept:<br>Date: '+storeItem.get('Date').toISOString().substring(0,10)+',<br> Revenues: '+storeItem.get('$dept'));
}}
}"
}
set series_list_json "\[\n [join $series_list ",\n "]\n \]"
# Show Axis only until 1st of current month.
# Everything within the current month is vague,
# because invoices are probably not yet written...
set axis_to_date [db_string to_date "select to_char(now(), 'YYYY-MM-01')"]
......@@ -549,3 +549,4 @@ SELECT acs_permission__grant_permission(
(select group_id from groups where group_name = 'Senior Managers'),
'read'
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment