use of com.axelor.apps.stock.db.Inventory in project axelor-open-suite by axelor.
the class InventoryController method showInventory.
/**
* Fonction appeler par le bouton imprimer
*
* @param request
* @param response
* @return
* @throws BirtException
* @throws IOException
*/
public void showInventory(ActionRequest request, ActionResponse response) {
try {
Inventory inventory = request.getContext().asType(Inventory.class);
String name = I18n.get("Inventory") + " " + inventory.getInventorySeq();
String fileLink = ReportFactory.createReport(IReport.INVENTORY, Beans.get(InventoryService.class).computeExportFileName(inventory)).addParam("InventoryId", inventory.getId()).addParam("Timezone", inventory.getCompany() != null ? inventory.getCompany().getTimezone() : null).addParam("Locale", ReportSettings.getPrintingLocale(null)).addParam("activateBarCodeGeneration", Beans.get(AppBaseService.class).getAppBase().getActivateBarCodeGeneration()).addFormat(inventory.getFormatSelect()).generate().getFileLink();
logger.debug("Printing " + name);
response.setView(ActionView.define(name).add("html", fileLink).map());
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.stock.db.Inventory 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());
}
use of com.axelor.apps.stock.db.Inventory 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());
}
Aggregations