Subversion Repositories SmartDukaan

Rev

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

Rev 643 Rev 723
Line 370... Line 370...
370
        return 0
370
        return 0
371
    else:
371
    else:
372
        return current_inventory_snapshot.availibility
372
        return current_inventory_snapshot.availibility
373
    """
373
    """
374
    
374
    
-
 
375
def mark_item_as_content_complete(entity_id):
-
 
376
    content_complete_status = status.CONTENT_COMPLETE
-
 
377
    items = Item.query.filter_by(catalog_item_id=entity_id).all()
-
 
378
    current_timestamp = datetime.datetime.now()
-
 
379
    for item in items:
-
 
380
        item_change_log = ItemChangeLog()
-
 
381
        item_change_log.old_status = item.status
-
 
382
        item_change_log.new_status = content_complete_status
-
 
383
        item_change_log.timestamp = current_timestamp
-
 
384
        item_change_log.item = item
-
 
385
        
-
 
386
        item.status = content_complete_status
-
 
387
        item.updatedOn = current_timestamp
-
 
388
    session.commit()
-
 
389
    return True
-
 
390
    
375
def get_item_availability_for_location(warehouse_loc, item_id):
391
def get_item_availability_for_location(warehouse_loc, item_id):
376
    if warehouse_loc is None:
392
    if warehouse_loc is None:
377
        raise InventoryServiceException(101, "Bad Warehouse Location")
393
        raise InventoryServiceException(101, "Bad Warehouse Location")
378
    if not item_id:
394
    if not item_id:
379
        raise InventoryServiceException(101, "Bas Item id")
395
        raise InventoryServiceException(101, "Bas Item id")