Skip to content

Commit

Permalink
2.Richiesta di Saverio: inserire nella funzione di firma documenti 12…
Browse files Browse the repository at this point in the history
…10 anche l’informazione della distinta 1210 e dell’importo (in valuta o in euro dopo l’associazione del sospeso). Aggiungere anche tra i filtri di ricerca anno e numero distinta 1210.

4.Consentire, nella funzione di ricerca mandati/reversali alla firma,  la ricerca per i possibili filtri senza tener conto dello stato del documento se impostato a ‘Tutti’.

5.Aggiungere sulla funzione di fattura elettronica passiva il download del file firmato.
  • Loading branch information
mspasiano committed Mar 2, 2016
1 parent 6bbc89a commit e85f232
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 16 deletions.
Expand Up @@ -4,7 +4,6 @@
import it.cnr.contab.cmis.service.SiglaCMISService;
import it.cnr.contab.config00.bulk.Configurazione_cnrBulk;
import it.cnr.contab.config00.ejb.EsercizioComponentSession;
import it.cnr.contab.config00.esercizio.bulk.EsercizioBulk;
import it.cnr.contab.config00.sto.bulk.Unita_organizzativaBulk;
import it.cnr.contab.docamm00.actions.CRUDFatturaPassivaAction;
import it.cnr.contab.docamm00.cmis.CMISDocAmmAspect;
Expand Down Expand Up @@ -40,15 +39,12 @@
import it.cnr.jada.util.ejb.EJBCommonServices;
import it.cnr.jada.util.jsp.Button;
import it.gov.fatturapa.sdi.fatturapa.v1.RegimeFiscaleType;
import it.gov.fatturapa.sdi.fatturapa.v1.SoggettoEmittenteType;
import it.gov.fatturapa.sdi.fatturapa.v1.TipoDocumentoType;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.rmi.RemoteException;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -158,6 +154,8 @@ protected Button[] createToolbar() {
toolbar.addAll(Arrays.asList(buttons));
toolbar.add(new it.cnr.jada.util.jsp.Button(it.cnr.jada.util.Config
.getHandler().getProperties(getClass()), "Toolbar.download"));
toolbar.add(new it.cnr.jada.util.jsp.Button(it.cnr.jada.util.Config
.getHandler().getProperties(getClass()), "Toolbar.downloadFatturaFirmata"));
toolbar.get(toolbar.size() - 1).setSeparator(true);
toolbar.add(new it.cnr.jada.util.jsp.Button(it.cnr.jada.util.Config
.getHandler().getProperties(getClass()), "Toolbar.rifiuta"));
Expand Down Expand Up @@ -315,6 +313,29 @@ public void scaricaFatturaHtml(ActionContext actioncontext) throws IOException,
}
}
}

public void scaricaFatturaFirmata(ActionContext actioncontext) throws IOException, ServletException, TransformerException, ApplicationException {
DocumentoEleTestataBulk documentoEleTestata = (DocumentoEleTestataBulk) getModel();
Folder fatturaFolder = (Folder) cmisService.getNodeByNodeRef(documentoEleTestata.getDocumentoEleTrasmissione().getCmisNodeRef());
ItemIterable<CmisObject> files = fatturaFolder.getChildren();
for (CmisObject cmisObject : files) {
if (cmisObject.getProperty(PropertyIds.SECONDARY_OBJECT_TYPE_IDS).getValues().contains("P:sigla_fatture_attachment:fattura_elettronica_xml_post_firma")){
Document document = (Document) cmisObject;
InputStream is = cmisService.getResource(document);
((HttpActionContext)actioncontext).getResponse().setContentLength(Long.valueOf(document.getContentStreamLength()).intValue());
((HttpActionContext)actioncontext).getResponse().setContentType(document.getContentStreamMimeType());
OutputStream os = ((HttpActionContext)actioncontext).getResponse().getOutputStream();
((HttpActionContext)actioncontext).getResponse().setDateHeader("Expires", 0);
byte[] buffer = new byte[((HttpActionContext)actioncontext).getResponse().getBufferSize()];
int buflength;
while ((buflength = is.read(buffer)) > 0) {
os.write(buffer,0,buflength);
}
is.close();
os.flush();
}
}
}

public String getNomeFileAllegato() {
DocumentoEleAllegatiBulk allegato = (DocumentoEleAllegatiBulk)getCrudDocEleAllegatiColl().getModel();
Expand Down
Expand Up @@ -420,6 +420,10 @@ public boolean isUoNonEnte() {
return false;
return true;
}

public String getNomeFileFirmato() {
return getDocumentoEleTrasmissione().getNomeFile();
}

public String getNomeFile(String prefix) {
if (getIdPaese() == null)
Expand Down
Expand Up @@ -28,6 +28,7 @@
import it.cnr.jada.persistency.sql.CompoundFindClause;
import it.cnr.jada.util.Log;
import it.cnr.jada.util.OrderedHashtable;
import it.cnr.jada.util.RemoteIterator;
import it.cnr.jada.util.action.ConsultazioniBP;
import it.cnr.jada.util.ejb.EJBCommonServices;
import it.cnr.jada.util.jsp.Button;
Expand Down Expand Up @@ -83,7 +84,7 @@ public void setMultiSelection(boolean flag) {

public void setColumnSet(ActionContext actioncontext, String statoTrasmissione) {
String columnSetName = "firmaBase";
if (statoTrasmissione.equalsIgnoreCase(StatoTrasmissione.ALL))
if (statoTrasmissione.equalsIgnoreCase(StatoTrasmissione.ALL) || statoTrasmissione.equalsIgnoreCase(MandatoBulk.STATO_TRASMISSIONE_TRASMESSO))
columnSetName = "all";
else if (!statoTrasmissione.equalsIgnoreCase(MandatoBulk.STATO_TRASMISSIONE_NON_INSERITO))
columnSetName = "firmaPredisposta";
Expand Down Expand Up @@ -439,4 +440,12 @@ private String getTitolo() {
public void invia(ActionContext context, FirmaOTPBulk firmaOTPBulk) throws Exception {

}
@Override
public RemoteIterator search(ActionContext actioncontext, CompoundFindClause compoundfindclause, OggettoBulk oggettobulk) throws BusinessProcessException {
setFindclause(compoundfindclause);
StatoTrasmissione statoTrasmissione = (StatoTrasmissione)oggettobulk.clone();
if (statoTrasmissione.getStato_trasmissione().equalsIgnoreCase(StatoTrasmissione.ALL))
statoTrasmissione.setStato_trasmissione(null);
return findFreeSearch(actioncontext, compoundfindclause, (OggettoBulk) statoTrasmissione);
}
}
Expand Up @@ -7,6 +7,15 @@ Toolbar.download.enabledProperty=printButtonEnabled
Toolbar.download.title=Download fattura
Toolbar.download.accessKey=D

Toolbar.downloadFatturaFirmata.img=img/p7m.gif
Toolbar.downloadFatturaFirmata.disabledImg=img/p7m.gif
Toolbar.downloadFatturaFirmata.label=Download<br>Fattura <u>F</u>irmata
Toolbar.downloadFatturaFirmata.href=javascript:doScaricaFatturaFirmata()
Toolbar.downloadFatturaFirmata.style=width:90px;
Toolbar.downloadFatturaFirmata.enabledProperty=printButtonEnabled
Toolbar.downloadFatturaFirmata.title=Download fattura firmata
Toolbar.downloadFatturaFirmata.accessKey=F

Toolbar.rifiuta.img=img/removedocument24.gif
Toolbar.rifiuta.disabledImg=img/removedocument24.gif
Toolbar.rifiuta.label=<u>R</u>ifiuta<br>Fattura
Expand Down
Expand Up @@ -103,8 +103,17 @@
nullable="false"
enabledOnFreeSearch="false"
caseSensitiveSearch="false"/>


<fieldProperty
name="esercizio_distinta"
property="esercizio_distinta"
inputType="TEXT"
label="Es. Distinta" />
<fieldProperty
name="pg_distinta"
property="pg_distinta"
inputType="TEXT"
label="N. Distinta" />

<formFieldProperty
name="esercizio" />
<formFieldProperty
Expand Down Expand Up @@ -175,7 +184,11 @@
name="ti_entrata_spesa" />
<findFieldProperty
name="sospeso" />

<findFieldProperty
name="esercizio_distinta" />
<findFieldProperty
name="pg_distinta" />

<columnSet
name="firmaBase">
<columnFieldProperty
Expand Down Expand Up @@ -268,16 +281,19 @@
name="im_pagamento" />
<columnFieldProperty
name="dt_registrazione" />
<columnFieldProperty
name="dt_firma"
property="dt_firma"
inputType="TEXT"
label="Data di Firma" />
<columnFieldProperty
name="esercizio_distinta" />
<columnFieldProperty
name="pg_distinta" />
<columnFieldProperty
name="documento"
property="documento"
inputType="TEXT"
label="Documento" />
<columnFieldProperty
name="dt_firma"
property="dt_firma"
inputType="TEXT"
label="Data di Firma" />
</columnSet>

</columnSet>
</bulkInfo>
Expand Up @@ -45,7 +45,7 @@
name="cd_unita_organizzativa"
property="cd_unita_organizzativa"
inputSize="10"
inputType="ROTEXT"
inputType="TEXT"
label="Unit&#224; Organizzativa"
enabledOnFreeSearch="true"
caseSensitiveSearch="false" />
Expand Down
Expand Up @@ -20,13 +20,19 @@
CNRUserInfo userInfo = (CNRUserInfo)HttpActionContext.getUserInfo(request);
DocumentoEleTestataBulk model = (DocumentoEleTestataBulk)bp.getModel();
String nomeFile = model != null?model.getNomeFile("EC"):"";
String nomeFileFirmato = model != null?model.getNomeFileFirmato():"";
%>
<title>FATTURA ELETTRONICA</title>
<script language="JavaScript">
function doScaricaFatturaHtml() {
window.open('genericdownload/fattura.html?methodName=scaricaFatturaHtml&it.cnr.jada.action.BusinessProcess=<%=bp.getPath()%>',
'Fattura', 'toolbar=no, location=no, directories=no, status=no, menubar=no,resizable,scrollbars,width=800,height=600').focus() ;
}
function doScaricaFatturaFirmata() {
window.open('genericdownload/<%=nomeFileFirmato%>?methodName=scaricaFatturaFirmata&it.cnr.jada.action.BusinessProcess=<%=bp.getPath()%>',
'Fattura', 'toolbar=no, location=no, directories=no, status=no, menubar=no,resizable,scrollbars,width=800,height=600').focus() ;
}
function doScaricaEsito() {
window.open('genericdownload/<%=nomeFile%>?methodName=scaricaEsito&it.cnr.jada.action.BusinessProcess=<%=bp.getPath()%>',
'Notifica', 'toolbar=no, location=no, directories=no, status=no, menubar=no,resizable,scrollbars,width=800,height=600').focus();
Expand Down
Binary file added sigla-web/src/main/webapp/img/p7m.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e85f232

Please sign in to comment.