| Line 2193... |
Line 2193... |
| 2193 |
<th>New Margin</th>
|
2193 |
<th>New Margin</th>
|
| 2194 |
<th>Commission %</th>
|
2194 |
<th>Commission %</th>
|
| 2195 |
<th>Return Provision %</th>
|
2195 |
<th>Return Provision %</th>
|
| 2196 |
<th>Flipkart Inventory</th>
|
2196 |
<th>Flipkart Inventory</th>
|
| 2197 |
<th>Sales History</th>
|
2197 |
<th>Sales History</th>
|
| - |
|
2198 |
<th>Category</th>
|
| 2198 |
</tr></thead>
|
2199 |
</tr></thead>
|
| 2199 |
<tbody>"""
|
2200 |
<tbody>"""
|
| 2200 |
for item in successfulAutoDecrease:
|
2201 |
for item in successfulAutoDecrease:
|
| 2201 |
it = Item.query.filter_by(id=item.item_id).one()
|
2202 |
it = Item.query.filter_by(id=item.item_id).one()
|
| 2202 |
mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.FLIPKART)
|
2203 |
mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.FLIPKART)
|
| Line 2213... |
Line 2214... |
| 2213 |
<td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/item.proposedSellingPrice)*100,1))+"%)"+"""</td>
|
2214 |
<td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/item.proposedSellingPrice)*100,1))+"%)"+"""</td>
|
| 2214 |
<td style="text-align:center">"""+str(mpItem.commission)+" %"+"""</td>
|
2215 |
<td style="text-align:center">"""+str(mpItem.commission)+" %"+"""</td>
|
| 2215 |
<td style="text-align:center">"""+str(mpItem.returnProvision)+" %"+"""</td>
|
2216 |
<td style="text-align:center">"""+str(mpItem.returnProvision)+" %"+"""</td>
|
| 2216 |
<td style="text-align:center">"""+str(item.ourInventory)+"""</td>
|
2217 |
<td style="text-align:center">"""+str(item.ourInventory)+"""</td>
|
| 2217 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
|
2218 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
|
| - |
|
2219 |
<td style="text-align:center">"""+str(CompetitionCategory._VALUES_TO_NAMES.get(item.competitiveCategory))+"""</td>
|
| 2218 |
</tr>"""
|
2220 |
</tr>"""
|
| 2219 |
message+="""</tbody></table><h3>Auto Increase Items</h3><table border="1" style="width:100%;">
|
2221 |
message+="""</tbody></table><h3>Auto Increase Items</h3><table border="1" style="width:100%;">
|
| 2220 |
<thead>
|
2222 |
<thead>
|
| 2221 |
<tr><th>Item Id</th>
|
2223 |
<tr><th>Item Id</th>
|
| 2222 |
<th>Product Name</th>
|
2224 |
<th>Product Name</th>
|
| Line 2226... |
Line 2228... |
| 2226 |
<th>New Margin</th>
|
2228 |
<th>New Margin</th>
|
| 2227 |
<th>Commission %</th>
|
2229 |
<th>Commission %</th>
|
| 2228 |
<th>Return Provision %</th>
|
2230 |
<th>Return Provision %</th>
|
| 2229 |
<th>Flipkart Inventory</th>
|
2231 |
<th>Flipkart Inventory</th>
|
| 2230 |
<th>Sales History</th>
|
2232 |
<th>Sales History</th>
|
| - |
|
2233 |
<th>Category</th>
|
| 2231 |
</tr></thead>
|
2234 |
</tr></thead>
|
| 2232 |
<tbody>"""
|
2235 |
<tbody>"""
|
| 2233 |
for item in successfulAutoIncrease:
|
2236 |
for item in successfulAutoIncrease:
|
| 2234 |
it = Item.query.filter_by(id=item.item_id).one()
|
2237 |
it = Item.query.filter_by(id=item.item_id).one()
|
| 2235 |
mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.FLIPKART)
|
2238 |
mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.FLIPKART)
|
| Line 2246... |
Line 2249... |
| 2246 |
<td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))*100,1))+"%)"+"""</td>
|
2249 |
<td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))*100,1))+"%)"+"""</td>
|
| 2247 |
<td style="text-align:center">"""+str(mpItem.commission)+" %"+"""</td>
|
2250 |
<td style="text-align:center">"""+str(mpItem.commission)+" %"+"""</td>
|
| 2248 |
<td style="text-align:center">"""+str(mpItem.returnProvision)+" %"+"""</td>
|
2251 |
<td style="text-align:center">"""+str(mpItem.returnProvision)+" %"+"""</td>
|
| 2249 |
<td style="text-align:center">"""+str(item.ourInventory)+"""</td>
|
2252 |
<td style="text-align:center">"""+str(item.ourInventory)+"""</td>
|
| 2250 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
|
2253 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
|
| - |
|
2254 |
<td style="text-align:center">"""+str(CompetitionCategory._VALUES_TO_NAMES.get(item.competitiveCategory))+"""</td>
|
| 2251 |
</tr>"""
|
2255 |
</tr>"""
|
| 2252 |
message+="""</tbody></table></body></html>"""
|
2256 |
message+="""</tbody></table></body></html>"""
|
| 2253 |
print message
|
2257 |
print message
|
| 2254 |
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
|
2258 |
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
|
| 2255 |
mailServer.ehlo()
|
2259 |
mailServer.ehlo()
|