Subversion Repositories SmartDukaan

Rev

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

Rev 3226 Rev 3239
Line 1001... Line 1001...
1001
    new_order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
1001
    new_order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
1002
    new_order.statusDescription = 'Submitted for Processing'
1002
    new_order.statusDescription = 'Submitted for Processing'
1003
    new_order.created_timestamp = current_time
1003
    new_order.created_timestamp = current_time
1004
    
1004
    
1005
    new_order.transaction = order.transaction
1005
    new_order.transaction = order.transaction
-
 
1006
    new_order.cod = False
1006
     
1007
     
1007
    for line_item in order.lineitems:
1008
    for line_item in order.lineitems:
1008
        litem = LineItem()
1009
        litem = LineItem()
1009
        litem.item_id = line_item.item_id
1010
        litem.item_id = line_item.item_id
1010
        litem.productGroup = line_item.productGroup
1011
        litem.productGroup = line_item.productGroup
Line 1025... Line 1026...
1025
        litem.transfer_price = line_item.transfer_price
1026
        litem.transfer_price = line_item.transfer_price
1026
        litem.order = new_order
1027
        litem.order = new_order
1027
 
1028
 
1028
    logistics_client = LogisticsClient().get_client()
1029
    logistics_client = LogisticsClient().get_client()
1029
    item_id = new_order.lineitems[0].item_id
1030
    item_id = new_order.lineitems[0].item_id
1030
    logistics_info = logistics_client.getLogisticsInfo(new_order.customer_pincode, item_id) #TODO: We should be able to pass another flag to suggest ignoring the inventory situation.
1031
    logistics_info = logistics_client.getLogisticsInfo(new_order.customer_pincode, item_id, DeliveryType.PREPAID) #TODO: We should be able to pass another flag to suggest ignoring the inventory situation.
1031
    logistics_info.deliveryTime = adjust_delivery_time(current_time, logistics_info.deliveryTime)
1032
    logistics_info.deliveryTime = adjust_delivery_time(current_time, logistics_info.deliveryTime)
1032
    
1033
    
1033
    new_order.warehouse_id = logistics_info.warehouseId
1034
    new_order.warehouse_id = logistics_info.warehouseId
1034
    new_order.logistics_provider_id = logistics_info.providerId
1035
    new_order.logistics_provider_id = logistics_info.providerId
1035
    new_order.airwaybill_no = logistics_info.airway_billno
1036
    new_order.airwaybill_no = logistics_info.airway_billno