use of com.axelor.apps.account.db.Budget in project axelor-open-suite by axelor.
the class BudgetSupplychainService method updateBudgetLinesFromPurchaseOrder.
public void updateBudgetLinesFromPurchaseOrder(PurchaseOrder purchaseOrder) {
List<PurchaseOrderLine> purchaseOrderLineList = purchaseOrder.getPurchaseOrderLineList();
if (purchaseOrderLineList == null) {
return;
}
purchaseOrderLineList.stream().flatMap(x -> x.getBudgetDistributionList().stream()).forEach(budgetDistribution -> {
Budget budget = budgetDistribution.getBudget();
updateLines(budget);
computeTotalAmountCommitted(budget);
});
}
use of com.axelor.apps.account.db.Budget in project axelor-open-suite by axelor.
the class BudgetController method computeTotalAmountRealized.
public void computeTotalAmountRealized(ActionRequest request, ActionResponse response) {
try {
Budget budget = request.getContext().asType(Budget.class);
budget = Beans.get(BudgetRepository.class).find(budget.getId());
response.setValue("totalAmountRealized", Beans.get(BudgetService.class).computeTotalAmountRealized(budget));
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.account.db.Budget in project axelor-open-suite by axelor.
the class BudgetController method validate.
public void validate(ActionRequest request, ActionResponse response) {
try {
Budget budget = request.getContext().asType(Budget.class);
budget = Beans.get(BudgetRepository.class).find(budget.getId());
Beans.get(BudgetService.class).validate(budget);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.account.db.Budget in project axelor-open-suite by axelor.
the class BudgetController method generatePeriods.
public void generatePeriods(ActionRequest request, ActionResponse response) {
try {
Budget budget = request.getContext().asType(Budget.class);
response.setValue("budgetLineList", Beans.get(BudgetService.class).generatePeriods(budget));
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.account.db.Budget in project axelor-open-suite by axelor.
the class BudgetController method checkSharedDates.
public void checkSharedDates(ActionRequest request, ActionResponse response) {
try {
Budget budget = request.getContext().asType(Budget.class);
Beans.get(BudgetService.class).checkSharedDates(budget);
} catch (Exception e) {
response.setError(e.getMessage());
}
}
Aggregations