Subversion Repositories SmartDukaan

Rev

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

Rev 8123 Rev 8125
Line 1478... Line 1478...
1478
                inventory_client.addInventory(item.id, warehouse.id, -1 * lineitem.quantity)
1478
                inventory_client.addInventory(item.id, warehouse.id, -1 * lineitem.quantity)
1479
        
1479
        
1480
        if order.freebieItemId:
1480
        if order.freebieItemId:
1481
            try:
1481
            try:
1482
                inventory_client = InventoryClient().get_client()
1482
                inventory_client = InventoryClient().get_client()
1483
                warehouse = inventory_client.getWarehouse(freebieWarehouseId)
1483
                freebie_warehouse = inventory_client.getWarehouse(freebieWarehouseId)
1484
                
1484
                
1485
                if warehouse.warehouseType!= WarehouseType.OURS or warehouse.inventoryType != InventoryType.GOOD:
1485
                if freebie_warehouse.warehouseType!= WarehouseType.OURS or freebie_warehouse.inventoryType != InventoryType.GOOD:
1486
                    raise TransactionServiceException(110,'Billing of Freebie is only allowed from OURS_GOOD warehouses ')
1486
                    raise TransactionServiceException(110,'Billing of Freebie is only allowed from OURS_GOOD warehouses ')
1487
                
1487
                
1488
                warehouse_client = WarehouseClient().get_client()
1488
                warehouse_client = WarehouseClient().get_client()
1489
                inventoryItem = warehouse_client.scanfreebie(orderId, order.freebieItemId, freebieWarehouseId, ScanType.SALE);
1489
                inventoryItem = warehouse_client.scanfreebie(orderId, order.freebieItemId, freebieWarehouseId, ScanType.SALE);
1490
                
1490