/******************************************************************************* * Imixs Workflow * Copyright (C) 2001, 2011 Imixs Software Solutions GmbH, * http://www.imixs.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You can receive a copy of the GNU General Public * License at http://www.gnu.org/licenses/gpl.html * * Project: * http://www.imixs.org * http://java.net/projects/imixs-workflow * * Contributors: * Imixs Software Solutions GmbH - initial API and implementation * Ralph Soika - Software Developer *******************************************************************************/ package com.alexanderlogistics; import java.util.List; import java.util.logging.Logger; import org.imixs.workflow.ItemCollection; import org.imixs.workflow.engine.DocumentService; import org.imixs.workflow.exceptions.PluginException; import org.imixs.workflow.exceptions.QueryException; import jakarta.annotation.security.DeclareRoles; import jakarta.annotation.security.RolesAllowed; import jakarta.annotation.security.RunAs; import jakarta.ejb.Singleton; import jakarta.inject.Inject; /** * Der KreditorService wird verwendet um einen Kreditor zu finden oder neue * IBAN/BIC kombinationen aufzunehmen. * * @author rsoika * */ @DeclareRoles({ "org.imixs.ACCESSLEVEL.NOACCESS", "org.imixs.ACCESSLEVEL.READERACCESS", "org.imixs.ACCESSLEVEL.AUTHORACCESS", "org.imixs.ACCESSLEVEL.EDITORACCESS", "org.imixs.ACCESSLEVEL.MANAGERACCESS" }) @RolesAllowed({ "org.imixs.ACCESSLEVEL.NOACCESS", "org.imixs.ACCESSLEVEL.READERACCESS", "org.imixs.ACCESSLEVEL.AUTHORACCESS", "org.imixs.ACCESSLEVEL.EDITORACCESS", "org.imixs.ACCESSLEVEL.MANAGERACCESS" }) @Singleton @RunAs("org.imixs.ACCESSLEVEL.MANAGERACCESS") public class KreditorDebitorService { public static final String TYPE_CARGOSOFTKREDITOR = "cargosoftkreditor"; @SuppressWarnings("unused") private static Logger logger = Logger.getLogger(KreditorDebitorService.class.getName()); @Inject DocumentService documentService; /** * Diese Method sucht einen Kreditor/Debitor. Bei Cargosoft haben kreditoren und * debitoren * die selbe nummer und haben nur ein führendes D/K (Absolutler Irrsinn) *
* Diese Methode erwartet das führende K oder D
*
* @throws PluginException
*/
public ItemCollection findCreditorDebitor(String cdtrNumber) throws PluginException {
if (cdtrNumber == null || !(cdtrNumber.startsWith("K") || cdtrNumber.startsWith("D"))) {
throw new PluginException(PluginException.class.getName(), "QUERY ERROR",
"Invalid debitor/creditor number - prafix K/D expected!");
}
try {
String query = "(type:" + TYPE_CARGOSOFTKREDITOR + ") AND (name:" + cdtrNumber + ")";
List
* Diese Methode erwartet das führende K
*
* @throws PluginException
*/
public ItemCollection findCreditor(String cdtrNumber) throws PluginException {
if ((!cdtrNumber.startsWith("K"))) {
cdtrNumber = "K" + cdtrNumber;
}
try {
String query = "(type:" + TYPE_CARGOSOFTKREDITOR + ") AND (name:" + cdtrNumber + ")";
List
* Diese Methode erwartet das führende D
*
* @throws PluginException
*/
public ItemCollection findDebitor(String dbtrNumber) throws PluginException {
if ((!dbtrNumber.startsWith("D"))) {
dbtrNumber = "D" + dbtrNumber;
}
try {
String query = "(type:" + TYPE_CARGOSOFTKREDITOR + ") AND (name:" + dbtrNumber + ")";
List