Skip to content

Commit

Permalink
Modifiche fatturazione elettronica:
Browse files Browse the repository at this point in the history
1.       anomalia casuale ELE_TESTATA…..

capita quando ti posizioni sulla tab ‘riferimento acquisto’  prima di salvare una modifica.

Prova SDI: 5509838. Vai sulla Tab riferimento acquisto, posizionati sulla prima riga di dettaglio, poi vai sulla tab ‘Dati generali del documento’ e metti l’importo che ora è modificabile. Se salvi ti esce l’errore da eliminare ;

2.       Per la notifica della mail inviata quando arriva una fattura passiva o quando viene accettata/rifiutata una fattura attiva bisogna modificare l’oggetto della mail aggiungendo anche la UO (Il messaggio va bene com’è solo nell’oggetto oltre all’identificativo SDI si aggiunge UO: Codice della UO di destinazione o di emissione).

3.       Prevedere nuova tipologia  allegato per gli ‘Allegati aggiunti’ del documento elettronico: ‘Comunicazione di non registrabilità’ usabile solo nel caso di decorrenza termini (FL_decorrenza_termini=’S’).

Questa tipologia deve prevedere: aggiornamento ad ‘S’ del campo FL_IRREGESTRABILE. Rendere non più modificabile il documento elettronico dopo l’aggiornamento di questo flag.


BUG sui contratti definitivi sul documentale
  • Loading branch information
mspasiano committed Oct 14, 2015
1 parent dafa7d4 commit 2cddd4b
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,16 @@ public void updateProperties(Map<String, Object> metadataProperties, CmisObject
node = ((Document)node).getObjectOfLatestVersion(false);
node = getSiglaSession().getObject(node);
node.refresh();
} else {
/**
* @marco.spasiano
* @date 07/10/2015
* workaround non riesco a capire perchè non aggiorna il cmis:name
* insieme alle altre property solo per le folder.
*/
if (metadataProperties.containsKey(PropertyIds.NAME)) {
node.updateProperties(Collections.singletonMap(PropertyIds.NAME, metadataProperties.get("cmis:name")), true);
}
}
node.updateProperties(metadataProperties, true);
} catch (Exception e) {
Expand All @@ -412,7 +422,7 @@ public void updateProperties(OggettoBulk oggettoBulk, CmisObject node){
}
for (Property<?> property : cmisBulkInfo.getAspectProperty(getSiglaSession(), oggettoBulk)) {
metadataProperties.put(property.getId(), property.getValue());
}
}
updateProperties(metadataProperties, node);
} catch (Exception e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package it.cnr.contab.config00.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.chemistry.opencmis.client.api.CmisObject;
import org.apache.chemistry.opencmis.client.api.Document;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ protected void initialize(ActionContext actioncontext)
throw handleException(e);
} catch (EJBException e) {
throw handleException(e);
}
}
}

private void setUoScrivania(Unita_organizzativaBulk uoScrivania) {
Expand Down Expand Up @@ -366,10 +366,23 @@ protected void basicEdit(ActionContext actioncontext, OggettoBulk oggettobulk, b
super.basicEdit(actioncontext, oggettobulk, flag);
DocumentoEleTestataBulk documentoEleTestata = (DocumentoEleTestataBulk) oggettobulk;
if (!documentoEleTestata.isEditabile())
setStatus(VIEW);

setStatus(VIEW);
}

@Override
public void setTab(String tabName, String pageName) {
super.setTab(tabName, pageName);
DocumentoEleTestataBulk documentoEleTestata = (DocumentoEleTestataBulk) getModel();
if (documentoEleTestata != null) {
if (pageName.equalsIgnoreCase("tabAllegati") && !documentoEleTestata.isIrregistrabile()){
setStatus(EDIT);
} else {
if (getStatus() == EDIT && !documentoEleTestata.isEditabile())
setStatus(VIEW);
}
}
}

public OggettoBulk completaFatturaPassiva(ActionContext context, Fattura_passivaBulk fatturaPassivaBulk, CRUDFatturaPassivaBP nbp, Fattura_passivaBulk fatturaPassivaDiRiferimento) throws BusinessProcessException {
try {
CRUDFatturaPassivaAction action = new CRUDFatturaPassivaAction();
Expand Down Expand Up @@ -546,11 +559,31 @@ protected boolean excludeChild(CmisObject cmisObject) {
@Override
protected void completeAllegato(AllegatoFatturaBulk allegato) {
for (SecondaryType secondaryType : allegato.getDocument().getSecondaryTypes()) {
if (AllegatoFatturaBulk.aspectNamesKeys.get(secondaryType.getId()) != null){
if (AllegatoFatturaBulk.aspectNamesDecorrenzaTerminiKeys.get(secondaryType.getId()) != null){
allegato.setAspectName(secondaryType.getId());
break;
}
}
super.completeAllegato(allegato);
}

@Override
public String getAllegatiFormName() {
DocumentoEleTestataBulk documentoEleTestata = (DocumentoEleTestataBulk) getModel();
if (documentoEleTestata.isRicevutaDecorrenzaTermini())
return "decorrenzaTermini";
return super.getAllegatiFormName();
}

@Override
public void save(ActionContext actioncontext) throws ValidationException,
BusinessProcessException {
for (Object obj : getCrudArchivioAllegati().getDetails()) {
AllegatoFatturaBulk allegatoFatturaBulk = (AllegatoFatturaBulk)obj;
if (allegatoFatturaBulk.getAspectName().equalsIgnoreCase("P:sigla_fatture_attachment:comunicazione_non_registrabilita")) {
((DocumentoEleTestataBulk) getModel()).setFlIrregistrabile("S");
}
}
super.save(actioncontext);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7417,6 +7417,7 @@ private void sendMailForNotificationOk(UserContext userContext, Fattura_attivaBu
String text = "";
String estremoFattura = fattura.getEsercizio()+"-"+fattura.getPg_fattura_attiva();
subject= "[SIGLA] Notifica esito positivo invio fattura attiva " + estremoFattura;
subject += " UO: " + fattura.getCd_unita_organizzativa();
text = "La fattura attiva elettronica: <b>" +estremoFattura + "</b>"+
" è stata accettata dal cliente.";
Utente_indirizzi_mailHome utente_indirizzi_mailHome = (Utente_indirizzi_mailHome)getHome(userContext,Utente_indirizzi_mailBulk.class);
Expand All @@ -7433,6 +7434,7 @@ private void sendMailForNotificationKo(UserContext userContext, Fattura_attivaBu
String text = "";
String estremoFattura = fattura.getEsercizio()+"-"+fattura.getPg_fattura_attiva();
subject= "[SIGLA] Notifica errore invio fattura attiva " + estremoFattura;
subject += " UO: " + fattura.getCd_unita_organizzativa();
text = "Errore durante l'invio della fattura attiva elettronica: <b>" +estremoFattura + "</b>"+
". Motivo: "+ fattura.getNoteInvioSdi();
Utente_indirizzi_mailHome utente_indirizzi_mailHome = (Utente_indirizzi_mailHome)getHome(userContext,Utente_indirizzi_mailBulk.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public void completaDocumento(UserContext usercontext, DocumentoEleTrasmissioneB
*/
try {
String subject= "[SIGLA] Notifica ricezione fattura passiva con Identificativo SdI:" + documentoEleTrasmissioneBulk.getIdentificativoSdi();
subject += " UO: " + documentoEleTrasmissioneBulk.getUnitaOrganizzativa().getCd_unita_organizzativa();
String text = "E' pervenuta la fattura dal trasmittente: <b>" +documentoEleTrasmissioneBulk.getIdCodice() + "</b><br>"+
"Prestatore: " + documentoEleTrasmissioneBulk.getDenominzionePrestatore() +"<br>" +
"Il documento è presente nell'area temporanea di SIGLA.";
Expand Down Expand Up @@ -324,6 +325,7 @@ private void notificaUOCompetenza(UserContext usercontext, DocumentoEleTrasmissi
trasmissione.getUnitaCompetenza().getCd_unita_organizzativa() != null) {
try {
String subject= "[SIGLA] Notifica assegnazione fattura passiva con Identificativo SdI:" + trasmissione.getIdentificativoSdi();
subject += " UO: " + testataDB.getUnitaCompetenza().getCd_unita_organizzativa();
String text = "E' pervenuta la fattura dal trasmittente: <b>" +trasmissione.getIdCodice() + "</b><br>"+
"Prestatore: " + trasmissione.getDenominzionePrestatore() +"<br>" +
"Il documento è presente nell'area temporanea di SIGLA.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@

public class AllegatoFatturaBulk extends AllegatoGenericoBulk {
private static final long serialVersionUID = 1L;
@SuppressWarnings("unchecked")
public static final java.util.Dictionary<String, String> aspectNamesKeys = new OrderedHashtable();

public static OrderedHashtable aspectNamesKeys = new OrderedHashtable(),
aspectNamesDecorrenzaTerminiKeys;

static {
aspectNamesKeys.put("P:sigla_fatture_attachment:durc","DURC");
aspectNamesKeys.put("P:sigla_fatture_attachment:tacciabilita","Tracciabilità");
aspectNamesKeys.put("P:sigla_fatture_attachment:prestazione_resa","Prestazione Resa");
aspectNamesKeys.put("P:sigla_fatture_attachment:altro","Altro");
aspectNamesKeys.put("P:sigla_fatture_attachment:altro","Altro");

aspectNamesDecorrenzaTerminiKeys = (OrderedHashtable) aspectNamesKeys.clone();
aspectNamesDecorrenzaTerminiKeys.put("P:sigla_fatture_attachment:comunicazione_non_registrabilita","Comunicazione di non registrabilità");
}
private String aspectName;

Expand All @@ -44,8 +49,12 @@ public List<String> getAspect() {
results.add(getAspectName());
return results;
}
public static java.util.Dictionary<String, String> getAspectnameskeys() {
public static OrderedHashtable getAspectnameskeys() {
return aspectNamesKeys;
}

public static OrderedHashtable getAspectnamesDecorrenzaTerminikeys() {
return aspectNamesDecorrenzaTerminiKeys;
}
@Override
public void validate() throws ValidationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,9 @@ public boolean isRifiutabile() {
getStatoDocumentoEle().equals(StatoDocumentoEleEnum.COMPLETO);
}
public boolean isEditabile() {
return getStatoDocumentoEle().equals(StatoDocumentoEleEnum.AGGIORNATO) ||
getStatoDocumentoEle().equals(StatoDocumentoEleEnum.COMPLETO);
return (getStatoDocumentoEle().equals(StatoDocumentoEleEnum.AGGIORNATO) ||
getStatoDocumentoEle().equals(StatoDocumentoEleEnum.COMPLETO)) &&
!isIrregistrabile();
}

public Fattura_passiva_rigaBulk getInstanceRiga() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.chemistry.opencmis.client.api.CmisObject;
import org.apache.chemistry.opencmis.client.api.Document;
import org.apache.chemistry.opencmis.client.api.Folder;
import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
import org.apache.chemistry.opencmis.commons.exceptions.CmisContentAlreadyExistsException;

public abstract class AllegatiCRUDBP<T extends AllegatoGenericoBulk, K extends AllegatoParentBulk> extends SimpleCRUDBP {
Expand Down Expand Up @@ -101,15 +102,17 @@ public OggettoBulk initializeModelForEditAllegati(ActionContext actioncontext, O
continue;
if (excludeChild(cmisObject))
continue;
Document document = (Document) cmisObject;
T allegato = (T) Introspector.newInstance(getAllegatoClass(), document);
allegato.setContentType(document.getContentStreamMimeType());
allegato.setNome(cmisObject.getName());
allegato.setDescrizione((String)document.getPropertyValue(SiglaCMISService.PROPERTY_DESCRIPTION));
allegato.setTitolo((String)document.getPropertyValue(SiglaCMISService.PROPERTY_TITLE));
completeAllegato(allegato);
allegato.setCrudStatus(OggettoBulk.NORMAL);
allegatoParentBulk.addToArchivioAllegati(allegato);
if (cmisObject.getBaseTypeId().equals(BaseTypeId.CMIS_DOCUMENT)) {
Document document = (Document) cmisObject;
T allegato = (T) Introspector.newInstance(getAllegatoClass(), document);
allegato.setContentType(document.getContentStreamMimeType());
allegato.setNome(cmisObject.getName());
allegato.setDescrizione((String)document.getPropertyValue(SiglaCMISService.PROPERTY_DESCRIPTION));
allegato.setTitolo((String)document.getPropertyValue(SiglaCMISService.PROPERTY_TITLE));
completeAllegato(allegato);
allegato.setCrudStatus(OggettoBulk.NORMAL);
allegatoParentBulk.addToArchivioAllegati(allegato);
}
}
} catch (ApplicationException e) {
throw handleException(e);
Expand Down Expand Up @@ -173,6 +176,10 @@ public void delete(ActionContext actioncontext)
super.delete(actioncontext);
}

public String getAllegatiFormName() {
return "default";
}

@SuppressWarnings("unchecked")
private void archiviaAllegati(ActionContext actioncontext, Document document) throws BusinessProcessException, ApplicationException{
AllegatoParentBulk allegatoParentBulk = (AllegatoParentBulk)getModel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
<aspect name="sigla_fatture_attachment:prestazione_resa">
<title>Allegato al documento elettronico e alla fattura generata da esso</title>
</aspect>
<aspect name="sigla_fatture_attachment:comunicazione_non_registrabilita">
<title>Allegato al documento elettronico e alla fattura generata da esso</title>
</aspect>
<aspect name="sigla_fatture_attachment:altro">
<title>Allegato al documento elettronico e alla fattura generata da esso</title>
</aspect>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,28 @@
name="file" />
<formFieldProperty
name="attivaFile" />
</form>
</form>

<form name="decorrenzaTermini">
<formFieldProperty
name="aspectName"
keysProperty="aspectNamesDecorrenzaTerminiKeys" />
<formFieldProperty
name="nome" />
<formFieldProperty
name="descrizione" />
<formFieldProperty
name="titolo" />
<formFieldProperty
name="file" />
<formFieldProperty
name="attivaFile" />
</form>

<columnSet name="default">
<columnFieldProperty
name="aspectName" />
name="aspectName"
keysProperty="aspectNamesDecorrenzaTerminiKeys" />
<columnFieldProperty
name="nome" />
<columnFieldProperty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@
property="flIrregistrabile"
maxLength="2"
inputSize="2"
inputType="TEXT"
inputType="SELECT"
enabledOnSearch="true"
enabledOnEdit="false"
keysProperty="decorrenzaTerminiKeys"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function doScaricaEsito() {
<%bp.getController().writeFormInput(out,null,"ricevutaDecorrenza",true,"GroupLabel","style=\"background: #F5F5DC;background-color:transparent;border-style : none; width:300; cursor:default; font-size : 16px;\"");%>
</td>
<% } %>
<% if (!bp.isSearching() && model != null &&
<% if (!bp.isSearching() && model != null && model.getStatoDocumento() != null &&
model.getStatoDocumento().equals(StatoDocumentoEleEnum.RIFIUTATO.name())) {%>
<tr>
<% bp.getController().writeFormField(out,"motivoRifiuto");%>
Expand Down
2 changes: 1 addition & 1 deletion sigla-web/src/main/webapp/util00/tab_allegati.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ function doScaricaFile() {
<% bp.getCrudArchivioAllegati().writeHTMLTable(pageContext,"default",true,false,true,"100%","150px"); %>
<div class="Group">
<table>
<% bp.getCrudArchivioAllegati().writeForm(out, "default"); %>
<% bp.getCrudArchivioAllegati().writeForm(out, bp.getAllegatiFormName()); %>
</table>
</div>

0 comments on commit 2cddd4b

Please sign in to comment.