use of com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_02.CustomerDirectDebitInitiationV02 in project axelor-open-suite by axelor.
the class BankOrderFile00800102Service method generateFile.
/**
* Generates the XML SEPA Direct Debit file (pain.008.001.02)
*
* @return the SEPA Direct Debit file (pain.008.001.02)
* @throws JAXBException
* @throws IOException
* @throws AxelorException
* @throws DatatypeConfigurationException
*/
@Override
public File generateFile() throws JAXBException, IOException, AxelorException, DatatypeConfigurationException {
// Creditor
PartyIdentification32 creditor = factory.createPartyIdentification32();
creditor.setNm(senderBankDetails.getOwnerName());
/*
* Hierarchy of a XML file
*
* GroupHeader : This building block is mandatory and present once.
* It contains elements such as Message Identification,
* Creation Date And Time, Grouping indicator.
* Payment Information : This building block is mandatory and repetitive.
* It contains, among other things, elements related
* to the Credit side of the transaction, such as
* Creditor and Payment Type Information.
* Direct Debit Transaction Information : This building block is mandatory and repetitive.
* It contains, among other things, elements related
* to the debit side of the transaction, such as
* Debtor and Remittance Information Rules.
*
* <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
* <Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02">
* <CstmrDrctDbtInitn>
* <GrpHdr> <-- occ : 1..1
* </GrpHdr>
* <PmtInf> <-- occ : 1..n
* <DrctDbtTxInf> <-- occ : 1..n
* </DrctDbtTxInf>
* </PmtInf>
* </CstmrDrctDbtInitn>
* </Document>
*/
/*
* Document, <Document> tag
*/
Document document = factory.createDocument();
/*
* Customer Direct Debit Initiation, <CstmrDrctDbtInitn> tag
*/
CustomerDirectDebitInitiationV02 customerDirectDebitInitiationV02 = factory.createCustomerDirectDebitInitiationV02();
document.setCstmrDrctDbtInitn(customerDirectDebitInitiationV02);
/*
* Group Header, <GrpHdr> tag
* Set of characteristics shared by all individual transactions included in the message.
*/
GroupHeader39 groupHeader = factory.createGroupHeader39();
createGrpHdr(groupHeader, creditor);
customerDirectDebitInitiationV02.setGrpHdr(groupHeader);
/*
* Payment Information, <PmtInf> tag
* Does not need to set the List<PaymentInstructionInformation4> to the customerDirectDebitInitiationV02 object (see doc).
*/
createPmtInf(customerDirectDebitInitiationV02.getPmtInf(), creditor);
fileToCreate = factory.createDocument(document);
return super.generateFile();
}
Aggregations