Subversion Repositories SmartDukaan

Rev

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

Rev 11775 Rev 11776
Line 1246... Line 1246...
1246
            sheet.write(sheet_iterator, 35, 'Auto Pricing Inactive')
1246
            sheet.write(sheet_iterator, 35, 'Auto Pricing Inactive')
1247
            sheet_iterator+=1
1247
            sheet_iterator+=1
1248
            continue
1248
            continue
1249
        sheet.write(sheet_iterator, 35, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
1249
        sheet.write(sheet_iterator, 35, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
1250
        sheet.write(sheet_iterator, 36, mpHistory.reason)
1250
        sheet.write(sheet_iterator, 36, mpHistory.reason)
-
 
1251
        if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_DECREMENT_SUCCESS":
-
 
1252
            sheet.write(sheet_iterator, 37, math.ceil(mpHistory.proposedSellingPrice))
-
 
1253
        if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_INCREMENT_SUCCESS":
1251
        sheet.write(sheet_iterator, 37, math.ceil(mpHistory.ourSellingPrice+max(10,.01*mpHistory.ourSellingPrice)))
1254
            sheet.write(sheet_iterator, 37, math.ceil(mpHistory.ourSellingPrice+max(10,.01*mpHistory.ourSellingPrice)))
-
 
1255
        
1252
        sheet_iterator+=1
1256
        sheet_iterator+=1
1253
    
1257
    
1254
    buyBoxItems[:] = []
1258
    buyBoxItems[:] = []
1255
    
1259
    
1256
    sheet = wbk.add_sheet('Pref Not Cheap')
1260
    sheet = wbk.add_sheet('Pref Not Cheap')
Line 1371... Line 1375...
1371
            sheet.write(sheet_iterator, 34, 'Auto Pricing Inactive')
1375
            sheet.write(sheet_iterator, 34, 'Auto Pricing Inactive')
1372
            sheet_iterator+=1
1376
            sheet_iterator+=1
1373
            continue
1377
            continue
1374
        sheet.write(sheet_iterator, 34, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
1378
        sheet.write(sheet_iterator, 34, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
1375
        sheet.write(sheet_iterator, 35, mpHistory.reason)
1379
        sheet.write(sheet_iterator, 35, mpHistory.reason)
-
 
1380
        if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_DECREMENT_SUCCESS":
1376
        sheet.write(sheet_iterator, 36, math.ceil(mpHistory.proposedSellingPrice))
1381
            sheet.write(sheet_iterator, 36, math.ceil(mpHistory.proposedSellingPrice))
-
 
1382
        if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_INCREMENT_SUCCESS":
-
 
1383
            sheet.write(sheet_iterator, 36, math.ceil(mpHistory.ourSellingPrice+max(10,.01*mpHistory.ourSellingPrice)))
1377
        
1384
        
1378
        sheet_iterator+=1
1385
        sheet_iterator+=1
1379
        
1386
        
1380
    prefNotCheapItems[:] = []
1387
    prefNotCheapItems[:] = []
1381
    
1388
    
Line 1591... Line 1598...
1591
            sheet.write(sheet_iterator, 36, 'Auto Pricing Inactive')
1598
            sheet.write(sheet_iterator, 36, 'Auto Pricing Inactive')
1592
            sheet_iterator+=1
1599
            sheet_iterator+=1
1593
            continue
1600
            continue
1594
        sheet.write(sheet_iterator, 36, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
1601
        sheet.write(sheet_iterator, 36, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
1595
        sheet.write(sheet_iterator, 37, mpHistory.reason)
1602
        sheet.write(sheet_iterator, 37, mpHistory.reason)
-
 
1603
        if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_DECREMENT_SUCCESS":
1596
        sheet.write(sheet_iterator, 38, math.ceil(mpHistory.proposedSellingPrice))
1604
            sheet.write(sheet_iterator, 38, math.ceil(mpHistory.proposedSellingPrice))
-
 
1605
        if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_INCREMENT_SUCCESS":
-
 
1606
            sheet.write(sheet_iterator, 38, math.ceil(mpHistory.ourSellingPrice+max(10,.01*mpHistory.ourSellingPrice)))
1597
        
1607
        
1598
        sheet_iterator+=1
1608
        sheet_iterator+=1
1599
    
1609
    
1600
    competitiveItems[:]=[]
1610
    competitiveItems[:]=[]
1601
    
1611
    
Line 2506... Line 2516...
2506
            <tbody>"""
2516
            <tbody>"""
2507
    for item in negativeMargins:
2517
    for item in negativeMargins:
2508
        mpHistory = item[0]
2518
        mpHistory = item[0]
2509
        catItem = item[1]
2519
        catItem = item[1]
2510
        netInventory=''
2520
        netInventory=''
2511
        if not inventoryMap.has_key(item):
2521
        if not inventoryMap.has_key(mpHistory.item_id):
2512
            netInventory='Info Not Available'
2522
            netInventory='Info Not Available'
2513
        else:
2523
        else:
2514
            netInventory = str(getNetAvailability(inventoryMap.get(item)))
2524
            netInventory = str(getNetAvailability(inventoryMap.get(mpHistory.item_id)))
2515
        message+="""<tr>
2525
        message+="""<tr>
2516
            <td style="text-align:center">"""+str(mpHistory.item_id)+"""</td>
2526
            <td style="text-align:center">"""+str(mpHistory.item_id)+"""</td>
2517
            <td style="text-align:center">"""+xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color)+"""</td>
2527
            <td style="text-align:center">"""+xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color)+"""</td>
2518
            <td style="text-align:center">"""+str(mpHistory.ourSellingPrice)+"""</td>
2528
            <td style="text-align:center">"""+str(mpHistory.ourSellingPrice)+"""</td>
2519
            <td style="text-align:center">"""+str(mpHistory.ourTp)+"""</td>
2529
            <td style="text-align:center">"""+str(mpHistory.ourTp)+"""</td>
Line 2521... Line 2531...
2521
            <td style="text-align:center">"""+str(mpHistory.lowestPossibleTp)+"""</td>
2531
            <td style="text-align:center">"""+str(mpHistory.lowestPossibleTp)+"""</td>
2522
            <td style="text-align:center">"""+str(mpHistory.margin)+"""</td>
2532
            <td style="text-align:center">"""+str(mpHistory.margin)+"""</td>
2523
            <td style="text-align:center">"""+str(round(mpHistory.margin/mpHistory.ourSellingPrice,2))+"""</td>
2533
            <td style="text-align:center">"""+str(round(mpHistory.margin/mpHistory.ourSellingPrice,2))+"""</td>
2524
            <td style="text-align:center">"""+str(mpHistory.ourInventory)+"""</td>
2534
            <td style="text-align:center">"""+str(mpHistory.ourInventory)+"""</td>
2525
            <td style="text-align:center">"""+netInventory+"""</td>
2535
            <td style="text-align:center">"""+netInventory+"""</td>
2526
            <td style="text-align:center">"""+getOosString((itemSaleMap.get(item))[1])+"""</td>
2536
            <td style="text-align:center">"""+getOosString((itemSaleMap.get(mpHistory.item_id))[1])+"""</td>
2527
            </tr>"""
2537
            </tr>"""
2528
    message+="""</tbody></table></body></html>"""
2538
    message+="""</tbody></table></body></html>"""
2529
    print message
2539
    print message
2530
    mailServer = smtplib.SMTP("smtp.gmail.com", 587)
2540
    mailServer = smtplib.SMTP("smtp.gmail.com", 587)
2531
    mailServer.ehlo()
2541
    mailServer.ehlo()