{"id":16416125,"url":"https://github.com/phax/ph-fatturapa","last_synced_at":"2025-09-07T06:38:44.760Z","repository":{"id":57724923,"uuid":"272773506","full_name":"phax/ph-fatturapa","owner":"phax","description":"Java library to easily read and write XSD compliant fatturaPA 1.2 and 1.2.1 invoices","archived":false,"fork":false,"pushed_at":"2025-03-06T09:07:22.000Z","size":9706,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-18T18:42:34.914Z","etag":null,"topics":["einvoice","fattura-elettronica","fattura-pa","java","jaxb","phoss"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-16T17:40:36.000Z","updated_at":"2025-03-06T09:07:25.000Z","dependencies_parsed_at":"2024-01-24T12:02:27.944Z","dependency_job_id":"fda150e0-bd2f-49cd-876b-8ea99471fc4e","html_url":"https://github.com/phax/ph-fatturapa","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-fatturapa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-fatturapa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-fatturapa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-fatturapa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phax","download_url":"https://codeload.github.com/phax/ph-fatturapa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245066496,"owners_count":20555402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["einvoice","fattura-elettronica","fattura-pa","java","jaxb","phoss"],"created_at":"2024-10-11T07:08:29.568Z","updated_at":"2025-09-07T06:38:44.748Z","avatar_url":"https://github.com/phax.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ph-fatturapa\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.helger/ph-fatturapa/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.helger/ph-fatturapa) \n[![javadoc](https://javadoc.io/badge2/com.helger/ph-fatturapa/javadoc.svg)](https://javadoc.io/doc/com.helger/ph-fatturapa)\n[![CodeCov](https://codecov.io/gh/phax/ph-fatturapa/branch/master/graph/badge.svg)](https://codecov.io/gh/phax/ph-fatturapa)\n\nJava library to easily read and write XML Schema compliant fatturaPA invoices.\n\nSupported versions are:\n* v1.2 (valid until 2020-12-31) \n* v1.2.1 (valid from 2020-10-01 to 2022-09-30)\n* v1.2.2 (valid from 2022-10-01)\n\nIt is licensed under Apache 2.0 license.\n\nIt requires at least Java 11 to be used.\n\n# Usage guide\n\nAll XML Schema files are converted using JAXB.\nFor version 1.2 the generated types are prefixed with \"FPA120\", for version 1.2.1 they are prefixed with \"FPA121\" for easy differentiation.\n\n## Read and write fatturaPA invoices\n\nUsing the classes `FatturaPA120Marshaller` and `FatturaPA121Marshaller` you can read and write fatturaPA invoices.\nClass `FatturaPA120Marshaller` handles version 1.2 and class `FatturaPA121Marshaller` handles version 1.2.1.\n\n### Reading\n\nReading an existing fatturaPA 1.2 from an existing File is as easy as this:\n\n```java\nFPA120FatturaElettronicaType aInvoice = new FatturaPA120Marshaller ().read (new File (\"invoice.xml\"));\nif (aInvoice != null) { \n  // Reading was successful\n} else {\n  // Error handling\n}\n```\nThere are several overloads of `read` to read from different kind of sources.\n\n### Writing\n\nWriting an existing `FPA120FatturaElettronicaType` is also very simple:\n\n```java\nFPA120FatturaElettronicaType aInvoice = ....;\nif (new FatturaPA120Marshaller ().write (aInvoice, new File (\"new-invoice.xml\")).isSuccess ()) { \n  // Writing was successful\n} else {\n  // Error handling\n}\n```\nThere are several overloads of `write` to write from different kind of targets and `getAs...` methods to convert the invoice to different formats.\n\nBy default a namespace context is present that uses the \"p\" prefix for the main element. If you want to change that, see the method `setNamespaceContext` of the Marshaller classes. \n\n# Building from source\n\nTo build from source you need Apache Maven and Java 17 or later.\nJust run this on the commandline:\n\n```shell\nmvn clean install\n```\n\n## Usage in an IDE\n\nIf you have build errors in your IDE, ensure that you once call `mvn process-sources` on the project. This will create the Java classes representing the XML schema objects.\n\nAfterwards you might need to manually add the following folders to your buildpath:\n* `target/generated-sources/fatturapa120`\n* `target/generated-sources/fatturapa121`\n* `target/generated-sources/fatturapa122`\n\n# Maven usage\n\nAdd the following to your pom.xml to use this artifact, replacing `x.y.z` with the real version number:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.helger\u003c/groupId\u003e\n  \u003cartifactId\u003eph-fatturapa\u003c/artifactId\u003e\n  \u003cversion\u003ex.y.z\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n# References\n\n* [Official fatturaPA format page]( https://www.fatturapa.gov.it/export/fatturazione/it/normativa/f-2.htm) - check the Italian version of the page; the English version is out of date\n\n# News and noteworthy\n\nv3.0.0 - 2025-08-25\n* Requires Java 17 as the minimum version\n* Updated to ph-commons 12.0.0\n* Removed all deprecated methods marked for removal\n* Switched JAXB Maven plugin to `org.jvnet.jaxb:jaxb-maven-plugin` \n\nv2.0.2 - 2023-04-07\n* Added v1.2.2 to `EFatturaPADocumentType`\n* Moved XML Schemas and test files to a folder `external/...`\n\nv2.0.1 - 2023-03-22\n* Added support for fatturaPA 1.2.2\n\nv2.0.0 - 2023-01-08\n* Using Java 11 as the baseline\n* Updated to ph-commons 11\n* Using JAXB 4.0 as the baseline\n\nv1.2.0 - 2021-05-02\n* Updated to ph-commons 10.1\n\nv1.1.0 - 2021-03-21\n* Updated to ph-commons 10\n\nv1.0.3 - 2020-09-17\n* Updated to Jakarta JAXB 2.3.3\n\nv1.0.2 - 2020-08-28\n* Using Java 8 date and time classes for JAXB created classes\n\nv1.0.1 - 2020-06-30\n* Minor API extension\n\nv1.0.0 - 2020-06-17\n* Initial version\n\n---\n\nMy personal [Coding Styleguide](https://github.com/phax/meta/blob/master/CodingStyleguide.md) |\nIt is appreciated if you star the GitHub project if you like it.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphax%2Fph-fatturapa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphax%2Fph-fatturapa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphax%2Fph-fatturapa/lists"}