From f06e473fac3d6c51ed4e1607bc6665bebc4f2bfb Mon Sep 17 00:00:00 2001 From: marcoalderighi Date: Thu, 2 Mar 2023 16:31:24 +0100 Subject: [PATCH] modifiche al calcolo importi fine lavori --- .../portos/bo/util/PagamentiCommonUtil.java | 21 +++++++++++++------ .../WEB-INF/src/content/Language.properties | 3 ++- .../verify_fine-lavori_calcolo.jsp | 7 ++++++- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PagamentiCommonUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PagamentiCommonUtil.java index 660046c3..0a310518 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PagamentiCommonUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PagamentiCommonUtil.java @@ -126,6 +126,7 @@ public abstract class PagamentiCommonUtil { boolean normEsenteSpese = false; boolean normEsenteBollo = false; + boolean richiestaAttestazione = false; long pagamentoIdSpese = 0L; long pagamentoIdBolli = 0L; if (DettPratica.class.getName().equals(className)) { @@ -140,6 +141,7 @@ public abstract class PagamentiCommonUtil { normEsenteBollo = fineLavori.isNormEsenteBollo(); pagamentoIdSpese = fineLavori.getPagamentoSpeseId(); pagamentoIdBolli = fineLavori.getPagamentoId(); + richiestaAttestazione = fineLavori.isRichiestaAttestazione(); } else if (Collaudo.class.getName().equals(className)) { Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(classPK); normEsenteSpese = true; @@ -147,12 +149,14 @@ public abstract class PagamentiCommonUtil { pagamentoIdSpese = 0L; pagamentoIdBolli = collaudo.getPagamentoId(); } - if (!normEsenteBollo && !normEsenteSpese) { - return Validator.isNotNull(pagamentoIdBolli) || Validator.isNotNull(pagamentoIdSpese); - } else if (normEsenteBollo) { - return Validator.isNotNull(pagamentoIdSpese); - } else if (normEsenteSpese) { - return Validator.isNotNull(pagamentoIdBolli); + if(!richiestaAttestazione){ + if (!normEsenteBollo && !normEsenteSpese) { + return Validator.isNotNull(pagamentoIdBolli) || Validator.isNotNull(pagamentoIdSpese); + } else if (normEsenteBollo) { + return Validator.isNotNull(pagamentoIdSpese); + } else if (normEsenteSpese) { + return Validator.isNotNull(pagamentoIdBolli); + } } return false; } @@ -161,6 +165,7 @@ public abstract class PagamentiCommonUtil { boolean esenteSpese = false; boolean esenteBollo = false; + boolean richiestaAttestazione = false; long pagamentoIdSpese = 0L; long pagamentoIdBolli = 0L; if (DettPratica.class.getName().equals(className)) { @@ -175,6 +180,7 @@ public abstract class PagamentiCommonUtil { esenteBollo = fineLavori.isNormEsenteBollo(); pagamentoIdSpese = fineLavori.getPagamentoSpeseId(); pagamentoIdBolli = fineLavori.getPagamentoId(); + richiestaAttestazione = fineLavori.isRichiestaAttestazione(); } else if (Collaudo.class.getName().equals(className)) { Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(classPK); esenteSpese = true; @@ -183,6 +189,9 @@ public abstract class PagamentiCommonUtil { pagamentoIdBolli = collaudo.getPagamentoId(); } boolean completed = false; + if(richiestaAttestazione){ + return true; + } if (!esenteBollo && !esenteSpese) { if (Validator.isNull(pagamentoIdBolli) || Validator.isNull(pagamentoIdSpese)) { return false; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties index 54dbe8e0..d5fc2206 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties @@ -113,4 +113,5 @@ add-fine-lavori-key=Comunica data fine lavori parziale/totale data-inizio-lavori-key=Data Inizio Lavori add-inizio-lavory-key=Comunica inizio lavori edit-fine-lavori-key=Inserisci relazione fine lavori -edit-fine-lavori-title-key=Inserisci relazione Fine Lavori \ No newline at end of file +edit-fine-lavori-title-key=Inserisci relazione Fine Lavori +label-disclaimer-bollo-16-euro= * (€ 16 per il rilascio dell'attestazione ed € 16 ogni 4 facciate del documento in formato uso bollo) \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fine-lavori_calcolo.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fine-lavori_calcolo.jsp index dcbd6899..39bffa01 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fine-lavori_calcolo.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fine-lavori_calcolo.jsp @@ -262,7 +262,7 @@ String currentCompleteUrl = PortalUtil.getCurrentCompleteURL(request);
-
Totale importo
+
Totale importo *
<% BigDecimal importoBolli = null; if (Validator.isNotNull(pagamento)) { @@ -280,6 +280,11 @@ String currentCompleteUrl = PortalUtil.getCurrentCompleteURL(request); LocaleUtil.getSiteDefault()).format(importoBolli) %>
+
+
+ <%= LanguageUtil.get(pageContext, "label-disclaimer-bollo-16-euro"); %> +
+