| Line 839... |
Line 839... |
| 839 |
|
839 |
|
| 840 |
subOrderAmountsMap[long(order.lineitems[0].unit_price)] = order
|
840 |
subOrderAmountsMap[long(order.lineitems[0].unit_price)] = order
|
| 841 |
|
841 |
|
| 842 |
order.fulfilmentWarehouseId = fulfilmentWhId
|
842 |
order.fulfilmentWarehouseId = fulfilmentWhId
|
| 843 |
order.warehouse_id = billingWarehouseId
|
843 |
order.warehouse_id = billingWarehouseId
|
| 844 |
|
- |
|
| 845 |
# fulfilmentWarehouseId = fulfilmentWhId
|
- |
|
| 846 |
# if OrderType.B2B == order.orderType:
|
- |
|
| 847 |
# #get state
|
- |
|
| 848 |
# stateMaster = fetchStateMaster()
|
- |
|
| 849 |
# stateId = -1
|
- |
|
| 850 |
# for k, v in stateMaster.iteritems():
|
- |
|
| 851 |
# if v.stateName == order.customer_state:
|
- |
|
| 852 |
# stateId = k
|
- |
|
| 853 |
# break
|
- |
|
| 854 |
# if stateId == -1:
|
- |
|
| 855 |
# raise TransactionServiceException(108, "No such State")
|
- |
|
| 856 |
# if not inventory_client.isAlive():
|
- |
|
| 857 |
# inventory_client = InventoryClient().get_client()
|
- |
|
| 858 |
# ffWarehouse = inventory_client.getWarehouse(order.fulfilmentWarehouseId)
|
- |
|
| 859 |
# if stateId!= ffWarehouse.stateId:
|
- |
|
| 860 |
# goodWhIds = inventory_client.getOursGoodWarehouseIdsForLocation(stateId)
|
- |
|
| 861 |
# if goodWhIds is None or len(goodWhIds) == 0:
|
- |
|
| 862 |
# raise TransactionServiceException(108, "No availability from this location")
|
- |
|
| 863 |
# fulfilmentWarehouseId = goodWhIds[0]
|
- |
|
| 864 |
# for goodWhId in goodWhIds:
|
- |
|
| 865 |
# availability = inventory_client.getItemAvailibilityAtWarehouse(goodWhId, order.lineitems[0].item_id)
|
- |
|
| 866 |
# if availability > 0:
|
- |
|
| 867 |
# fulfilmentWarehouseId = goodWhId
|
- |
|
| 868 |
# break
|
- |
|
| 869 |
#
|
- |
|
| 870 |
# order.fulfilmentWarehouseId = fulfilmentWarehouseId
|
- |
|
| 871 |
# fulfillmentWh = inventory_client.getWarehouse(fulfilmentWarehouseId)
|
- |
|
| 872 |
# order.warehouse_id = fulfillmentWh.billingWarehouseId
|
- |
|
| 873 |
|
844 |
|
| 874 |
if order.pickupStoreId:
|
845 |
if order.pickupStoreId:
|
| 875 |
order.otg = False
|
846 |
order.otg = False
|
| 876 |
|
847 |
|
| 877 |
if order.productCondition != ProductCondition.BAD:
|
848 |
if order.productCondition != ProductCondition.BAD:
|
| 878 |
inventory_client.reserveItemInWarehouse(item_id, fulfilmentWarehouseId, sourceId, order.id, to_java_date(order.created_timestamp), to_java_date(order.promised_shipping_time), order.lineitems[0].quantity)
|
849 |
inventory_client.reserveItemInWarehouse(item_id, order.fulfilmentWarehouseId, sourceId, order.id, to_java_date(order.created_timestamp), to_java_date(order.promised_shipping_time), order.lineitems[0].quantity)
|
| 879 |
|
850 |
|
| 880 |
try:
|
851 |
try:
|
| 881 |
item_pricing = inventory_client.getItemPricing(item_id, -1)
|
852 |
item_pricing = inventory_client.getItemPricing(item_id, -1)
|
| 882 |
order.lineitems[0].transfer_price = item_pricing.transferPrice
|
853 |
order.lineitems[0].transfer_price = item_pricing.transferPrice
|
| 883 |
order.lineitems[0].nlc = item_pricing.nlc
|
854 |
order.lineitems[0].nlc = item_pricing.nlc
|