Subversion Repositories SmartDukaan

Rev

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

Rev 5235 Rev 5533
Line 44... Line 44...
44
        try {
44
        try {
45
            Client warehouseClient = new WarehouseClient().getClient();
45
            Client warehouseClient = new WarehouseClient().getClient();
46
            InventoryItem inventoryItem = warehouseClient.getInventoryItemFromId(Long.valueOf(id));
46
            InventoryItem inventoryItem = warehouseClient.getInventoryItemFromId(Long.valueOf(id));
47
            in.shop2020.model.v1.catalog.InventoryService.Client catalogClient = new CatalogClient().getClient();
47
            in.shop2020.model.v1.catalog.InventoryService.Client catalogClient = new CatalogClient().getClient();
48
            Warehouse warehouse = catalogClient.getWarehouse(inventoryItem.getCurrentWarehouseId());
48
            Warehouse warehouse = catalogClient.getWarehouse(inventoryItem.getCurrentWarehouseId());
49
            warehouseClient.scanSerializedItem(inventoryItem, ScanType.DOA_REPLACED, warehouse.getBillingWarehouseId());
49
            warehouseClient.scan(inventoryItem, ScanType.DOA_REPLACED, inventoryItem.getInitialQuantity(), warehouse.getBillingWarehouseId());
50
            in.shop2020.purchase.PurchaseService.Client purchaseClient = new PurchaseClient().getClient();
50
            in.shop2020.purchase.PurchaseService.Client purchaseClient = new PurchaseClient().getClient();
51
            purchaseClient.unFulfillPO(inventoryItem.getPurchaseId(), inventoryItem.getItemId(), 1);
51
            purchaseClient.unFulfillPO(inventoryItem.getPurchaseId(), inventoryItem.getItemId(), 1);
52
        } catch (Exception e) {
52
        } catch (Exception e) {
53
            logger.error("Could not fetch inventory items", e);
53
            logger.error("Could not fetch inventory items", e);
54
        }
54
        }