| 1 |
nino.borges |
515 |
"""
|
| 2 |
|
|
|
| 3 |
|
|
MCP_Reporting
|
| 4 |
|
|
|
| 5 |
|
|
Created by
|
| 6 |
|
|
Emanuel Borges
|
| 7 |
|
|
01.20.2014
|
| 8 |
|
|
|
| 9 |
|
|
This class will hold all of the reporting that you can do with the MCP.
|
| 10 |
|
|
|
| 11 |
|
|
"""
|
| 12 |
|
|
|
| 13 |
|
|
import os
|
| 14 |
|
|
|
| 15 |
|
|
class Reports():
|
| 16 |
|
|
"""Main Reporting Class"""
|
| 17 |
|
|
def __init__(self,dbObj):
|
| 18 |
|
|
self.dbObj = dbObj
|
| 19 |
|
|
self.tempDir = os.getenv('TEMP')
|
| 20 |
|
|
self.reportFileName = "MCP_Report.csv"
|
| 21 |
|
|
self.tpmMatrix = self.dbObj(RetrieveAllTPMMatrix)
|
| 22 |
|
|
def CreateTpmActiveCaseReport(self, TPM):
|
| 23 |
|
|
"""Returns a report that shows all active cases for a TPM"""
|
| 24 |
|
|
empID = self.tpmMatrix(TPM)[0]
|
| 25 |
|
|
activeCases = self.dbObj.RetrieveMyActiveCaseList(empID)
|
| 26 |
|
|
outputFile = open(os.path.join(self.tempDir,self.tpmMatrix),'w')
|
| 27 |
|
|
|
| 28 |
|
|
outputFile.close()
|
| 29 |
|
|
return activeCases
|
| 30 |
|
|
def CreateTpmAllCaseReport(self,TPM):
|
| 31 |
|
|
"""Returns a report that shows all cases for a TPM"""
|
| 32 |
|
|
empID = self.tpmMatrix(TPM)[0]
|
| 33 |
|
|
allTPMCases = self.dbObj.RetrieveMyCaseList(empID)
|
| 34 |
|
|
outputFile = open(os.path.join(self.tempDir,self.tpmMatrix),'w')
|
| 35 |
|
|
|
| 36 |
|
|
outputFile.close()
|
| 37 |
|
|
return allTPMCases
|
| 38 |
|
|
|
| 39 |
|
|
|