use of com.axelor.apps.account.db.IrrecoverableInvoiceLine in project axelor-open-suite by axelor.
the class IrrecoverableService method createIrrecoverableReportLineList.
/**
* Fonction permettant de créer une liste de ligne de reporting pour une ligne Facture
*
* @param iil Une ligne Facture
* @param invoice Une facture
* @param prorataRate Un taux de restant à payer d'une facture
* @return
*/
public List<IrrecoverableReportLine> createIrrecoverableReportLineList(IrrecoverableInvoiceLine iil, Invoice invoice, BigDecimal prorataRate) {
int seq = 1;
List<IrrecoverableReportLine> irlList = new ArrayList<IrrecoverableReportLine>();
for (InvoiceLine invoiceLine : invoice.getInvoiceLineList()) {
irlList.add(this.createIrrecoverableReportLine(iil, invoiceLine.getName(), invoiceLine.getExTaxTotal().multiply(prorataRate).setScale(AppBaseService.DEFAULT_NB_DECIMAL_DIGITS, RoundingMode.HALF_UP), seq));
seq++;
}
for (InvoiceLineTax invoiceLineTax : invoice.getInvoiceLineTaxList()) {
irlList.add(this.createIrrecoverableReportLine(iil, invoiceLineTax.getTaxLine().getTax().getName(), invoiceLineTax.getTaxTotal().multiply(prorataRate).setScale(AppBaseService.DEFAULT_NB_DECIMAL_DIGITS, RoundingMode.HALF_UP), seq));
seq++;
}
// Afin de ne pas modifier les valeurs des lignes de factures, on les recharges depuis la base
invoiceRepo.refresh(invoice);
return irlList;
}
use of com.axelor.apps.account.db.IrrecoverableInvoiceLine in project axelor-open-suite by axelor.
the class IrrecoverableService method createIrrecoverableInvoiceLine.
/**
* Fonction permettant de créer une ligne Facture
*
* @param icl Une ligne Client
* @param invoice Une facture
* @param seq Un numéro de séquence
* @return
* @throws AxelorException
*/
public IrrecoverableInvoiceLine createIrrecoverableInvoiceLine(IrrecoverableCustomerLine icl, Invoice invoice, int seq) throws AxelorException {
IrrecoverableInvoiceLine iil = new IrrecoverableInvoiceLine();
iil.setInvoice(invoice);
iil.setInvoiceLineSeq(seq);
iil.setIrrecoverableCustomerLine(icl);
BigDecimal prorataRate = this.getProrataRate(invoice, invoice.getRejectMoveLine() != null);
iil.setIrrecoverableReportLineList(this.createIrrecoverableReportLineList(iil, invoice, prorataRate));
log.debug("Ligne facture : {}", iil);
return iil;
}
use of com.axelor.apps.account.db.IrrecoverableInvoiceLine in project axelor-open-suite by axelor.
the class IrrecoverableService method createIrrecoverableInvoiceLineList.
/**
* Fonction permettant de créer une liste de ligne Facture
*
* @param icl Une ligne Client
* @param invoiceList Une liste de factures du tiers payeur
* @return
* @throws AxelorException
*/
public List<IrrecoverableInvoiceLine> createIrrecoverableInvoiceLineList(IrrecoverableCustomerLine icl, List<Invoice> invoiceList) throws AxelorException {
int seq = 1;
List<IrrecoverableInvoiceLine> iilList = new ArrayList<IrrecoverableInvoiceLine>();
for (Invoice invoice : invoiceList) {
iilList.add(this.createIrrecoverableInvoiceLine(icl, invoice, seq));
seq++;
}
return iilList;
}
Aggregations