Subversion Repositories SmartDukaan

Rev

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

Rev 11780 Rev 11781
Line 1516... Line 1516...
1516
            <th>Product Name</th>
1516
            <th>Product Name</th>
1517
            <th>Old Price</th>
1517
            <th>Old Price</th>
1518
            <th>New Price</th>
1518
            <th>New Price</th>
1519
            <th>Old Margin</th>
1519
            <th>Old Margin</th>
1520
            <th>New Margin</th>
1520
            <th>New Margin</th>
-
 
1521
            <th>Commission %</th>
-
 
1522
            <th>Return Provision %</th>
1521
            <th>Snapdeal Inventory</th>
1523
            <th>Snapdeal Inventory</th>
1522
            <th>Sales History</th>
1524
            <th>Sales History</th>
1523
            </tr></thead>
1525
            </tr></thead>
1524
            <tbody>"""
1526
            <tbody>"""
1525
    for item in successfulAutoDecrease:
1527
    for item in successfulAutoDecrease:
Line 1534... Line 1536...
1534
                <td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
1536
                <td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
1535
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1537
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1536
                <td style="text-align:center">"""+str(math.ceil(item.proposedSellingPrice))+"""</td>
1538
                <td style="text-align:center">"""+str(math.ceil(item.proposedSellingPrice))+"""</td>
1537
                <td style="text-align:center">"""+str(round(item.margin))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
1539
                <td style="text-align:center">"""+str(round(item.margin))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
1538
                <td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/item.proposedSellingPrice)*100,1))+"%)"+"""</td>
1540
                <td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/item.proposedSellingPrice)*100,1))+"%)"+"""</td>
-
 
1541
                <td style="text-align:center">"""+str(mpItem.commission)+"""</td>
-
 
1542
                <td style="text-align:center">"""+str(mpItem.returnProvision)+" %"+"""</td>
1539
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1543
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1540
                <td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
1544
                <td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
1541
                </tr>"""
1545
                </tr>"""
1542
    message+="""</tbody></table><h3>Auto Increase Items</h3><table border="1" style="width:100%;">
1546
    message+="""</tbody></table><h3>Auto Increase Items</h3><table border="1" style="width:100%;">
1543
            <thead>
1547
            <thead>
Line 1545... Line 1549...
1545
            <th>Product Name</th>
1549
            <th>Product Name</th>
1546
            <th>Old Price</th>
1550
            <th>Old Price</th>
1547
            <th>New Price</th>
1551
            <th>New Price</th>
1548
            <th>Old Margin</th>
1552
            <th>Old Margin</th>
1549
            <th>New Margin</th>
1553
            <th>New Margin</th>
-
 
1554
            <th>Commission %</th>
-
 
1555
            <th>Return Provision %</th>
1550
            <th>Snapdeal Inventory</th>
1556
            <th>Snapdeal Inventory</th>
1551
            <th>Sales History</th>
1557
            <th>Sales History</th>
1552
            </tr></thead>
1558
            </tr></thead>
1553
            <tbody>"""
1559
            <tbody>"""
1554
    for item in successfulAutoIncrease:
1560
    for item in successfulAutoIncrease:
Line 1563... Line 1569...
1563
                <td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
1569
                <td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
1564
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1570
                <td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
1565
                <td style="text-align:center">"""+str(math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))+"""</td>
1571
                <td style="text-align:center">"""+str(math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))+"""</td>
1566
                <td style="text-align:center">"""+str(round((item.margin),1))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
1572
                <td style="text-align:center">"""+str(round((item.margin),1))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
1567
                <td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))*100,1))+"%)"+"""</td>
1573
                <td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))*100,1))+"%)"+"""</td>
-
 
1574
                <td style="text-align:center">"""+str(mpItem.commission)+"""</td>
-
 
1575
                <td style="text-align:center">"""+str(mpItem.returnProvision)+" %"+"""</td>
1568
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1576
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1569
                <td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
1577
                <td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
1570
                </tr>"""
1578
                </tr>"""
1571
    message+="""</tbody></table></body></html>"""
1579
    message+="""</tbody></table></body></html>"""
1572
    print message
1580
    print message
Line 1734... Line 1742...
1734
            <th>Current Margin</th>
1742
            <th>Current Margin</th>
1735
            <th>Competition TP</th>
1743
            <th>Competition TP</th>
1736
            <th>Lowest Possible TP</th>
1744
            <th>Lowest Possible TP</th>
1737
            <th>NLC</th>
1745
            <th>NLC</th>
1738
            <th>Target NLC</th>
1746
            <th>Target NLC</th>
-
 
1747
            <th>Commission %</th>
-
 
1748
            <th>Return Provision %</th>
1739
            <th>Snapdeal Inventory</th>
1749
            <th>Snapdeal Inventory</th>
1740
            <th>Total Inventory</th>
1750
            <th>Total Inventory</th>
1741
            <th>Sales History</th>
1751
            <th>Sales History</th>
1742
            </tr></thead>
1752
            </tr></thead>
1743
            <tbody>"""
1753
            <tbody>"""
1744
    items = session.query(MarketPlaceHistory).filter(MarketPlaceHistory.timestamp==currentTimestamp).filter(MarketPlaceHistory.source==OrderSource.SNAPDEAL).filter(MarketPlaceHistory.item_id.in_(lost_buy_box)).all()
1754
    items = session.query(MarketPlaceHistory).filter(MarketPlaceHistory.timestamp==currentTimestamp).filter(MarketPlaceHistory.source==OrderSource.SNAPDEAL).filter(MarketPlaceHistory.item_id.in_(lost_buy_box)).all()
1745
    for item in items:
1755
    for item in items:
1746
        it = Item.query.filter_by(id=item.item_id).one()
1756
        it = Item.query.filter_by(id=item.item_id).one()
-
 
1757
        mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.SNAPDEAL)
1747
        netInventory=''
1758
        netInventory=''
1748
        if not inventoryMap.has_key(item.item_id):
1759
        if not inventoryMap.has_key(item.item_id):
1749
            netInventory='Info Not Available'
1760
            netInventory='Info Not Available'
1750
        else:
1761
        else:
1751
            netInventory = str(getNetAvailability(inventoryMap.get(item.item_id)))
1762
            netInventory = str(getNetAvailability(inventoryMap.get(item.item_id)))
Line 1757... Line 1768...
1757
                <td style="text-align:center">"""+str(round(item.margin))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
1768
                <td style="text-align:center">"""+str(round(item.margin))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
1758
                <td style="text-align:center">"""+str(item.lowestTp)+"""</td>
1769
                <td style="text-align:center">"""+str(item.lowestTp)+"""</td>
1759
                <td style="text-align:center">"""+str(item.lowestPossibleTp)+"""</td>
1770
                <td style="text-align:center">"""+str(item.lowestPossibleTp)+"""</td>
1760
                <td style="text-align:center">"""+str(item.ourNlc)+"""</td>
1771
                <td style="text-align:center">"""+str(item.ourNlc)+"""</td>
1761
                <td style="text-align:center">"""+str(item.targetNlc)+"""</td>
1772
                <td style="text-align:center">"""+str(item.targetNlc)+"""</td>
-
 
1773
                <td style="text-align:center">"""+str(mpItem.commission)+"""</td>
-
 
1774
                <td style="text-align:center">"""+str(mpItem.returnProvision)+" %"+"""</td>
1762
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1775
                <td style="text-align:center">"""+str(item.ourInventory)+"""</td>
1763
                <td style="text-align:center">"""+netInventory+"""</td>
1776
                <td style="text-align:center">"""+netInventory+"""</td>
1764
                <td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
1777
                <td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
1765
                </tr>"""
1778
                </tr>"""
1766
    message+="""</tbody></table></body></html>"""
1779
    message+="""</tbody></table></body></html>"""