Search in sources :

Example 11 with InventoryLine

use of com.axelor.apps.stock.db.InventoryLine in project axelor-open-suite by axelor.

the class InventoryLineController method compute.

public void compute(ActionRequest request, ActionResponse response) {
    InventoryLine inventoryLine = request.getContext().asType(InventoryLine.class);
    Inventory inventory = request.getContext().getParent() != null ? request.getContext().getParent().asType(Inventory.class) : inventoryLine.getInventory();
    inventoryLine = Beans.get(InventoryLineService.class).compute(inventoryLine, inventory);
    response.setValue("unit", inventoryLine.getUnit());
    response.setValue("gap", inventoryLine.getGap());
    response.setValue("gapValue", inventoryLine.getGapValue());
    response.setValue("realValue", inventoryLine.getRealValue());
}
Also used : Inventory(com.axelor.apps.stock.db.Inventory) InventoryLine(com.axelor.apps.stock.db.InventoryLine)

Example 12 with InventoryLine

use of com.axelor.apps.stock.db.InventoryLine in project axelor-open-suite by axelor.

the class InventoryLineController method updateInventoryLine.

public void updateInventoryLine(ActionRequest request, ActionResponse response) throws AxelorException {
    InventoryLine inventoryLine = request.getContext().asType(InventoryLine.class);
    Inventory inventory = request.getContext().getParent() != null ? request.getContext().getParent().asType(Inventory.class) : inventoryLine.getInventory();
    inventoryLine = Beans.get(InventoryLineService.class).updateInventoryLine(inventoryLine, inventory);
    response.setValue("rack", inventoryLine.getRack());
    response.setValue("currentQty", inventoryLine.getCurrentQty());
}
Also used : Inventory(com.axelor.apps.stock.db.Inventory) InventoryLine(com.axelor.apps.stock.db.InventoryLine)

Aggregations

InventoryLine (com.axelor.apps.stock.db.InventoryLine)12 Product (com.axelor.apps.base.db.Product)4 Inventory (com.axelor.apps.stock.db.Inventory)4 Transactional (com.google.inject.persist.Transactional)4 BigDecimal (java.math.BigDecimal)4 StockLocation (com.axelor.apps.stock.db.StockLocation)3 StockLocationLine (com.axelor.apps.stock.db.StockLocationLine)3 TrackingNumber (com.axelor.apps.stock.db.TrackingNumber)3 AxelorException (com.axelor.exception.AxelorException)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Company (com.axelor.apps.base.db.Company)1 StockMove (com.axelor.apps.stock.db.StockMove)1 StockMoveLine (com.axelor.apps.stock.db.StockMoveLine)1 TrackingNumberConfiguration (com.axelor.apps.stock.db.TrackingNumberConfiguration)1 InventoryLineRepository (com.axelor.apps.stock.db.repo.InventoryLineRepository)1 StockConfigRepository (com.axelor.apps.stock.db.repo.StockConfigRepository)1 StockLocationLineRepository (com.axelor.apps.stock.db.repo.StockLocationLineRepository)1 Beans (com.axelor.inject.Beans)1 MetaFiles (com.axelor.meta.MetaFiles)1