Subversion Repositories SmartDukaan

Rev

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

Rev 9452 Rev 9572
Line 55... Line 55...
55
        try {
55
        try {
56
            Client warehouseClient = new WarehouseClient().getClient();
56
            Client warehouseClient = new WarehouseClient().getClient();
57
            InventoryItem inventoryItem = warehouseClient.getInventoryItemFromId(Long.valueOf(id));
57
            InventoryItem inventoryItem = warehouseClient.getInventoryItemFromId(Long.valueOf(id));
58
            in.shop2020.model.v1.inventory.InventoryService.Client catalogClient = new InventoryClient().getClient();
58
            in.shop2020.model.v1.inventory.InventoryService.Client catalogClient = new InventoryClient().getClient();
59
            Warehouse warehouse = catalogClient.getWarehouse(inventoryItem.getCurrentWarehouseId());
59
            Warehouse warehouse = catalogClient.getWarehouse(inventoryItem.getCurrentWarehouseId());
60
            warehouseClient.scan(inventoryItem, ScanType.DOA_REPLACED, inventoryItem.getInitialQuantity(), warehouse.getBillingWarehouseId(), 0);
60
            warehouseClient.scan(inventoryItem, ScanType.DOA_REPLACED, 1, warehouse.getBillingWarehouseId(), 0);
61
            in.shop2020.purchase.PurchaseService.Client purchaseClient = new PurchaseClient().getClient();
61
            in.shop2020.purchase.PurchaseService.Client purchaseClient = new PurchaseClient().getClient();
62
            purchaseClient.unFulfillPO(inventoryItem.getPurchaseId(), inventoryItem.getItemId(), 1);
62
            purchaseClient.unFulfillPO(inventoryItem.getPurchaseId(), inventoryItem.getItemId(), 1);
63
        } catch (Exception e) {
63
        } catch (Exception e) {
64
            logger.error("Could not fetch inventory items", e);
64
            logger.error("Could not fetch inventory items", e);
65
        }
65
        }