use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.
the class BankOrderController method validate.
public void validate(ActionRequest request, ActionResponse response) throws AxelorException {
Context context = request.getContext();
BankOrderService bankOrderService = Beans.get(BankOrderService.class);
BankOrder bankOrder = context.asType(BankOrder.class);
bankOrder = Beans.get(BankOrderRepository.class).find(bankOrder.getId());
try {
EbicsUser ebicsUser = bankOrder.getSignatoryEbicsUser();
if (ebicsUser == null) {
response.setError(I18n.get(IExceptionMessage.EBICS_MISSING_NAME));
} else {
if (ebicsUser.getEbicsPartner().getEbicsTypeSelect() == EbicsPartnerRepository.EBICS_TYPE_TS) {
bankOrderService.validate(bankOrder);
} else {
if (context.get("password") == null) {
response.setError(I18n.get(IExceptionMessage.EBICS_WRONG_PASSWORD));
}
if (context.get("password") != null) {
String password = (String) context.get("password");
if (ebicsUser.getPassword() == null || !ebicsUser.getPassword().equals(password)) {
response.setValue("password", "");
response.setError(I18n.get(IExceptionMessage.EBICS_WRONG_PASSWORD));
} else {
bankOrderService.validate(bankOrder);
}
}
response.setReload(true);
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.
the class BankOrderController method setStatusCorrect.
public void setStatusCorrect(ActionRequest request, ActionResponse response) {
BankOrder bankOrder = request.getContext().asType(BankOrder.class);
bankOrder = Beans.get(BankOrderRepository.class).find(bankOrder.getId());
Beans.get(BankOrderService.class).setStatusToDraft(bankOrder);
response.setReload(true);
}
use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.
the class BankOrderController method fillBankDetails.
public void fillBankDetails(ActionRequest request, ActionResponse response) {
BankOrder bankOrder = request.getContext().asType(BankOrder.class);
BankDetails bankDetails = Beans.get(BankOrderService.class).getDefaultBankDetails(bankOrder);
response.setValue("senderBankDetails", bankDetails);
}
use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.
the class BankOrderController method resetReceivers.
public void resetReceivers(ActionRequest request, ActionResponse response) {
try {
BankOrder bankOrder = request.getContext().asType(BankOrder.class);
Beans.get(BankOrderService.class).resetReceivers(bankOrder);
response.setValue("bankOrderLineList", bankOrder.getBankOrderLineList());
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.
the class BankOrderLineController method computeCompanyCurrencyAmount.
public void computeCompanyCurrencyAmount(ActionRequest request, ActionResponse response) {
BankOrderLine bankOrderLine = request.getContext().asType(BankOrderLine.class);
BankOrder bankOrder = request.getContext().getParent().asType(BankOrder.class);
try {
response.setValue("companyCurrencyAmount", Beans.get(BankOrderLineService.class).computeCompanyCurrencyAmount(bankOrder, bankOrderLine));
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations