diff --git a/.gitignore b/.gitignore index a3c740250..34045dc01 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ /j-lawyer-fax/test/org/jlawyer/tests/test.pdf /j-lawyer-server/j-lawyer-io/addbasicauth-error.log /j-lawyer-server/j-lawyer-io/addbasicauth.log +/j-lawyer-invoicing/target/ diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/bea/SendBeaMessageDialog.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/bea/SendBeaMessageDialog.java index a0b0b0bf3..93b78014f 100755 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/bea/SendBeaMessageDialog.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/bea/SendBeaMessageDialog.java @@ -758,7 +758,7 @@ public class SendBeaMessageDialog extends javax.swing.JDialog implements SendCom private DropTargetHandler dropTargetHandler; /** - * Creates new form SendEmailDialog + * Creates new form SendBeaMessageDialog * * @param parent * @param modal diff --git a/j-lawyer-invoicing/dependency-reduced-pom.xml b/j-lawyer-invoicing/dependency-reduced-pom.xml new file mode 100644 index 000000000..ed1f5cc2d --- /dev/null +++ b/j-lawyer-invoicing/dependency-reduced-pom.xml @@ -0,0 +1,80 @@ + + + 4.0.0 + org.jlawyer.invoicing + j-lawyer-invoicing + 1.0-SNAPSHOT + + + + maven-antrun-plugin + 1.7 + + + install + + run + + + + + + + + + maven-shade-plugin + 3.6.0 + + + package + + shade + + + + + org.codehaus.groovy:groovy-all + + + + + com + shaded.com + + + + jakarta + shaded.jakarta + + + org + shaded.org + + org.jlawyer.** + org.xml.** + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + + + + 11 + org.jlawyer.invoicing.JLawyerInvoicing + 11 + UTF-8 + + diff --git a/j-lawyer-invoicing/nbactions.xml b/j-lawyer-invoicing/nbactions.xml new file mode 100644 index 000000000..4140b2aa0 --- /dev/null +++ b/j-lawyer-invoicing/nbactions.xml @@ -0,0 +1,55 @@ + + + + run + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:3.1.0:exec + + + + ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs} + + org.jlawyer.invoicing.JLawyerInvoicing + java + + + + debug + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:3.1.0:exec + + + -agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} + ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs} + + org.jlawyer.invoicing.JLawyerInvoicing + java + true + + + + profile + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:3.1.0:exec + + + + ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs} + org.jlawyer.invoicing.JLawyerInvoicing + java + + + + diff --git a/j-lawyer-invoicing/pom.xml b/j-lawyer-invoicing/pom.xml new file mode 100644 index 000000000..d95015ab5 --- /dev/null +++ b/j-lawyer-invoicing/pom.xml @@ -0,0 +1,124 @@ + + + 4.0.0 + org.jlawyer.invoicing + j-lawyer-invoicing + 1.0-SNAPSHOT + jar + + UTF-8 + 11 + 11 + org.jlawyer.invoicing.JLawyerInvoicing + + + + + org.mustangproject + validator + shaded + 2.12.0 + + + + + + + + maven-antrun-plugin + 1.7 + + + install + + + + + + + + + + run + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.6.0 + + + package + + shade + + + + + org.codehaus.groovy:groovy-all + + + + + com + shaded.com + + + + + + + jakarta + shaded.jakarta + + + org + shaded.org + + org.jlawyer.** + + org.xml.** + + + + + + *:* + + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + + + + \ No newline at end of file diff --git a/j-lawyer-invoicing/src/main/java/org/jlawyer/invoicing/JLawyerInvoicing.java b/j-lawyer-invoicing/src/main/java/org/jlawyer/invoicing/JLawyerInvoicing.java new file mode 100644 index 000000000..1fccfcc09 --- /dev/null +++ b/j-lawyer-invoicing/src/main/java/org/jlawyer/invoicing/JLawyerInvoicing.java @@ -0,0 +1,49 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + */ + +package org.jlawyer.invoicing; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Date; +import org.mustangproject.BankDetails; +import org.mustangproject.Contact; +import org.mustangproject.Invoice; +import org.mustangproject.Item; +import org.mustangproject.Product; +import org.mustangproject.TradeParty; +import org.mustangproject.ZUGFeRD.Profiles; +import org.mustangproject.ZUGFeRD.ZUGFeRD2PullProvider; + +/** + * + * @author jens + */ +public class JLawyerInvoicing { + + public static void main(String[] args) { + System.out.println("Hello World!"); + + Invoice i = new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()) + .setSender(new TradeParty("Test company","teststr","55232","teststadt","DE").addTaxID("DE4711").addVATID("DE0815").setContact(new Contact("Hans Test","+49123456789","test@example.org")).addBankDetails(new BankDetails("DE12500105170648489890","COBADEFXXX"))) + .setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE")) + .setReferenceNumber("991-01484-64")//leitweg-id + .setNumber("123").addItem(new Item(new Product("Testprodukt", "", "C62", BigDecimal.ZERO), /*price*/ new BigDecimal("1.0"), /*qty*/ new BigDecimal("1.0"))); + + ZUGFeRD2PullProvider zf2p = new ZUGFeRD2PullProvider(); + zf2p.setProfile(Profiles.getByName("XRechnung")); + zf2p.generateXML(i); + String theXML = new String(zf2p.getXML()); + try { + BufferedWriter writer = new BufferedWriter(new FileWriter("xrechnung.xml")); + writer.write(theXML); + writer.close(); + } catch (IOException e) { + e.printStackTrace(); + } + + } +} diff --git a/j-lawyer-invoicing/xrechnung.xml b/j-lawyer-invoicing/xrechnung.xml new file mode 100644 index 000000000..818ce2f04 --- /dev/null +++ b/j-lawyer-invoicing/xrechnung.xml @@ -0,0 +1,133 @@ + + + + + + + + + urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 + + + + + urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0 + + + + 123 + 380 + + 20240815 + + + + + + 1 + + + Testprodukt + + + + 1.0000 + 1.0000 + + + + 1.0000 + + + + VAT + Z + 0.00 + + + 1.00 + + + + + 991-01484-64 + + Test company + + Hans Test + + +49123456789 + + + test@example.org + + + + 55232 + teststr + teststadt + DE + + + DE0815 + + + DE4711 + + + + Franz Müller + + 55232 + teststr.12 + Entenhausen + DE + + + + + + + 20240815 + + + + + 123 + EUR + + 58 + SEPA credit transfer + + DE12500105170648489890 + + + COBADEFXXX + + + + 0.00 + VAT + 1.00 + Z + 0.00 + + + Please remit until 15.08.2024 + + 20240815 + + + + 1.00 + 0.00 + 0.00 + 1.00 + 0.00 + 1.00 + 0.00 + 1.00 + + + +