public class Invoice
extends java.lang.Object
Cross Industry Invoice
XPath:/rsm:CrossIndustryInvoice
Constructor and Description |
---|
Invoice(Identifier invoiceNumber,
Codes.InvoiceTypeCode invoiceTypeCode,
java.time.LocalDate invoiceIssueDate,
java.lang.String sellerName,
java.lang.String buyerName,
Codes.Currency invoiceCurrencyCode,
Amount invoiceTotalAmountWithoutVAT,
Amount invoiceTotalAmountWithVAT,
Amount amountDueForPayment)
Creates an Invoice object
|
Modifier and Type | Method and Description |
---|---|
PurchaseOrderReference |
appendNewPurchaseOrderReference()
Creates a PurchaseOrderReference object and appends it to the list obtainable by a call to get
getPurchaseOrderReferences() |
SellerVATIdentifier |
appendNewSellerVATIdentifier()
Creates a SellerVATIdentifier object and appends it to the list obtainable by a call to get
getSellerVATIdentifiers() |
static Invoice |
fromXML(java.lang.String fileName,
boolean recompute)
Creates and Invoice instance from a Factur-X XML document.
|
Amount |
getAmountDueForPayment()
BT-115:Amount due for payment
|
java.lang.String |
getBusinessProcessType()
BT-23:Business process type
|
Identifier |
getBuyerLegalOrganizationIdentifer()
BT-47:Buyer legal registration identifier
|
Codes.SchemeIdentifier |
getBuyerLegalOrganizationSchemeIdentiferAttribute()
BT-47-1:scheme identifier attribute
|
java.lang.String |
getBuyerName()
BT-44:Buyer name
|
java.lang.String |
getBuyerReference()
BT-10:Buyer reference
|
Codes.DateFormat |
getDateFormat()
BT-2-0:date format
|
Codes.Currency |
getInvoiceCurrencyCode()
BT-5:Invoice currency code
|
java.time.LocalDate |
getInvoiceIssueDate()
BT-2:Invoice issue date
|
Identifier |
getInvoiceNumber()
BT-1:Invoice number
|
Amount |
getInvoiceTotalAmountWithoutVAT()
BT-109:Invoice total amount without VAT
|
Amount |
getInvoiceTotalAmountWithVAT()
BT-112:Invoice total amount with VAT
|
Amount |
getInvoiceTotalVATAmount()
BT-110:Invoice total VAT amount
|
Codes.InvoiceTypeCode |
getInvoiceTypeCode()
BT-3:Invoice type code
|
java.util.List<PurchaseOrderReference> |
getPurchaseOrderReferences()
Returns a list of PurchaseOrderReference objects previously created by calls to
appendNewPurchaseOrderReference() |
Codes.CountryCodeList |
getSellerCountryCode()
BT-40:Seller country code
|
Identifier |
getSellerLegalOrganizationIdentifer()
BT-30:Seller legal registration identifier
|
Codes.SchemeIdentifier |
getSellerLegalOrganizationSchemeIdentiferAttribute()
BT-30-1:Seller legal registration identifier identification scheme identifier
|
java.lang.String |
getSellerName()
BT-27:Seller name
|
java.util.List<SellerVATIdentifier> |
getSellerVATIdentifiers()
Returns a list of SellerVATIdentifier objects previously created by calls to
appendNewSellerVATIdentifier() |
Identifier |
getSpecificationIdentifier()
BT-24:Specification identifier
|
Codes.Currency |
getVATCurrency()
BT-110-0:VAT currency
|
java.lang.String |
getXMLAsDataURL() |
void |
initForUnitTest()
Initializes in a way so that lists that have mandatory entries like VATBreakdowns are empty and need to be explicitly filled.
|
static java.lang.String |
joinVeryLongString(java.lang.String[] chunks)
to be used for strings exceeding the compiler limit of 2^16 bytes for a string constant
|
static void |
main(java.lang.String[] args) |
Invoice |
setAmountDueForPayment(Amount value) |
Invoice |
setBusinessProcessType(java.lang.String value) |
Invoice |
setBuyerLegalOrganizationIdentifer(Identifier value) |
Invoice |
setBuyerLegalOrganizationSchemeIdentiferAttribute(Codes.SchemeIdentifier value) |
Invoice |
setBuyerName(java.lang.String value) |
Invoice |
setBuyerReference(java.lang.String value) |
Invoice |
setInvoiceCurrencyCode(Codes.Currency value) |
Invoice |
setInvoiceIssueDate(java.time.LocalDate value) |
Invoice |
setInvoiceNumber(Identifier value) |
Invoice |
setInvoiceTotalAmountWithoutVAT(Amount value) |
Invoice |
setInvoiceTotalAmountWithVAT(Amount value) |
Invoice |
setInvoiceTotalVATAmount(Amount value) |
Invoice |
setInvoiceTypeCode(Codes.InvoiceTypeCode value) |
void |
setRecompute(boolean value)
Controls the computation of computed fields like
getInvoiceTotalAmountWithoutVAT()
By default the values are always computed but in the case that the values were explicitly set (e.g. |
Invoice |
setSellerCountryCode(Codes.CountryCodeList value) |
Invoice |
setSellerLegalOrganizationIdentifer(Identifier value) |
Invoice |
setSellerLegalOrganizationSchemeIdentiferAttribute(Codes.SchemeIdentifier value) |
Invoice |
setSellerName(java.lang.String value) |
Invoice |
setVATCurrency(Codes.Currency value) |
void |
toJUnitJavaSourceCode(java.io.PrintStream out,
java.lang.String packageName,
java.lang.String className,
java.lang.String referenceFilesDirectory)
Creates JUnit Java source code that will construct an Invoice instance identical with this Invoice from API calls and compare the produced XML against a reference file.
|
void |
toXML(java.io.PrintStream out)
Serializes to a Factur-X XML document that matches the profile specific XML Schema from the specification (in this version the file _Factur-X 1.0.06 2022 03 01 - FINAL EN/4.
|
void |
toXML(java.io.PrintWriter out)
Serializes to a Factur-X XML document that matches the profile specific XML Schema from the specification (in this version the file _Factur-X 1.0.06 2022 03 01 - FINAL EN/4.
|
public Invoice(Identifier invoiceNumber, Codes.InvoiceTypeCode invoiceTypeCode, java.time.LocalDate invoiceIssueDate, java.lang.String sellerName, java.lang.String buyerName, Codes.Currency invoiceCurrencyCode, Amount invoiceTotalAmountWithoutVAT, Amount invoiceTotalAmountWithVAT, Amount amountDueForPayment)
invoiceNumber
- BT-1:Invoice number
A unique identification of the Invoice.
The sequential number required in Article 226(2) of the directive 2006/112/EC [2], to uniquely identify the Invoice within the business context, time-frame, operating systems and records of the Seller. It may be based on one or more series of numbers, which may include alphanumeric characters. No identification scheme is to be used.
CHORUSPRO: the invoice number is limited to 20 characters
BR-2: An Invoice shall have an Invoice number (BT-1).
invoiceTypeCode
- BT-3:Invoice type code
A code specifying the functional type of the Invoice.
Commercial invoices and credit notes are defined according the entries in UNTDID 1001 [6].Other entries of UNTDID 1001 [6] with specific invoices or credit notes may be used if applicable.
The types of documents used are:380: Commercial Invoice381: Credit note384: Corrected invoice389: Self-billied invoice (created by the buyer on behalf of the supplier)261: Self billed credit note (not accepted by CHORUSPRO)386: Prepayment invoice751: Invoice information for accounting purposes (not accepted by CHORUSPRO)
BR-4: An Invoice shall have an Invoice type code (BT-3).
invoiceIssueDate
- BT-2:Invoice issue date
The date when the Invoice was issued.
CHORUSPRO: the issue date must be before or equal to the deposit date.
BR-3: An Invoice shall have an Invoice issue date (BT-2).
sellerName
- BT-27:Seller name
The full formal name by which the Seller is registered in the national registry of legal entities or as a Taxable person or otherwise trades as a person or persons.
BR-6: An Invoice shall contain the Seller name (BT-27).
buyerName
- BT-44:Buyer name
The full name of the Buyer.
CHORUS PRO: this field is limied to 99 characters.
BR-7: An Invoice shall contain the Buyer name (BT-44).
invoiceCurrencyCode
- BT-5:Invoice currency code
The currency in which all Invoice amounts are given, except for the Total VAT amount in accounting currency.
Only one currency shall be used in the Invoice, except for the Invoice total VAT amount in accounting currency (BT-111) in accordance with article 230 of Directive 2006/112/EC on VAT [2].The lists of valid currencies are registered with the ISO 4217 Maintenance Agency “Codes for the representation of currencies and funds”.
CHORUS PRO: Invoices and credit notes or Chorus Pro are mono-currencies only.
BR-5: An Invoice shall have an Invoice currency code (BT-5).
invoiceTotalAmountWithoutVAT
- BT-109:Invoice total amount without VAT
The total amount of the Invoice without VAT.
The Invoice total amount without VAT is the Sum of Invoice line net amount minus Sum of allowances on document level plus Sum of charges on document level.
BR-13: An Invoice shall have the Invoice total amount without VAT (BT-109).BR-CO-13: Invoice total amount without VAT (BT-109) = ? Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108).
invoiceTotalAmountWithVAT
- BT-112:Invoice total amount with VAT
The total amount of the Invoice with VAT.
The Invoice total amount with VAT is the Invoice total amount without VAT plus the Invoice total VAT amount.
BR-14: An Invoice shall have the Invoice total amount with VAT (BT-112).BR-CO-15: Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).
amountDueForPayment
- BT-115:Amount due for payment
The outstanding amount that is requested to be paid.
This amount is the Invoice total amount with VAT minus the paid amount that has been paid in advance. The amount is zero in case of a fully paid Invoice. The amount may be negative; in that case the Seller owes the amount to the Buyer.
BR-15: An Invoice shall have the Amount due for payment (BT- 115).BR-CO-16: Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) + Rounding amount (BT-114).
public void setRecompute(boolean value)
getInvoiceTotalAmountWithoutVAT()
By default the values are always computed but in the case that the values were explicitly set (e.g. after creating and instance via fromXML(String,boolean)
), it might be desirable to obtain the explicitly set values instead.value
- whether or not to ignore explicitly set values of computed fields and work with computed values insteadpublic void initForUnitTest()
public SellerVATIdentifier appendNewSellerVATIdentifier()
getSellerVATIdentifiers()
public PurchaseOrderReference appendNewPurchaseOrderReference()
getPurchaseOrderReferences()
public java.util.List<SellerVATIdentifier> getSellerVATIdentifiers()
appendNewSellerVATIdentifier()
public java.util.List<PurchaseOrderReference> getPurchaseOrderReferences()
appendNewPurchaseOrderReference()
public Invoice setBusinessProcessType(java.lang.String value)
value
- BT-23:Business process type
Identifies the business process context in which the transaction appears, to enable the Buyer to process the Invoice in an appropriate way.
To be specified by the Buyer.
CHORUSPRO: this data makes it possible to inform the "cadre de facturation" (billing framework, which could be invoice from agent, co-contractor, subcontractor, invoicing part of a public works contract, etc.). The codes to be used are defined in the CHORUSPRO specifications: A1 (invoice deposit), A2 (prepaid invoice deposit), ... By default (in the absence of this field), the case A1 is applied.
XPath:/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:BusinessProcessSpecifiedDocumentContextParameter/ram:ID
public Invoice setInvoiceNumber(Identifier value)
value
- BT-1:Invoice number
A unique identification of the Invoice.
The sequential number required in Article 226(2) of the directive 2006/112/EC [2], to uniquely identify the Invoice within the business context, time-frame, operating systems and records of the Seller. It may be based on one or more series of numbers, which may include alphanumeric characters. No identification scheme is to be used.
CHORUSPRO: the invoice number is limited to 20 characters
BR-2: An Invoice shall have an Invoice number (BT-1).
XPath:/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:ID
public Invoice setInvoiceTypeCode(Codes.InvoiceTypeCode value)
value
- BT-3:Invoice type code
A code specifying the functional type of the Invoice.
Commercial invoices and credit notes are defined according the entries in UNTDID 1001 [6].Other entries of UNTDID 1001 [6] with specific invoices or credit notes may be used if applicable.
The types of documents used are:380: Commercial Invoice381: Credit note384: Corrected invoice389: Self-billied invoice (created by the buyer on behalf of the supplier)261: Self billed credit note (not accepted by CHORUSPRO)386: Prepayment invoice751: Invoice information for accounting purposes (not accepted by CHORUSPRO)
BR-4: An Invoice shall have an Invoice type code (BT-3).
XPath:/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:TypeCode
public Invoice setInvoiceIssueDate(java.time.LocalDate value)
value
- BT-2:Invoice issue date
The date when the Invoice was issued.
CHORUSPRO: the issue date must be before or equal to the deposit date.
BR-3: An Invoice shall have an Invoice issue date (BT-2).
XPath:/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString
public Invoice setBuyerReference(java.lang.String value)
value
- BT-10:Buyer reference
An identifier assigned by the Buyer used for internal routing purposes.
The identifier is defined by the Buyer (e.g. contact ID, department, office id, project code), but provided by the Seller in the Invoice.
CHORUS PRO: for the public sector, it is the "Service Exécutant". It is mandatory for some buyers. It must belong to the Chorus Pro repository. It is limited to 100 characters.
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerReference
public Invoice setSellerName(java.lang.String value)
value
- BT-27:Seller name
The full formal name by which the Seller is registered in the national registry of legal entities or as a Taxable person or otherwise trades as a person or persons.
BR-6: An Invoice shall contain the Seller name (BT-27).
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:Name
public Invoice setSellerLegalOrganizationSchemeIdentiferAttribute(Codes.SchemeIdentifier value)
value
- BT-30-1:Seller legal registration identifier identification scheme identifier
The identification scheme identifier of the Seller legal registration identifier.
If used, the identification scheme identifier shall be chosen from the entries of the list published by the ISO/IEC 6523 maintenance agency.
For a SIREN or a SIRET, the value of this field is "0002"
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization/ram:ID/@schemeID
public Invoice setSellerLegalOrganizationIdentifer(Identifier value)
value
- BT-30:Seller legal registration identifier
An identifier issued by an official registrar that identifies the Seller as a legal entity or person.
If no identification scheme is specified, it should be known by Buyer and Seller.
BR-CO-26: In order for the buyer to automatically identify a supplier, the Seller identifier (BT-29), the Seller legal registration identifier (BT-30) and/or the Seller VAT identifier (BT-31) shall be present.
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization/ram:ID
public Invoice setSellerCountryCode(Codes.CountryCodeList value)
value
- BT-40:Seller country code
A code that identifies the country.
If no tax representative is specified, this is the country where VAT is liable. The lists of valid countries are registered with the EN ISO 3166-1 Maintenance agency, “Codes for the representation of names of countries and their subdivisions”.
BR-9: The Seller postal address (BG-5) shall contain a Seller country code (BT-40).
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID
public Invoice setBuyerName(java.lang.String value)
value
- BT-44:Buyer name
The full name of the Buyer.
CHORUS PRO: this field is limied to 99 characters.
BR-7: An Invoice shall contain the Buyer name (BT-44).
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:Name
public Invoice setBuyerLegalOrganizationSchemeIdentiferAttribute(Codes.SchemeIdentifier value)
value
- BT-47-1:scheme identifier attribute
Scheme identifier for Buyer legal identifier
If used, the identification scheme identifier shall be chosen from the entries of the list published by the ISO/IEC 6523 maintenance agency.
For a SIREN or a SIRET, the value of this field is "0002"
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedLegalOrganization/ram:ID/@schemeID
public Invoice setBuyerLegalOrganizationIdentifer(Identifier value)
value
- BT-47:Buyer legal registration identifier
An identifier issued by an official registrar that identifies the Buyer as a legal entity or person.The identification scheme identifier of the Buyer legal registration identifier.
If no identification scheme is specified, it should be known by Buyer and Seller, e.g. the identifier that is exclusively used in the applicable legal environment.If used, the identification scheme shall be chosen from the entries of the list published by the ISO/IEC 6523 maintenance agency.
CHORUSPRO: the identifier of the buyer (public entity) is mandatory and is always a SIRET number
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedLegalOrganization/ram:ID
public Invoice setInvoiceCurrencyCode(Codes.Currency value)
value
- BT-5:Invoice currency code
The currency in which all Invoice amounts are given, except for the Total VAT amount in accounting currency.
Only one currency shall be used in the Invoice, except for the Invoice total VAT amount in accounting currency (BT-111) in accordance with article 230 of Directive 2006/112/EC on VAT [2].The lists of valid currencies are registered with the ISO 4217 Maintenance Agency “Codes for the representation of currencies and funds”.
CHORUS PRO: Invoices and credit notes or Chorus Pro are mono-currencies only.
BR-5: An Invoice shall have an Invoice currency code (BT-5).
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode
public Invoice setInvoiceTotalAmountWithoutVAT(Amount value)
value
- BT-109:Invoice total amount without VAT
The total amount of the Invoice without VAT.
The Invoice total amount without VAT is the Sum of Invoice line net amount minus Sum of allowances on document level plus Sum of charges on document level.
BR-13: An Invoice shall have the Invoice total amount without VAT (BT-109).BR-CO-13: Invoice total amount without VAT (BT-109) = ? Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108).
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxBasisTotalAmount
public Invoice setVATCurrency(Codes.Currency value)
value
- BT-110-0:VAT currency
@currencyID is mandatory to differentiate between VAT amount and VAT amount in accounting currency.
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount/@currencyID
public Invoice setInvoiceTotalVATAmount(Amount value)
value
- BT-110:Invoice total VAT amount
The total VAT amount for the Invoice.
The Invoice total VAT amount is the sum of all VAT category tax amounts.
BR-CO-14: Invoice total VAT amount (BT-110) = ? VAT category tax amount (BT-117).
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount
public Invoice setInvoiceTotalAmountWithVAT(Amount value)
value
- BT-112:Invoice total amount with VAT
The total amount of the Invoice with VAT.
The Invoice total amount with VAT is the Invoice total amount without VAT plus the Invoice total VAT amount.
BR-14: An Invoice shall have the Invoice total amount with VAT (BT-112).BR-CO-15: Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:GrandTotalAmount
public Invoice setAmountDueForPayment(Amount value)
value
- BT-115:Amount due for payment
The outstanding amount that is requested to be paid.
This amount is the Invoice total amount with VAT minus the paid amount that has been paid in advance. The amount is zero in case of a fully paid Invoice. The amount may be negative; in that case the Seller owes the amount to the Buyer.
BR-15: An Invoice shall have the Amount due for payment (BT- 115).BR-CO-16: Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) + Rounding amount (BT-114).
XPath:/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:DuePayableAmount
public java.lang.String getBusinessProcessType()
Identifies the business process context in which the transaction appears, to enable the Buyer to process the Invoice in an appropriate way.
To be specified by the Buyer.
CHORUSPRO: this data makes it possible to inform the "cadre de facturation" (billing framework, which could be invoice from agent, co-contractor, subcontractor, invoicing part of a public works contract, etc.). The codes to be used are defined in the CHORUSPRO specifications: A1 (invoice deposit), A2 (prepaid invoice deposit), ... By default (in the absence of this field), the case A1 is applied.
public Identifier getSpecificationIdentifier() throws ComputationException
An identification of the specification containing the total set of rules regarding semantic content, cardinalities and business rules to which the data contained in the instance document conforms.
This identifies compliance or conformance to this document. Compliant invoices specify: urn:cen.eu:en16931:2017. Invoices, compliant to a user specification may identify that user specification here.No identification scheme is to be used.
For profile Minimum : urn:factur-x.eu:1p0:minimumFor profile BASIC WL : urn:factur-x.eu:1p0:basicwlFor profile BASIC : urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basicFor Profile EN 16931 (Comfort) : urn:cen.eu:en16931:2017For Profile EXTENDED : urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended
BR-1: An Invoice shall have a Specification identifier (BT-24).
setRecompute(boolean)
has been called with a value of false in which case the value /rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID is returnedComputationException
public Identifier getInvoiceNumber()
A unique identification of the Invoice.
The sequential number required in Article 226(2) of the directive 2006/112/EC [2], to uniquely identify the Invoice within the business context, time-frame, operating systems and records of the Seller. It may be based on one or more series of numbers, which may include alphanumeric characters. No identification scheme is to be used.
CHORUSPRO: the invoice number is limited to 20 characters
BR-2: An Invoice shall have an Invoice number (BT-1).
public Codes.InvoiceTypeCode getInvoiceTypeCode()
A code specifying the functional type of the Invoice.
Commercial invoices and credit notes are defined according the entries in UNTDID 1001 [6].Other entries of UNTDID 1001 [6] with specific invoices or credit notes may be used if applicable.
The types of documents used are:380: Commercial Invoice381: Credit note384: Corrected invoice389: Self-billied invoice (created by the buyer on behalf of the supplier)261: Self billed credit note (not accepted by CHORUSPRO)386: Prepayment invoice751: Invoice information for accounting purposes (not accepted by CHORUSPRO)
BR-4: An Invoice shall have an Invoice type code (BT-3).
public Codes.DateFormat getDateFormat() throws ComputationException
Value= 102
Only value "102"
setRecompute(boolean)
has been called with a value of false in which case the value /rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString/@format is returnedComputationException
public java.time.LocalDate getInvoiceIssueDate()
The date when the Invoice was issued.
CHORUSPRO: the issue date must be before or equal to the deposit date.
BR-3: An Invoice shall have an Invoice issue date (BT-2).
public java.lang.String getBuyerReference()
An identifier assigned by the Buyer used for internal routing purposes.
The identifier is defined by the Buyer (e.g. contact ID, department, office id, project code), but provided by the Seller in the Invoice.
CHORUS PRO: for the public sector, it is the "Service Exécutant". It is mandatory for some buyers. It must belong to the Chorus Pro repository. It is limited to 100 characters.
public java.lang.String getSellerName()
The full formal name by which the Seller is registered in the national registry of legal entities or as a Taxable person or otherwise trades as a person or persons.
BR-6: An Invoice shall contain the Seller name (BT-27).
public Codes.SchemeIdentifier getSellerLegalOrganizationSchemeIdentiferAttribute()
The identification scheme identifier of the Seller legal registration identifier.
If used, the identification scheme identifier shall be chosen from the entries of the list published by the ISO/IEC 6523 maintenance agency.
For a SIREN or a SIRET, the value of this field is "0002"
public Identifier getSellerLegalOrganizationIdentifer()
An identifier issued by an official registrar that identifies the Seller as a legal entity or person.
If no identification scheme is specified, it should be known by Buyer and Seller.
BR-CO-26: In order for the buyer to automatically identify a supplier, the Seller identifier (BT-29), the Seller legal registration identifier (BT-30) and/or the Seller VAT identifier (BT-31) shall be present.
public Codes.CountryCodeList getSellerCountryCode()
A code that identifies the country.
If no tax representative is specified, this is the country where VAT is liable. The lists of valid countries are registered with the EN ISO 3166-1 Maintenance agency, “Codes for the representation of names of countries and their subdivisions”.
BR-9: The Seller postal address (BG-5) shall contain a Seller country code (BT-40).
public java.lang.String getBuyerName()
The full name of the Buyer.
CHORUS PRO: this field is limied to 99 characters.
BR-7: An Invoice shall contain the Buyer name (BT-44).
public Codes.SchemeIdentifier getBuyerLegalOrganizationSchemeIdentiferAttribute()
Scheme identifier for Buyer legal identifier
If used, the identification scheme identifier shall be chosen from the entries of the list published by the ISO/IEC 6523 maintenance agency.
For a SIREN or a SIRET, the value of this field is "0002"
public Identifier getBuyerLegalOrganizationIdentifer()
An identifier issued by an official registrar that identifies the Buyer as a legal entity or person.The identification scheme identifier of the Buyer legal registration identifier.
If no identification scheme is specified, it should be known by Buyer and Seller, e.g. the identifier that is exclusively used in the applicable legal environment.If used, the identification scheme shall be chosen from the entries of the list published by the ISO/IEC 6523 maintenance agency.
CHORUSPRO: the identifier of the buyer (public entity) is mandatory and is always a SIRET number
public Codes.Currency getInvoiceCurrencyCode()
The currency in which all Invoice amounts are given, except for the Total VAT amount in accounting currency.
Only one currency shall be used in the Invoice, except for the Invoice total VAT amount in accounting currency (BT-111) in accordance with article 230 of Directive 2006/112/EC on VAT [2].The lists of valid currencies are registered with the ISO 4217 Maintenance Agency “Codes for the representation of currencies and funds”.
CHORUS PRO: Invoices and credit notes or Chorus Pro are mono-currencies only.
BR-5: An Invoice shall have an Invoice currency code (BT-5).
public Amount getInvoiceTotalAmountWithoutVAT()
The total amount of the Invoice without VAT.
The Invoice total amount without VAT is the Sum of Invoice line net amount minus Sum of allowances on document level plus Sum of charges on document level.
BR-13: An Invoice shall have the Invoice total amount without VAT (BT-109).BR-CO-13: Invoice total amount without VAT (BT-109) = ? Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108).
public Codes.Currency getVATCurrency()
@currencyID is mandatory to differentiate between VAT amount and VAT amount in accounting currency.
public Amount getInvoiceTotalVATAmount()
The total VAT amount for the Invoice.
The Invoice total VAT amount is the sum of all VAT category tax amounts.
BR-CO-14: Invoice total VAT amount (BT-110) = ? VAT category tax amount (BT-117).
public Amount getInvoiceTotalAmountWithVAT()
The total amount of the Invoice with VAT.
The Invoice total amount with VAT is the Invoice total amount without VAT plus the Invoice total VAT amount.
BR-14: An Invoice shall have the Invoice total amount with VAT (BT-112).BR-CO-15: Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).
public Amount getAmountDueForPayment()
The outstanding amount that is requested to be paid.
This amount is the Invoice total amount with VAT minus the paid amount that has been paid in advance. The amount is zero in case of a fully paid Invoice. The amount may be negative; in that case the Seller owes the amount to the Buyer.
BR-15: An Invoice shall have the Amount due for payment (BT- 115).BR-CO-16: Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) + Rounding amount (BT-114).
public void toXML(java.io.PrintStream out) throws java.io.IOException, FacturXException
out
- the print stream to write tojava.io.IOException
FacturXException
public void toXML(java.io.PrintWriter out) throws java.io.IOException, FacturXException
out
- the print stream to write tojava.io.IOException
FacturXException
public java.lang.String getXMLAsDataURL() throws java.io.IOException, FacturXException
java.io.IOException
FacturXException
public void toJUnitJavaSourceCode(java.io.PrintStream out, java.lang.String packageName, java.lang.String className, java.lang.String referenceFilesDirectory) throws FacturXException
out
- the print stream to write topackageName
- the package name to use in the package declarationclassName
- the name to use as class name for the test classreferenceFilesDirectory
- the directory in which the test expects the reference output xml file that is named className+".xml"
FacturXException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static java.lang.String joinVeryLongString(java.lang.String[] chunks)
public static Invoice fromXML(java.lang.String fileName, boolean recompute) throws java.io.IOException
fileName
- the Factur-X XML file to read fromrecompute
- specifies whether or not computed fields are computed or the values from the file are used insteadjava.io.IOException