Search in sources :

Example 16 with PaymentScheduleLine

use of com.axelor.apps.account.db.PaymentScheduleLine in project axelor-open-suite by axelor.

the class PaymentScheduleLineBankPaymentServiceImpl method reject.

@Override
public void reject(String paymentScheduleLineName, InterbankCodeLine rejectionReason, boolean represent) throws AxelorException {
    PaymentScheduleLine paymentScheduleLine = paymentScheduleLineRepo.findByName(paymentScheduleLineName);
    reject(paymentScheduleLine, rejectionReason, represent);
}
Also used : PaymentScheduleLine(com.axelor.apps.account.db.PaymentScheduleLine)

Example 17 with PaymentScheduleLine

use of com.axelor.apps.account.db.PaymentScheduleLine in project axelor-open-suite by axelor.

the class PaymentScheduleLineBankPaymentServiceImpl method reject.

@Override
public void reject(long id, InterbankCodeLine rejectionReason, boolean represent) throws AxelorException {
    PaymentScheduleLine paymentScheduleLine = paymentScheduleLineRepo.find(id);
    reject(paymentScheduleLine, rejectionReason, represent);
}
Also used : PaymentScheduleLine(com.axelor.apps.account.db.PaymentScheduleLine)

Example 18 with PaymentScheduleLine

use of com.axelor.apps.account.db.PaymentScheduleLine in project axelor-open-suite by axelor.

the class PaymentScheduleLineBankPaymentServiceImpl method representPaymentScheduleLine.

@Transactional
protected PaymentScheduleLine representPaymentScheduleLine(PaymentScheduleLine paymentScheduleLine) {
    PaymentSchedule paymentSchedule = paymentScheduleLine.getPaymentSchedule();
    BigDecimal inTaxAmount = paymentScheduleLine.getInTaxAmount();
    int scheduleLineSeq = paymentScheduleService.getNextScheduleLineSeq(paymentSchedule);
    LocalDate scheduleDate = paymentScheduleLine.getScheduleDate();
    PaymentScheduleLine representedPaymentScheduleLine = createPaymentScheduleLine(paymentSchedule, inTaxAmount, scheduleLineSeq, scheduleDate);
    representedPaymentScheduleLine.setFromReject(true);
    representedPaymentScheduleLine.setStatusSelect(PaymentScheduleLineRepository.STATUS_IN_PROGRESS);
    return representedPaymentScheduleLine;
}
Also used : PaymentSchedule(com.axelor.apps.account.db.PaymentSchedule) PaymentScheduleLine(com.axelor.apps.account.db.PaymentScheduleLine) LocalDate(java.time.LocalDate) BigDecimal(java.math.BigDecimal) Transactional(com.google.inject.persist.Transactional)

Example 19 with PaymentScheduleLine

use of com.axelor.apps.account.db.PaymentScheduleLine in project axelor-open-suite by axelor.

the class IrrecoverableService method createIrrecoverablePaymentScheduleLineLineList.

/**
 * Fonction permettant de créer une liste de ligne d'échéance rejetée
 *
 * @param icl Une ligne Client
 * @param invoiceList Une liste de d'échéance rejetée du tiers payeur
 * @return
 * @throws AxelorException
 */
public List<IrrecoverablePaymentScheduleLineLine> createIrrecoverablePaymentScheduleLineLineList(IrrecoverableCustomerLine icl, List<PaymentScheduleLine> paymentScheduleLineList) throws AxelorException {
    int seq = 1;
    List<IrrecoverablePaymentScheduleLineLine> ipsllList = new ArrayList<IrrecoverablePaymentScheduleLineLine>();
    for (PaymentScheduleLine paymentScheduleLine : paymentScheduleLineList) {
        ipsllList.add(this.createIrrecoverablePaymentScheduleLineLine(icl, paymentScheduleLine, seq));
        seq++;
    }
    return ipsllList;
}
Also used : IrrecoverablePaymentScheduleLineLine(com.axelor.apps.account.db.IrrecoverablePaymentScheduleLineLine) PaymentScheduleLine(com.axelor.apps.account.db.PaymentScheduleLine) ArrayList(java.util.ArrayList)

Example 20 with PaymentScheduleLine

use of com.axelor.apps.account.db.PaymentScheduleLine in project axelor-open-suite by axelor.

the class IrrecoverableService method getIrrecoverable.

/**
 * Procédure permettant de remplir la liste des factures et échéances rejetées à passer en
 * irrécouvrable d'une société, ansi que de remplir le champ nom de l'objet irrécouvrable
 *
 * @param irrecoverable Un objet Irrécouvrable
 * @throws AxelorException
 */
@Transactional(rollbackOn = { Exception.class })
public void getIrrecoverable(Irrecoverable irrecoverable) throws AxelorException {
    Company company = irrecoverable.getCompany();
    this.testCompanyField(company);
    if (irrecoverable.getName() == null) {
        irrecoverable.setName(this.getSequence(company));
    }
    irrecoverable.setInvoiceSet(new HashSet<Invoice>());
    irrecoverable.getInvoiceSet().addAll(this.getInvoiceList(company));
    irrecoverable.getInvoiceSet().addAll(this.getRejectInvoiceList(company));
    irrecoverable.setPaymentScheduleLineSet(new HashSet<PaymentScheduleLine>());
    irrecoverable.getPaymentScheduleLineSet().addAll(this.getPaymentScheduleLineList(company));
    irrecoverableRepo.save(irrecoverable);
}
Also used : Company(com.axelor.apps.base.db.Company) Invoice(com.axelor.apps.account.db.Invoice) PaymentScheduleLine(com.axelor.apps.account.db.PaymentScheduleLine) Transactional(com.google.inject.persist.Transactional)

Aggregations

PaymentScheduleLine (com.axelor.apps.account.db.PaymentScheduleLine)29 Transactional (com.google.inject.persist.Transactional)12 Invoice (com.axelor.apps.account.db.Invoice)11 AxelorException (com.axelor.exception.AxelorException)10 ArrayList (java.util.ArrayList)8 PaymentSchedule (com.axelor.apps.account.db.PaymentSchedule)7 BigDecimal (java.math.BigDecimal)6 LocalDate (java.time.LocalDate)5 MoveLine (com.axelor.apps.account.db.MoveLine)4 BankDetails (com.axelor.apps.base.db.BankDetails)4 Company (com.axelor.apps.base.db.Company)4 Partner (com.axelor.apps.base.db.Partner)4 Move (com.axelor.apps.account.db.Move)3 PaymentMode (com.axelor.apps.account.db.PaymentMode)3 AccountingBatch (com.axelor.apps.account.db.AccountingBatch)2 PaymentModeService (com.axelor.apps.account.service.payment.PaymentModeService)2 BankOrder (com.axelor.apps.bankpayment.db.BankOrder)2 EntityTransaction (javax.persistence.EntityTransaction)2 Account (com.axelor.apps.account.db.Account)1 AccountManagement (com.axelor.apps.account.db.AccountManagement)1