Subversion Repositories SmartDukaan

Rev

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

Rev 30063 Rev 34205
Line 4015... Line 4015...
4015
    return order
4015
    return order
4016
 
4016
 
4017
def change_product(order_id, item_id):
4017
def change_product(order_id, item_id):
4018
    '''
4018
    '''
4019
    Ship a product of a different color to the customer.
4019
    Ship a product of a different color to the customer.
4020
    '''
4020
    Do nothing
4021
    order = get_order(order_id)
4021
    order = get_order(order_id)
4022
    if order.status not in [OrderStatus.COD_VERIFICATION_PENDING, OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.ACCEPTED, OrderStatus.INVENTORY_LOW, OrderStatus.LOW_INV_PO_RAISED, OrderStatus.LOW_INV_REVERSAL_IN_PROCESS, OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT]:
4022
    if order.status not in [OrderStatus.COD_VERIFICATION_PENDING, OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.ACCEPTED, OrderStatus.INVENTORY_LOW, OrderStatus.LOW_INV_PO_RAISED, OrderStatus.LOW_INV_REVERSAL_IN_PROCESS, OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT]:
4023
        raise TransactionServiceException(120, "This order has already been processed. Please seek help from engineering.")
4023
        raise TransactionServiceException(120, "This order has already been processed. Please seek help from engineering.")
4024
        
4024
        
4025
    lineitem = order.lineitems[0]
4025
    lineitem = order.lineitems[0]
Line 4048... Line 4048...
4048
    lineitem.model_number = item.modelNumber
4048
    lineitem.model_number = item.modelNumber
4049
    lineitem.color = item.color
4049
    lineitem.color = item.color
4050
    
4050
    
4051
    session.commit()
4051
    session.commit()
4052
    move_orders_to_correct_warehouse()
4052
    move_orders_to_correct_warehouse()
-
 
4053
    '''
4053
    order = get_order(order_id)
4054
    order = get_order(order_id)
4054
    return order
4055
    return order
4055
 
4056
 
-
 
4057
 
4056
def change_warehouse(order_id, warehouse_id):
4058
def change_warehouse(order_id, warehouse_id):
4057
    '''
4059
    '''
4058
    Update the warehouse which will be used to fulfil this order.
4060
    Update the warehouse which will be used to fulfil this order.
4059
    '''
4061
    '''
4060
    order = get_order(order_id)
4062
    order = get_order(order_id)