Subversion Repositories SmartDukaan

Rev

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

Rev 18072 Rev 18095
Line 8135... Line 8135...
8135
    
8135
    
8136
    
8136
    
8137
    orderscansMap = {}
8137
    orderscansMap = {}
8138
    orderInventoryItemMap = {}
8138
    orderInventoryItemMap = {}
8139
    orderFulfilmentWarehouseMap = {}
8139
    orderFulfilmentWarehouseMap = {}
-
 
8140
    nonSerializedUsedInventoryMap = {}
8140
    for order in ordersList:
8141
    for order in ordersList:
8141
        scanList = []
8142
        scanList = []
8142
        inventoryItemList = []
8143
        inventoryItemList = []
8143
        newTaxType = __getOrderTaxType(order)
8144
        newTaxType = __getOrderTaxType(order)
8144
        if order.taxType == 2:
8145
        if order.taxType == 2:
Line 8354... Line 8355...
8354
                        orderQuantity = lineitem.quantity
8355
                        orderQuantity = lineitem.quantity
8355
                        if totalCurrentQuantity < lineitem.quantity:
8356
                        if totalCurrentQuantity < lineitem.quantity:
8356
                            if warehouseDbConnection.open:
8357
                            if warehouseDbConnection.open:
8357
                                warehouseDbConnection.close()
8358
                                warehouseDbConnection.close()
8358
                            raise TransactionServiceException(318, "Unsufficient Quantity with this item number " + itemNumbers[0]+" in Vendor Warehouse Id- "+str(warehouse.id)+" Order Id:- "+str(order.id))
8359
                            raise TransactionServiceException(318, "Unsufficient Quantity with this item number " + itemNumbers[0]+" in Vendor Warehouse Id- "+str(warehouse.id)+" Order Id:- "+str(order.id))
8359
                            
8360
                        
-
 
8361
                        usedInventory = 0
-
 
8362
                        if nonSerializedUsedInventoryMap.has_key(item.id):
-
 
8363
                            usedInventory = nonSerializedUsedInventoryMap.get(item.id)
-
 
8364
                            usedInventory = usedInventory+orderQuantity
-
 
8365
                            nonSerializedUsedInventoryMap[item.id] = usedInventory
-
 
8366
                        else:
-
 
8367
                            usedInventory = orderQuantity
-
 
8368
                            nonSerializedUsedInventoryMap[item.id] = usedInventory
-
 
8369
                        
-
 
8370
                        if usedInventory > totalCurrentQuantity:
-
 
8371
                            if warehouseDbConnection.open:
-
 
8372
                                warehouseDbConnection.close()
-
 
8373
                            raise TransactionServiceException(318, "Unsufficient Quantity with this item number " + itemNumbers[0]+" in Vendor Warehouse Id- "+str(warehouse.id)+" Order Id:- "+str(order.id))
-
 
8374
                        
8360
                        for invItem in invItems:
8375
                        for invItem in invItems:
8361
                            scanSql = "select * from scanNew where inventoryItemId =%d order by id"%(invItem[0])
8376
                            scanSql = "select * from scanNew where inventoryItemId =%d order by id"%(invItem[0])
8362
                            whCursor.execute(scanSql)
8377
                            whCursor.execute(scanSql)
8363
                            scans = whCursor.fetchall()
8378
                            scans = whCursor.fetchall()
8364
                            
8379
                            
Line 8485... Line 8500...
8485
                        if totalCurrentQuantity < lineitem.quantity:
8500
                        if totalCurrentQuantity < lineitem.quantity:
8486
                            if warehouseDbConnection.open:
8501
                            if warehouseDbConnection.open:
8487
                                warehouseDbConnection.close()
8502
                                warehouseDbConnection.close()
8488
                            raise TransactionServiceException(110, "Unsufficient Quantity with this item number " + itemNumbers[0]+" in Vendor Warehouse Id- "+str(warehouse.id)+" Order Id:- "+str(order.id))
8503
                            raise TransactionServiceException(110, "Unsufficient Quantity with this item number " + itemNumbers[0]+" in Vendor Warehouse Id- "+str(warehouse.id)+" Order Id:- "+str(order.id))
8489
                        
8504
                        
-
 
8505
                        usedInventory = 0
-
 
8506
                        if nonSerializedUsedInventoryMap.has_key(item.id):
-
 
8507
                            usedInventory = nonSerializedUsedInventoryMap.get(item.id)
-
 
8508
                            usedInventory = usedInventory+orderQuantity
-
 
8509
                            nonSerializedUsedInventoryMap[item.id] = usedInventory
-
 
8510
                        else:
-
 
8511
                            usedInventory = orderQuantity
-
 
8512
                            nonSerializedUsedInventoryMap[item.id] = usedInventory
-
 
8513
                        
-
 
8514
                        if usedInventory > totalCurrentQuantity:
-
 
8515
                            if warehouseDbConnection.open:
-
 
8516
                                warehouseDbConnection.close()
-
 
8517
                            raise TransactionServiceException(318, "Unsufficient Quantity with this item number " + itemNumbers[0]+" in Vendor Warehouse Id- "+str(warehouse.id)+" Order Id:- "+str(order.id))
-
 
8518
                        
8490
                        for invItem in invItems:
8519
                        for invItem in invItems:
8491
                            scanSql = "select * from scanNew where inventoryItemId =%d order by id"%(invItem[0])
8520
                            scanSql = "select * from scanNew where inventoryItemId =%d order by id"%(invItem[0])
8492
                            whCursor.execute(scanSql)
8521
                            whCursor.execute(scanSql)
8493
                            scans = whCursor.fetchall()
8522
                            scans = whCursor.fetchall()
8494
                            
8523