Class Invoice
- java.lang.Object
-
- com.fourjs.report.facturx.profiles.minimum.Invoice
-
public class Invoice extends Object
BG-0:InvoiceCross Industry Invoice
XPath:/rsm:CrossIndustryInvoice
-
-
Constructor Summary
Constructors Constructor Description Invoice(Identifier invoiceNumber, Codes.InvoiceTypeCode invoiceTypeCode, LocalDate invoiceIssueDate, String sellerName, String buyerName, Codes.Currency invoiceCurrencyCode, Amount invoiceTotalAmountWithoutVAT, Amount invoiceTotalAmountWithVAT, Amount amountDueForPayment)
Creates an Invoice object
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PurchaseOrderReference
appendNewPurchaseOrderReference()
Creates a PurchaseOrderReference object and appends it to the list obtainable by a call to getgetPurchaseOrderReferences()
SellerVATIdentifier
appendNewSellerVATIdentifier()
Creates a SellerVATIdentifier object and appends it to the list obtainable by a call to getgetSellerVATIdentifiers()
static Invoice
fromXML(String fileName, boolean recompute)
Creates and Invoice instance from a Factur-X XML document.Amount
getAmountDueForPayment()
BT-115:Amount due for paymentString
getBusinessProcessType()
BT-23:Business process typeIdentifier
getBuyerLegalOrganizationIdentifer()
BT-47:Buyer legal registration identifierCodes.SchemeIdentifier
getBuyerLegalOrganizationSchemeIdentiferAttribute()
BT-47-1:scheme identifier attributeString
getBuyerName()
BT-44:Buyer nameString
getBuyerReference()
BT-10:Buyer referenceCodes.DateFormat
getDateFormat()
BT-2-0:date formatCodes.Currency
getInvoiceCurrencyCode()
BT-5:Invoice currency codeLocalDate
getInvoiceIssueDate()
BT-2:Invoice issue dateIdentifier
getInvoiceNumber()
BT-1:Invoice numberAmount
getInvoiceTotalAmountWithoutVAT()
BT-109:Invoice total amount without VATAmount
getInvoiceTotalAmountWithVAT()
BT-112:Invoice total amount with VATAmount
getInvoiceTotalVATAmount()
BT-110:Invoice total VAT amountCodes.InvoiceTypeCode
getInvoiceTypeCode()
BT-3:Invoice type codeList<PurchaseOrderReference>
getPurchaseOrderReferences()
Returns a list of PurchaseOrderReference objects previously created by calls toappendNewPurchaseOrderReference()
Codes.CountryCodeList
getSellerCountryCode()
BT-40:Seller country codeIdentifier
getSellerLegalOrganizationIdentifer()
BT-30:Seller legal registration identifierCodes.SchemeIdentifier
getSellerLegalOrganizationSchemeIdentiferAttribute()
BT-30-1:Seller legal registration identifier identification scheme identifierString
getSellerName()
BT-27:Seller nameList<SellerVATIdentifier>
getSellerVATIdentifiers()
Returns a list of SellerVATIdentifier objects previously created by calls toappendNewSellerVATIdentifier()
Identifier
getSpecificationIdentifier()
BT-24:Specification identifierCodes.Currency
getVATCurrency()
BT-110-0:VAT currencyString
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 String
joinVeryLongString(String[] chunks)
to be used for strings exceeding the compiler limit of 2^16 bytes for a string constantstatic void
main(String[] args)
Invoice
setAmountDueForPayment(Amount value)
Invoice
setBusinessProcessType(String value)
Invoice
setBuyerLegalOrganizationIdentifer(Identifier value)
Invoice
setBuyerLegalOrganizationSchemeIdentiferAttribute(Codes.SchemeIdentifier value)
Invoice
setBuyerName(String value)
Invoice
setBuyerReference(String value)
Invoice
setInvoiceCurrencyCode(Codes.Currency value)
Invoice
setInvoiceIssueDate(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 likegetInvoiceTotalAmountWithoutVAT()
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(String value)
Invoice
setVATCurrency(Codes.Currency value)
void
toJUnitJavaSourceCode(PrintStream out, String packageName, String className, 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(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(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.
-
-
-
Constructor Detail
-
Invoice
public Invoice(Identifier invoiceNumber, Codes.InvoiceTypeCode invoiceTypeCode, LocalDate invoiceIssueDate, String sellerName, String buyerName, Codes.Currency invoiceCurrencyCode, Amount invoiceTotalAmountWithoutVAT, Amount invoiceTotalAmountWithVAT, Amount amountDueForPayment)
Creates an Invoice object- Parameters:
invoiceNumber
- BT-1:Invoice numberA 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 codeA 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 dateThe 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 nameThe 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 nameThe 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 codeThe 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 VATThe 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 VATThe 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 paymentThe 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).
-
-
Method Detail
-
setRecompute
public void setRecompute(boolean value)
Controls the computation of computed fields likegetInvoiceTotalAmountWithoutVAT()
By default the values are always computed but in the case that the values were explicitly set (e.g. after creating and instance viafromXML(String,boolean)
), it might be desirable to obtain the explicitly set values instead.- Parameters:
value
- whether or not to ignore explicitly set values of computed fields and work with computed values instead
-
initForUnitTest
public void initForUnitTest()
Initializes in a way so that lists that have mandatory entries like VATBreakdowns are empty and need to be explicitly filled.
-
appendNewSellerVATIdentifier
public SellerVATIdentifier appendNewSellerVATIdentifier()
Creates a SellerVATIdentifier object and appends it to the list obtainable by a call to getgetSellerVATIdentifiers()
- Returns:
- SellerVATIdentifier
-
appendNewPurchaseOrderReference
public PurchaseOrderReference appendNewPurchaseOrderReference()
Creates a PurchaseOrderReference object and appends it to the list obtainable by a call to getgetPurchaseOrderReferences()
- Returns:
- PurchaseOrderReference
-
getSellerVATIdentifiers
public List<SellerVATIdentifier> getSellerVATIdentifiers()
Returns a list of SellerVATIdentifier objects previously created by calls toappendNewSellerVATIdentifier()
-
getPurchaseOrderReferences
public List<PurchaseOrderReference> getPurchaseOrderReferences()
Returns a list of PurchaseOrderReference objects previously created by calls toappendNewPurchaseOrderReference()
-
setBusinessProcessType
public Invoice setBusinessProcessType(String value)
- Parameters:
value
- BT-23:Business process typeIdentifies 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
- Returns:
- Invoice
-
setInvoiceNumber
public Invoice setInvoiceNumber(Identifier value)
- Parameters:
value
- BT-1:Invoice numberA 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
- Returns:
- Invoice
-
setInvoiceTypeCode
public Invoice setInvoiceTypeCode(Codes.InvoiceTypeCode value)
- Parameters:
value
- BT-3:Invoice type codeA 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
- Returns:
- Invoice
-
setInvoiceIssueDate
public Invoice setInvoiceIssueDate(LocalDate value)
- Parameters:
value
- BT-2:Invoice issue dateThe 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
- Returns:
- Invoice
-
setBuyerReference
public Invoice setBuyerReference(String value)
- Parameters:
value
- BT-10:Buyer referenceAn 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
- Returns:
- Invoice
-
setSellerName
public Invoice setSellerName(String value)
- Parameters:
value
- BT-27:Seller nameThe 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
- Returns:
- Invoice
-
setSellerLegalOrganizationSchemeIdentiferAttribute
public Invoice setSellerLegalOrganizationSchemeIdentiferAttribute(Codes.SchemeIdentifier value)
- Parameters:
value
- BT-30-1:Seller legal registration identifier identification scheme identifierThe 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
- Returns:
- Invoice
-
setSellerLegalOrganizationIdentifer
public Invoice setSellerLegalOrganizationIdentifer(Identifier value)
- Parameters:
value
- BT-30:Seller legal registration identifierAn 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
- Returns:
- Invoice
-
setSellerCountryCode
public Invoice setSellerCountryCode(Codes.CountryCodeList value)
- Parameters:
value
- BT-40:Seller country codeA 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
- Returns:
- Invoice
-
setBuyerName
public Invoice setBuyerName(String value)
- Parameters:
value
- BT-44:Buyer nameThe 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
- Returns:
- Invoice
-
setBuyerLegalOrganizationSchemeIdentiferAttribute
public Invoice setBuyerLegalOrganizationSchemeIdentiferAttribute(Codes.SchemeIdentifier value)
- Parameters:
value
- BT-47-1:scheme identifier attributeScheme 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
- Returns:
- Invoice
-
setBuyerLegalOrganizationIdentifer
public Invoice setBuyerLegalOrganizationIdentifer(Identifier value)
- Parameters:
value
- BT-47:Buyer legal registration identifierAn 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
- Returns:
- Invoice
-
setInvoiceCurrencyCode
public Invoice setInvoiceCurrencyCode(Codes.Currency value)
- Parameters:
value
- BT-5:Invoice currency codeThe 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
- Returns:
- Invoice
-
setInvoiceTotalAmountWithoutVAT
public Invoice setInvoiceTotalAmountWithoutVAT(Amount value)
- Parameters:
value
- BT-109:Invoice total amount without VATThe 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
- Returns:
- Invoice
-
setVATCurrency
public Invoice setVATCurrency(Codes.Currency value)
- Parameters:
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
- Returns:
- Invoice
-
setInvoiceTotalVATAmount
public Invoice setInvoiceTotalVATAmount(Amount value)
- Parameters:
value
- BT-110:Invoice total VAT amountThe 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
- Returns:
- Invoice
-
setInvoiceTotalAmountWithVAT
public Invoice setInvoiceTotalAmountWithVAT(Amount value)
- Parameters:
value
- BT-112:Invoice total amount with VATThe 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
- Returns:
- Invoice
-
setAmountDueForPayment
public Invoice setAmountDueForPayment(Amount value)
- Parameters:
value
- BT-115:Amount due for paymentThe 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
- Returns:
- Invoice
-
getBusinessProcessType
public String getBusinessProcessType()
BT-23:Business process typeIdentifies 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.
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:BusinessProcessSpecifiedDocumentContextParameter/ram:ID
-
getSpecificationIdentifier
public Identifier getSpecificationIdentifier() throws ComputationException
BT-24:Specification identifierAn 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).
- Returns:
- a computed value unless an explicit value has been set and
setRecompute(boolean)
has been called with a value of false in which case the value /rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID is returned - Throws:
ComputationException
-
getInvoiceNumber
public Identifier getInvoiceNumber()
BT-1:Invoice numberA 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).
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:ID
-
getInvoiceTypeCode
public Codes.InvoiceTypeCode getInvoiceTypeCode()
BT-3:Invoice type codeA 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).
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:TypeCode
-
getDateFormat
public Codes.DateFormat getDateFormat() throws ComputationException
BT-2-0:date formatValue= 102
Only value "102"
- Returns:
- a computed value unless an explicit value has been set and
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 returned - Throws:
ComputationException
-
getInvoiceIssueDate
public LocalDate getInvoiceIssueDate()
BT-2:Invoice issue dateThe 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).
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString
-
getBuyerReference
public String getBuyerReference()
BT-10:Buyer referenceAn 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.
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerReference
-
getSellerName
public String getSellerName()
BT-27:Seller nameThe 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).
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:Name
-
getSellerLegalOrganizationSchemeIdentiferAttribute
public Codes.SchemeIdentifier getSellerLegalOrganizationSchemeIdentiferAttribute()
BT-30-1:Seller legal registration identifier identification scheme identifierThe 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"
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization/ram:ID/@schemeID
-
getSellerLegalOrganizationIdentifer
public Identifier getSellerLegalOrganizationIdentifer()
BT-30:Seller legal registration identifierAn 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.
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization/ram:ID
-
getSellerCountryCode
public Codes.CountryCodeList getSellerCountryCode()
BT-40:Seller country codeA 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).
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID
-
getBuyerName
public String getBuyerName()
BT-44:Buyer nameThe 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).
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:Name
-
getBuyerLegalOrganizationSchemeIdentiferAttribute
public Codes.SchemeIdentifier getBuyerLegalOrganizationSchemeIdentiferAttribute()
BT-47-1:scheme identifier attributeScheme 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"
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedLegalOrganization/ram:ID/@schemeID
-
getBuyerLegalOrganizationIdentifer
public Identifier getBuyerLegalOrganizationIdentifer()
BT-47:Buyer legal registration identifierAn 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
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedLegalOrganization/ram:ID
-
getInvoiceCurrencyCode
public Codes.Currency getInvoiceCurrencyCode()
BT-5:Invoice currency codeThe 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).
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode
-
getInvoiceTotalAmountWithoutVAT
public Amount getInvoiceTotalAmountWithoutVAT()
BT-109:Invoice total amount without VATThe 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).
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxBasisTotalAmount
-
getVATCurrency
public Codes.Currency getVATCurrency()
BT-110-0:VAT currency@currencyID is mandatory to differentiate between VAT amount and VAT amount in accounting currency.
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount/@currencyID
-
getInvoiceTotalVATAmount
public Amount getInvoiceTotalVATAmount()
BT-110:Invoice total VAT amountThe 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).
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount
-
getInvoiceTotalAmountWithVAT
public Amount getInvoiceTotalAmountWithVAT()
BT-112:Invoice total amount with VATThe 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).
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:GrandTotalAmount
-
getAmountDueForPayment
public Amount getAmountDueForPayment()
BT-115:Amount due for paymentThe 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).
- Returns:
- the value /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:DuePayableAmount
-
toXML
public void toXML(PrintStream out) throws IOException, FacturXException
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. FACTUR-X_1.0.06_XSD_SCHEMATRON - 2022 03 01/0. Factur-X_1.0.06_MINIMUM_XSD/FACTUR-X_MINIMUM.xsd)- Parameters:
out
- the print stream to write to- Throws:
IOException
FacturXException
-
toXML
public void toXML(PrintWriter out) throws IOException, FacturXException
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. FACTUR-X_1.0.06_XSD_SCHEMATRON - 2022 03 01/0. Factur-X_1.0.06_MINIMUM_XSD/FACTUR-X_MINIMUM.xsd)- Parameters:
out
- the print stream to write to- Throws:
IOException
FacturXException
-
getXMLAsDataURL
public String getXMLAsDataURL() throws IOException, FacturXException
- Throws:
IOException
FacturXException
-
toJUnitJavaSourceCode
public void toJUnitJavaSourceCode(PrintStream out, String packageName, String className, String referenceFilesDirectory) throws FacturXException
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.- Parameters:
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 namedclassName+".xml"
- Throws:
FacturXException
-
joinVeryLongString
public static String joinVeryLongString(String[] chunks)
to be used for strings exceeding the compiler limit of 2^16 bytes for a string constant
-
fromXML
public static Invoice fromXML(String fileName, boolean recompute) throws IOException
Creates and Invoice instance from a Factur-X XML document.- Parameters:
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 instead- Throws:
IOException
-
-