Blame view

app/partials/analytics/analytics.service.js 1.76 KB
4bb02bb84   Rishav   new integration w...
1
2
3
  (function(){
   'use strict';    
      angular.module('acufuel')
f100849ce   Mr. Hot Foods   analytics updates
4
        .service('analyticsService', ['$q', '$http', 'BASE_URL',analyticsService]);
4bb02bb84   Rishav   new integration w...
5

f100849ce   Mr. Hot Foods   analytics updates
6
        function analyticsService($q, $http, BASE_URL) {        
4bb02bb84   Rishav   new integration w...
7
8
9
          var temp = {};
  
          
f100849ce   Mr. Hot Foods   analytics updates
10
11
12
13
          this.getMFS = function(){
              var deferred = $q.defer();
              $http({
                  method : 'GET',
565570086   Kuldeep Arora   highcharts(MFS,CS...
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
                 // url : BASE_URL.url +'/fuelOrder/export/mfs'
                    url : BASE_URL.url + '/fuelOrder/analytics'
              })
              .then(function (result){
                  deferred.resolve(result.data);
              },function (result){
                console.log(result)
                  deferred.resolve(result.data);
              })
              return deferred.promise;
          }
  
  /*---date filter for chart ---  dates are sending to the api  */
          this.getDRFChart = function(fd,td){
              var deferred = $q.defer();
              $http({
                  method : 'GET',
                  url : BASE_URL.url + '/fuelOrder/filterchart?fromDate='+fd+'&toDate='+td+''
f100849ce   Mr. Hot Foods   analytics updates
32
33
34
35
36
37
38
39
              })
              .then(function (result){
                  deferred.resolve(result.data);
              },function (result){
                console.log(result)
                  deferred.resolve(result.data);
              })
              return deferred.promise;
a9aef0b1c   Anchit Jindal   new changes imple...
40
          }
f100849ce   Mr. Hot Foods   analytics updates
41

a9aef0b1c   Anchit Jindal   new changes imple...
42
          this.getCS = function(){
f100849ce   Mr. Hot Foods   analytics updates
43
44
45
46
47
48
49
50
51
52
53
54
              var deferred = $q.defer();
              $http({
                  method : 'GET',
                  url : BASE_URL.url +'/user/sources'
              })
              .then(function (result){
                  deferred.resolve(result.data);
              },function (result){
                console.log(result)
                  deferred.resolve(result.data);
              })
              return deferred.promise;
a9aef0b1c   Anchit Jindal   new changes imple...
55
          }
f100849ce   Mr. Hot Foods   analytics updates
56

4bb02bb84   Rishav   new integration w...
57
58
59
        }
        
  })();