use of com.axelor.apps.account.db.AnalyticJournal in project axelor-open-suite by axelor.
the class AnalyticMoveLineServiceImpl method createAnalyticMoveLine.
public AnalyticMoveLine createAnalyticMoveLine(AnalyticDistributionLine analyticDistributionLine, BigDecimal total, int typeSelect, LocalDate date) {
AnalyticMoveLine analyticMoveLine = new AnalyticMoveLine();
analyticMoveLine.setOriginalPieceAmount(total);
analyticMoveLine.setAnalyticAccount(analyticDistributionLine.getAnalyticAccount());
analyticMoveLine.setAnalyticAxis(analyticDistributionLine.getAnalyticAxis());
analyticMoveLine.setAnalyticJournal(analyticDistributionLine.getAnalyticJournal());
AnalyticJournal analyticJournal = analyticDistributionLine.getAnalyticJournal();
Company company = analyticJournal == null ? null : analyticJournal.getCompany();
if (company != null) {
analyticMoveLine.setCurrency(company.getCurrency());
}
analyticMoveLine.setDate(date);
analyticMoveLine.setPercentage(analyticDistributionLine.getPercentage());
analyticMoveLine.setAmount(computeAmount(analyticMoveLine));
analyticMoveLine.setTypeSelect(typeSelect);
return analyticMoveLine;
}
Aggregations