fix steuerbescheid ATC
This commit is contained in:
parent
a3609c26c9
commit
7217b76b43
4 changed files with 1519 additions and 5 deletions
|
|
@ -396,6 +396,132 @@ public class CargosoftMigrationRestService implements Serializable {
|
|||
return log;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dieser agent prüft die Rechnungen der letzten 2 Wochen auf einen Billingtext
|
||||
* der mit "24DE" beginnt und übernimmt dann diesen Text als neue ATC number
|
||||
*
|
||||
* @return
|
||||
* @throws QueryException
|
||||
* @throws AccessDeniedException
|
||||
* @throws ProcessingErrorException
|
||||
* @throws PluginException
|
||||
* @throws ModelException
|
||||
*/
|
||||
@GET
|
||||
@Path("/fix-atc")
|
||||
@Produces({ MediaType.TEXT_PLAIN })
|
||||
public String fixATCNumber()
|
||||
throws QueryException, AccessDeniedException, ProcessingErrorException, PluginException, ModelException {
|
||||
String query = "($modelversion:rechnungsausgang-de-1.0) " +
|
||||
"AND $created:[20241001 TO 20241201]";
|
||||
logger.info("query=" + query);
|
||||
log = "Query\n\n" + query;
|
||||
|
||||
List<ItemCollection> result = documentService.find(query, 9999, 0);
|
||||
|
||||
log = log + "\n\nSelection Count=" + result.size();
|
||||
log = log + "\n\nFixes:\n\n";
|
||||
|
||||
for (ItemCollection workitem : result) {
|
||||
logger.info("verify: " + workitem.getUniqueID());
|
||||
|
||||
if (!workitem.hasItem("invoice.atc.number")) {
|
||||
// Fetch _childitems and check billingText
|
||||
List<ItemCollection> childs = InvoiceUtil.explodeChildList(workitem);
|
||||
for (ItemCollection child : childs) {
|
||||
List<String> billingTexts = child.getItemValueList("billingtext", String.class);
|
||||
boolean contains24DE = false;
|
||||
String atcNumber = "";
|
||||
for (String str : billingTexts) {
|
||||
if (str.startsWith("24DE")) {
|
||||
contains24DE = true;
|
||||
atcNumber = str;
|
||||
logger.info(" found in " + workitem.getUniqueID());
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (contains24DE) {
|
||||
count++;
|
||||
workitem.setItemValue("invoice.atc.number", atcNumber);
|
||||
// save only
|
||||
logger.info(" update: " + workitem.getUniqueID());
|
||||
log = log + "\n - " + workitem.getUniqueID();
|
||||
documentService.save(workitem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
log = log + "\n\n=== Completed! " + count + " fixes! ===\n\n";
|
||||
return log;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dieser agent prüft die Rechnungen der letzten 2 Wochen auf einen Billingtext
|
||||
* der mit "24DE" beginnt und übernimmt dann diesen Text als neue ATC number
|
||||
*
|
||||
* @return
|
||||
* @throws QueryException
|
||||
* @throws AccessDeniedException
|
||||
* @throws ProcessingErrorException
|
||||
* @throws PluginException
|
||||
* @throws ModelException
|
||||
*/
|
||||
@GET
|
||||
@Path("/fix-atc2")
|
||||
@Produces({ MediaType.TEXT_PLAIN })
|
||||
public String fixATCNumber2()
|
||||
throws QueryException, AccessDeniedException, ProcessingErrorException, PluginException, ModelException {
|
||||
String query = "($modelversion:rechnungsausgang-de-1.0) " +
|
||||
"AND $created:[20241001 TO 20241201]";
|
||||
logger.info("query=" + query);
|
||||
log = "Query\n\n" + query;
|
||||
|
||||
List<ItemCollection> result = documentService.find(query, 9999, 0);
|
||||
|
||||
log = log + "\n\nSelection Count=" + result.size();
|
||||
log = log + "\n\nFixes:\n\n";
|
||||
|
||||
for (ItemCollection workitem : result) {
|
||||
logger.info("verify: " + workitem.getUniqueID());
|
||||
|
||||
if (workitem.hasItem("invoice.atc.number")) {
|
||||
// Fetch _childitems and check billingText
|
||||
List<ItemCollection> childs = InvoiceUtil.explodeChildList(workitem);
|
||||
for (ItemCollection child : childs) {
|
||||
List<String> billingTexts = child.getItemValueList("billingtext", String.class);
|
||||
boolean contains24DE = false;
|
||||
String atcNumber = "";
|
||||
for (String str : billingTexts) {
|
||||
if (str.startsWith("24DE")) {
|
||||
contains24DE = true;
|
||||
atcNumber = str;
|
||||
logger.info(" found in " + workitem.getUniqueID());
|
||||
child.setItemValue("atc.number", atcNumber);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (contains24DE) {
|
||||
count++;
|
||||
|
||||
InvoiceUtil.implodeChildList(workitem, childs);
|
||||
// save only
|
||||
logger.info(" update: " + workitem.getUniqueID());
|
||||
log = log + "\n - " + workitem.getUniqueID();
|
||||
documentService.save(workitem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
log = log + "\n\n=== Completed! " + count + " fixes! ===\n\n";
|
||||
return log;
|
||||
}
|
||||
|
||||
public String fixFehlerhafteCargosoftDatenMitSnapshot()
|
||||
throws QueryException, AccessDeniedException, ProcessingErrorException, PluginException, ModelException {
|
||||
|
||||
|
|
|
|||
|
|
@ -701,7 +701,8 @@ public class CargosoftXMLInvoiceImportService {
|
|||
String val = billingTextNodes.item(bi).getTextContent();
|
||||
childItemCol.appendItemValue("BillingText", val);
|
||||
// handelt es sich um eine ATC Nummer?
|
||||
if (val.startsWith("ATC")) {
|
||||
// Änderung 22.10.2024 - jetzt auch auf 24DE prüfen
|
||||
if (val.startsWith("ATC") || val.startsWith("24DE")) {
|
||||
childItemCol.setItemValue("atc.number", val);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8
pom.xml
8
pom.xml
|
|
@ -26,16 +26,16 @@
|
|||
<!-- Dependency Versions -->
|
||||
<jakarta.version>10.0.0</jakarta.version>
|
||||
<org.imixs.office.version>5.0.3-SNAPSHOT</org.imixs.office.version>
|
||||
<org.imixs.workflow.version>6.0.8-SNAPSHOT</org.imixs.workflow.version>
|
||||
<org.imixs.workflow.version>6.0.8</org.imixs.workflow.version>
|
||||
<org.imixs.marty.version>5.0.0</org.imixs.marty.version>
|
||||
<org.imixs.archive.version>3.0.2</org.imixs.archive.version>
|
||||
<org.imixs.adapters.version>3.0.2-SNAPSHOT</org.imixs.adapters.version>
|
||||
<org.imixs.melman.version>2.0.0-SNAPSHOT</org.imixs.melman.version>
|
||||
<org.imixs.adapters.version>3.0.2</org.imixs.adapters.version>
|
||||
<org.imixs.melman.version>2.0.2</org.imixs.melman.version>
|
||||
<microprofile.version>6.0</microprofile.version>
|
||||
<net.sf.saxon.version>9.9.1-4</net.sf.saxon.version>
|
||||
<apache.pdfbox.version>2.0.26</apache.pdfbox.version>
|
||||
<!-- -->
|
||||
<org.imixs.ai.version>1.1.0-SNAPSHOT</org.imixs.ai.version>
|
||||
<org.imixs.ai.version>1.1.0</org.imixs.ai.version>
|
||||
<custom.webResources>src/main/webapp</custom.webResources>
|
||||
|
||||
<!-- Environment Settings -->
|
||||
|
|
|
|||
1387
workflow/steuerbescheid-de-1.0.6.bpmn
Normal file
1387
workflow/steuerbescheid-de-1.0.6.bpmn
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue