From 04acdb4ff34b0f228695f4b26fb93ea399d5a127 Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Mon, 27 Apr 2026 16:31:42 +0200 Subject: [PATCH] Feedback von Taxman --- doc/KSeF/FEEDBACK.md | 46 ++++++++--------- .../einvoice/KSeFAdapter.java | 49 +++++++++++-------- .../ksef/api/KSeFAdapterTest.java | 4 +- .../src/test/resources/ksef/ksef.xml | 40 +++++++++++++-- .../resources/ksef/output/invoice-simple.xml | 44 +++++++++++++---- workflow/pl/e-invoice/templates/ksef.xml | 33 +++++++++++++ 6 files changed, 159 insertions(+), 57 deletions(-) diff --git a/doc/KSeF/FEEDBACK.md b/doc/KSeF/FEEDBACK.md index 47b90b5..c35ad33 100644 --- a/doc/KSeF/FEEDBACK.md +++ b/doc/KSeF/FEEDBACK.md @@ -1,25 +1,25 @@ # Feedback zum PDF FIle -## 1. Podmiot 1 — Daten des Rechnungsausstellers (AGLP) - -- `` FIXED -- `` FIXED -- `PL` FIXED - -## 2. Podmiot 2 — Daten des Rechnungsempfängers - -- ` ` - ALREADY IMPLEMENTED -- EU-Rechnungsempfänger - UNCLEAR! -- Anschrift des Rechnungsempfängers - CARGOSOFT TOPIC - -## 3. Abschnitt — Rechnungskopf (außer Standardfelder P_1, P_2, P_6) - -- `` - FIXED -- `` - FIXED - -# 4. Rechnungspositionen — Pflichtfelder je Position - -- `` - FIXED -- `` - IGNORED - NOT FIXED! - -ab `` wird es krimminell +| Feld / Komponente | Status | +| :------------------------------------------------------- | :----------------------- | +| **1. Podmiot 1 — Daten des Rechnungsausstellers (AGLP)** | | +| `` | **FIXED** | +| `` | **FIXED** | +| `PL` | **FIXED** | +| **2. Podmiot 2 — Daten des Rechnungsempfängers** | | +| ` ` | **ALREADY IMPLEMENTED** | +| EU-Rechnungsempfänger | **UNCLEAR!** | +| Anschrift des Rechnungsempfängers | **CARGOSOFT TOPIC** | +| **3. Abschnitt — Rechnungskopf** | **FIXED** | +| `` | **FIXED** | +| `` | **FIXED** | +| **4. Rechnungspositionen — Pflichtfelder** | | +| `` | **FIXED** | +| `` | **IGNORED - NOT FIXED!** | +| `` | **????** | +| `` | **????** | +| **5. Rechnungssummen — / ** | | +| _Noch keine Details_ | — | +| **6. Zahlung — ** | | +| `` | **FIXED** | +| `` | **FIXED** | 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 24dee1d..debdb73 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 @@ -315,7 +315,9 @@ public class KSeFAdapter implements SignalAdapter { // finally set the due date at the end of the XML tree model.setDueDateTime(workitem.getItemValueLocalDate("invoice.duedate")); - // finally update the template file + /* + * finally update the template file + */ fileDataXMLTemplate.setContent(model.getContent()); } catch (FileNotFoundException | EInvoiceFormatException | TransformerException e) { @@ -332,31 +334,36 @@ public class KSeFAdapter implements SignalAdapter { * @throws PluginException */ private void syncPerformanceDate(ItemCollection workitem) throws PluginException { - try { - logger.info("----Resync cargosoft performancedate...."); - DocumentBuilder documentBuilder; - // hole die XML Datei - FileData cargoXML = snapshotService.getWorkItemFile(workitem.getUniqueID(), - workitem.getItemValueString("cargosoft.import.filename")); - if (cargoXML != null) { - InputStream inputStream = new ByteArrayInputStream(cargoXML.getContent()); - InputSource inputSource = new InputSource(inputStream); - documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document doc = documentBuilder.parse(inputSource); + if (!workitem.hasItem("invoice.performancedate")) { + try { + logger.info("----Resync cargosoft performancedate...."); + DocumentBuilder documentBuilder; + // hole die XML Datei + FileData cargoXML = snapshotService.getWorkItemFile(workitem.getUniqueID(), + workitem.getItemValueString("cargosoft.import.filename")); + if (cargoXML != null) { + InputStream inputStream = new ByteArrayInputStream(cargoXML.getContent()); + InputSource inputSource = new InputSource(inputStream); - // Performance Date - CargosoftXMLInvoiceImportService.readXMLValue(doc, "/Invoices/Invoice/InvoiceHeader/PerformanceDate", - workitem, "invoice.performancedate", - Date.class); + documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + Document doc = documentBuilder.parse(inputSource); - // falls keines gefunden wurde nehmen wir das invoice date - if (workitem.getItemValueDate("invoice.performancedate") == null) { - workitem.setItemValue("invoice.performancedate", workitem.getItemValueDate("invoice.date")); + // Performance Date + CargosoftXMLInvoiceImportService.readXMLValue(doc, + "/Invoices/Invoice/InvoiceHeader/PerformanceDate", + workitem, "invoice.performancedate", + Date.class); + + // falls keines gefunden wurde nehmen wir das invoice date + if (workitem.getItemValueDate("invoice.performancedate") == null) { + workitem.setItemValue("invoice.performancedate", workitem.getItemValueDate("invoice.date")); + } } + } catch (ParserConfigurationException | SAXException | IOException e) { + throw new PluginException(CargosoftXMLInvoiceImportService.class.getName(), "XML_ERROR", + e.getMessage()); } - } catch (ParserConfigurationException | SAXException | IOException e) { - throw new PluginException(CargosoftXMLInvoiceImportService.class.getName(), "XML_ERROR", e.getMessage()); } } diff --git a/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/ksef/api/KSeFAdapterTest.java b/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/ksef/api/KSeFAdapterTest.java index cfc7f09..cdf9450 100644 --- a/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/ksef/api/KSeFAdapterTest.java +++ b/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/ksef/api/KSeFAdapterTest.java @@ -12,6 +12,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.time.LocalDate; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.logging.Logger; @@ -100,6 +101,7 @@ public class KSeFAdapterTest { workitem.setItemValue("invoice.CorrectionInvoiceNumber", ""); workitem.setItemValue("partner.id", "BP-001"); workitem.setItemValue("partner.vat", "PL1234567890"); + workitem.setItemValue("invoice.performancedate", new Date()); // Prepare child items (invoice line items) List childItems = new ArrayList<>(); @@ -159,7 +161,7 @@ public class KSeFAdapterTest { // simulation Korrekturrechnung workitem.setItemValue("invoice.correction", true); workitem.setItemValue("invoice.CorrectionInvoiceNumber", "6551"); - + workitem.setItemValue("invoice.performancedate", new Date()); // Prepare child items (invoice line items) List childItems = new ArrayList<>(); diff --git a/office-alexander-logistics-app/src/test/resources/ksef/ksef.xml b/office-alexander-logistics-app/src/test/resources/ksef/ksef.xml index 76e0401..15eca9f 100644 --- a/office-alexander-logistics-app/src/test/resources/ksef/ksef.xml +++ b/office-alexander-logistics-app/src/test/resources/ksef/ksef.xml @@ -13,14 +13,14 @@ + PL 9552521552 - Alexander Global Logistics + ALEXANDER GLOBAL LOGISTICS POLAND sp. z o.o. PL - Gdanska 36 - 70-660 Szczecin + ul. Gdańska 36, 70-660 Szczecin MBudas@alexander-logistics.com @@ -57,6 +57,7 @@ #CURRENCY# + Szczecin @@ -104,5 +105,38 @@ + + + + 6 + + + + PL79116022020000000654306674 + BIGBPLPWXXX + Bank Millennium S.A. + Konto PLN + + + PL16116022020000000654910469 + BIGBPLPWXXX + Bank Millennium S.A. + Konto EUR + + + PL72116022020000000654911595 + BIGBPLPWXXX + Bank Millennium S.A. + Konto USD + + \ No newline at end of file diff --git a/office-alexander-logistics-app/src/test/resources/ksef/output/invoice-simple.xml b/office-alexander-logistics-app/src/test/resources/ksef/output/invoice-simple.xml index 6e79abc..5625343 100644 --- a/office-alexander-logistics-app/src/test/resources/ksef/output/invoice-simple.xml +++ b/office-alexander-logistics-app/src/test/resources/ksef/output/invoice-simple.xml @@ -6,19 +6,19 @@ FA 3 - 2026-04-16T06:22:32.455873037Z + 2026-04-27T16:20:53.265515Z Imixs eInvoice + PL 9552521552 - Alexander Global Logistics + ALEXANDER GLOBAL LOGISTICS POLAND sp. z o.o. PL - Gdanska 36 - 70-660 Szczecin + ul. Gdańska 36, 70-660 Szczecin MBudas@alexander-logistics.com @@ -56,9 +56,10 @@ PLN 2025-02-10 + Szczecin FV/2025/001 - 2025-03-10 + 2026-04-27 1 - a743f373-b75c-44c5-a077-ee628295b5d3 szt. 1 6000.00 6000.00 - 0 2 - 9eb2d946-a3cb-4adb-8ed1-069e2f48d67d szt. 1 4000.00 4000.00 - 0 + + + + + 2025-03-10 + + 6 + + + PL79116022020000000654306674 + BIGBPLPWXXX + Bank Millennium S.A. + Konto PLN + + + PL16116022020000000654910469 + BIGBPLPWXXX + Bank Millennium S.A. + Konto EUR + + diff --git a/workflow/pl/e-invoice/templates/ksef.xml b/workflow/pl/e-invoice/templates/ksef.xml index 5f80b0d..15eca9f 100644 --- a/workflow/pl/e-invoice/templates/ksef.xml +++ b/workflow/pl/e-invoice/templates/ksef.xml @@ -105,5 +105,38 @@ + + + + 6 + + + + PL79116022020000000654306674 + BIGBPLPWXXX + Bank Millennium S.A. + Konto PLN + + + PL16116022020000000654910469 + BIGBPLPWXXX + Bank Millennium S.A. + Konto EUR + + + PL72116022020000000654911595 + BIGBPLPWXXX + Bank Millennium S.A. + Konto USD + + \ No newline at end of file