Subversion Repositories SmartDukaan

Rev

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

Rev 6629 Rev 6631
Line 1454... Line 1454...
1454
    # Provider is 4 is for self pickup and hardcoded. We should figure out a way to not to hard code.   
1454
    # Provider is 4 is for self pickup and hardcoded. We should figure out a way to not to hard code.   
1455
    if order.status == OrderStatus.BILLED and order.logistics_provider_id != 4:
1455
    if order.status == OrderStatus.BILLED and order.logistics_provider_id != 4:
1456
        raise TransactionServiceException(101, "Order is not marked for self pickup: " + str(orderId))
1456
        raise TransactionServiceException(101, "Order is not marked for self pickup: " + str(orderId))
1457
         
1457
         
1458
    if order.status in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_TO_DESTINATION_CITY, OrderStatus.REACHED_DESTINATION_CITY, OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE, OrderStatus.RTO_IN_TRANSIT, OrderStatus.BILLED, OrderStatus.RECEIVED_AT_STORE]:
1458
    if order.status in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_TO_DESTINATION_CITY, OrderStatus.REACHED_DESTINATION_CITY, OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE, OrderStatus.RTO_IN_TRANSIT, OrderStatus.BILLED, OrderStatus.RECEIVED_AT_STORE]:
-
 
1459
        order.delivery_timestamp = datetime.datetime.strptime(deliveryTimestamp, "%Y-%m-%d %H:%M:%S")
-
 
1460
        if order.first_dlvyatmp_timestamp is None:
1459
        order.delivery_timestamp = deliveryTimestamp
1461
            order.first_dlvyatmp_timestamp = order.delivery_timestamp
1460
        order.receiver = receiver
1462
        order.receiver = receiver
1461
    order.status = OrderStatus.DELIVERY_SUCCESS
1463
    order.status = OrderStatus.DELIVERY_SUCCESS
1462
    order.statusDescription = "Order delivered"
1464
    order.statusDescription = "Order delivered"
1463
    update_trust_level(order)
1465
    update_trust_level(order)
1464
    session.commit()
1466
    session.commit()