diff --git a/doc/KSeF/KSEF_CLIENT.md b/doc/KSeF/KSEF_CLIENT.md
deleted file mode 100644
index 878c219..0000000
--- a/doc/KSeF/KSEF_CLIENT.md
+++ /dev/null
@@ -1,76 +0,0 @@
-# ksef-client
-
-Um die ksef-client Library nutzen zu können muss man eine relativ komplexe prozedur durchlaufen um Zugrifff darauf zu erhalen:
-
-## 1. Personal Access Token (PAT) erstellen
-
-Du brauchst einen GitHub-Token, damit dein Projekt das Paket aus GitHub Packages herunterladen darf.
-
-So machst du das:
-
-1. Klicke oben rechts auf GitHub auf dein Profil.
-2. Gehe zu Settings.
-3. Links unten: Developer settings.
-4. Dann: Personal access tokens.
-5. Dann: Tokens (classic).
-6. Klicke: Generate new token (classic).
-
-**Beim Erstellen:**
-
-- Vergib irgendeinen Namen (z. B. „ksef-client access“).
-- Wähle nur ein einziges Häkchen:
-
-👉 read:packages
-
-- Token generieren → Token kopieren! Du siehst ihn nur einmal.
-
-## 2. Maven für GitHub Packages konfigurieren
-
-Damit Maven die Pakete laden kann, musst du GitHub Packages in der Datei `~/.m2/settings.xml` eintragen.
-
-👉 Inhalt, den du einfügen musst:
-
-```xml
-
-
-
- github-cirfmf
- rsoika
- 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
-
-
-
-
-
-```
-
-## 3. Repository in deiner pom.xml eintragen
-
-Füge das in deine pom.xml ein:
-
-```
-
-
- github-cirfmf
- https://maven.pkg.github.com/CIRFMF/ksef-client-java
-
-
-
-```
-
-## 4. Abhängigkeit hinzufügen
-
-Auch in die pom.xml:
-
-```xml
- ..
-
- pl.akmf.ksef-sdk
- ksef-client
- 3.0.4
-
-...
-```
diff --git a/doc/KSeF/SECRETS.md b/doc/KSeF/SECRETS.md
new file mode 100644
index 0000000..9a78aa4
--- /dev/null
+++ b/doc/KSeF/SECRETS.md
@@ -0,0 +1,3 @@
+NIP = "9552521552"
+
+TOKEN = "20251113-EC-2751AC3000-5C5466924B-62|nip-9552521552|fc0c95d020dc45d4af491fb0aa755f3f3f674b33ecbf4250a88ea6e36fa8340b
diff --git a/docker-compose.yml b/docker-compose.yml
index 3e69214..953c781 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -44,6 +44,11 @@ services:
LLM_SERVICE_ENDPOINT_USER: "admin"
LLM_SERVICE_ENDPOINT_PASSWORD: "imixs4.null"
+ # KSeF - Polen
+ KSEF_API_NIP: "9552521552"
+ KSEF_API_TOKEN: "20251113-EC-2751AC3000-5C5466924B-62|nip-9552521552|fc0c95d020dc45d4af491fb0aa755f3f3f674b33ecbf4250a88ea6e36fa8340b"
+ KSEF_API_ENDPOINT: "https://ksef-test.mf.gov.pl/api/v2"
+
METRICS_ENABLED: "false"
ports:
diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/EInvoiceConverterAdapter.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/EInvoiceAdapter.java
similarity index 95%
rename from office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/EInvoiceConverterAdapter.java
rename to office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/EInvoiceAdapter.java
index 13fe39a..038a921 100644
--- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/EInvoiceConverterAdapter.java
+++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/EInvoiceAdapter.java
@@ -78,13 +78,13 @@ import jakarta.inject.Inject;
* @version 1.0
* @author rsoika
*/
-public class EInvoiceConverterAdapter implements SignalAdapter {
+public class EInvoiceAdapter implements SignalAdapter {
final String TYPE_TEXTBLOCK = "textblock";
public static final String DOCUMENT_ERROR = "DOCUMENT_ERROR";
public static final String CONFIG_ERROR = "CONFIG_ERROR";
public static final String LINE_ITEMS_PROPERTY = "invoice.items";
- private static Logger logger = Logger.getLogger(EInvoiceConverterAdapter.class.getName());
+ private static Logger logger = Logger.getLogger(EInvoiceAdapter.class.getName());
public static SimpleDateFormat dateFormatter = new SimpleDateFormat("dd.MM.yyyy", Locale.GERMAN);
public static NumberFormat numberFormat = NumberFormat.getInstance(Locale.GERMANY);
@@ -117,7 +117,7 @@ public class EInvoiceConverterAdapter implements SignalAdapter {
workitem,
false);
if (eInvoiceConfig == null || !eInvoiceConfig.hasItem("create")) {
- throw new PluginException(EInvoiceConverterAdapter.class.getSimpleName(), CONFIG_ERROR,
+ throw new PluginException(EInvoiceAdapter.class.getSimpleName(), CONFIG_ERROR,
"missing e-invoice configuration in model event - please check model configuration");
}
ItemCollection createDefinition = XMLParser.parseItemStructure(eInvoiceConfig.getItemValueString("create"));
@@ -182,7 +182,7 @@ public class EInvoiceConverterAdapter implements SignalAdapter {
}
if (pdfFileData == null) {
- throw new PluginException(EInvoiceConverterAdapter.class.getSimpleName(),
+ throw new PluginException(EInvoiceAdapter.class.getSimpleName(),
DOCUMENT_ERROR,
"DOCUMENT_ERROR: no pdf file found!");
}
@@ -236,7 +236,7 @@ public class EInvoiceConverterAdapter implements SignalAdapter {
} catch (IOException e) {
// TODO Auto-generated catch block
- throw new PluginException(EInvoiceConverterAdapter.class.getSimpleName(), CONFIG_ERROR,
+ throw new PluginException(EInvoiceAdapter.class.getSimpleName(), CONFIG_ERROR,
"Failed to generate e-invoice: " + e.getMessage());
}
}
@@ -277,9 +277,12 @@ public class EInvoiceConverterAdapter implements SignalAdapter {
}
// // Summenbildung
- model.setNetTotalAmount(workitem.getItemValueDouble("invoice.total.net"));
+ model.setNetTotalAmount(workitem.getItemValueDouble("invoice.total"));
model.setGrandTotalAmount(workitem.getItemValueDouble("invoice.total"));
+
+ // date
model.setIssueDateTime(workitem.getItemValueLocalDate("invoice.date"));
+ model.setDueDateTime(workitem.getItemValueLocalDate("invoice.duedate"));
// Update Addresses
TradeParty billingAddress = buildAddress(workitem.getItemValueString("partner.id"), "buyer");
@@ -374,7 +377,7 @@ public class EInvoiceConverterAdapter implements SignalAdapter {
sourceName = workflowService.adaptText(sourceName, workitem);
if ((template == null || template.isEmpty()) || (textblock == null || textblock.isEmpty())) {
- throw new PluginException(EInvoiceConverterAdapter.class.getSimpleName(),
+ throw new PluginException(EInvoiceAdapter.class.getSimpleName(),
CONFIG_ERROR,
"invalid e-invoice configuration in model event - textblock/template reference not defined!");
}
@@ -384,7 +387,7 @@ public class EInvoiceConverterAdapter implements SignalAdapter {
// do we found the document?
if (fileData == null) {
- throw new PluginException(EInvoiceConverterAdapter.class.getSimpleName(),
+ throw new PluginException(EInvoiceAdapter.class.getSimpleName(),
CONFIG_ERROR,
"invalid e-invoice configuration in model event - textblock/template: " + textblock + "/" + template
+ " not found!");
diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/KSeFAdapter.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/KSeFAdapter.java
index fc7e1bc..20e6cd9 100644
--- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/KSeFAdapter.java
+++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/KSeFAdapter.java
@@ -63,7 +63,7 @@ public class KSeFAdapter implements SignalAdapter {
public static final String DOCUMENT_ERROR = "DOCUMENT_ERROR";
public static final String CONFIG_ERROR = "CONFIG_ERROR";
public static final String LINE_ITEMS_PROPERTY = "invoice.items";
- private static Logger logger = Logger.getLogger(EInvoiceConverterAdapter.class.getName());
+ private static Logger logger = Logger.getLogger(EInvoiceAdapter.class.getName());
public static SimpleDateFormat dateFormatter = new SimpleDateFormat("dd.MM.yyyy", Locale.GERMAN);
public static NumberFormat numberFormat = NumberFormat.getInstance(Locale.GERMANY);
@@ -96,7 +96,7 @@ public class KSeFAdapter implements SignalAdapter {
workitem,
false);
if (eInvoiceConfig == null || !eInvoiceConfig.hasItem("ksef")) {
- throw new PluginException(EInvoiceConverterAdapter.class.getSimpleName(), CONFIG_ERROR,
+ throw new PluginException(EInvoiceAdapter.class.getSimpleName(), CONFIG_ERROR,
"missing e-invoice/ksef configuration in model event - please check model configuration");
}
ItemCollection ksefDefinition = XMLParser.parseItemStructure(eInvoiceConfig.getItemValueString("ksef"));
@@ -154,9 +154,12 @@ public class KSeFAdapter implements SignalAdapter {
}
// // Summenbildung
- model.setNetTotalAmount(workitem.getItemValueDouble("invoice.total.net"));
+ model.setNetTotalAmount(workitem.getItemValueDouble("invoice.total"));
model.setGrandTotalAmount(workitem.getItemValueDouble("invoice.total"));
+
+ // date
model.setIssueDateTime(workitem.getItemValueLocalDate("invoice.date"));
+ model.setDueDateTime(workitem.getItemValueLocalDate("invoice.duedate"));
// Update Addresses
TradeParty billingAddress = buildAddress(workitem.getItemValueString("partner.id"), "buyer");
@@ -251,7 +254,7 @@ public class KSeFAdapter implements SignalAdapter {
sourceName = workflowService.adaptText(sourceName, workitem);
if ((template == null || template.isEmpty()) || (textblock == null || textblock.isEmpty())) {
- throw new PluginException(EInvoiceConverterAdapter.class.getSimpleName(),
+ throw new PluginException(EInvoiceAdapter.class.getSimpleName(),
CONFIG_ERROR,
"invalid e-invoice configuration in model event - textblock/template reference not defined!");
}
@@ -261,7 +264,7 @@ public class KSeFAdapter implements SignalAdapter {
// do we found the document?
if (fileData == null) {
- throw new PluginException(EInvoiceConverterAdapter.class.getSimpleName(),
+ throw new PluginException(EInvoiceAdapter.class.getSimpleName(),
CONFIG_ERROR,
"invalid e-invoice configuration in model event - textblock/template: " + textblock + "/" + template
+ " not found!");
diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ksef/KSeFExportAdapter.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/KSeFExportAdapter.java
similarity index 95%
rename from office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ksef/KSeFExportAdapter.java
rename to office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/KSeFExportAdapter.java
index d394cfc..3ae74df 100644
--- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/ksef/KSeFExportAdapter.java
+++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/einvoice/KSeFExportAdapter.java
@@ -1,4 +1,4 @@
-package com.alexanderlogistics.ksef;
+package com.alexanderlogistics.einvoice;
import java.util.List;
import java.util.logging.Logger;
@@ -67,7 +67,7 @@ public class KSeFExportAdapter implements SignalAdapter {
}
try {
- kSeFAPIService.uploadInvoice(workitem, "test.xml");
+ kSeFAPIService.uploadInvoice(workitem, "ksef.xml");
} catch (PluginException e) {
// convert PluginException into a AdapterException to handle the error via the
diff --git a/workflow/pl/e-invoice/templates/ksef.xml b/workflow/pl/e-invoice/templates/ksef.xml
index 88b49f1..68e32c8 100644
--- a/workflow/pl/e-invoice/templates/ksef.xml
+++ b/workflow/pl/e-invoice/templates/ksef.xml
@@ -8,131 +8,60 @@
FA
3
2026-06-05T02:45:33.422866Z
- Generator Imixs
+ Imixs eInvoice
+
+
- #nip#
- Bogusz - Sienkiewicz
+ 9552521552
+ Alexander Global Logistics
PL
- al. Różycki 7594
- 87-607 Środa Śląska
+ Gdanska 36
+ 70-660 Szczecin
- Lucja17@example.net
- 86-588-03-53
+ info@alexander-logistics.com
+
+
+
- 3861610227
- Błaszczak - Lenart
+
+
- PL
- al. Szewczyk 7247
- 84-642 Żelechów
+
+
+
- Jakubina82@gmail.com
- 75-461-31-12
+
+
- KL-2936
- 2
- 2
+
+
PLN
- #invoicing_date#
- Lidzbark
- FA/GRQMB-#invoice_number#/05/2025
- 2025-07-11
- 10652.38
- 2450.05
- 13102.43
-
- 2
- 2
- 2
- 2
-
- 1
-
-
- 1
-
- 2
-
- 1
-
-
+
+
+
+
+
+
+
+
+ 0.00
+ 0.00
+ 0.00
+
VAT
-
- 1
- 66465935-48e0-b7d9-ea88-d9d7ff4c6023
- Refined Concrete Pants
- szt.
- 8
- 295.81
- 2366.48
- 23
-
-
- 2
- 16d35141-c43f-98fc-5249-27d7b2845cf7
- Sleek Steel Pants
- szt.
- 10
- 402.96
- 4029.60
- 23
-
-
- 3
- 8647a6b5-f12a-3817-869e-010e4353686a
- Incredible Steel Salad
- szt.
- 8
- 11.13
- 89.04
- 23
-
-
- 4
- 6a9b993d-33c1-eba2-f06c-7d8f22e7430b
- Ergonomic Soft Fish
- szt.
- 8
- 34.03
- 272.24
- 23
-
-
- 5
- 05e42590-9bfb-10c2-a946-fd1641f705e7
- Intelligent Frozen Cheese
- szt.
- 3
- 501.86
- 1505.58
- 23
-
-
- 6
- dbb7aed5-fedb-96d7-0afd-c3d0c23740a7
- Ergonomic Metal Bike
- szt.
- 6
- 398.24
- 2389.44
- 23
-
-
- 1
- 2025-07-17
- 7
-
+
+
\ No newline at end of file
diff --git a/workflow/pl/rechnungsausgang-pl-1.1.0.bpmn b/workflow/pl/rechnungsausgang-pl-1.1.0.bpmn
index f6640bb..e6573d5 100644
--- a/workflow/pl/rechnungsausgang-pl-1.1.0.bpmn
+++ b/workflow/pl/rechnungsausgang-pl-1.1.0.bpmn
@@ -122,6 +122,16 @@ th { font-weight: bold;}
event_S9HJ1A
event_qIhyWA
gateway_utXBiw
+ event_OEuWOw
+ task_UCh9Ww
+ event_rnULsg
+ event_3FDnsA
+ gateway_S4b22A
+ task_t4TgPg
+ event_SAU2eg
+ task_PYE0HA
+ event_KPfjQQ
+ event_6fSDtg
@@ -1120,7 +1130,7 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
@@ -1369,7 +1379,7 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
@@ -1492,7 +1502,7 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
@@ -1527,10 +1537,11 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
$workflowgroup - $workflowstatus]]>
sequenceFlow_gjnUAA
- sequenceFlow_eadkWg
+ sequenceFlow_83w7TA
sequenceFlow_0aNMvQ
+ sequenceFlow_qs1rug
-
+
@@ -1585,7 +1596,6 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
e-invoice-template
ksef.xml
-
true
]]>
@@ -1602,7 +1612,7 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
false
-
+
sequenceFlow_2BSFNw
sequenceFlow_JNYd0A
sequenceFlow_F90iWQ
@@ -1871,7 +1881,7 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
@@ -1910,7 +1920,7 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
sequenceFlow_BaNbmQ
sequenceFlow_ATB00A
sequenceFlow_nrxqhg
- sequenceFlow_6VjCnQ
+ sequenceFlow_0cMadw
@@ -1924,7 +1934,7 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
sequenceFlow_eadkWg
sequenceFlow_DCA0Tw
-
+
@@ -1939,9 +1949,6 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
-
-
@@ -2010,7 +2017,6 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
- sequenceFlow_DCA0Tw
sequenceFlow_BaNbmQ
sequenceFlow_79GZ8w
@@ -2018,7 +2024,7 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
@@ -2184,16 +2190,339 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
- sequenceFlow_6VjCnQ
- sequenceFlow_0cMadw
- sequenceFlow_sNNdbA
+ sequenceFlow_2th1MQ
+ sequenceFlow_DCA0Tw
+ sequenceFlow_Gox0Rw
-
+
-
+
+
+ sequenceFlow_qs1rug
+
+
+
+
+
+
+
+
+
+
+
+
+ txtlastcomment]]>
+
+
+
+
+
+
+
+
+ _imginvoice.number dbtr.number dbtr.name (invoice.currency invoice.total) ]]>
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $workflowgroup - $workflowstatus]]>
+ sequenceFlow_sO35Dg
+ sequenceFlow_eadkWg
+ sequenceFlow_jG1Bdw
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+ sequenceFlow_JNYd0A
+ sequenceFlow_jG1Bdw
+ sequenceFlow_Rdv4Yg
+ sequenceFlow_o0J3Sg
+
+
+
+
+
+
+
+ sequenceFlow_Rdv4Yg
+
+
+
+
+
+
+
+
+
+
+ sequenceFlow_DCA0Tw
+ sequenceFlow_o0J3Sg
+ sequenceFlow_83w7TA
+ sequenceFlow_2th1MQ
+
+
+
+
+
+
+
+
+
+
+ txtlastcomment]]>
+
+
+
+
+
+
+
+
+ _imginvoice.number dbtr.number dbtr.name (invoice.currency invoice.total) ]]>
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $workflowgroup - $workflowstatus]]>
+ sequenceFlow_UOahyg
+ sequenceFlow_ATB00A
+ sequenceFlow_mtiCpg
+ sequenceFlow_6VjCnQ
+ sequenceFlow_sNNdbA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ adapter.error_code: adapter.error_message]]>
+
+
+
+
+
+
+
+
+ adapter.error_code: adapter.error_message]]>
+
+
+ false
+
+
+
+ sequenceFlow_Gox0Rw
+ sequenceFlow_mtiCpg
+
+ sequenceFlow_79GZ8w
+
+
+
+
+
+
+
+
+
+
+ txtlastcomment]]>
+
+
+
+
+
+
+
+
+ _imginvoice.number dbtr.number dbtr.name (invoice.currency invoice.total) ]]>
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $workflowgroup - $workflowstatus]]>
+ sequenceFlow_83w7TA
+ sequenceFlow_Rofsqw
+ sequenceFlow_qs1rug
+ sequenceFlow_nqoCTQ
+
+
+ sequenceFlow_nqoCTQ
+
+
+
+
+
+
+
+
+ sequenceFlow_Rofsqw
+
+
+
+
@@ -2203,8 +2532,9 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
+
@@ -2427,7 +2757,7 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
@@ -2436,21 +2766,21 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
-
+
-
+
-
+
-
+
-
+
@@ -2478,7 +2808,7 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
@@ -2493,21 +2823,21 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
-
+
-
+
-
+
-
+
-
+
@@ -2523,15 +2853,66 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2760,25 +3141,25 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
@@ -2803,34 +3184,31 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
+
-
+
-
-
-
-
-
-
-
+
+
-
-
+
+
+
-
-
-
+
+
+
+
-
-
+
+
@@ -2840,15 +3218,58 @@ Wiedervorlage wird um 7 bzw. 5 Tage erhöht
-
-
-
-
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+