Subversion Repositories SmartDukaan

Rev

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

Rev 12712 Rev 12715
Line 2117... Line 2117...
2117
def sendAutoPricingMail(successfulAutoDecrease,successfulAutoIncrease):
2117
def sendAutoPricingMail(successfulAutoDecrease,successfulAutoIncrease):
2118
    if len(successfulAutoDecrease)==0 and len(successfulAutoIncrease)==0 :
2118
    if len(successfulAutoDecrease)==0 and len(successfulAutoIncrease)==0 :
2119
        return
2119
        return
2120
    xstr = lambda s: s or ""
2120
    xstr = lambda s: s or ""
2121
    message="""<html>
2121
    message="""<html>
2122
            <h3 style="color:red;">Test Run.Please validate with costing sheet before taking any decision</h3>
-
 
2123
            <body>
2122
            <body>
2124
            <h3>Auto Decrease Items</h3>
2123
            <h3>Auto Decrease Items</h3>
2125
            <table border="1" style="width:100%;">
2124
            <table border="1" style="width:100%;">
2126
            <thead>
2125
            <thead>
2127
            <tr><th>Item Id</th>
2126
            <tr><th>Item Id</th>
Line 2499... Line 2498...
2499
            if item.isPromotion:
2498
            if item.isPromotion:
2500
                amItem.fbbPromoPrice = math.ceil(item.proposedSp)
2499
                amItem.fbbPromoPrice = math.ceil(item.proposedSp)
2501
            else:
2500
            else:
2502
                amItem.fbbPrice = math.ceil(item.proposedSp)
2501
                amItem.fbbPrice = math.ceil(item.proposedSp)
2503
            amItem.fbaPriceLastUpdatedOn = datetime.now()
2502
            amItem.fbaPriceLastUpdatedOn = datetime.now()
-
 
2503
    session.commit()
2504
    for item in successfulAutoIncrease:
2504
    for item in successfulAutoIncrease:
2505
        amItem = Amazonlisted.get_by(itemId=item.item_id)
2505
        amItem = Amazonlisted.get_by(itemId=item.item_id)
2506
        if item.warehouseLocation==1:
2506
        if item.warehouseLocation==1:
2507
            if item.isPromotion:
2507
            if item.isPromotion:
2508
                amItem.fbaPromoPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
2508
                amItem.fbaPromoPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
Line 2513... Line 2513...
2513
            if item.isPromotion:
2513
            if item.isPromotion:
2514
                amItem.fbbPromoPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
2514
                amItem.fbbPromoPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
2515
            else:
2515
            else:
2516
                amItem.fbbPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
2516
                amItem.fbbPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
2517
            amItem.fbbPriceLastUpdatedOn = datetime.now()
2517
            amItem.fbbPriceLastUpdatedOn = datetime.now()
-
 
2518
    session.commit()
-
 
2519
    
2518
 
2520
 
2519
def main():
2521
def main():
2520
    parser = optparse.OptionParser()
2522
    parser = optparse.OptionParser()
2521
    parser.add_option("-t", "--type", dest="runType",
2523
    parser.add_option("-t", "--type", dest="runType",
2522
                   default="FULL", type="string",
2524
                   default="FULL", type="string",