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()); }