invoicePlugin - bessere Kontrolle partner.id
This commit is contained in:
parent
15e37ff2c8
commit
988a831200
2 changed files with 4 additions and 2 deletions
|
|
@ -133,7 +133,7 @@ public class BusinessPartnerService {
|
|||
* @throws PluginException
|
||||
*/
|
||||
public ItemCollection updateBusinessPartnerData(ItemCollection workitem) throws PluginException {
|
||||
String partnerID = workitem.getItemValueString("partner.id");
|
||||
String partnerID = workitem.getItemValueString("partner.id").trim();
|
||||
// Migration wenn keine partner.id existier!
|
||||
if (partnerID.isEmpty()) {
|
||||
if (InvoiceUtil.isCreditorInvoice(workitem)) {
|
||||
|
|
@ -181,6 +181,8 @@ public class BusinessPartnerService {
|
|||
// we need to load the object within the current transaction context
|
||||
businessPartner = documentService.load(businessPartner.getUniqueID());
|
||||
if (businessPartner != null) {
|
||||
// update partner id data
|
||||
workitem.setItemValue("partner.id", partnerID);
|
||||
workitem.setItemValue("partner.name", businessPartner.getItemValueString("partner.name"));
|
||||
logger.info("check invoice type....");
|
||||
// Update Invoice Partner Meta Data
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ public class CargosoftSplitAdapter implements SignalAdapter {
|
|||
*/
|
||||
if ("credit".equals(workitem.getItemValueString("payment.type"))) {
|
||||
// Haben wir ein alternative Konto im Business Partner hinterlegt?
|
||||
String alternativKonto = partner.getItemValueString("cargosot.credit.cdtr.number");
|
||||
String alternativKonto = partner.getItemValueString("cargosot.credit.cdtr.number").trim();
|
||||
if (!alternativKonto.isBlank()) {
|
||||
cdtrNumber = alternativKonto;
|
||||
workitem.setItemValue("cdtr.number", alternativKonto);
|
||||
|
|
|
|||
Loading…
Reference in a new issue