Subversion Repositories SmartDukaan

Rev

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

Rev 4823 Rev 4824
Line 84... Line 84...
84
        Calendar date = new GregorianCalendar();
84
        Calendar date = new GregorianCalendar();
85
        int year = date.get(Calendar.YEAR);
85
        int year = date.get(Calendar.YEAR);
86
        int month = date.get(Calendar.MONTH) +1;
86
        int month = date.get(Calendar.MONTH) +1;
87
        int day = date.get(Calendar.DAY_OF_MONTH);
87
        int day = date.get(Calendar.DAY_OF_MONTH);
88
        long currentTimestamp = date.getTimeInMillis();
88
        long currentTimestamp = date.getTimeInMillis();
89
        long lastTimestamp = Long.parseLong(org.apache.commons.io.FileUtils.readFileToString(new File(REPORT_DIR + File.separator + "last.timestamp")));
89
        String lastTimestampString = org.apache.commons.io.FileUtils.readFileToString(new File(REPORT_DIR + File.separator + "last.timestamp"));
-
 
90
        lastTimestampString = lastTimestampString.replace("\"", "").replace("\n", "");
-
 
91
        long lastTimestamp = Long.parseLong(lastTimestampString);
90
        
92
        
91
        String filename = "inventory-report." + year + "-" + month + "-" + day + "-" + lastTimestamp + ".xls";
93
        String filename = "inventory-report." + year + "-" + month + "-" + day + "-" + lastTimestamp + ".xls";
92
        if(lastTimestamp-currentTimestamp > REPORT_GENERATION_INTERVAL*60*60*1000){
94
        if(lastTimestamp-currentTimestamp > REPORT_GENERATION_INTERVAL*60*60*1000){
93
        	filename = "inventory-report." + year + "-" + month + "-" + day + "-" + currentTimestamp + ".xls";
95
        	filename = "inventory-report." + year + "-" + month + "-" + day + "-" + currentTimestamp + ".xls";
94
        	File inventoryReportFile = new File(REPORT_DIR + File.separator + filename);
96
        	File inventoryReportFile = new File(REPORT_DIR + File.separator + filename);