From 5aa9fba8f8db6de8cc0512f11b2ea33c57a31d77 Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Thu, 9 Oct 2025 17:15:30 +0200 Subject: [PATCH] Auswahl eines optionalen Buchungskontos bei Eingangsgutschriften --- .../BusinessPartnerController.java | 19 + .../BusinessPartnerService.java | 19 +- .../resources/bundle/custom_de.properties | 2 +- .../resources/bundle/custom_en.properties | 2 +- .../parts/alexander/zahlungsart.xhtml | 36 +- .../parts/alexander/zahlungsart_old.xhtml | 38 ++ .../main/webapp/pages/xxxdataviews/data.xhtml | 201 ------ ...chnungseingang-sachrechnung-ams-1.0.0.bpmn | 367 ++++------- ...chnungseingang-sachrechnung-de-1.0.23.bpmn | 618 +++++++----------- 9 files changed, 467 insertions(+), 835 deletions(-) create mode 100644 office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/zahlungsart_old.xhtml delete mode 100644 office-alexander-logistics-app/src/main/webapp/pages/xxxdataviews/data.xhtml diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerController.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerController.java index c137a29..e1752c8 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerController.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerController.java @@ -206,6 +206,25 @@ public class BusinessPartnerController implements Serializable { validationController.setRequired(false); } + /** + * Diese Methode liefert eine Liste mit sämtlichen Buchungskonten die wir für + * den aktuellen Businesspartner kennen + * + * @return + */ + public List getAccounts(String bpid) { + List result = new ArrayList<>(); + ItemCollection partner = businessPartnerService.getBusinessPartnerByID(bpid); + if (partner != null) { + result.add(partner.getItemValueString("cdtr.number")); + result.add(partner.getItemValueString("cargosot.credit.cdtr.number")); + result.add(partner.getItemValueString("dbtr.number")); + } + // Entfernt null oder leere Strings + result.removeIf(s -> s == null || s.isBlank()); + return result; + } + /** * WorkflowEvent listener resolved additional data. * diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerService.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerService.java index 64dc970..779ead4 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerService.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/BusinessPartnerService.java @@ -195,10 +195,27 @@ public class BusinessPartnerService { } logger.info("...is creditor invoice"); if (InvoiceUtil.isCreditorInvoice(workitem)) { - workitem.setItemValue("cdtr.number", businessPartner.getItemValueString("cdtr.number")); workitem.setItemValue("cdtr.name", businessPartner.getItemValueString("partner.name")); workitem.setItemValue("cdtr.mail", businessPartner.getItemValueString("cdtr.mail")); workitem.setItemValue("invoice.country", businessPartner.getItemValueString("_vendor_country")); + + /* + * Sonderfall - Frau Mahner 9.10.2025 + * Wenn es eine Gutschrift ist und man über das Custom part 'zahlungsart.xthml' + * ein alternatives Konto gewählt hat muss dieses gewinnen! + * Ansonsten nehmen wir die cdtr.number + */ + if ("credit".equals(workitem.getItemValueString("payment.type"))) { + String bookingAccount = workitem.getItemValueString("payment.booking.account"); + if (!bookingAccount.isBlank()) { + workitem.setItemValue("cdtr.number", bookingAccount); + } else { + workitem.setItemValue("cdtr.number", businessPartner.getItemValueString("cdtr.number")); + } + } else { + // default - cdtr.number + workitem.setItemValue("cdtr.number", businessPartner.getItemValueString("cdtr.number")); + } } // Validate Business Partner Status! diff --git a/office-alexander-logistics-app/src/main/resources/bundle/custom_de.properties b/office-alexander-logistics-app/src/main/resources/bundle/custom_de.properties index a59aa68..4e9dbde 100644 --- a/office-alexander-logistics-app/src/main/resources/bundle/custom_de.properties +++ b/office-alexander-logistics-app/src/main/resources/bundle/custom_de.properties @@ -19,7 +19,7 @@ payment.type=Zahlungsart payment.no_sepa=Manuelle Auslandszahlung payment.direct_debit=Lastschrift payment.credit=Gutschrift - +payment.booking.account=Buchungskonto pos.number=Positionsnummer pos.tax=Steuer pos.type=Leistungsart diff --git a/office-alexander-logistics-app/src/main/resources/bundle/custom_en.properties b/office-alexander-logistics-app/src/main/resources/bundle/custom_en.properties index b191591..2c7c79a 100644 --- a/office-alexander-logistics-app/src/main/resources/bundle/custom_en.properties +++ b/office-alexander-logistics-app/src/main/resources/bundle/custom_en.properties @@ -19,7 +19,7 @@ payment.type=Payment Type payment.no_sepa=Manual foreign payment payment.direct_debit=Direct Debit payment.credit=Credit - +payment.booking.account=Account pos.number=Pos-No. pos.tax=Tax pos.type=Type diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/zahlungsart.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/zahlungsart.xhtml index c8e6df8..ce85a2f 100644 --- a/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/zahlungsart.xhtml +++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/zahlungsart.xhtml @@ -4,17 +4,31 @@ - - - - - - - - - - - + + + + + + + + + + + + + + #{custom['payment.booking.account']}: + + + + + + diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/zahlungsart_old.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/zahlungsart_old.xhtml new file mode 100644 index 0000000..c8e6df8 --- /dev/null +++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/parts/alexander/zahlungsart_old.xhtml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/office-alexander-logistics-app/src/main/webapp/pages/xxxdataviews/data.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/xxxdataviews/data.xhtml deleted file mode 100644 index ed68085..0000000 --- a/office-alexander-logistics-app/src/main/webapp/pages/xxxdataviews/data.xhtml +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - -
-
-

- - -

-
- - -
- - - - - -
-
- - - - - - -
-
- - - - - - - - -
- - -
- #{message.total_result} - #{dataViewController.getTotalCount()} - #{message.serach_hits} -
- - - - - - - - - - - - -
- - - - - - - - - -
-
- -
- - - - - - - - - - - - #{columnDef.item['item.label']} - - - - - - - - #{columnDef.item['item.label']} - - - - - #{columnDef.item['item.label']} - - - - - - - - #{columnDef.item['item.label']} - - - - - - #{columnDef.item['item.label']} - - - - - - - - #{columnDef.item['item.label']} - - - - - - - - - - -
-
- -
-
- - -
-
- - - -
\ No newline at end of file diff --git a/workflow/ams/rechnungseingang-sachrechnung-ams-1.0.0.bpmn b/workflow/ams/rechnungseingang-sachrechnung-ams-1.0.0.bpmn index 2fbee8c..3694086 100644 --- a/workflow/ams/rechnungseingang-sachrechnung-ams-1.0.0.bpmn +++ b/workflow/ams/rechnungseingang-sachrechnung-ams-1.0.0.bpmn @@ -76,6 +76,7 @@ DataObject_2 task_TQ0OeA event_oyj02w + event_oFwt0Q IntermediateCatchEvent_15 @@ -88,7 +89,6 @@ IntermediateCatchEvent_12 IntermediateCatchEvent_23 Task_1 - IntermediateCatchEvent_26 Task_10 Task_11 ExclusiveGateway_4 @@ -115,7 +115,6 @@ IntermediateCatchEvent_8 IntermediateThrowEvent_2 IntermediateThrowEvent_4 - IntermediateCatchEvent_27 IntermediateCatchEvent_32 IntermediateCatchEvent_33 EventBasedGateway_2 @@ -235,7 +234,6 @@ if (workitem['payment.type'][0]!="direct_debit" && workitem['payment.type'][0]! SequenceFlow_0 - SequenceFlow_15 SequenceFlow_21 SequenceFlow_33 @@ -289,7 +287,7 @@ if (workitem['payment.type'][0]!="direct_debit" && workitem['payment.type'][0]! SequenceFlow_63 SequenceFlow_71 SequenceFlow_37 - SequenceFlow_66 + sequenceFlow_KcLbVA @@ -489,6 +487,7 @@ Betrag: _amount (Brutto € _amount_brutto$workflowgroup - $workflowstatus]]> SequenceFlow_33 SequenceFlow_20 + sequenceFlow_OipFFg SequenceFlow_22 @@ -595,12 +594,12 @@ Betrag: _amount (Brutto € _amount_brutto - + SequenceFlow_15 - + @@ -1480,8 +1479,8 @@ Betrag: invoice.total invoice.currencySequenceFlow_23 SequenceFlow_18 SequenceFlow_19 - SequenceFlow_64 + sequenceFlow_LWKEkw @@ -3195,196 +3194,16 @@ if (workitem['payment.type'][0]!="direct_debit" && workitem['payment.type'][0]! - - SequenceFlow_67 + + sequenceFlow_KcLbVA - - SequenceFlow_65 + + sequenceFlow_LWKEkw - - - - - - - - - - _subject]]> - - - - - - - - - _amount (Brutto € _amount_brutto) -_description]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - home]]> - - - - - - - - - - - - false - - - - - - - SequenceFlow_64 - SequenceFlow_65 - - - - - - - - - - - - - - - - - _subject]]> - - - - - - - - - _amount (Brutto € _amount_brutto) -_description]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - home - - start - false -]]> - - - - - - - - - - - - false - - - - - - - SequenceFlow_66 - SequenceFlow_67 - - - - - - - @@ -4075,7 +3894,10 @@ result.isValid=true; rechnungseingang-de-1.2 5000 990 - ]]> + + + +]]> @@ -4415,6 +4237,97 @@ Betrag: _amount (Brutto € _amount_brutto + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home]]> + + + + + + + + + + + + false + + + + + + + SequenceFlow_15 + sequenceFlow_OipFFg + + + + + + + + + + @@ -4539,9 +4452,9 @@ Betrag: _amount (Brutto € _amount_brutto - + - + @@ -4781,18 +4694,6 @@ Betrag: _amount (Brutto € _amount_brutto - - - - - - - - - - - - @@ -4892,6 +4793,12 @@ Betrag: _amount (Brutto € _amount_brutto + + + + + + @@ -4935,10 +4842,9 @@ Betrag: _amount (Brutto € _amount_brutto - + - - + @@ -4972,9 +4878,7 @@ Betrag: _amount (Brutto € _amount_brutto - - - + @@ -5294,30 +5198,6 @@ Betrag: _amount (Brutto € _amount_brutto - - - - - - - - - - - - - - - - - - - - - - - - @@ -5478,6 +5358,21 @@ Betrag: _amount (Brutto € _amount_brutto + + + + + + + + + + + + + + + diff --git a/workflow/rechnungseingang-sachrechnung-de-1.0.23.bpmn b/workflow/rechnungseingang-sachrechnung-de-1.0.23.bpmn index d4f9308..9db2ebe 100644 --- a/workflow/rechnungseingang-sachrechnung-de-1.0.23.bpmn +++ b/workflow/rechnungseingang-sachrechnung-de-1.0.23.bpmn @@ -72,8 +72,10 @@ IntermediateCatchEvent_36 IntermediateThrowEvent_6 IntermediateCatchEvent_40 - IntermediateThrowEvent_7 + event_kfBcgQ + task_Q7SOng + event_eVD9GQ Task_6 @@ -103,7 +105,6 @@ IntermediateCatchEvent_18 IntermediateCatchEvent_14 Task_1 - IntermediateCatchEvent_26 Task_14 Task_10 Task_11 @@ -134,12 +135,10 @@ IntermediateCatchEvent_4 ExclusiveGateway_3 IntermediateCatchEvent_8 - IntermediateCatchEvent_27 IntermediateCatchEvent_5005-10 IntermediateThrowEvent_4 IntermediateThrowEvent_2 IntermediateCatchEvent_2 - IntermediateCatchEvent_32 EventBasedGateway_3 IntermediateCatchEvent_33 @@ -232,7 +231,6 @@ if (workitem['payment.type'][0]!="direct_debit" && workitem['payment.type'][0]! SequenceFlow_0 - SequenceFlow_15 SequenceFlow_21 SequenceFlow_33 @@ -286,7 +284,7 @@ if (workitem['payment.type'][0]!="direct_debit" && workitem['payment.type'][0]! SequenceFlow_63 SequenceFlow_71 SequenceFlow_37 - SequenceFlow_66 + sequenceFlow_fkG2mg @@ -486,6 +484,7 @@ Betrag: _amount (Brutto € _amount_brutto$workflowgroup - $workflowstatus]]> SequenceFlow_33 SequenceFlow_20 + sequenceFlow_yv0oYQ SequenceFlow_22 @@ -569,6 +568,9 @@ Betrag: _amount (Brutto € _amount_brutto + + + ]]> @@ -591,12 +593,12 @@ Betrag: _amount (Brutto € _amount_brutto - + SequenceFlow_15 - + @@ -1467,8 +1469,8 @@ Betrag: invoice.total invoice.currencySequenceFlow_23 SequenceFlow_18 SequenceFlow_19 - SequenceFlow_64 + sequenceFlow_6XZa7Q @@ -3175,298 +3177,30 @@ if (workitem['payment.type'][0]!="direct_debit" && workitem['payment.type'][0]! - - SequenceFlow_70 + + sequenceFlow_uVGLzQ - - SequenceFlow_67 + + sequenceFlow_fkG2mg - - SequenceFlow_65 + + sequenceFlow_6XZa7Q - - - - - - - - - - _subject]]> - - - - - - - - - _amount (Brutto € _amount_brutto) -_description]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - home]]> - - - - - - - - - - - - false - - - - - - - SequenceFlow_64 - SequenceFlow_65 - - - - - - - - - - - - - - - - - _subject]]> - - - - - - - - - _amount (Brutto € _amount_brutto) -_description]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - home - - start - false -]]> - - - - - - - - - - - - false - - - - - - - SequenceFlow_66 - SequenceFlow_67 - - - - - - - - - - - - - - - - - _subject]]> - - - - - - - - - _amount (Brutto € _amount_brutto) -_description]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - home]]> - - - - - - - - - - - - false - - - - - - - SequenceFlow_69 - SequenceFlow_70 - SequenceFlow_2 SequenceFlow_68 - SequenceFlow_69 + sequenceFlow_uVGLzQ - - - - - - @@ -4056,11 +3790,14 @@ result.isValid=true; stop false - + rechnungseingang-de-1.2 5000 990 - ]]> + + + +]]> @@ -4087,16 +3824,9 @@ result.isValid=true; SequenceFlow_83 - SequenceFlow_82 + sequenceFlow_occvwQ + - - SequenceFlow_82 - - - - - - @@ -4363,6 +4093,152 @@ Betrag: _amount (Brutto € _amount_brutto + + + + + + + + + + _subject]]> + + + + + + + + + _amount (Brutto € _amount_brutto) +_description]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + home + + start + false + + + +]]> + + + + + + + + + + + + false + + + + + + + SequenceFlow_15 + sequenceFlow_yv0oYQ + + + + + + + + + + + + + + + + + txtlastcomment]]> + + + + + + + + + numsequencenumber: cdtr.name invoice.number (invoice.currency invoice.total) space.name]]> + + + true + + + + + + + + + + + + + + + $workflowgroup - $workflowstatus]]> + SequenceFlow_60 + sequenceFlow_occvwQ + sequenceFlow_sYFVlw + + + + + + + sequenceFlow_sYFVlw + + + + @@ -4427,9 +4303,9 @@ Betrag: _amount (Brutto € _amount_brutto - + - + @@ -4457,15 +4333,15 @@ Betrag: _amount (Brutto € _amount_brutto - + - + - + - + @@ -4763,9 +4639,9 @@ Betrag: _amount (Brutto € _amount_brutto - + - + @@ -4780,24 +4656,6 @@ Betrag: _amount (Brutto € _amount_brutto - - - - - - - - - - - - - - - - - - @@ -4865,15 +4723,9 @@ Betrag: _amount (Brutto € _amount_brutto - + - - - - - - - + @@ -4897,10 +4749,24 @@ Betrag: _amount (Brutto € _amount_brutto + + + + + + + + + + + + + + + - - + @@ -4910,8 +4776,7 @@ Betrag: _amount (Brutto € _amount_brutto - - + @@ -4936,21 +4801,20 @@ Betrag: _amount (Brutto € _amount_brutto - + - - - - + + + - - + + @@ -5304,48 +5168,12 @@ Betrag: _amount (Brutto € _amount_brutto - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -5414,18 +5242,12 @@ Betrag: _amount (Brutto € _amount_brutto - - - - - - - - + + @@ -5482,6 +5304,34 @@ Betrag: _amount (Brutto € _amount_brutto + + + + + + + + + + + + + + + + + + + + + + + + + + + +