fix
This commit is contained in:
parent
c0c50bc178
commit
2c5695f8fc
1 changed files with 115 additions and 116 deletions
|
|
@ -65,12 +65,12 @@ public class MahnlaufExecuteAdapter implements SignalAdapter {
|
|||
List<String> refList = mahnLaufWorkitem.getItemValue("$workitemref");
|
||||
|
||||
// sind die Wärhungen idendtisch (mischmasch geht niht)
|
||||
String lastCurrency="";
|
||||
String lastCurrency = "";
|
||||
for (String uniqueId : refList) {
|
||||
ItemCollection invoice = workflowService.getWorkItem(uniqueId);
|
||||
String invoiceCurrency=invoice.getItemValueString("invoice.currency");
|
||||
String invoiceCurrency = invoice.getItemValueString("invoice.currency");
|
||||
if (lastCurrency.isEmpty()) {
|
||||
lastCurrency=invoiceCurrency;
|
||||
lastCurrency = invoiceCurrency;
|
||||
} else {
|
||||
if (!lastCurrency.equals(invoiceCurrency)) {
|
||||
throw new PluginException(MahnlaufRefAddAdapter.class.getName(), MahnlaufService.ERROR_WORKFLOW,
|
||||
|
|
@ -79,10 +79,8 @@ public class MahnlaufExecuteAdapter implements SignalAdapter {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
double saldo = 0;
|
||||
int dunningLevel=0;
|
||||
int dunningLevel = 0;
|
||||
String currency = "";
|
||||
for (String uniqueId : refList) {
|
||||
ItemCollection invoice = workflowService.getWorkItem(uniqueId);
|
||||
|
|
@ -113,23 +111,25 @@ public class MahnlaufExecuteAdapter implements SignalAdapter {
|
|||
mahnlaufService.processInvoice(invoice.event(MahnlaufService.EVENT_MAHNLAUF_EXECUTE));
|
||||
}
|
||||
|
||||
|
||||
switch (invoice.getTaskID()) {
|
||||
case 5200:
|
||||
dunningLevel=1;
|
||||
if (dunningLevel < 1)
|
||||
dunningLevel = 1;
|
||||
break;
|
||||
case 5210:
|
||||
dunningLevel=2;
|
||||
if (dunningLevel < 2)
|
||||
dunningLevel = 2;
|
||||
break;
|
||||
case 5220:
|
||||
dunningLevel=3;
|
||||
if (dunningLevel < 3)
|
||||
dunningLevel = 3;
|
||||
break;
|
||||
default:
|
||||
dunningLevel=1;
|
||||
if (dunningLevel < 1)
|
||||
dunningLevel = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// create a workitem stub for the mail message
|
||||
ItemCollection invoiceStub = new ItemCollection();
|
||||
invoiceStub.setItemValue("invoice.number", invoice.getItemValue("invoice.number"));
|
||||
|
|
@ -178,19 +178,18 @@ public class MahnlaufExecuteAdapter implements SignalAdapter {
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
return mahnLaufWorkitem;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if the reminder date is today or in the past
|
||||
*
|
||||
* @param uniqueid
|
||||
* @return
|
||||
*/
|
||||
public boolean isInDue(ItemCollection invoice) {
|
||||
LocalDate date = invoice.getItemValueLocalDate("invoice.reminder");
|
||||
return date.compareTo(LocalDate.now())<=0;
|
||||
return date.compareTo(LocalDate.now()) <= 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue