Subversion Repositories SmartDukaan

Rev

Rev 17454 | Rev 18463 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17454 Rev 18156
Line 27... Line 27...
27
import time
27
import time
28
import xlwt
28
import xlwt
29
from dtr.utils import utils
29
from dtr.utils import utils
30
from dtr.utils.utils import toTimeStamp
30
from dtr.utils.utils import toTimeStamp
31
from dtr.reports import getdata
31
from dtr.reports import getdata
-
 
32
from scripts.ActivityReport import cutOff, cutOffMonth
32
#from xlwt import 
33
#from xlwt import 
33
 
34
 
34
DataService.initialize()
35
DataService.initialize()
35
client = MongoClient('mongodb://localhost:27017/')
36
client = MongoClient('mongodb://localhost:27017/')
36
 
37
 
Line 56... Line 57...
56
datetime_format.num_format_str = 'dd/mm/yyyy HH:MM AM/PM'
57
datetime_format.num_format_str = 'dd/mm/yyyy HH:MM AM/PM'
57
categoryMap = {3:"Mobiles", 5:"Tablets"}
58
categoryMap = {3:"Mobiles", 5:"Tablets"}
58
 
59
 
59
curDate = date.today()
60
curDate = date.today()
60
cutOffMonth = (datetime.now().month + 11)%12
61
cutOffMonth = (datetime.now().month + 11)%12
-
 
62
cutOffMonth = 12 if cutOffMonth == 0 else cutOffMonth
61
cutOffYear = curDate.year - (0 if curDate.month-1 > 0 else 1)
63
cutOffYear = curDate.year - (0 if curDate.month-1 > 0 else 1)
62
cutOff = datetime(cutOffYear, cutOffMonth, 1)
64
cutOff = datetime(cutOffYear, cutOffMonth, 1)
63
 
65
 
64
 
66
 
65
def generateFlipkartReco():
67
def generateFlipkartReco():