47 lines
1.2 KiB
Java
47 lines
1.2 KiB
Java
package com.alexanderlogistics;
|
|
|
|
import org.imixs.workflow.ItemCollection;
|
|
import org.imixs.workflow.engine.plugins.AbstractPlugin;
|
|
import org.imixs.workflow.exceptions.PluginException;
|
|
|
|
import jakarta.inject.Inject;
|
|
|
|
/**
|
|
* Das InvoiceOutgoingPlugin aktualisiert die Debitor E-Mail Adresse
|
|
*
|
|
* Auch das feld _img wird in Abhängigkeit vom item 'invoice.protest' gesetzt
|
|
*
|
|
* @author rsoika
|
|
* @version 1.0
|
|
*
|
|
*/
|
|
public class InvoiceOutgoingPlugin extends AbstractPlugin {
|
|
|
|
@Inject
|
|
BusinessPartnerService businessPartnerService;
|
|
|
|
/**
|
|
*
|
|
* @throws PluginException - if data is missing
|
|
*
|
|
**/
|
|
@Override
|
|
public ItemCollection run(ItemCollection workitem, ItemCollection event) throws PluginException {
|
|
|
|
// Update BUsiness Partner Data
|
|
businessPartnerService.updateBusinessPartnerData(workitem);
|
|
|
|
// Update Invoice.positions
|
|
InvoiceUtil.updateInvoicePositions(workitem);
|
|
|
|
String img = "";
|
|
if (workitem.getItemValueBoolean("invoice.protest")) {
|
|
img = img + "<img title='Reklamiert' src=\"/layout/icons/icon106.png\">";
|
|
|
|
}
|
|
workitem.setItemValue("_img", img);
|
|
|
|
return workitem;
|
|
}
|
|
|
|
}
|