use of com.axelor.apps.bankpayment.db.BankStatement in project axelor-open-suite by axelor.
the class BankStatementManagementRepository method copy.
@Override
public BankStatement copy(BankStatement entity, boolean deep) {
BankStatement bankStatement = super.copy(entity, deep);
bankStatement.setStatusSelect(this.STATUS_RECEIVED);
return bankStatement;
}
use of com.axelor.apps.bankpayment.db.BankStatement in project axelor-open-suite by axelor.
the class BankReconciliationService method loadBankStatement.
@Transactional
public void loadBankStatement(BankReconciliation bankReconciliation, boolean includeBankStatement) {
BankStatement bankStatement = bankReconciliation.getBankStatement();
BankStatementFileFormat bankStatementFileFormat = bankStatement.getBankStatementFileFormat();
switch(bankStatementFileFormat.getStatementFileFormatSelect()) {
case BankStatementFileFormatRepository.FILE_FORMAT_CAMT_XXX_CFONB120_REP:
case BankStatementFileFormatRepository.FILE_FORMAT_CAMT_XXX_CFONB120_STM:
Beans.get(BankReconciliationLoadAFB120Service.class).loadBankStatement(bankReconciliation, includeBankStatement);
break;
default:
Beans.get(BankReconciliationLoadService.class).loadBankStatement(bankReconciliation, includeBankStatement);
}
compute(bankReconciliation);
bankReconciliationRepository.save(bankReconciliation);
}
use of com.axelor.apps.bankpayment.db.BankStatement in project axelor-open-suite by axelor.
the class BankStatementController method runBankReconciliation.
public void runBankReconciliation(ActionRequest request, ActionResponse response) {
try {
BankStatement bankStatement = request.getContext().asType(BankStatement.class);
bankStatement = Beans.get(BankStatementRepository.class).find(bankStatement.getId());
List<BankReconciliation> bankReconciliationList = Beans.get(BankReconciliationCreateService.class).createAllFromBankStatement(bankStatement);
if (bankReconciliationList != null) {
response.setView(ActionView.define(I18n.get("Bank reconciliations")).model(BankReconciliation.class.getName()).add("grid", "bank-reconciliation-grid").add("form", "bank-reconciliation-form").param("search-filters", "bank-reconciliation-filters").domain("self.id in (" + Joiner.on(",").join(bankReconciliationList.stream().map(BankReconciliation::getId).toArray()) + ")").map());
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
response.setReload(true);
}
use of com.axelor.apps.bankpayment.db.BankStatement in project axelor-open-suite by axelor.
the class BankStatementController method print.
public void print(ActionRequest request, ActionResponse response) {
try {
BankStatement bankStatement = request.getContext().asType(BankStatement.class);
bankStatement = Beans.get(BankStatementRepository.class).find(bankStatement.getId());
String name = bankStatement.getName();
String fileLink = Beans.get(BankStatementService.class).print(bankStatement);
response.setView(ActionView.define(name).add("html", fileLink).map());
} catch (Exception e) {
TraceBackService.trace(response, e);
}
response.setReload(true);
}
use of com.axelor.apps.bankpayment.db.BankStatement in project axelor-open-suite by axelor.
the class BankStatementCreateService method createBankStatement.
public BankStatement createBankStatement(File file, LocalDate fromDate, LocalDate toDate, BankStatementFileFormat bankStatementFileFormat, EbicsPartner ebicsPartner, LocalDateTime executionDateTime) throws IOException {
BankStatement bankStatement = new BankStatement();
bankStatement.setFromDate(fromDate);
bankStatement.setToDate(toDate);
bankStatement.setBankStatementFileFormat(bankStatementFileFormat);
bankStatement.setEbicsPartner(ebicsPartner);
bankStatement.setGetDateTime(executionDateTime);
bankStatement.setBankStatementFile(Beans.get(MetaFiles.class).upload(file));
bankStatement.setName(this.computeName(bankStatement));
bankStatement.setStatusSelect(BankStatementRepository.STATUS_RECEIVED);
return bankStatement;
}
Aggregations