improve Steuerbescheid KI
This commit is contained in:
parent
05589a4249
commit
a682955ab5
7 changed files with 75 additions and 2481 deletions
|
|
@ -64,12 +64,19 @@ public class InvoiceUtil {
|
||||||
/**
|
/**
|
||||||
* converts the Map List of a workitem into a List of ItemCollectons
|
* converts the Map List of a workitem into a List of ItemCollectons
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
|
||||||
public static List<ItemCollection> explodeChildList(ItemCollection workitem) {
|
public static List<ItemCollection> explodeChildList(ItemCollection workitem) {
|
||||||
|
return explodeChildList(workitem, CHILD_ITEM_PROPERTY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* converts the Map List of a workitem into a List of ItemCollectons
|
||||||
|
*/
|
||||||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
|
public static List<ItemCollection> explodeChildList(ItemCollection workitem, String childItemName) {
|
||||||
// convert current list of childItems into ItemCollection elements
|
// convert current list of childItems into ItemCollection elements
|
||||||
ArrayList<ItemCollection> childItems = new ArrayList<ItemCollection>();
|
ArrayList<ItemCollection> childItems = new ArrayList<ItemCollection>();
|
||||||
|
|
||||||
List<Object> mapOrderItems = workitem.getItemValue(CHILD_ITEM_PROPERTY);
|
List<Object> mapOrderItems = workitem.getItemValue(childItemName);
|
||||||
for (Object mapOderItem : mapOrderItems) {
|
for (Object mapOderItem : mapOrderItems) {
|
||||||
if (mapOderItem instanceof Map) {
|
if (mapOderItem instanceof Map) {
|
||||||
ItemCollection itemCol = new ItemCollection((Map) mapOderItem);
|
ItemCollection itemCol = new ItemCollection((Map) mapOderItem);
|
||||||
|
|
@ -84,8 +91,18 @@ public class InvoiceUtil {
|
||||||
*
|
*
|
||||||
* @param workitem
|
* @param workitem
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "rawtypes" })
|
|
||||||
public static void implodeChildList(ItemCollection workitem, List<ItemCollection> childItems) {
|
public static void implodeChildList(ItemCollection workitem, List<ItemCollection> childItems) {
|
||||||
|
implodeChildList(workitem, childItems, CHILD_ITEM_PROPERTY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the List of ItemCollections back into a List of Map elements
|
||||||
|
*
|
||||||
|
* @param workitem
|
||||||
|
*/
|
||||||
|
@SuppressWarnings({ "rawtypes" })
|
||||||
|
public static void implodeChildList(ItemCollection workitem, List<ItemCollection> childItems,
|
||||||
|
String childItemName) {
|
||||||
List<Map> mapOrderItems = new ArrayList<Map>();
|
List<Map> mapOrderItems = new ArrayList<Map>();
|
||||||
// convert the child ItemCollection elements into a List of Map
|
// convert the child ItemCollection elements into a List of Map
|
||||||
if (childItems != null) {
|
if (childItems != null) {
|
||||||
|
|
@ -93,7 +110,7 @@ public class InvoiceUtil {
|
||||||
for (ItemCollection orderItem : childItems) {
|
for (ItemCollection orderItem : childItems) {
|
||||||
mapOrderItems.add(orderItem.getAllItems());
|
mapOrderItems.add(orderItem.getAllItems());
|
||||||
}
|
}
|
||||||
workitem.replaceItemValue(CHILD_ITEM_PROPERTY, mapOrderItems);
|
workitem.replaceItemValue(childItemName, mapOrderItems);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,33 +85,46 @@ public class SteuerbescheidPlugin extends AbstractPlugin {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected void updateFaelligkeit(ItemCollection workitem) {
|
protected void updateFaelligkeit(ItemCollection workitem) {
|
||||||
Date datEust = workitem.getItemValueDate("steuer.eust.due");
|
|
||||||
Date datZoll = workitem.getItemValueDate("steuer.zoll.due");
|
|
||||||
|
|
||||||
|
boolean foundZoll = false;
|
||||||
|
boolean foundEust = false;
|
||||||
|
Date datEust = null;
|
||||||
|
Date datZoll = null;
|
||||||
|
// resolve datEust und datZoll from steuerbescheid.positionen ChildItems....
|
||||||
|
List<ItemCollection> steuerPositionen = InvoiceUtil.explodeChildList(workitem, "steuerbescheid.position");
|
||||||
|
for (ItemCollection steuerPos : steuerPositionen) {
|
||||||
|
if (steuerPos.getItemValueString("key").startsWith("A")) {
|
||||||
|
datZoll = steuerPos.getItemValueDate("duedate");
|
||||||
|
}
|
||||||
|
if (steuerPos.getItemValueString("key").startsWith("B")) {
|
||||||
|
datEust = steuerPos.getItemValueDate("duedate");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Map fälligkeit auf die Cargosoft Positionen
|
||||||
List<ItemCollection> rows = InvoiceUtil.explodeChildList(workitem);
|
List<ItemCollection> rows = InvoiceUtil.explodeChildList(workitem);
|
||||||
boolean update = false;
|
|
||||||
for (ItemCollection pos : rows) {
|
for (ItemCollection pos : rows) {
|
||||||
|
if (datZoll != null && "ZOLL".equalsIgnoreCase(pos.getItemValueString("activity.type"))) {
|
||||||
if (datZoll != null) {
|
pos.setItemValue("duedate", datZoll);
|
||||||
if ("ZOLL".equalsIgnoreCase(pos.getItemValueString("activity.type"))
|
foundZoll = true;
|
||||||
&& pos.getItemValueDate("duedate") == null) {
|
|
||||||
pos.setItemValue("duedate", datZoll);
|
|
||||||
update = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (datEust != null) {
|
if (datEust != null && "EUST".equalsIgnoreCase(pos.getItemValueString("activity.type"))) {
|
||||||
if ("EUST".equalsIgnoreCase(pos.getItemValueString("activity.type"))
|
pos.setItemValue("duedate", datEust);
|
||||||
&& pos.getItemValueDate("duedate") == null) {
|
foundEust = true;
|
||||||
pos.setItemValue("duedate", datEust);
|
|
||||||
update = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update) {
|
if (foundEust) {
|
||||||
InvoiceUtil.implodeChildList(workitem, rows);
|
workitem.setItemValue("steuer.eust.due", datEust);
|
||||||
|
} else {
|
||||||
|
workitem.removeItem("steuer.eust.due");
|
||||||
}
|
}
|
||||||
|
if (foundZoll) {
|
||||||
|
workitem.setItemValue("steuer.zoll.due", datZoll);
|
||||||
|
} else {
|
||||||
|
workitem.removeItem("steuer.zoll.due");
|
||||||
|
}
|
||||||
|
InvoiceUtil.implodeChildList(workitem, rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -9,20 +9,21 @@
|
||||||
|
|
||||||
<steuerbescheid>
|
<steuerbescheid>
|
||||||
<steuer.anmelder>....</steuer.anmelder>
|
<steuer.anmelder>....</steuer.anmelder>
|
||||||
<steuer.zoll.due type="date"></steuer.zoll.due>
|
<steuerbescheid.position>
|
||||||
<steuer.eust.due type="date"></steuer.eust.due>
|
<key>...</key>
|
||||||
|
<duedate type="date"></duedate>
|
||||||
|
</steuerbescheid.position>
|
||||||
|
<steuerbescheid.position>
|
||||||
|
<key>...</key>
|
||||||
|
<duedate type="date"></duedate>
|
||||||
|
</steuerbescheid.position>
|
||||||
</steuerbescheid>
|
</steuerbescheid>
|
||||||
|
|
||||||
Den Anmelder findest du im Absatz 'Anmelder'. Hier ist nur der Firmenname interessant und nicht die Steuernummer und Adresse.
|
Den Anmelder findest du im Absatz 'Anmelder'. Hier ist nur der Firmenname interessant und nicht die Steuernummer und Adresse.
|
||||||
|
Die Tabelle mit den Positionsnummern enthält einen oder mehrere Buchungsschlüssel (key) mit Detailinformationen.
|
||||||
|
Eine einzelne Positionszeile beginnt entweder mit dem Buchungsschlüssel 'A....' oder 'B....' und enthält optional ein Fälligkeitsdatum (duedate).
|
||||||
|
|
||||||
In der Tabelle mit den Buchungsschlüsseln können Fälligkeits Daten ausgewiesen sein. Diese sind für die beiden XML Tags <steuer.zoll.due type="date"> und <steuer.eust.due type="date"> relevant.
|
Beachte: Füge keine Erklärungen oder Kommentare hinzu. Formatiere Datumswerte im ISO 8601-Format (YYYY-MM-DD).
|
||||||
Werte nur die Zeilen aus, in denen der Aufschubnehmer 'Alexander Global Logistics GmbH' ist und auch ein Fälligkeitsdatum ausgewiesen ist.
|
|
||||||
Der Buchungsschlüssel 'A0000' gibt das Fälligkeitsdatum für 'steuer.zoll.due' an. Der Buchungsschlüssel 'B0000' gibt das Fälligkeitsdatum für 'steuer.eust.due' an.
|
|
||||||
Es kann für beide Buchungsschlüssel ein Fälligkeitsdatum geben oder aber nur für einen der beiden!
|
|
||||||
|
|
||||||
Beachte: Die beiden XML Tags <steuer.zoll.due type="date"> und <steuer.eust.due type="date"> sind optional und können entfallen, wenn es keinen Wert gibt.
|
|
||||||
|
|
||||||
Beachte: Gib nur das XML Objekt aus. Füge keine Erklärungen oder Kommentare hinzu. Formatiere Datumswerte im ISO 8601-Format (YYYY-MM-DD).
|
|
||||||
|
|
||||||
[/INST]
|
[/INST]
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -951,20 +951,21 @@ if (workitem.getItemValueString('txtcomment') == '' ) {
|
||||||
|
|
||||||
<steuerbescheid>
|
<steuerbescheid>
|
||||||
<steuer.anmelder>....</steuer.anmelder>
|
<steuer.anmelder>....</steuer.anmelder>
|
||||||
<steuer.zoll.due type="date"></steuer.zoll.due>
|
<steuerbescheid.position>
|
||||||
<steuer.eust.due type="date"></steuer.eust.due>
|
<key>...</key>
|
||||||
|
<duedate type="date"></duedate>
|
||||||
|
</steuerbescheid.position>
|
||||||
|
<steuerbescheid.position>
|
||||||
|
<key>...</key>
|
||||||
|
<duedate type="date"></duedate>
|
||||||
|
</steuerbescheid.position>
|
||||||
</steuerbescheid>
|
</steuerbescheid>
|
||||||
|
|
||||||
Den Anmelder findest du im Absatz 'Anmelder'. Hier ist nur der Firmenname interessant und nicht die Steuernummer und Adresse.
|
Den Anmelder findest du im Absatz 'Anmelder'. Hier ist nur der Firmenname interessant und nicht die Steuernummer und Adresse.
|
||||||
|
Die Tabelle mit den Positionsnummern enthält einen oder mehrere Buchungsschlüssel (key) mit Detailinformationen.
|
||||||
|
Eine einzelne Positionszeile beginnt entweder mit dem Buchungsschlüssel 'A....' oder 'B....' und enthält optional ein Fälligkeitsdatum (duedate).
|
||||||
|
|
||||||
In der Tabelle mit den Buchungsschlüsseln können Fälligkeits Daten ausgewiesen sein. Diese sind für die beiden XML Tags <steuer.zoll.due type="date"> und <steuer.eust.due type="date"> relevant.
|
Beachte: Füge keine Erklärungen oder Kommentare hinzu. Formatiere Datumswerte im ISO 8601-Format (YYYY-MM-DD).
|
||||||
Werte nur die Zeilen aus, in denen der Aufschubnehmer 'Alexander Global Logistics GmbH' ist und auch ein Fälligkeitsdatum ausgewiesen ist.
|
|
||||||
Der Buchungsschlüssel 'A0000' gibt das Fälligkeitsdatum für 'steuer.zoll.due' an. Der Buchungsschlüssel 'B0000' gibt das Fälligkeitsdatum für 'steuer.eust.due' an.
|
|
||||||
Es kann für beide Buchungsschlüssel ein Fälligkeitsdatum geben oder aber nur für einen der beiden!
|
|
||||||
|
|
||||||
Beachte: Die beiden XML Tags <steuer.zoll.due type="date"> und <steuer.eust.due type="date"> sind optional und können entfallen, wenn es keinen Wert gibt.
|
|
||||||
|
|
||||||
Beachte: Gib nur das XML Objekt aus. Füge keine Erklärungen oder Kommentare hinzu. Formatiere Datumswerte im ISO 8601-Format (YYYY-MM-DD).
|
|
||||||
|
|
||||||
[/INST]
|
[/INST]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue