fixed KSeFAdapter - compute pos numbers manually
This commit is contained in:
parent
3ebd619df4
commit
6bee49b917
2 changed files with 5933 additions and 3 deletions
|
|
@ -212,12 +212,18 @@ public class KSeFAdapter implements SignalAdapter {
|
||||||
workitem.getItemValueString("invoice.currency"));
|
workitem.getItemValueString("invoice.currency"));
|
||||||
|
|
||||||
// Update Invoice Items
|
// Update Invoice Items
|
||||||
|
// Here we compute the pos number independent if the _childitems hold a posnum.
|
||||||
|
// This is because a new imported cargosoft invoice does not provide numPos
|
||||||
|
// items in the child list. So it is important to generate the pos numbers here
|
||||||
|
// one by one
|
||||||
List<ItemCollection> invoiceItems = InvoiceUtil.explodeChildList(workitem, "_childitems");
|
List<ItemCollection> invoiceItems = InvoiceUtil.explodeChildList(workitem, "_childitems");
|
||||||
double lineTotalAmount = 0.00;
|
double lineTotalAmount = 0.00;
|
||||||
|
int pos = 1;
|
||||||
for (ItemCollection invoiceItem : invoiceItems) {
|
for (ItemCollection invoiceItem : invoiceItems) {
|
||||||
TradeLineItem tradeLineItem = buildTradeLineItem(invoiceItem);
|
TradeLineItem tradeLineItem = buildTradeLineItem(invoiceItem, pos);
|
||||||
model.setTradeLineItem(tradeLineItem);
|
model.setTradeLineItem(tradeLineItem);
|
||||||
lineTotalAmount = lineTotalAmount + tradeLineItem.getTotal();
|
lineTotalAmount = lineTotalAmount + tradeLineItem.getTotal();
|
||||||
|
pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Summenbildung
|
// Summenbildung
|
||||||
|
|
@ -340,12 +346,16 @@ public class KSeFAdapter implements SignalAdapter {
|
||||||
* Parses the data list of an invoice line and returns a TradeLineItem object.
|
* Parses the data list of an invoice line and returns a TradeLineItem object.
|
||||||
* The order of the list items must be exactly!
|
* The order of the list items must be exactly!
|
||||||
*/
|
*/
|
||||||
private TradeLineItem buildTradeLineItem(ItemCollection orderItem) {
|
private TradeLineItem buildTradeLineItem(ItemCollection orderItem, int pos) {
|
||||||
if (orderItem == null) {
|
if (orderItem == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
TradeLineItem tradeLineItem = new TradeLineItem(orderItem.getItemValueString("numpos"));
|
// TradeLineItem tradeLineItem = new
|
||||||
|
// TradeLineItem(orderItem.getItemValueString("numpos"));
|
||||||
|
// We do not trust the item 'numPos' here because it can be empty for new
|
||||||
|
// invoices!
|
||||||
|
TradeLineItem tradeLineItem = new TradeLineItem(pos + "");
|
||||||
|
|
||||||
tradeLineItem.setName(orderItem.getItemValueString("datev.text"));
|
tradeLineItem.setName(orderItem.getItemValueString("datev.text"));
|
||||||
tradeLineItem.setQuantity(1);
|
tradeLineItem.setQuantity(1);
|
||||||
|
|
|
||||||
5920
workflow/pl/rechnungseingang-pl-1.0.12.bpmn
Normal file
5920
workflow/pl/rechnungseingang-pl-1.0.12.bpmn
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue