Subversion Repositories SmartDukaan

Rev

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

Rev 8197 Rev 8204
Line 156... Line 156...
156
                current_inventory_snapshot = CurrentInventorySnapshot()
156
                current_inventory_snapshot = CurrentInventorySnapshot()
157
                current_inventory_snapshot.item_id = item_id
157
                current_inventory_snapshot.item_id = item_id
158
                current_inventory_snapshot.warehouse = warehouse
158
                current_inventory_snapshot.warehouse = warehouse
159
                current_inventory_snapshot.availability = 0
159
                current_inventory_snapshot.availability = 0
160
                current_inventory_snapshot.reserved = 0
160
                current_inventory_snapshot.reserved = 0
-
 
161
                current_inventory_snapshot.held = 0
161
            # added the difference in the current inventory    
162
            # added the difference in the current inventory    
162
            current_inventory_snapshot.availability = current_inventory_snapshot.availability + quantity
163
            current_inventory_snapshot.availability = current_inventory_snapshot.availability + quantity
163
            item = __get_item_from_master(item_id)
164
            item = __get_item_from_master(item_id)
164
            try:
165
            try:
165
                if quantity > 0 and __get_item_reserved(item_id) > 0:
166
                if quantity > 0 and __get_item_reserved(item_id) > 0:
Line 212... Line 213...
212
        current_inventory_snapshot = CurrentInventorySnapshot()
213
        current_inventory_snapshot = CurrentInventorySnapshot()
213
        current_inventory_snapshot.item_id = itemId
214
        current_inventory_snapshot.item_id = itemId
214
        current_inventory_snapshot.warehouse_id = warehouseId
215
        current_inventory_snapshot.warehouse_id = warehouseId
215
        current_inventory_snapshot.availability = 0
216
        current_inventory_snapshot.availability = 0
216
        current_inventory_snapshot.reserved = 0
217
        current_inventory_snapshot.reserved = 0
-
 
218
        current_inventory_snapshot.held = 0
217
    # added the difference in the current inventory    
219
    # added the difference in the current inventory    
218
    current_inventory_snapshot.availability = current_inventory_snapshot.availability + quantity
220
    current_inventory_snapshot.availability = current_inventory_snapshot.availability + quantity
219
    session.commit()
221
    session.commit()
220
    #**Update item availability cache**#
222
    #**Update item availability cache**#
221
    clear_item_availability_cache(itemId)
223
    clear_item_availability_cache(itemId)
Line 336... Line 338...
336
        current_inventory_snapshot = CurrentInventorySnapshot()
338
        current_inventory_snapshot = CurrentInventorySnapshot()
337
        current_inventory_snapshot.warehouse_id = warehouse_id
339
        current_inventory_snapshot.warehouse_id = warehouse_id
338
        current_inventory_snapshot.item_id = item_id
340
        current_inventory_snapshot.item_id = item_id
339
        current_inventory_snapshot.availability = 0
341
        current_inventory_snapshot.availability = 0
340
        current_inventory_snapshot.reserved = 0
342
        current_inventory_snapshot.reserved = 0
-
 
343
        current_inventory_snapshot.held = 0
341
        
344
        
342
    current_inventory_snapshot.reserved = current_inventory_snapshot.reserved + quantity
345
    current_inventory_snapshot.reserved = current_inventory_snapshot.reserved + quantity
343
    
346
    
344
    reservation = CurrentReservationSnapshot()
347
    reservation = CurrentReservationSnapshot()
345
    reservation.item_id = item_id
348
    reservation.item_id = item_id