I tried to create a xml based on the xml provided in the Factur-X 1.0.06 norm I retrieved here:
1. For Chrorus pro, credit note must be 380:
In code the default value is set to 381. I didn't try to send it to Chorus Pro. Here is your implementation in Invoice class.
public Invoice setCreditNote() {
this.documentCode = "381";
return this;
}
based on official facturx documentation, I should be able to set different values. The types of documents used are:
- 380: Commercial Invoice
- 381: Credit note
- 384: Corrected invoice
- 389: Self-billied invoice (created by the buyer on behalf of the supplier)
- 261: Self billed credit note (not accepted by CHORUSPRO)
- 386: Prepayment invoice
- 751: Invoice information for accounting purposes (not accepted by CHORUSPRO)
2. I have gross price that is appearing in my XML while I didn't set it :
This should be optional I guess.
<ram:SpecifiedLineTradeAgreement>
<ram:GrossPriceProductTradePrice>
<ram:ChargeAmount>4.1000</ram:ChargeAmount>
<ram:BasisQuantity unitCode="C62">1.0000</ram:BasisQuantity>
</ram:GrossPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
3. We can't override line total amount:
For example, calculated value should be 82.00 but there's a reduction on price.
Overriding line total amount is not working. I tried to set the value with :
.setLineTotalAmount(new BigDecimal("81.90"))
I also tried to do this in Item object. Without success.
4. Payment type code should be modified: 58 is not valid for Chorus
58 can not be used for Chorus, we should set it to 30 -> BT-81
In particular, the following codes can be used:
- 10: Species
- 20: Check
- 30: Transfer (includes SEPA transfer for CHORUSPRO)
- 42: Payment on bank account
- 48: Payment by credit card
- 49: Direct debit (includes SEPA Direct Debit for CHORUSPRO)
- 57 : Standing Agreement
- 58: SEPA transfer (not used for CHORUSPRO: code 30)
- 59: SEPA Direct Debit (not used for CHORUSPRO: code 49)
- 97: Report
- ZZZ: agreed amoung trading partners on interim basis
5. Bank Information issue:
In bank Id, we should be able to provide IBAN without BIC
I used :
.addBankDetails(new BankDetails(ownIBAN, ownBIC))
It generates:
<ram:PayeePartyCreditorFinancialAccount>
<ram:IBANID>FR2012421242124212421242124</ram:IBANID>
</ram:PayeePartyCreditorFinancialAccount>
<ram:PayeeSpecifiedCreditorFinancialInstitution>
<ram:BICID>COBADEFFXXX</ram:BICID>
</ram:PayeeSpecifiedCreditorFinancialInstitution>
6. Total Prepaid amount
We can't set total prepaid amount.
/**
* get the TotalPrepaidAmount located in
* SpecifiedTradeSettlementMonetarySummation (v1) or
* SpecifiedTradeSettlementHeaderMonetarySummation (v2)
*
* @return the total sum (incl. VAT) of prepayments, i.e. the difference between
* GrandTotalAmount and DuePayableAmount
*/
default BigDecimal getTotalPrepaidAmount() {
return BigDecimal.ZERO;
}
7. XML Schema invalid:
> The Factur-x XML file is not valid against the official XML Schema Definition. Here is the error, which may give you an idea on the cause of the problem: Element '{urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100}Description': This element is not expected., line 26.
When I create a product, description property is added:
<ram:SpecifiedTradeProduct>
<ram:Name>Huile d'olive à l'ancienne</ram:Name>
<ram:Description/>
</ram:SpecifiedTradeProduct>
4. For a product, I can't add global ID: SOLVED...
I was expecting this output:
<ram:GlobalID schemeID="0160">3518370200090</ram:GlobalID>
<ram:Name>Biscuits aux raisins 300g</ram:Name>
I didn't use the product constructor. Instead I used the builder:
product = new Product()
.setName("Nougat de l'Abbaye 250g")
.addGlobalID(new SchemedID("0160", "3518370400049"))
.setUnit("C62")
.setVATPercent(new BigDecimal(20));
item = new Item()
.setProduct(product)
.setPrice( new BigDecimal("4.10"))
.setQuantity(new BigDecimal(20))
.setLineTotalAmount(new BigDecimal("81.90"));
items.add(item);
Best regards
David Vera