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
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
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
|
||||
ArrayList<ItemCollection> childItems = new ArrayList<ItemCollection>();
|
||||
|
||||
List<Object> mapOrderItems = workitem.getItemValue(CHILD_ITEM_PROPERTY);
|
||||
List<Object> mapOrderItems = workitem.getItemValue(childItemName);
|
||||
for (Object mapOderItem : mapOrderItems) {
|
||||
if (mapOderItem instanceof Map) {
|
||||
ItemCollection itemCol = new ItemCollection((Map) mapOderItem);
|
||||
|
|
@ -84,8 +91,18 @@ public class InvoiceUtil {
|
|||
*
|
||||
* @param workitem
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes" })
|
||||
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>();
|
||||
// convert the child ItemCollection elements into a List of Map
|
||||
if (childItems != null) {
|
||||
|
|
@ -93,7 +110,7 @@ public class InvoiceUtil {
|
|||
for (ItemCollection orderItem : childItems) {
|
||||
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) {
|
||||
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);
|
||||
boolean update = false;
|
||||
for (ItemCollection pos : rows) {
|
||||
|
||||
if (datZoll != null) {
|
||||
if ("ZOLL".equalsIgnoreCase(pos.getItemValueString("activity.type"))
|
||||
&& pos.getItemValueDate("duedate") == null) {
|
||||
pos.setItemValue("duedate", datZoll);
|
||||
update = true;
|
||||
}
|
||||
if (datZoll != null && "ZOLL".equalsIgnoreCase(pos.getItemValueString("activity.type"))) {
|
||||
pos.setItemValue("duedate", datZoll);
|
||||
foundZoll = true;
|
||||
}
|
||||
if (datEust != null) {
|
||||
if ("EUST".equalsIgnoreCase(pos.getItemValueString("activity.type"))
|
||||
&& pos.getItemValueDate("duedate") == null) {
|
||||
pos.setItemValue("duedate", datEust);
|
||||
update = true;
|
||||
}
|
||||
if (datEust != null && "EUST".equalsIgnoreCase(pos.getItemValueString("activity.type"))) {
|
||||
pos.setItemValue("duedate", datEust);
|
||||
foundEust = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (update) {
|
||||
InvoiceUtil.implodeChildList(workitem, rows);
|
||||
if (foundEust) {
|
||||
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>
|
||||
<steuer.anmelder>....</steuer.anmelder>
|
||||
<steuer.zoll.due type="date"></steuer.zoll.due>
|
||||
<steuer.eust.due type="date"></steuer.eust.due>
|
||||
<steuerbescheid.position>
|
||||
<key>...</key>
|
||||
<duedate type="date"></duedate>
|
||||
</steuerbescheid.position>
|
||||
<steuerbescheid.position>
|
||||
<key>...</key>
|
||||
<duedate type="date"></duedate>
|
||||
</steuerbescheid.position>
|
||||
</steuerbescheid>
|
||||
|
||||
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.
|
||||
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).
|
||||
Beachte: Füge keine Erklärungen oder Kommentare hinzu. Formatiere Datumswerte im ISO 8601-Format (YYYY-MM-DD).
|
||||
|
||||
[/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>
|
||||
<steuer.anmelder>....</steuer.anmelder>
|
||||
<steuer.zoll.due type="date"></steuer.zoll.due>
|
||||
<steuer.eust.due type="date"></steuer.eust.due>
|
||||
<steuerbescheid.position>
|
||||
<key>...</key>
|
||||
<duedate type="date"></duedate>
|
||||
</steuerbescheid.position>
|
||||
<steuerbescheid.position>
|
||||
<key>...</key>
|
||||
<duedate type="date"></duedate>
|
||||
</steuerbescheid.position>
|
||||
</steuerbescheid>
|
||||
|
||||
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.
|
||||
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).
|
||||
Beachte: Füge keine Erklärungen oder Kommentare hinzu. Formatiere Datumswerte im ISO 8601-Format (YYYY-MM-DD).
|
||||
|
||||
[/INST]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue