| Line 136... |
Line 136... |
| 136 |
sheet.write(i, 13, xls_field.get('status'))
|
136 |
sheet.write(i, 13, xls_field.get('status'))
|
| 137 |
sheet.write(i, 14, xls_field.get('cmsId'))
|
137 |
sheet.write(i, 14, xls_field.get('cmsId'))
|
| 138 |
sheet.write(i, 15, xls_field.get('shipsBy'))
|
138 |
sheet.write(i, 15, xls_field.get('shipsBy'))
|
| 139 |
i = i + 1
|
139 |
i = i + 1
|
| 140 |
|
140 |
|
| 141 |
body = "<html><body><table border='1'><tr><th>Category</th><th>NEXT DAY - Skus</th><th>NO NEXT DAY - Skus</th><th>NOT AVAILABLE - Skus</th><th>NEXT DAY - Products</th><th>NO NEXT DAY - Products</th><th>NOT AVAILABLE - Products</th></tr>"
|
141 |
body = "<html><body><table border='1'><tr><th>Category</th><th>TOTAL AVAILABLE - Skus</th><th>NEXT DAY - Skus</th><th>NOT AVAILABLE - Skus</th><th>TOTAL AVAILABLE - Products</th><th>NEXT DAY - Products</th><th>NOT AVAILABLE - Products</th></tr>"
|
| 142 |
for catName in statsMap.keys():
|
142 |
for catName in statsMap.keys():
|
| 143 |
innerMap = statsMap.get(catName)
|
143 |
innerMap = statsMap.get(catName)
|
| 144 |
body = body + "<tr><td>" + catName + "</td><td>" + str(len(innerMap.get('NEXT DAY'))) + "</td><td>" + str(len(innerMap.get('NO NEXT DAY'))) + "</td><td>" + str(len(innerMap.get('NOT AVAILABLE'))) + "</td><td>" + str(len(set(innerMap.get('NEXT DAY')))) + "</td><td>" + str(len(set(innerMap.get('NO NEXT DAY')))) + "</td><td>" + str(len(set(innerMap.get('NOT AVAILABLE')))) + "</td></tr>"
|
144 |
body = body + "<tr><td>" + catName + "</td><td>" + str(len(innerMap.get('NEXT DAY')+innerMap.get('NO NEXT DAY'))) + "</td><td>" + str(len(innerMap.get('NEXT DAY'))) + "</td><td>" + str(len(innerMap.get('NOT AVAILABLE'))) + "</td><td>" + str(len(set(innerMap.get('NEXT DAY')+innerMap.get('NO NEXT DAY')))) + "</td><td>" + str(len(set(innerMap.get('NEXT DAY')))) + "</td><td>" + str(len(set(innerMap.get('NOT AVAILABLE')))) + "</td></tr>"
|
| 145 |
body = body + "</table></body></html>"
|
145 |
body = body + "</table></body></html>"
|
| 146 |
|
146 |
|
| 147 |
timestring = datetime.datetime.now().strftime("%Y-%m-%d")
|
147 |
timestring = datetime.datetime.now().strftime("%Y-%m-%d")
|
| 148 |
filename = "/tmp/stockreport" + timestring + ".xls"
|
148 |
filename = "/tmp/stockreport" + timestring + ".xls"
|
| 149 |
wbk.save(filename)
|
149 |
wbk.save(filename)
|