support list of atc.number items
This commit is contained in:
parent
316ea10de5
commit
5a04a70a4d
1 changed files with 12 additions and 9 deletions
|
|
@ -472,8 +472,8 @@ public class CargosoftXMLInvoiceImportService {
|
|||
// Row Positions lesen
|
||||
readXMLRows(doc, workitem);
|
||||
|
||||
// Suche die ATC Nummer....
|
||||
resolveATCNumber(doc, workitem);
|
||||
// Suche die ATC Nummern....
|
||||
resolveATCNumbers(doc, workitem);
|
||||
|
||||
// Jetzt noch das Space mapping
|
||||
mahnlaufService.mapInvoiceTextToSpace(workitem, spacePosMappings);
|
||||
|
|
@ -566,26 +566,29 @@ public class CargosoftXMLInvoiceImportService {
|
|||
}
|
||||
|
||||
/**
|
||||
* Hilfsmethode die die ATC Nummer sucht.
|
||||
* Hilfsmethode die die ATC Nummer sucht und in das workitem feld
|
||||
* invoice.atc.number einträgt.
|
||||
* Wir gehen davon aus, das wir über die ChildItems diese aus dem billingtexts
|
||||
* schon ermittel haben.
|
||||
* Es können mehrere ATC nummern existieren. Diese werden in einer Liste
|
||||
* gespeichert
|
||||
*
|
||||
* @param doc
|
||||
* @param workitem
|
||||
*/
|
||||
private void resolveATCNumber(Document doc, ItemCollection workitem) {
|
||||
|
||||
private void resolveATCNumbers(Document doc, ItemCollection workitem) {
|
||||
String atcNumber = null;
|
||||
List<ItemCollection> childs = InvoiceUtil.explodeChildList(workitem);
|
||||
for (ItemCollection child : childs) {
|
||||
if (child.hasItem("atc.number")) {
|
||||
atcNumber = child.getItemValueString("atc.number");
|
||||
break;
|
||||
workitem.appendItemValue("invoice.atc.number", atcNumber);
|
||||
// break;
|
||||
}
|
||||
}
|
||||
if (atcNumber != null && !atcNumber.isEmpty()) {
|
||||
workitem.setItemValue("invoice.atc.number", atcNumber);
|
||||
}
|
||||
// if (atcNumber != null && !atcNumber.isEmpty()) {
|
||||
// workitem.setItemValue("invoice.atc.number", atcNumber);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue