use of com.axelor.apps.account.db.AnalyticMoveLine in project axelor-open-suite by axelor.
the class InvoiceLineProjectController method setProjectToAnalyticDistribution.
public void setProjectToAnalyticDistribution(ActionRequest request, ActionResponse response) {
try {
InvoiceLine invoiceLine = request.getContext().asType(InvoiceLine.class);
List<AnalyticMoveLine> analyticMoveLines = invoiceLine.getAnalyticMoveLineList();
if (analyticMoveLines != null) {
response.setValue("analyticMoveLineList", Beans.get(InvoiceLineProjectService.class).setProjectToAnalyticDistribution(invoiceLine, analyticMoveLines));
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.account.db.AnalyticMoveLine in project axelor-open-suite by axelor.
the class AnalyticMoveLineSupplychainRepository method copy.
@Override
public AnalyticMoveLine copy(AnalyticMoveLine entity, boolean deep) {
AnalyticMoveLine copy = super.copy(entity, deep);
copy.setPurchaseOrderLine(null);
copy.setSaleOrderLine(null);
return copy;
}
use of com.axelor.apps.account.db.AnalyticMoveLine in project axelor-open-suite by axelor.
the class PurchaseOrderLineServiceProjectImpl method createAnalyticDistributionWithTemplate.
@Override
public PurchaseOrderLine createAnalyticDistributionWithTemplate(PurchaseOrderLine purchaseOrderLine) {
PurchaseOrderLine poLine = super.createAnalyticDistributionWithTemplate(purchaseOrderLine);
List<AnalyticMoveLine> analyticMoveLineList = poLine.getAnalyticMoveLineList();
if (poLine.getProject() != null && analyticMoveLineList != null) {
analyticMoveLineList.forEach(analyticLine -> analyticLine.setProject(poLine.getProject()));
}
return poLine;
}
use of com.axelor.apps.account.db.AnalyticMoveLine in project axelor-open-suite by axelor.
the class PurchaseOrderWorkflowServiceProjectImpl method cancelPurchaseOrder.
@Override
@Transactional
public void cancelPurchaseOrder(PurchaseOrder purchaseOrder) {
super.cancelPurchaseOrder(purchaseOrder);
for (PurchaseOrderLine purchaseOrderLine : purchaseOrder.getPurchaseOrderLineList()) {
for (AnalyticMoveLine analyticMoveLine : purchaseOrderLine.getAnalyticMoveLineList()) {
analyticMoveLine.setProject(null);
analyticMoveLineRepository.save(analyticMoveLine);
}
}
}
use of com.axelor.apps.account.db.AnalyticMoveLine in project axelor-open-suite by axelor.
the class ProjectAnalyticMoveLineServiceImpl method updateLines.
@Override
@Transactional(rollbackOn = Exception.class)
public SaleOrder updateLines(SaleOrder saleOrder) {
for (SaleOrderLine orderLine : saleOrder.getSaleOrderLineList()) {
orderLine.setProject(saleOrder.getProject());
for (AnalyticMoveLine analyticMoveLine : orderLine.getAnalyticMoveLineList()) {
analyticMoveLine.setProject(saleOrder.getProject());
analyticMoveLineRepository.save(analyticMoveLine);
}
}
return saleOrder;
}
Aggregations