Subversion Repositories SmartDukaan

Rev

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

Rev 12651 Rev 12652
Line 1454... Line 1454...
1454
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1454
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1455
        try:
1455
        try:
1456
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1456
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1457
        except:
1457
        except:
1458
            daysOfStock = float("inf")
1458
            daysOfStock = float("inf")
-
 
1459
        if str(daysOfStock)=='inf':
1459
        sheet.write(sheet_iterator, 39, daysOfStock)
1460
            sheet.write(sheet_iterator, 39, str(daysOfStock))
-
 
1461
        else:
-
 
1462
            sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
1460
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1463
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1461
        #sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
1464
        #sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
1462
        sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
1465
        sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
1463
        sheet_iterator+=1
1466
        sheet_iterator+=1
1464
    #TODO : Take excell sheet generation code inside a function 
1467
    #TODO : Take excell sheet generation code inside a function 
Line 1519... Line 1522...
1519
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1522
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1520
        try:
1523
        try:
1521
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1524
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1522
        except:
1525
        except:
1523
            daysOfStock = float("inf")
1526
            daysOfStock = float("inf")
-
 
1527
        if str(daysOfStock)=='inf':
1524
        sheet.write(sheet_iterator, 39, daysOfStock)
1528
            sheet.write(sheet_iterator, 39, str(daysOfStock))
-
 
1529
        else:
-
 
1530
            sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
1525
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1531
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1526
        if amScraping.decision is None:
1532
        if amScraping.decision is None:
1527
            sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
1533
            sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
-
 
1534
            sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
-
 
1535
            sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
1528
            sheet_iterator+=1
1536
            sheet_iterator+=1
1529
            continue
1537
            continue
1530
        sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
1538
        sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
1531
        sheet.write(sheet_iterator, 42, amScraping.reason)
1539
        sheet.write(sheet_iterator, 42, amScraping.reason)
1532
        if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
1540
        if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
Line 1594... Line 1602...
1594
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1602
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1595
        try:
1603
        try:
1596
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1604
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1597
        except:
1605
        except:
1598
            daysOfStock = float("inf")
1606
            daysOfStock = float("inf")
-
 
1607
        if str(daysOfStock)=='inf':
1599
        sheet.write(sheet_iterator, 39, daysOfStock)
1608
            sheet.write(sheet_iterator, 39, str(daysOfStock))
-
 
1609
        else:
-
 
1610
            sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
1600
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1611
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1601
        if amScraping.decision is None:
1612
        if amScraping.decision is None:
1602
            sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
1613
            sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
-
 
1614
            sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
-
 
1615
            sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
1603
            sheet_iterator+=1
1616
            sheet_iterator+=1
1604
            continue
1617
            continue
1605
        sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
1618
        sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
1606
        sheet.write(sheet_iterator, 42, amScraping.reason)
1619
        sheet.write(sheet_iterator, 42, amScraping.reason)
1607
        if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
1620
        if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
Line 1669... Line 1682...
1669
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1682
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1670
        try:
1683
        try:
1671
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1684
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1672
        except:
1685
        except:
1673
            daysOfStock = float("inf")
1686
            daysOfStock = float("inf")
-
 
1687
        if str(daysOfStock)=='inf':
1674
        sheet.write(sheet_iterator, 39, daysOfStock)
1688
            sheet.write(sheet_iterator, 39, str(daysOfStock))
-
 
1689
        else:
-
 
1690
            sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
1675
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1691
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1676
        if amScraping.decision is None:
1692
        if amScraping.decision is None:
1677
            sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
1693
            sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
-
 
1694
            sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
-
 
1695
            sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
1678
            sheet_iterator+=1
1696
            sheet_iterator+=1
1679
            continue
1697
            continue
1680
        sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
1698
        sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
1681
        sheet.write(sheet_iterator, 42, amScraping.reason)
1699
        sheet.write(sheet_iterator, 42, amScraping.reason)
1682
        if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
1700
        if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
Line 1790... Line 1808...
1790
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1808
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1791
        try:
1809
        try:
1792
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1810
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1793
        except:
1811
        except:
1794
            daysOfStock = float("inf")
1812
            daysOfStock = float("inf")
-
 
1813
        if str(daysOfStock)=='inf':
1795
        sheet.write(sheet_iterator, 39, daysOfStock)
1814
            sheet.write(sheet_iterator, 39, str(daysOfStock))
-
 
1815
        else:
-
 
1816
            sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
1796
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1817
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1797
        if amScraping.decision is None:
1818
        if amScraping.decision is None:
1798
            sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
1819
            sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
-
 
1820
            sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
-
 
1821
            sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
1799
            sheet_iterator+=1
1822
            sheet_iterator+=1
1800
            continue
1823
            continue
1801
        sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
1824
        sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
1802
        sheet.write(sheet_iterator, 42, amScraping.reason)
1825
        sheet.write(sheet_iterator, 42, amScraping.reason)
1803
        if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
1826
        if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
Line 1907... Line 1930...
1907
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1930
        sheet.write(sheet_iterator, 38, amScraping.avgSale)
1908
        try:
1931
        try:
1909
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1932
            daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
1910
        except:
1933
        except:
1911
            daysOfStock = float("inf")
1934
            daysOfStock = float("inf")
-
 
1935
        if str(daysOfStock)=='inf':
1912
        sheet.write(sheet_iterator, 39, daysOfStock)
1936
            sheet.write(sheet_iterator, 39, str(daysOfStock))
-
 
1937
        else:
-
 
1938
            sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
1913
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1939
        sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
1914
        sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
1940
        sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
1915
        sheet_iterator+=1
1941
        sheet_iterator+=1
1916
    
1942
    
1917
    sheet = wbk.add_sheet('Exception List')
1943
    sheet = wbk.add_sheet('Exception List')