Subversion Repositories SmartDukaan

Rev

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

Rev 12248 Rev 12280
Line 116... Line 116...
116
 
116
 
117
PAGE_HEIGHT=defaultPageSize[1]
117
PAGE_HEIGHT=defaultPageSize[1]
118
PAGE_WIDTH=defaultPageSize[0]
118
PAGE_WIDTH=defaultPageSize[0]
119
 
119
 
120
billedOrdersColorMap = {}
120
billedOrdersColorMap = {}
-
 
121
stateIdMap = {}
121
 
122
 
122
ORDER_STATUS_TO_USER_TRUST_LEVEL_DELTA_DICT = {
123
ORDER_STATUS_TO_USER_TRUST_LEVEL_DELTA_DICT = {
123
        OrderStatus.RTO_RESHIPPED    :  3,
124
        OrderStatus.RTO_RESHIPPED    :  3,
124
        OrderStatus.RTO_IN_TRANSIT   : -5,
125
        OrderStatus.RTO_IN_TRANSIT   : -5,
125
        OrderStatus.DELIVERY_SUCCESS :  1,
126
        OrderStatus.DELIVERY_SUCCESS :  1,
126
        OrderStatus.DOA_CERT_INVALID : -5
127
        OrderStatus.DOA_CERT_INVALID : -5
127
}
128
}
128
 
129
 
-
 
130
try:
-
 
131
    glob_inventory_client = InventoryClient().get_client()
-
 
132
    stateIdMap = glob_inventory_client.getStateMaster()
-
 
133
except:
-
 
134
    print "Could not fetch"
-
 
135
 
129
delhi_pincodes = ['110001','110002','110003','110004','110005','110006','110007','110008','110009','110010','110011','110012','110013','110014','110015',\
136
delhi_pincodes = ['110001','110002','110003','110004','110005','110006','110007','110008','110009','110010','110011','110012','110013','110014','110015',\
130
                '110016','110017','110018','110019','110020','110021','110022','110023','110024','110025','110026','110027','110028','110029','110030',\
137
                '110016','110017','110018','110019','110020','110021','110022','110023','110024','110025','110026','110027','110028','110029','110030',\
131
                '110031','110032','110033','110034','110035','110037','110038','110041','110042','110044','110045','110046','110047','110048','110049',\
138
                '110031','110032','110033','110034','110035','110037','110038','110041','110042','110044','110045','110046','110047','110048','110049',\
132
                '110051','110052','110053','110054','110055','110056','110057','110058','110059','110060','110061','110062','110063','110064','110065',\
139
                '110051','110052','110053','110054','110055','110056','110057','110058','110059','110060','110061','110062','110063','110064','110065',\
133
                '110066','110067','110068','110070','110071','110074','110075','110076','110078','110081','110082','110083','110084','110085','110086',\
140
                '110066','110067','110068','110070','110071','110074','110075','110076','110078','110081','110082','110083','110084','110085','110086',\
Line 248... Line 255...
248
                litem.color = line_item.color
255
                litem.color = line_item.color
249
            if line_item.extra_info:
256
            if line_item.extra_info:
250
                litem.extra_info = line_item.extra_info
257
                litem.extra_info = line_item.extra_info
251
            litem.quantity = line_item.quantity
258
            litem.quantity = line_item.quantity
252
            litem.unit_price = line_item.unit_price
259
            litem.unit_price = line_item.unit_price
-
 
260
            if line_item.mrp:
-
 
261
                litem.mrp = line_item.mrp 
253
            litem.unit_weight = line_item.unit_weight
262
            litem.unit_weight = line_item.unit_weight
254
            litem.total_price = line_item.total_price
263
            litem.total_price = line_item.total_price
255
            litem.total_weight = line_item.total_weight
264
            litem.total_weight = line_item.total_weight
256
            try:
265
            try:
257
                litem.transfer_price = line_item.transfer_price
266
                litem.transfer_price = line_item.transfer_price
Line 1509... Line 1518...
1509
            lineitem.transfer_price = item_pricing.transferPrice
1518
            lineitem.transfer_price = item_pricing.transferPrice
1510
            lineitem.nlc = item_pricing.nlc
1519
            lineitem.nlc = item_pricing.nlc
1511
            if order.taxType == TaxType.CFORM:
1520
            if order.taxType == TaxType.CFORM:
1512
                lineitem.vatRate = 2
1521
                lineitem.vatRate = 2
1513
            else:
1522
            else:
-
 
1523
                if stateIdMap[warehouse.stateId].vatType==VatType.MRP:
-
 
1524
                    lineitem.vatRate = catalog_client.getVatPercentageForItem(lineitem.item_id, warehouse.stateId, lineitem.mrp)
-
 
1525
                else:
1514
                lineitem.vatRate = catalog_client.getVatPercentageForItem(lineitem.item_id, warehouse.stateId, lineitem.unit_price)
1526
                    lineitem.vatRate = catalog_client.getVatPercentageForItem(lineitem.item_id, warehouse.stateId, lineitem.unit_price)
1515
            order.vendorId = warehouse.vendor.id
1527
            order.vendorId = warehouse.vendor.id
1516
        except InventoryServiceException as e:
1528
        except InventoryServiceException as e:
1517
            print sys.exc_info()[0]
1529
            print sys.exc_info()[0]
1518
            print e.message
1530
            print e.message
1519
            raise TransactionServiceException(110, 'Transfer price missing for itemId: ' + str(item_id) + ' and vendor: ' + str(warehouse.vendor.id))
1531
            raise TransactionServiceException(110, 'Transfer price missing for itemId: ' + str(item_id) + ' and vendor: ' + str(warehouse.vendor.id))
Line 2981... Line 2993...
2981
        if line_item.color:
2993
        if line_item.color:
2982
            litem.color = line_item.color
2994
            litem.color = line_item.color
2983
        if line_item.extra_info:
2995
        if line_item.extra_info:
2984
            litem.extra_info = line_item.extra_info
2996
            litem.extra_info = line_item.extra_info
2985
        litem.quantity = line_item.quantity
2997
        litem.quantity = line_item.quantity
-
 
2998
        litem.mrp = line_item.mrp
2986
        litem.unit_price = line_item.unit_price
2999
        litem.unit_price = line_item.unit_price
2987
        litem.unit_weight = line_item.unit_weight
3000
        litem.unit_weight = line_item.unit_weight
2988
        litem.total_price = line_item.total_price
3001
        litem.total_price = line_item.total_price
2989
        litem.total_weight = line_item.total_weight
3002
        litem.total_weight = line_item.total_weight
2990
        litem.transfer_price = line_item.transfer_price
3003
        litem.transfer_price = line_item.transfer_price