|
@@ -515,21 +515,43 @@ function report_session_analytic(reporting){
|
|
|
name: index.display_name,
|
|
|
qty: qty,
|
|
|
total: accounting.formatMoney(total, '', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
|
|
|
+ amount: total,
|
|
|
});
|
|
|
};
|
|
|
});
|
|
|
- info.sort(function(a, b) {
|
|
|
- return b.qty - a.qty
|
|
|
- });
|
|
|
- var utc_start;
|
|
|
- var utc_stop = ' ';
|
|
|
- utc_start = moment.utc(item.start_at,'YYYY-MM-DD h:mm:ss A');
|
|
|
- utc_start = moment(utc_start._d).format('DD/MM/YYYY HH:mm:ss');
|
|
|
- if(item.stop_at){
|
|
|
- utc_stop = moment.utc(item.stop_at,'YYYY-MM-DD h:mm:ss A');
|
|
|
- utc_stop = moment(utc_stop._d).format('DD/MM/YYYY HH:mm:ss');
|
|
|
- };
|
|
|
if(info.length > 0){
|
|
|
+ info.sort(function(a, b) {
|
|
|
+ return b.qty - a.qty
|
|
|
+ });
|
|
|
+ /*
|
|
|
+ TOTALES
|
|
|
+ */
|
|
|
+ var total = _.reduce(_.map(info,function(item) {
|
|
|
+ return item.amount;
|
|
|
+ }),function(memo, num) {
|
|
|
+ return memo + num;
|
|
|
+ },0);
|
|
|
+ var qty = _.reduce(_.map(info,function(item) {
|
|
|
+ return item.qty;
|
|
|
+ }),function(memo, num) {
|
|
|
+ return memo + num;
|
|
|
+ },0);
|
|
|
+
|
|
|
+ info.push({
|
|
|
+ name: '**Totales',
|
|
|
+ qty: qty,
|
|
|
+ total: accounting.formatMoney(total, '', CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator),
|
|
|
+ amount: total,
|
|
|
+ });
|
|
|
+
|
|
|
+ var utc_start;
|
|
|
+ var utc_stop = ' ';
|
|
|
+ utc_start = moment.utc(item.start_at,'YYYY-MM-DD h:mm:ss A');
|
|
|
+ utc_start = moment(utc_start._d).format('DD/MM/YYYY HH:mm:ss');
|
|
|
+ if(item.stop_at){
|
|
|
+ utc_stop = moment.utc(item.stop_at,'YYYY-MM-DD h:mm:ss A');
|
|
|
+ utc_stop = moment(utc_stop._d).format('DD/MM/YYYY HH:mm:ss');
|
|
|
+ };
|
|
|
data.push({
|
|
|
id: item.id,
|
|
|
config_id: item.config_id[1],
|