use of com.axelor.apps.account.db.IrrecoverableReportLine 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 Echéance rejetée
*
* @param iil Une ligne Echéance rejetée
* @param invoice Une échéance rejetée
* @param prorataRate Un taux de restant à payer d'une échéance rejetée
* @return
* @throws AxelorException
*/
public List<IrrecoverableReportLine> createIrrecoverableReportLineList(IrrecoverablePaymentScheduleLineLine ipsll, PaymentScheduleLine paymentScheduleLine, Tax tax) throws AxelorException {
List<IrrecoverableReportLine> irlList = new ArrayList<IrrecoverableReportLine>();
BigDecimal taxRate = taxService.getTaxRate(tax, appAccountService.getTodayDate(paymentScheduleLine.getPaymentSchedule() != null ? paymentScheduleLine.getPaymentSchedule().getCompany() : Optional.ofNullable(AuthUtils.getUser()).map(User::getActiveCompany).orElse(null)));
BigDecimal amount = paymentScheduleLine.getInTaxAmount();
BigDecimal divid = taxRate.add(BigDecimal.ONE);
// Montant hors-Taxe
BigDecimal irrecoverableAmount = amount.divide(divid, 6, RoundingMode.HALF_UP).setScale(AppBaseService.DEFAULT_NB_DECIMAL_DIGITS, RoundingMode.HALF_UP);
// Montant Tax
BigDecimal taxAmount = amount.subtract(irrecoverableAmount);
irlList.add(this.createIrrecoverableReportLine(ipsll, "HT", irrecoverableAmount, 1));
irlList.add(this.createIrrecoverableReportLine(ipsll, tax.getName(), taxAmount, 2));
return irlList;
}
use of com.axelor.apps.account.db.IrrecoverableReportLine in project axelor-open-suite by axelor.
the class IrrecoverableService method createIrrecoverableReportLine.
/**
* Fonction permettant de créer une ligne Reporting
*
* @param iil Une ligne Echéance rejetée
* @param label Un libellé
* @param value Une valeur
* @param seq Un numéro de séquence
* @return
*/
public IrrecoverableReportLine createIrrecoverableReportLine(IrrecoverablePaymentScheduleLineLine ipsll, String label, BigDecimal value, int seq) {
IrrecoverableReportLine irl = new IrrecoverableReportLine();
irl.setReportLineSeq(seq);
irl.setLabel(label);
irl.setValue(value);
irl.setIrrecoverablePaymentScheduleLineLine(ipsll);
log.debug("Ligne reporting : {}", irl);
return irl;
}
use of com.axelor.apps.account.db.IrrecoverableReportLine 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.IrrecoverableReportLine in project axelor-open-suite by axelor.
the class IrrecoverableService method createIrrecoverableReportLine.
/**
* Fonction permettant de créer une ligne Reporting
*
* @param iil Une ligne Facture
* @param label Un libellé
* @param value Une valeur
* @param seq Un numéro de séquence
* @return
*/
public IrrecoverableReportLine createIrrecoverableReportLine(IrrecoverableInvoiceLine iil, String label, BigDecimal value, int seq) {
IrrecoverableReportLine irl = new IrrecoverableReportLine();
irl.setReportLineSeq(seq);
irl.setLabel(label);
irl.setValue(value);
irl.setIrrecoverableInvoiceLine(iil);
log.debug("Ligne reporting : {}", irl);
return irl;
}
Aggregations