use of com.axelor.apps.account.service.payment.invoice.payment.InvoicePaymentToolService in project axelor-open-suite by axelor.
the class InvoiceServiceImpl method getMoveLinesFromInvoiceAdvancePayments.
@Override
public List<MoveLine> getMoveLinesFromInvoiceAdvancePayments(Invoice invoice) {
List<MoveLine> advancePaymentMoveLines = new ArrayList<>();
Set<Invoice> advancePayments = invoice.getAdvancePaymentInvoiceSet();
List<InvoicePayment> invoicePayments;
if (advancePayments == null || advancePayments.isEmpty()) {
return advancePaymentMoveLines;
}
InvoicePaymentToolService invoicePaymentToolService = Beans.get(InvoicePaymentToolService.class);
for (Invoice advancePayment : advancePayments) {
invoicePayments = advancePayment.getInvoicePaymentList();
List<MoveLine> creditMoveLines = invoicePaymentToolService.getCreditMoveLinesFromPayments(invoicePayments);
advancePaymentMoveLines.addAll(creditMoveLines);
}
return advancePaymentMoveLines;
}
Aggregations