use of org.estatio.module.financial.dom.BankAccount in project estatio by estatio.
the class InvoiceAttributesVM method getSellerBankAccountBankName.
@Programmatic
public String getSellerBankAccountBankName() {
FinancialAccount financialAccount = invoice.getSellerBankAccount();
if (!(financialAccount instanceof BankAccount)) {
return null;
}
final BankAccount bankAccount = (BankAccount) financialAccount;
Party bank = bankAccount.getBank();
if (bank == null) {
return null;
}
return bank.getName();
}
use of org.estatio.module.financial.dom.BankAccount in project estatio by estatio.
the class InvoiceAttributesVM method getSellerBankAccountIban.
@Programmatic
public String getSellerBankAccountIban() {
FinancialAccount financialAccount = invoice.getSellerBankAccount();
if (!(financialAccount instanceof BankAccount)) {
return null;
}
final BankAccount bankAccount = (BankAccount) financialAccount;
return bankAccount.getIban();
}
use of org.estatio.module.financial.dom.BankAccount in project estatio by estatio.
the class SellerBankAccountCreator_createBankAccount method act.
public SellerBankAccountCreator act(final String ibanNumber) {
bankAccountRepository.newBankAccount(sellerBankAccountCreator.getSeller(), ibanNumber, null);
// not exactly sure why, but this lookup is required (instead of setting bankaccount right away) in order that jaxb viewmodel is recreated correctly (otherwise we get an empty bank account).
final BankAccount bankAccount = bankAccountRepository.findBankAccountByReference(sellerBankAccountCreator.getSeller(), ibanNumber);
sellerBankAccountCreator.setBankAccount(bankAccount);
return sellerBankAccountCreator;
}
use of org.estatio.module.financial.dom.BankAccount in project estatio by estatio.
the class CreditTransfer method asXml.
@Programmatic
public CreditTransferTransactionInformation10 asXml() {
CreditTransferTransactionInformation10 cdtTrfTxInf = new CreditTransferTransactionInformation10();
PaymentIdentification1 pmtId = new PaymentIdentification1();
cdtTrfTxInf.setPmtId(pmtId);
pmtId.setEndToEndId(getEndToEndId());
AmountType3Choice amt = new AmountType3Choice();
cdtTrfTxInf.setAmt(amt);
ActiveOrHistoricCurrencyAndAmount instdAmt = new ActiveOrHistoricCurrencyAndAmount();
amt.setInstdAmt(instdAmt);
instdAmt.setCcy(getCurrency().getReference().trim());
instdAmt.setValue(getAmount());
BankAccount creditorBankAccount = this.getSellerBankAccount();
cdtTrfTxInf.setCdtrAgt(PaymentBatch.agentFor(creditorBankAccount));
cdtTrfTxInf.setCdtrAcct(PaymentBatch.cashAccountFor(creditorBankAccount));
PartyIdentification32 cdtr = new PartyIdentification32();
cdtTrfTxInf.setCdtr(cdtr);
cdtr.setNm(getSeller().getName());
PostalAddress6 pstlAdr = new PostalAddress6();
cdtr.setPstlAdr(pstlAdr);
pstlAdr.setCtry(PaymentBatch.ctryFor(getSeller()));
RemittanceInformation5 rmtInf = new RemittanceInformation5();
cdtTrfTxInf.setRmtInf(rmtInf);
List<String> ustrdList = rmtInf.getUstrds();
ustrdList.add(getRemittanceInformation());
return cdtTrfTxInf;
}
use of org.estatio.module.financial.dom.BankAccount in project estatio by estatio.
the class BankAccountVerificationStateSubscriber method attachDocumentAsPossibleIbanProofIfNone.
private void attachDocumentAsPossibleIbanProofIfNone(final IncomingInvoice incomingInvoice) {
final BankAccount bankAccount = incomingInvoice.getBankAccount();
if (bankAccount == null) {
return;
}
// if already have some proof, then no need to attach any other
final Optional<Document> currentProofIfAny = lookupAttachedPdfService.lookupIbanProofPdfFrom(bankAccount);
if (currentProofIfAny.isPresent()) {
return;
}
// else, attach this invoice as possible iban proof.
final Optional<Document> documentIfAny = lookupAttachedPdfService.lookupIncomingInvoicePdfFrom(incomingInvoice);
if (documentIfAny.isPresent()) {
final Document document = documentIfAny.get();
paperclipRepository.attach(document, BankAccount_attachPdfAsIbanProof.ROLE_NAME_FOR_IBAN_PROOF, bankAccount);
}
}
Aggregations