Search in sources :

Example 26 with BankOrder

use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.

the class BankOrderController method cancel.

public void cancel(ActionRequest request, ActionResponse response) {
    try {
        BankOrder bankOrder = request.getContext().asType(BankOrder.class);
        bankOrder = Beans.get(BankOrderRepository.class).find(bankOrder.getId());
        Beans.get(BankOrderService.class).cancelBankOrder(bankOrder);
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : BankOrderService(com.axelor.apps.bankpayment.service.bankorder.BankOrderService) BankOrder(com.axelor.apps.bankpayment.db.BankOrder) AxelorException(com.axelor.exception.AxelorException)

Example 27 with BankOrder

use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.

the class BankOrderController method fillSignatoryEbicsUser.

public void fillSignatoryEbicsUser(ActionRequest request, ActionResponse response) {
    BankOrder bankOrder = request.getContext().asType(BankOrder.class);
    if (bankOrder.getSenderBankDetails() != null) {
        EbicsUser ebicsUser = Beans.get(BankOrderService.class).getDefaultEbicsUserFromBankDetails(bankOrder.getSenderBankDetails());
        bankOrder.setSignatoryEbicsUser(ebicsUser);
        response.setValues(bankOrder);
    }
}
Also used : EbicsUser(com.axelor.apps.bankpayment.db.EbicsUser) BankOrderService(com.axelor.apps.bankpayment.service.bankorder.BankOrderService) BankOrder(com.axelor.apps.bankpayment.db.BankOrder)

Example 28 with BankOrder

use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.

the class BankOrderController method print.

public void print(ActionRequest request, ActionResponse response) throws AxelorException {
    BankOrder bankOrder = request.getContext().asType(BankOrder.class);
    String name = I18n.get("Bank Order") + " " + bankOrder.getBankOrderSeq();
    String fileLink = ReportFactory.createReport(IReport.BANK_ORDER, name + "-${date}").addParam("BankOrderId", bankOrder.getId()).addParam("Locale", ReportSettings.getPrintingLocale(null)).addParam("Timezone", bankOrder.getSenderCompany() != null ? bankOrder.getSenderCompany().getTimezone() : null).generate().getFileLink();
    log.debug("Printing " + name);
    response.setView(ActionView.define(name).add("html", fileLink).map());
}
Also used : BankOrder(com.axelor.apps.bankpayment.db.BankOrder)

Example 29 with BankOrder

use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.

the class BankOrderController method setStatusReject.

public void setStatusReject(ActionRequest request, ActionResponse response) {
    BankOrder bankOrder = request.getContext().asType(BankOrder.class);
    bankOrder = Beans.get(BankOrderRepository.class).find(bankOrder.getId());
    Beans.get(BankOrderService.class).setStatusToRejected(bankOrder);
    response.setReload(true);
}
Also used : BankOrderService(com.axelor.apps.bankpayment.service.bankorder.BankOrderService) BankOrder(com.axelor.apps.bankpayment.db.BankOrder)

Example 30 with BankOrder

use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.

the class BankOrderController method confirm.

public void confirm(ActionRequest request, ActionResponse response) {
    try {
        BankOrder bankOrder = request.getContext().asType(BankOrder.class);
        bankOrder = Beans.get(BankOrderRepository.class).find(bankOrder.getId());
        if (bankOrder != null) {
            Beans.get(BankOrderService.class).confirm(bankOrder);
        }
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
    response.setReload(true);
}
Also used : BankOrderService(com.axelor.apps.bankpayment.service.bankorder.BankOrderService) BankOrder(com.axelor.apps.bankpayment.db.BankOrder) AxelorException(com.axelor.exception.AxelorException)

Aggregations

BankOrder (com.axelor.apps.bankpayment.db.BankOrder)33 AxelorException (com.axelor.exception.AxelorException)16 Transactional (com.google.inject.persist.Transactional)11 BankOrderService (com.axelor.apps.bankpayment.service.bankorder.BankOrderService)10 BankOrderLine (com.axelor.apps.bankpayment.db.BankOrderLine)8 PaymentMode (com.axelor.apps.account.db.PaymentMode)6 BankDetails (com.axelor.apps.base.db.BankDetails)6 LocalDate (java.time.LocalDate)6 Company (com.axelor.apps.base.db.Company)4 Currency (com.axelor.apps.base.db.Currency)4 InvoicePayment (com.axelor.apps.account.db.InvoicePayment)3 EbicsUser (com.axelor.apps.bankpayment.db.EbicsUser)3 Partner (com.axelor.apps.base.db.Partner)3 BigDecimal (java.math.BigDecimal)3 ArrayList (java.util.ArrayList)3 AccountingBatch (com.axelor.apps.account.db.AccountingBatch)2 PaymentScheduleLine (com.axelor.apps.account.db.PaymentScheduleLine)2 BankOrderRepository (com.axelor.apps.bankpayment.db.repo.BankOrderRepository)2 BankOrderLineService (com.axelor.apps.bankpayment.service.bankorder.BankOrderLineService)2 BankOrderMergeService (com.axelor.apps.bankpayment.service.bankorder.BankOrderMergeService)2