Subversion Repositories SmartDukaan

Rev

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

Rev 7557 Rev 7560
Line 3062... Line 3062...
3062
    lineitem.unit_weight = weight
3062
    lineitem.unit_weight = weight
3063
    
3063
    
3064
    session.commit()
3064
    session.commit()
3065
    return order
3065
    return order
3066
 
3066
 
-
 
3067
def change_courier_provider(order_id, provider_id):
-
 
3068
    order = get_order(order_id)
-
 
3069
    if order.status not in [OrderStatus.COD_VERIFICATION_PENDING, OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.INVENTORY_LOW, OrderStatus.ACCEPTED]:
-
 
3070
        raise TransactionServiceException(121, "This order has already been processed. Please seek help from engineering.")
-
 
3071
    
-
 
3072
    if order.logistics_provider_id == provider_id:
-
 
3073
        raise TransactionServiceException(121, "Provider Id entered by you is same as provider assigned to order.")
-
 
3074
    
-
 
3075
    logistics_client = LogisticsClient().get_client()
-
 
3076
    awb_number = logistics_client.getEmptyAWB(provider_id, order.cod)
-
 
3077
    order.logistics_provider_id = provider_id
-
 
3078
    order.airwaybill_no = awb_number
-
 
3079
    order.track_id = awb_number
-
 
3080
    session.commit()
-
 
3081
 
-
 
3082
    return order
-
 
3083
 
3067
def change_product(order_id, item_id):
3084
def change_product(order_id, item_id):
3068
    '''
3085
    '''
3069
    Ship a product of a different color to the customer.
3086
    Ship a product of a different color to the customer.
3070
    '''
3087
    '''
3071
    order = get_order(order_id)
3088
    order = get_order(order_id)