Search in sources :

Example 1 with Pain00800101

use of com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.Pain00800101 in project axelor-open-suite by axelor.

the class BankOrderFile00800101Service method generateFile.

/**
 * Generates the XML SEPA Direct Debit file (pain.008.001.01)
 *
 * @return the SEPA Direct Debit file (pain.008.001.01)
 * @throws JAXBException
 * @throws IOException
 * @throws AxelorException
 * @throws DatatypeConfigurationException
 */
@Override
public File generateFile() throws JAXBException, IOException, AxelorException, DatatypeConfigurationException {
    // Creditor
    PartyIdentification8 creditor = factory.createPartyIdentification8();
    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.01">
     *     <pain.008.001.01>
     *         <GrpHdr>                 <-- occ : 1..1
     *         </GrpHdr>
     *         <PmtInf>                 <-- occ : 1..n
     *             <DrctDbtTxInf>       <-- occ : 1..n
     *             </DrctDbtTxInf>
     *         </PmtInf>
     *     </pain.008.001.01>
     * </Document>
     */
    /*
     * Document, <Document> tag
     */
    Document document = factory.createDocument();
    /*
     * pain.008.001.01, <pain.008.001.01> tag
     */
    Pain00800101 pain00800101 = factory.createPain00800101();
    document.setPain00800101(pain00800101);
    /*
     * Group Header, <GrpHdr> tag
     * Set of characteristics shared by all individual transactions included in the message.
     */
    GroupHeader1 groupHeader = factory.createGroupHeader1();
    createGrpHdr(groupHeader, creditor);
    pain00800101.setGrpHdr(groupHeader);
    /*
     * Payment Information, <PmtInf> tag
     * Does not need to set the List<PaymentInstructionInformation2> to the pain00800101 object (see doc).
     */
    createPmtInf(pain00800101.getPmtInf(), creditor);
    fileToCreate = factory.createDocument(document);
    return super.generateFile();
}
Also used : Pain00800101(com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.Pain00800101) PartyIdentification8(com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.PartyIdentification8) GroupHeader1(com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.GroupHeader1) Document(com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.Document)

Aggregations

Document (com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.Document)1 GroupHeader1 (com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.GroupHeader1)1 Pain00800101 (com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.Pain00800101)1 PartyIdentification8 (com.axelor.apps.bankpayment.xsd.sepa.pain_008_001_01.PartyIdentification8)1