Class Invoice
- java.lang.Object
-
- com.fourjs.report.facturx.AbstractInvoice
-
- com.fourjs.report.facturx.profiles.minimum.Invoice
-
public class Invoice extends AbstractInvoice
BG-0:InvoiceCross Industry Invoice
XPath:/rsm:CrossIndustryInvoice
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fourjs.report.facturx.AbstractInvoice
AbstractInvoice.Profile
-
-
Field Summary
-
Fields inherited from class com.fourjs.report.facturx.AbstractInvoice
computeBT131, debug, debugIndentationLevel, recompute
-
-
Constructor Summary
Constructors Constructor Description Invoice(IdentifierType 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
-
Methods inherited from class com.fourjs.report.facturx.AbstractInvoice
assertNotNull, fromPDFFile, fromXMLFile, getIndentedDebugPrefix, getXMLAsDataURL, joinVeryLongString, main, parseDate, toXML
-
-
-
-
Constructor Detail
-
Invoice
public Invoice(IdentifierType 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.- Overrides:
setRecomputein classAbstractInvoice- Parameters:
value- whether or not to ignore explicitly set values of computed fields and work with computed values instead
-
getProfile
public AbstractInvoice.Profile getProfile()
- Specified by:
getProfilein classAbstractInvoice
-
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(IdentifierType 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(IdentifierType 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(IdentifierType 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()
-
getBusinessProcessTypeForJAXB
public String getBusinessProcessTypeForJAXB()
-
getSpecificationIdentifier
public IdentifierType getSpecificationIdentifier() throws ComputationException
- Throws:
ComputationException
-
getSpecificationIdentifierForJAXB
public String getSpecificationIdentifierForJAXB()
-
getInvoiceNumber
public IdentifierType getInvoiceNumber()
-
getInvoiceNumberForJAXB
public String getInvoiceNumberForJAXB()
-
getInvoiceTypeCode
public Codes.InvoiceTypeCode getInvoiceTypeCode()
-
getInvoiceTypeCodeForJAXB
public Codes.InvoiceTypeCode getInvoiceTypeCodeForJAXB()
-
getDateFormat
public Codes.DateFormat getDateFormat() throws ComputationException
- Throws:
ComputationException
-
getDateFormatForJAXB
public Codes.DateFormat getDateFormatForJAXB()
-
getInvoiceIssueDate
public LocalDate getInvoiceIssueDate()
-
getInvoiceIssueDateForJAXB
public String getInvoiceIssueDateForJAXB()
-
getBuyerReference
public String getBuyerReference()
-
getBuyerReferenceForJAXB
public String getBuyerReferenceForJAXB()
-
getSellerName
public String getSellerName()
-
getSellerNameForJAXB
public String getSellerNameForJAXB()
-
getSellerLegalOrganizationSchemeIdentiferAttribute
public Codes.SchemeIdentifier getSellerLegalOrganizationSchemeIdentiferAttribute()
-
getSellerLegalOrganizationSchemeIdentiferAttributeForJAXB
public Codes.SchemeIdentifier getSellerLegalOrganizationSchemeIdentiferAttributeForJAXB()
-
getSellerLegalOrganizationIdentifer
public IdentifierType getSellerLegalOrganizationIdentifer()
-
getSellerLegalOrganizationIdentiferForJAXB
public String getSellerLegalOrganizationIdentiferForJAXB()
-
getSellerCountryCode
public Codes.CountryCodeList getSellerCountryCode()
-
getSellerCountryCodeForJAXB
public Codes.CountryCodeList getSellerCountryCodeForJAXB()
-
getBuyerName
public String getBuyerName()
-
getBuyerNameForJAXB
public String getBuyerNameForJAXB()
-
getBuyerLegalOrganizationSchemeIdentiferAttribute
public Codes.SchemeIdentifier getBuyerLegalOrganizationSchemeIdentiferAttribute()
-
getBuyerLegalOrganizationSchemeIdentiferAttributeForJAXB
public Codes.SchemeIdentifier getBuyerLegalOrganizationSchemeIdentiferAttributeForJAXB()
-
getBuyerLegalOrganizationIdentifer
public IdentifierType getBuyerLegalOrganizationIdentifer()
-
getBuyerLegalOrganizationIdentiferForJAXB
public String getBuyerLegalOrganizationIdentiferForJAXB()
-
getInvoiceCurrencyCode
public Codes.Currency getInvoiceCurrencyCode()
-
getInvoiceCurrencyCodeForJAXB
public Codes.Currency getInvoiceCurrencyCodeForJAXB()
-
getInvoiceTotalAmountWithoutVAT
public Amount getInvoiceTotalAmountWithoutVAT()
-
getInvoiceTotalAmountWithoutVATForJAXB
public String getInvoiceTotalAmountWithoutVATForJAXB()
-
getVATCurrency
public Codes.Currency getVATCurrency()
-
getVATCurrencyForJAXB
public Codes.Currency getVATCurrencyForJAXB()
-
getInvoiceTotalVATAmount
public Amount getInvoiceTotalVATAmount()
-
getInvoiceTotalVATAmountForJAXB
public String getInvoiceTotalVATAmountForJAXB()
-
getInvoiceTotalAmountWithVAT
public Amount getInvoiceTotalAmountWithVAT()
-
getInvoiceTotalAmountWithVATForJAXB
public String getInvoiceTotalAmountWithVATForJAXB()
-
getAmountDueForPayment
public Amount getAmountDueForPayment()
-
getAmountDueForPaymentForJAXB
public String getAmountDueForPaymentForJAXB()
-
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)- Specified by:
toXMLin classAbstractInvoice- Parameters:
out- the print stream to write to- Throws:
IOExceptionFacturXException
-
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.- Specified by:
toJUnitJavaSourceCodein classAbstractInvoice- 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
-
fromXML
public static Invoice fromXML(String fileName, boolean recompute) throws IOException
Deprecated.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
-
fromPDF
public static Invoice fromPDF(String fileName, boolean recompute) throws IOException
Deprecated.Creates and Invoice instance from a Factur-X hybrid PDF document.- Parameters:
fileName- the Factur-X hybrid PDF file to read fromrecompute- specifies whether or not computed fields are computed or the values from the file are used instead- Returns:
- an Invoice instance or null if the PDF does not contain a file attachment named "factur-x.xml".
- Throws:
IOException
-
-