Subversion Repositories SmartDukaan

Rev

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

Rev 11116 Rev 11167
Line 1487... Line 1487...
1487
            <th>Old Price</th>
1487
            <th>Old Price</th>
1488
            <th>New Price</th>
1488
            <th>New Price</th>
1489
            <th>Old Margin</th>
1489
            <th>Old Margin</th>
1490
            <th>New Margin</th>
1490
            <th>New Margin</th>
1491
            <th>Snapdeal Inventory</th>
1491
            <th>Snapdeal Inventory</th>
-
 
1492
            <th>Sales History</th>
1492
            </tr></thead>
1493
            </tr></thead>
1493
            <tbody>"""
1494
            <tbody>"""
1494
    for item in successfulAutoDecrease:
1495
    for item in successfulAutoDecrease:
1495
        it = Item.query.filter_by(id=item.item_id).one()
1496
        it = Item.query.filter_by(id=item.item_id).one()
1496
        mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.SNAPDEAL)
1497
        mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.SNAPDEAL)
Line 1504... Line 1505...
1504
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1505
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1505
                <td style="text-align:center">"""+str(math.ceil(item.proposedSellingPrice))+"""</td>
1506
                <td style="text-align:center">"""+str(math.ceil(item.proposedSellingPrice))+"""</td>
1506
                <td style="text-align:center">"""+str(round(item.margin))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
1507
                <td style="text-align:center">"""+str(round(item.margin))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
1507
                <td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/item.proposedSellingPrice)*100,1))+"%)"+"""</td>
1508
                <td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/item.proposedSellingPrice)*100,1))+"%)"+"""</td>
1508
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1509
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
-
 
1510
                <td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
1509
                </tr>"""
1511
                </tr>"""
1510
    message+="""</tbody></table><h3>Auto Increase Items</h3><table border="1" style="width:100%;">
1512
    message+="""</tbody></table><h3>Auto Increase Items</h3><table border="1" style="width:100%;">
1511
            <thead>
1513
            <thead>
1512
            <tr><th>Item Id</th>
1514
            <tr><th>Item Id</th>
1513
            <th>Product Name</th>
1515
            <th>Product Name</th>
1514
            <th>Old Price</th>
1516
            <th>Old Price</th>
1515
            <th>New Price</th>
1517
            <th>New Price</th>
1516
            <th>Old Margin</th>
1518
            <th>Old Margin</th>
1517
            <th>New Margin</th>
1519
            <th>New Margin</th>
1518
            <th>Snapdeal Inventory</th>
1520
            <th>Snapdeal Inventory</th>
-
 
1521
            <th>Sales History</th>
1519
            </tr></thead>
1522
            </tr></thead>
1520
            <tbody>"""
1523
            <tbody>"""
1521
    for item in successfulAutoIncrease:
1524
    for item in successfulAutoIncrease:
1522
        it = Item.query.filter_by(id=item.item_id).one()
1525
        it = Item.query.filter_by(id=item.item_id).one()
1523
        mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.SNAPDEAL)
1526
        mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.SNAPDEAL)
Line 1531... Line 1534...
1531
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1534
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1532
                <td style="text-align:center">"""+str(math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))+"""</td>
1535
                <td style="text-align:center">"""+str(math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))+"""</td>
1533
                <td style="text-align:center">"""+str(round((item.margin),1))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
1536
                <td style="text-align:center">"""+str(round((item.margin),1))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
1534
                <td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))*100,1))+"%)"+"""</td>
1537
                <td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))*100,1))+"%)"+"""</td>
1535
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1538
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
-
 
1539
                <td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
1536
                </tr>"""
1540
                </tr>"""
1537
    message+="""</tbody></table></body></html>"""
1541
    message+="""</tbody></table></body></html>"""
1538
    print message
1542
    print message
1539
    mailServer = smtplib.SMTP("smtp.gmail.com", 587)
1543
    mailServer = smtplib.SMTP("smtp.gmail.com", 587)
1540
    mailServer.ehlo()
1544
    mailServer.ehlo()