diff --git a/office-alexander-logistics-testclient/src/test/java/com/alexanderlogistics/rest/TestSendInvoice.java b/office-alexander-logistics-testclient/src/test/java/com/alexanderlogistics/rest/TestSendInvoice.java new file mode 100644 index 0000000..6bf4f13 --- /dev/null +++ b/office-alexander-logistics-testclient/src/test/java/com/alexanderlogistics/rest/TestSendInvoice.java @@ -0,0 +1,87 @@ +package com.alexanderlogistics.rest; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + +import java.io.IOException; +import java.util.List; +import java.util.logging.Logger; + +import org.imixs.melman.FormAuthenticator; +import org.imixs.melman.RestAPIException; +import org.imixs.melman.WorkflowClient; +import org.imixs.workflow.ItemCollection; +import org.imixs.workflow.exceptions.PluginException; +import org.imixs.workflow.xml.XMLDataCollectionAdapter; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import jakarta.xml.bind.JAXBException; + +/** + * A simple example how to send an invoice document remote. + * + */ +// @Disabled +public class TestSendInvoice { + + private static Logger logger = Logger.getLogger(TestSendInvoice.class.getName()); + + WorkflowClient client = null; + + // String restAPI = "https://test.alexander-logistics.office-workflow.de/api"; + String restAPI = "http://localhost:8080/api"; + String userID = "kutzner-service"; + String password = "imixs"; + + /** + * Setup a new Rest Client + * + * @throws PluginException + */ + @BeforeEach + public void setup() throws PluginException { + + client = new WorkflowClient(restAPI); + FormAuthenticator aut; + try { + aut = new FormAuthenticator(restAPI, userID, password); + client.registerClientRequestFilter(aut); + } catch (RestAPIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * Create an event log entry.... + * + */ + @Test + public void sendXMLData() { + + logger.info("send invoice..."); + ItemCollection payLoad = new ItemCollection(); + ItemCollection result = null; + try { + // read test data + List col = null; + // read default content + + col = XMLDataCollectionAdapter + .readCollectionFromInputStream(getClass().getResourceAsStream("/invoice-01.xml")); + assertEquals(1, col.size()); + // set invoice data.... + // XMLDataCollection result = client.postXMLDocument("workflow/workitem", + // XMLDocumentAdapter.getDocument(col.get(0))); + result = client.processWorkitem(col.get(0)); + + logger.info("completed"); + } catch (RestAPIException | JAXBException | IOException e) { + logger.severe("Failed to send event log entry: " + e.getMessage()); + + fail(e); + } + } + +} diff --git a/office-alexander-logistics-testclient/src/test/resources/invoice-01.xml b/office-alexander-logistics-testclient/src/test/resources/invoice-01.xml new file mode 100644 index 0000000..e6ee361 --- /dev/null +++ b/office-alexander-logistics-testclient/src/test/resources/invoice-01.xml @@ -0,0 +1,187 @@ + + + + + + workitem + + + Rechnungsausgang + + + 5001 + + + 980 + + + + + + + application/pdf + + JVBERi0xLjMgCiXi48............................ + + + + + + + + + + NACHL40 + + + EUR + + + 252.84 + + + Container transport from port + to warehouse in Antwerp + + + H + + + SEE + + + LA-PAP-2508-012 + + + + + FC + + + EUR + + + 22.38 + + + Fuel Charge as per fuel floater August + 2025 + + + H + + + DIESEL + + + LA-PAP-2508-012 + + + + + ZOLLABF + + + EUR + + + 16.2 + + + custom clearance fiscal representation + VAT reporting + + + H + + + SEE + + + LA-PAP-2508-012 + + + + + + + + + Graphic Packaging International (NL) + + + D12495 + + + 0.0 + + + 202508 + + + IM-ZEL + + + + + + EUR + + + 2025-09-01T00:00:00+02:00 + + + 2025-10-16T00:00:00+02:00 + + + EN + + + 245956 + + + LA-PAP-2508-012 + LA-PAP-2508-012 + LA-PAP-2508-012 + + + 0.0 + + + 2025-10-16T00:00:00+02:00 + + + 469.07 + + + LA-PAP-2508-012 + + + 469.07 + + + 469.07 + + + 0.0 + + + R + + + Ausgangsrechnung + + + 0.0 + + + 001 + + + 10 + + + + + \ No newline at end of file diff --git a/templates/imixs/29ae0278-5a41-43e0-b4e7-c36d4213e1a3.xml b/templates/imixs/29ae0278-5a41-43e0-b4e7-c36d4213e1a3.xml new file mode 100644 index 0000000..562303f --- /dev/null +++ b/templates/imixs/29ae0278-5a41-43e0-b4e7-c36d4213e1a3.xml @@ -0,0 +1,585 @@ + + + + + 2025-09-01T18:30:01.140+02:00 + + + imixs-workflow-service + + + imixs-workflow-service + + + 0 + + + 2025-09-01T18:30:01.139|rechnungsausgang-de-1.0|5001.980|5001| + + + + + application/pdf + + + + imixs-workflow-service + + + 95644 + + + 2025-09-01T18:30:00.642+02:00 + + + 001_245956_250901_R.pdf + + + C9E59AF1DFA81CE54EF9881919DE1461 + + + imixs-workflow-service + + + + + application/xml + + + + imixs-workflow-service + + + 15505 + + + 2025-09-01T18:30:00.642+02:00 + + + 001_R_245956_181333105.xml + + + EE7ABDA6FEBBF781E7622AF846AFFB5C + + + imixs-workflow-service + + + + + + + 2 + + + 001_245956_250901_R.pdf + 001_R_245956_181333105.xml + + + true + + + 980 + + + 2025-09-01T18:30:00.642+02:00 + + + 5001 + + + rechnungsausgang-de-1.0 + + + 2025-09-01T18:30:01.140+02:00 + + + + + + imixs-workflow-service + + + 5001 + + + {process:bf82e9a0-955c-4c76-9c9d-7540f13e649e:member} + {space:508ad55d-75e4-4ef5-8443-caef35fda82c:member} + + + 29ae0278-5a41-43e0-b4e7-c36d4213e1a3-1756744201141 + + + 5001 + + + 794631802971c264 + + + 29ae0278-5a41-43e0-b4e7-c36d4213e1a3 + + + bf82e9a0-955c-4c76-9c9d-7540f13e649e + 508ad55d-75e4-4ef5-8443-caef35fda82c + + + 1 + + + + + + Rechnungsausgang + + + Offen + + + R 245956 D12495 Graphic Packaging International (NL) (EUR 469,07) + + + 6f4f891e-4e55-4ebb-b539-a8620acf02bf + + + mgeisler + amahner + skueck + mmwangi + sdwomoh + + + + + NACHL40 + + + EUR + + + 252.84 + + + Container transport from port + to warehouse in Antwerp + + + H + + + SEE + + + LA-PAP-2508-012 + + + + + FC + + + EUR + + + 22.38 + + + Fuel Charge as per fuel floater August + 2025 + + + H + + + DIESEL + + + LA-PAP-2508-012 + + + + + ZOLLABF + + + EUR + + + 16.2 + + + custom clearance fiscal representation + VAT reporting + + + H + + + SEE + + + LA-PAP-2508-012 + + + + + ENTLCON + + + EUR + + + 120.0 + + + unloading container at the warehouse + + reloading cargo onto truck + + + H + + + SEE + + + LA-PAP-2508-012 + + + + + HAND + + + EUR + + + 15.65 + + + Road tax + + + H + + + SEE + + + LA-PAP-2508-012 + + + + + NACHL40 + + + EUR + + + 42.0 + + + Left bank charges for delivery to whs + + + H + + + SEE + + + LA-PAP-2508-012 + + + + + + + + 001_R_245956_181333105.xml + + + + + + Graphic Packaging International (NL) + + + D12495 + + + 0.0 + + + 202508 + + + IM-ZEL + + + + + + EUR + + + 2025-09-01T00:00:00+02:00 + + + 2025-10-16T00:00:00+02:00 + + + EN + + + 245956 + + + LA-PAP-2508-012 + LA-PAP-2508-012 + LA-PAP-2508-012 + LA-PAP-2508-012 + LA-PAP-2508-012 + LA-PAP-2508-012 + + + 0.0 + + + 2025-10-16T00:00:00+02:00 + + + 469.07 + + + LA-PAP-2508-012 + + + 469.07 + + + 469.07 + + + 0.0 + + + R + + + Ausgangsrechnung + + + 0.0 + + + 001 + + + imixs-workflow-service + + + imixs-workflow-service + + + + + + amahner + mting + + + mgeisler + + + amahner + skueck + mmwangi + sdwomoh + + + iashrafi + mnajafi + + + lschloh + mwoehning + atuleweit + vkoszeck + + + mwoehning + lschloh + atuleweit + tcengel + mgerdes + vkoszeck + nmersmann + mklamka + + + 980 + + + 3055530 + + + BP2495 + + + Graphic Packaging International (NL) + + + 10 + + + amahner + mting + + + Assistenz + + + mgeisler + + + Verantwortlich + + + Mahnwesen + + + bf82e9a0-955c-4c76-9c9d-7540f13e649e + + + amahner + skueck + mmwangi + sdwomoh + + + Team + + + 3055530 + + + iashrafi + mnajafi + + + Assistenz + + + lschloh + mwoehning + atuleweit + vkoszeck + + + Verantwortlich + + + Import Paper + + + 508ad55d-75e4-4ef5-8443-caef35fda82c + + + mwoehning + lschloh + atuleweit + tcengel + mgerdes + vkoszeck + nmersmann + mklamka + + + Team + + + + + + Mahnwesen + + + bf82e9a0-955c-4c76-9c9d-7540f13e649e + + + Import Paper + + + Import Paper + + + 508ad55d-75e4-4ef5-8443-caef35fda82c + + + + + + <?xml version="1.0"?> + <imixs-form> + <imixs-form-section columns="3" label="Rechnungsdaten"> + <item name="invoice.text" type="text" label="Text:" readonly="true"/> + <item name="partner.id" type="custom" path="alexander/businesspartner_search" + readonly="true" label="Businesspartner:"/> + </imixs-form-section> + + <imixs-form-section columns="3" label=""> + <item name="invoice.number" type="text" label="Rechnungsnummer:" readonly="true" /> + <item name="invoice.date" type="date" label="Rechnungsdatum:" readonly="true" /> + <item name="invoice.duedate" type="date" label="Fälligkeit:" readonly="true"/> + </imixs-form-section> + + <imixs-form-section columns="3"> + <item name="payment.term" type="text" label="Zahlungsbedingung:" readonly="true" /> + <item name="invoice.reminder" type="date" required="true" label="Wiedervorlage:" /> + <item name="invoice.protest" type="selectBooleanCheckbox" label="Wurde reklamiert"/> + <item name="invoice.atc.number" type="text" label="ATC-Nr." readonly="true"/> + </imixs-form-section> + <imixs-form-section> + <item name="" type="custom" path="alexander/spaceref" label="Bereich:" /> + </imixs-form-section> + + <imixs-form-section label="Positionen" path="alexander/section_datevbuchung" /> + <imixs-form-section label="Zahlungseingänge" path="alexander/section_payments" /> + <imixs-form-section label="Mahnläufe" path="alexander/section_dunnings" /> + </imixs-form> + + + alexander/form_basic + + + Rechnungsausgang + + + + 2025-09-01T18:30:00.642+02:00 + Import aus Cargosoft + imixs-workflow-service + + + + typcn-upload-outline|typcn-weather-sunny,icon-sub-ne + + + Offen + + + R 245956 D12495 Graphic Packaging International (NL) (EUR 469,07) + + + workitem + + + + 2025-09-01T18:30:00.642+02:00 + Import aus Cargosoft + imixs-workflow-service + + + + \ No newline at end of file diff --git a/templates/imixs/outgoing_invoice.xml b/templates/imixs/outgoing_invoice.xml new file mode 100644 index 0000000..e6ee361 --- /dev/null +++ b/templates/imixs/outgoing_invoice.xml @@ -0,0 +1,187 @@ + + + + + + workitem + + + Rechnungsausgang + + + 5001 + + + 980 + + + + + + + application/pdf + + JVBERi0xLjMgCiXi48............................ + + + + + + + + + + NACHL40 + + + EUR + + + 252.84 + + + Container transport from port + to warehouse in Antwerp + + + H + + + SEE + + + LA-PAP-2508-012 + + + + + FC + + + EUR + + + 22.38 + + + Fuel Charge as per fuel floater August + 2025 + + + H + + + DIESEL + + + LA-PAP-2508-012 + + + + + ZOLLABF + + + EUR + + + 16.2 + + + custom clearance fiscal representation + VAT reporting + + + H + + + SEE + + + LA-PAP-2508-012 + + + + + + + + + Graphic Packaging International (NL) + + + D12495 + + + 0.0 + + + 202508 + + + IM-ZEL + + + + + + EUR + + + 2025-09-01T00:00:00+02:00 + + + 2025-10-16T00:00:00+02:00 + + + EN + + + 245956 + + + LA-PAP-2508-012 + LA-PAP-2508-012 + LA-PAP-2508-012 + + + 0.0 + + + 2025-10-16T00:00:00+02:00 + + + 469.07 + + + LA-PAP-2508-012 + + + 469.07 + + + 469.07 + + + 0.0 + + + R + + + Ausgangsrechnung + + + 0.0 + + + 001 + + + 10 + + + + + \ No newline at end of file diff --git a/workflow/pl/sepa-export-manual-pl-3.0.2.bpmn b/workflow/pl/sepa-export-manual-pl-3.0.2.bpmn index 943bb2d..236c441 100644 --- a/workflow/pl/sepa-export-manual-pl-3.0.2.bpmn +++ b/workflow/pl/sepa-export-manual-pl-3.0.2.bpmn @@ -579,7 +579,7 @@ result.isValid=true; - + @@ -691,7 +691,7 @@ result.isValid=true; false - +