Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.1 billing 3.0.10 #2

Merged
merged 7 commits into from
May 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '1.8', '11' ]
java: [ '11' ]

name: build java ${{ matrix.java }}
steps:
Expand Down
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Pbuild-sources-and-javadoc
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

# Peppol bis billing 3 generator

This is a Pojo implementation of https://docs.peppol.eu/poacc/billing/3.0/. For now
only Invoice is created.
This is a Pojo implementation of https://docs.peppol.eu/poacc/billing/3.0/.

The principle is that the domain classes in plain java encode naming and cardinality
and they can produce xml from itself.
Expand All @@ -15,6 +14,7 @@ it ease of use and no dependency nature.

We use `phive-api` for optional validation.

This is Java 11.

# Installation

Expand Down
7 changes: 3 additions & 4 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,20 @@
</parent>

<artifactId>peppol-bis-billing-3-generator-api</artifactId>
<version>0-SNAPSHOT</version>
<description>Peppol BIS Billing 3 generator Api</description>

<dependencies>
<dependency>
<groupId>no.digipost</groupId>
<artifactId>peppol-bis-billing-3-generator-domain</artifactId>
<version>0-SNAPSHOT</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>no.digipost</groupId>
<artifactId>peppol-bis-billing-3-generator-validation</artifactId>
<optional>true</optional>
<scope>compile</scope>
<version>0-SNAPSHOT</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eaxy</groupId>
Expand All @@ -34,7 +33,7 @@
<dependency>
<groupId>com.helger.phive.rules</groupId>
<artifactId>phive-rules-peppol</artifactId>
<version>2.0.3</version>
<version>2.1.4</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
18 changes: 2 additions & 16 deletions api/src/test/java/peppol/bis/invoice3/PeppolBillingpiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package peppol.bis.invoice3;

import com.helger.phive.peppol.PeppolValidation391;
import com.helger.phive.peppol.PeppolValidation3_11_1;
import com.helger.phive.peppol.PeppolValidation3_12_0;
import org.eaxy.Document;
import org.eaxy.Xml;
import org.junit.jupiter.api.Test;
Expand All @@ -38,7 +38,7 @@ class PeppolBillingpiTest {

@Test
void code_examples_for_api_billing_3_0_9() {
DefaultPeppolBilling3Validation.setVesid_invoice(PeppolValidation3_11_1.VID_OPENPEPPOL_INVOICE_V3);
DefaultPeppolBilling3Validation.setVesid_invoice(PeppolValidation3_12_0.VID_OPENPEPPOL_INVOICE_V3);

final Invoice invoice = ExampleUsage1.example1();
assertThat(invoice.xmlRoot().toXML(), containsString("<Invoice"));
Expand All @@ -48,20 +48,6 @@ void code_examples_for_api_billing_3_0_9() {
assertFalse(result.isValid(), "We except the example to be an invalid peppol billing");
}

@Test
void code_examples_for_api_billing_3_0_5h() {
DefaultPeppolBilling3Validation.setVesid_invoice(PeppolValidation391.VID_OPENPEPPOL_INVOICE_V3);

final Invoice invoice = ExampleUsage1.example1();
assertThat(invoice.xmlRoot().toXML(), containsString("<Invoice"));

final ValidationResult result = new Validate(invoice).result();
System.out.println(String.join("Warns: \n", result.warns()));

assertTrue(result.isValid(), "We except the example to be a valid peppol billing. But has errors: \n" + String.join("\n", result.errors()));

}

@Test
void Norwegian_code_examples_for_api_billing_3_0_5h() {
DefaultPeppolBilling3Validation.setVesid_invoice(PeppolValidation3_11_1.VID_OPENPEPPOL_INVOICE_V3);
Expand Down
1 change: 0 additions & 1 deletion domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>peppol-bis-billing-3-generator-domain</artifactId>
<version>0-SNAPSHOT</version>
<description>Peppol BIS Billing 3 generator Domain</description>

<dependencies>
Expand Down
21 changes: 11 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -75,14 +75,6 @@
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
Expand Down Expand Up @@ -165,8 +157,17 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<goals>
Expand Down
3 changes: 2 additions & 1 deletion validation/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ This project includes:
Old JAXB Runtime under Eclipse Distribution License - v 1.0
peppol-bis-billing-3-generator-domain under Apache License, Version 2.0
peppol-bis-billing-3-generator-validation under Apache License, Version 2.0
ph-collection under Apache 2
ph-commons under Apache 2
ph-jaxb under Apache 2
ph-jaxb-adapter under Apache 2
ph-jaxb-pom under Apache 2
ph-schematron-api under Apache 2
ph-schematron-pur under Apache 2
Expand All @@ -34,6 +34,7 @@ This project includes:
ph-xsds-ccts-cct-schemamodule under Apache 2
ph-xsds-xades132 under Apache 2
ph-xsds-xades141 under Apache 2
ph-xsds-xml under Apache 2
ph-xsds-xmldsig under Apache 2
phive-api under Apache 2
phive-engine under Apache 2
Expand Down
12 changes: 6 additions & 6 deletions validation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>peppol-bis-billing-3-generator-validation</artifactId>
<version>0-SNAPSHOT</version>
<description>Peppol BIS Billing 3 generator Validation</description>

<dependencies>
Expand All @@ -20,25 +19,25 @@
<version>0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<groupId>com.helger.commons</groupId>
<artifactId>ph-commons</artifactId>
<version>9.5.4</version>
<version>10.1.2</version>
</dependency>
<dependency>
<groupId>com.helger.phive.rules</groupId>
<artifactId>phive-rules-peppol</artifactId>
<version>2.0.3</version>
<version>2.1.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.helger.phive</groupId>
<artifactId>phive-engine</artifactId>
<version>7.0.1</version>
<version>7.2.0</version>
</dependency>
<dependency>
<groupId>com.helger.phive</groupId>
<artifactId>phive-api</artifactId>
<version>7.0.1</version>
<version>7.2.0</version>
</dependency>
<dependency>
<groupId>org.eaxy</groupId>
Expand All @@ -57,6 +56,7 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.helger.phive.engine.source.IValidationSourceXML;
import com.helger.phive.engine.source.ValidationSourceXML;
import com.helger.phive.peppol.PeppolValidation;
import com.helger.phive.peppol.PeppolValidation3_11_1;
import com.helger.phive.peppol.PeppolValidation3_12_0;
import org.eaxy.Document;
import peppol.bis.invoice3.domain.BillingCommon;
import peppol.bis.invoice3.domain.CreditNote;
Expand All @@ -46,9 +46,9 @@ public class DefaultPeppolBilling3Validation implements PeppolBilling3Validation

{
if (vesid_invoice == null)
DefaultPeppolBilling3Validation.setVesid_invoice(PeppolValidation3_11_1.VID_OPENPEPPOL_INVOICE_V3);
DefaultPeppolBilling3Validation.setVesid_invoice(PeppolValidation3_12_0.VID_OPENPEPPOL_INVOICE_V3);
if (vesid_creditNote == null)
DefaultPeppolBilling3Validation.setVesid_creditNote(PeppolValidation3_11_1.VID_OPENPEPPOL_CREDIT_NOTE_V3);
DefaultPeppolBilling3Validation.setVesid_creditNote(PeppolValidation3_12_0.VID_OPENPEPPOL_CREDIT_NOTE_V3);
}

@Override
Expand Down Expand Up @@ -103,14 +103,12 @@ public static void setVesid_invoice(VESID vesid_invoice) {
DefaultPeppolBilling3Validation.validationExecutorSetRegistry = new ValidationExecutorSetRegistry<>();
DefaultPeppolBilling3Validation.vesid_invoice = vesid_invoice;
PeppolValidation.initStandard(validationExecutorSetRegistry);
PeppolValidation.initThirdParty(validationExecutorSetRegistry);
}

public static void setVesid_creditNote(VESID vesid_creditNote) {
DefaultPeppolBilling3Validation.validationExecutorSetRegistry = new ValidationExecutorSetRegistry<>();
DefaultPeppolBilling3Validation.vesid_creditNote = vesid_creditNote;
PeppolValidation.initStandard(validationExecutorSetRegistry);
PeppolValidation.initThirdParty(validationExecutorSetRegistry);
}

private List<String> getTextFrom(ErrorList errorList) {
Expand Down