From 95c0d812a1663d456e93771fddc0182e21bbd628 Mon Sep 17 00:00:00 2001 From: Marco Mancini Date: Tue, 4 Apr 2023 13:26:35 +0200 Subject: [PATCH] fix cancellazione --- .../portos/bo/service/impl/IntPraticaLocalServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java index 8af375d8..0d1c49d7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java @@ -241,7 +241,10 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { @Override public IntPratica deleteIntPratica(IntPratica intPratica, boolean forced) throws SystemException, PortalException { - if (intPratica.getStatus() == WorkflowConstants.STATUS_ANY || forced) { + + int contoDett = dettPraticaPersistence.countByIntPraticaId(intPratica.getIntPraticaId()); + + if (intPratica.getStatus() == WorkflowConstants.STATUS_ANY || forced || contoDett==1) { if (Validator.isNotNull(intPratica.getDocPraticaAnnullamentoId())) { deleteFileAnnullamento(intPratica.getDocPraticaAnnullamentoId()); }