Introduzione visualizzazion ricevute

This commit is contained in:
Thomas Zilio 2019-02-20 16:07:42 +01:00
parent 5d3224d1c7
commit 2a464c931d
17 changed files with 4155 additions and 2584 deletions

File diff suppressed because it is too large Load Diff

View File

@ -34,9 +34,9 @@ class FatturaElettronica
/** @var Fattura Fattura collegata */
protected $fattura = null;
public function __construct($file)
public function __construct($name)
{
$this->file = static::getImportDirectory().'/'.$file;
$this->file = static::getImportDirectory().'/'.$name;
$this->xml = XML::readFile($this->file);
// Individuazione fattura pre-esistente
@ -84,10 +84,10 @@ class FatturaElettronica
return $filename;
}
public static function isValid($file)
public static function isValid($name)
{
try {
new static($file);
new static($name);
return true;
} catch (UnexpectedValueException $e) {

View File

@ -64,10 +64,9 @@ class Interaction extends Connection
$body = static::responseBody($response);
$message = '';
if ($body['status'] != '200') {
$message = $body['status'].' - '.$body['message'];
} else {
$message = '';
}
return $message;

View File

@ -13,7 +13,7 @@ $xml->loadXML($content);
// XSL
$xsl = new DOMDocument();
$xsl->load(DOCROOT.'/assets/src/xml/fe-stylesheet-1.2.1.xsl');
$xsl->load(DOCROOT.'/plugins/xml/asso-invoice.xsl');
// XSLT
$xslt = new XSLTProcessor();

View File

@ -27,16 +27,19 @@ switch (filter('op')) {
$results = [];
foreach ($list as $name) {
$content = Interaction::getReceipt($name);
Interaction::getReceipt($name);
$fattura = null;
try {
$receipt = new Ricevuta($name, $content);
$receipt->save();
$fattura = $receipt->getFattura()->numero_esterno;
$receipt->delete();
Interaction::processReceipt($name);
} catch (Exception $e) {
} catch (UnexpectedValueException $e) {
}
$results[] = [

View File

@ -21,12 +21,19 @@ class Interaction extends Connection
public static function getReceipt($name)
{
$response = static::request('POST', 'notifica_da_importare', [
'name' => $name,
]);
$body = static::responseBody($response);
$directory = Ricevuta::getImportDirectory();
$file = $directory.'/'.$name;
return $body['content'];
if (!file_exists($file)) {
$response = static::request('POST', 'notifica_da_importare', [
'name' => $name,
]);
$body = static::responseBody($response);
Ricevuta::store($name, $body['content']);
}
return $name;
}
public static function processReceipt($filename)

View File

@ -2,8 +2,11 @@
namespace Plugins\ReceiptFE;
use Modules;
use Modules\Fatture\Fattura;
use Plugins;
use UnexpectedValueException;
use Uploads;
use Util\XML;
/**
@ -13,18 +16,22 @@ use Util\XML;
*/
class Ricevuta
{
/** @var array XML della fattura */
protected static $directory = null;
/** @var array Percorso del file XML */
protected $file = null;
/** @var array XML della ricevuta */
protected $xml = null;
/** @var array XML della fattura */
/** @var array XML della ricevuta */
protected $fattura = null;
public function __construct($name, $content)
public function __construct($name)
{
$this->xml = XML::read($content);
$this->file = static::getImportDirectory().'/'.$name;
$this->xml = XML::readFile($this->file);
$nome = $this->xml['NomeFile'];
$filename = explode('.', $nome)[0];
$filename = explode('.', $name)[0];
$pieces = explode('_', $filename);
$progressivo_invio = $pieces[1];
@ -35,25 +42,86 @@ class Ricevuta
if (empty($this->fattura)) {
throw new UnexpectedValueException();
} else {
// Processo la ricevuta e salvo il codice e messaggio di errore
$filename = explode('.', $name)[0];
$pieces = explode('_', $filename);
$codice = $pieces[2];
$descrizione = $this->xml['Destinatario']['Descrizione'];
$data = $this->xml['DataOraRicezione'];
$this->fattura->codice_stato_fe = $codice;
$this->fattura->descrizione_ricevuta_fe = $descrizione;
$this->fattura->data_stato_fe = date('Y-m-d H:i:s', strtotime($data));
$this->fattura->save();
return true;
}
}
public static function store($filename, $content)
{
$directory = static::getImportDirectory();
$file = $directory.'/'.$filename;
directory($directory);
file_put_contents($file, $content);
return $filename;
}
public static function getImportDirectory()
{
if (!isset(self::$directory)) {
$plugin = Plugins::get('Ricevute FE');
self::$directory = DOCROOT.'/'.$plugin->upload_directory;
}
return self::$directory;
}
public function saveAllegato($codice)
{
$module = Modules::get('Fatture di vendita');
$info = [
'category' => tr('Fattura Elettronica'),
'id_module' => $module->id,
'id_record' => $this->fattura->id,
];
// Registrazione XML come allegato
$filename = Uploads::upload($this->file, array_merge($info, [
'name' => tr('Ricevuta _TYPE_', [
'_TYPE_' => $codice,
]),
'original' => basename($this->file),
]));
}
public function saveStato($codice)
{
$fattura = $this->getFattura();
// Modifica lo stato solo se la fattura non è già stata consegnata (per evitare problemi da doppi invii)
if ($fattura->codice_stato_fe == 'RC') {
return;
}
// Processo la ricevuta e salvo il codice e messaggio di errore
$descrizione = $this->xml['Destinatario']['Descrizione'];
$data = $this->xml['DataOraRicezione'];
$fattura->codice_stato_fe = $codice;
$fattura->data_stato_fe = date('Y-m-d H:i:s', strtotime($data));
$fattura->save();
}
public function save()
{
$name = basename($this->file);
$filename = explode('.', $name)[0];
$pieces = explode('_', $filename);
$codice = $pieces[2];
$this->saveAllegato($codice);
$this->saveStato($codice);
}
public function getFattura()
{
return $this->fattura;
}
public function delete()
{
delete($this->file);
}
}

137
plugins/xml/AT_v1.0.xsl Normal file
View File

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.fatturapa.gov.it/sdi/messaggi/v1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:param name="SV_OutputFormat" select="'HTML'"/>
<xsl:variable name="XML" select="/"/>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
#notifica-container { width: 100%; position: relative; font-family: sans-serif; }
#notifica { margin-left: auto; margin-right: auto; max-width: 1280px; min-width: 930px; padding: 0; }
#notifica h1 { padding: 20px 0 0 0; margin: 0; font-size: 30px; }
#notifica h2 { padding: 20px 0 0 0; margin: 0; font-size: 20px; border-bottom: 2px solid #333333; }
#notifica h3 { padding: 20px 0 0 0; margin: 0; font-size: 17px; }
#notifica h4 { padding: 20px 0 0 0; margin: 0; font-size: 15px; }
#notifica h5 { padding: 15px 0 0 0; margin: 0; font-size: 14px; font-style: italic; }
#notifica ul { list-style-type: none; margin: 0 !important; padding: 1em 0 1em 2em !important; }
#notifica ul li {}
#notifica ul li span { font-weight: bold; }
#notifica div { padding: 0; margin: 0; }
#notifica div.page {
background: #fff url("http://www.fatturapa.gov.it/img/sdi.png") right bottom no-repeat !important;
position: relative;
margin: 20px 0
50px 0;
padding: 60px;
background: -moz-linear-gradient(0% 0 360deg, #FFFFFF, #F2F2F2 20%, #FFFFFF) repeat scroll 0 0 transparent;
border: 1px solid #CCCCCC;
-webkitbox-shadow: 0 0 10px rgba(0, 0, 0,
0.3);
-mozbox-shadow: 0
0 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
#notifica div.header { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica div.footer { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica-container .versione { font-size: 11px; float:right; color: #777777; }
#notifica table { font-size: .9em; margin-top: 1em; border-collapse: collapse; border: 1px solid black; }
#notifica table caption { color: black; padding: .5em 0; font-weight: bold; }
#notifica table th { border: 1px solid black; background-color: #f0f0f0; padding: .2em .5em; }
#notifica table td { border: 1px solid black; padding: .2em .5em; }
#notifica table td:first-child { text-align: center; font-weight: bold; }
</style>
</head>
<body>
<xsl:for-each select="a:AttestazioneTrasmissioneFattura">
<div id="notifica-container">
<div id="notifica">
<div class="page">
<div class="versione">
<xsl:if test="ds:Signature">
File con firma elettronica -
</xsl:if>
Versione <xsl:value-of select="@versione"/>
</div>
<h1>Attestazione di avvenuta trasmissione della fattura con impossibilità di recapito</h1>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="IdentificativoSdI" /></span>
</li>
<li>
Nome File:
<span><xsl:value-of select="NomeFile" /></span>
</li>
<li>
Data Ora Ricezione:
<span><xsl:value-of select="DataOraRicezione" /></span>
</li>
<xsl:if test="RiferimentoArchivio">
<li>
<h3>Riferimento Archivio:</h3>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="RiferimentoArchivio/IdentificativoSdI" /></span>
</li>
<li>
Nome File:
<span><xsl:value-of select="RiferimentoArchivio/NomeFile" /></span>
</li>
</ul>
</li>
</xsl:if>
<li>
Destinatario:
<span><xsl:value-of select="Destinatario" /></span>
</li>
<li>
Message Id:
<span><xsl:value-of select="MessageId" /></span>
</li>
<xsl:if test="PecMessageId">
<li>
Pec Message-ID:
<span><xsl:value-of select="PecMessageId" /></span>
</li>
</xsl:if>
<xsl:if test="Note">
<li>
Note:
<span><xsl:value-of select="Note" /></span>
</li>
</xsl:if>
<li>
Hash del File Originale:
<span><xsl:value-of select="HashFileOriginale" /></span>
</li>
</ul>
</div>
</div>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

145
plugins/xml/DT_v1.0.xsl Normal file
View File

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.fatturapa.gov.it/sdi/messaggi/v1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:param name="SV_OutputFormat" select="'HTML'"/>
<xsl:variable name="XML" select="/"/>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
#notifica-container { width: 100%; position: relative; font-family: sans-serif; }
#notifica { margin-left: auto; margin-right: auto; max-width: 1280px; min-width: 930px; padding: 0; }
#notifica h1 { padding: 20px 0 0 0; margin: 0; font-size: 30px; }
#notifica h2 { padding: 20px 0 0 0; margin: 0; font-size: 20px; border-bottom: 2px solid #333333; }
#notifica h3 { padding: 20px 0 0 0; margin: 0; font-size: 17px; }
#notifica h4 { padding: 20px 0 0 0; margin: 0; font-size: 15px; }
#notifica h5 { padding: 15px 0 0 0; margin: 0; font-size: 14px; font-style: italic; }
#notifica ul { list-style-type: none; margin: 0 !important; padding: 1em 0 1em 2em !important; }
#notifica ul li {}
#notifica ul li span { font-weight: bold; }
#notifica div { padding: 0; margin: 0; }
#notifica div.page {
background: #fff url("http://www.fatturapa.gov.it/img/sdi.png") right bottom no-repeat !important;
position: relative;
margin: 20px 0
50px 0;
padding: 60px;
background: -moz-linear-gradient(0% 0 360deg, #FFFFFF, #F2F2F2 20%, #FFFFFF) repeat scroll 0 0 transparent;
border: 1px solid #CCCCCC;
-webkitbox-shadow: 0 0 10px rgba(0, 0, 0,
0.3);
-mozbox-shadow: 0
0 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
#notifica div.header { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica div.footer { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica-container .versione { font-size: 11px; float:right; color: #777777; }
#notifica table { font-size: .9em; margin-top: 1em; border-collapse: collapse; border: 1px solid black; }
#notifica table caption { color: black; padding: .5em 0; font-weight: bold; }
#notifica table th { border: 1px solid black; background-color: #f0f0f0; padding: .2em .5em; }
#notifica table td { border: 1px solid black; padding: .2em .5em; }
#notifica table td:first-child { text-align: center; font-weight: bold; }
</style>
</head>
<body>
<xsl:for-each select="a:NotificaDecorrenzaTermini">
<div id="notifica-container">
<div id="notifica">
<div class="page">
<div class="versione">
<xsl:if test="ds:Signature">
File con firma elettronica -
</xsl:if>
Versione <xsl:value-of select="@versione"/>
<br/>
<xsl:variable name="dupliceRuolo">
<xsl:value-of select="@IntermediarioConDupliceRuolo"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$dupliceRuolo='Si'"> Flusso semplificato</xsl:when>
</xsl:choose>
</div>
<h1>Notifica Decorrenza Termini</h1>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="IdentificativoSdI" /></span>
</li>
<xsl:if test="RiferimentoFattura">
<li>
<h3>Riferimento Fattura</h3>
<ul>
<li>
Numero Fattura:
<span><xsl:value-of select="RiferimentoFattura/NumeroFattura" /></span>
</li>
<li>
Anno Fattura:
<span><xsl:value-of select="RiferimentoFattura/AnnoFattura" /></span>
</li>
<xsl:if test="RiferimentoFattura/PosizioneFattura">
<li>
Posizione Fattura:
<span><xsl:value-of select="RiferimentoFattura/PosizioneFattura" /></span>
</li>
</xsl:if>
</ul>
</li>
</xsl:if>
<li>
Nome File:
<span><xsl:value-of select="NomeFile" /></span>
</li>
<xsl:if test="Descrizione">
<li>
Descrizione:
<span><xsl:value-of select="Descrizione" /></span>
</li>
</xsl:if>
<li>
Message Id:
<span><xsl:value-of select="MessageId" /></span>
</li>
<xsl:if test="PecMessageId">
<li>
Pec Message Id:
<span><xsl:value-of select="PecMessageId" /></span>
</li>
</xsl:if>
<xsl:if test="Note">
<li>
Note:
<span><xsl:value-of select="Note" /></span>
</li>
</xsl:if>
</ul>
</div>
</div>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

132
plugins/xml/EC_v1.0.xsl Normal file
View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.fatturapa.gov.it/sdi/messaggi/v1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:param name="SV_OutputFormat" select="'HTML'"/>
<xsl:variable name="XML" select="/"/>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
#notifica-container { width: 100%; position: relative; font-family: sans-serif; }
#notifica { margin-left: auto; margin-right: auto; max-width: 1280px; min-width: 930px; padding: 0; }
#notifica h1 { padding: 20px 0 0 0; margin: 0; font-size: 30px; }
#notifica h2 { padding: 20px 0 0 0; margin: 0; font-size: 20px; border-bottom: 2px solid #333333; }
#notifica h3 { padding: 20px 0 0 0; margin: 0; font-size: 17px; }
#notifica h4 { padding: 20px 0 0 0; margin: 0; font-size: 15px; }
#notifica h5 { padding: 15px 0 0 0; margin: 0; font-size: 14px; font-style: italic; }
#notifica ul { list-style-type: none; margin: 0 !important; padding: 1em 0 1em 2em !important; }
#notifica ul li {}
#notifica ul li span { font-weight: bold; }
#notifica div { padding: 0; margin: 0; }
#notifica div.page {
background: #fff url("http://www.fatturapa.gov.it/img/sdi.png") right bottom no-repeat !important;
position: relative;
margin: 20px 0
50px 0;
padding: 60px;
background: -moz-linear-gradient(0% 0 360deg, #FFFFFF, #F2F2F2 20%, #FFFFFF) repeat scroll 0 0 transparent;
border: 1px solid #CCCCCC;
-webkitbox-shadow: 0 0 10px rgba(0, 0, 0,
0.3);
-mozbox-shadow: 0
0 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
#notifica div.header { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica div.footer { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica-container .versione { font-size: .7em; float:right; color: #777777; }
#notifica table { font-size: .9em; margin-top: 1em; border-collapse: collapse; border: 1px solid black; }
#notifica table caption { color: black; padding: .5em 0; font-weight: bold; }
#notifica table th { border: 1px solid black; background-color: #f0f0f0; padding: .2em .5em; }
#notifica table td { border: 1px solid black; padding: .2em .5em; }
#notifica table td:first-child { text-align: center; font-weight: bold; }
</style>
</head>
<body>
<xsl:for-each select="a:NotificaEsitoCommittente">
<div id="notifica-container">
<div id="notifica">
<div class="page">
<div class="versione">
<xsl:if test="ds:Signature">
File con firma elettronica -
</xsl:if>
Versione <xsl:value-of select="@versione"/>
</div>
<h1>Notifica Esito Committente</h1>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="IdentificativoSdI" /></span>
</li>
<xsl:if test="RiferimentoFattura">
<li>
<h3>Riferimento Fattura</h3>
<ul>
<li>
Numero Fattura:
<span><xsl:value-of select="RiferimentoFattura/NumeroFattura" /></span>
</li>
<li>
Anno Fattura:
<span><xsl:value-of select="RiferimentoFattura/AnnoFattura" /></span>
</li>
<xsl:if test="RiferimentoFattura/PosizioneFattura">
<li>
Posizione Fattura:
<span><xsl:value-of select="RiferimentoFattura/PosizioneFattura" /></span>
</li>
</xsl:if>
</ul>
</li>
</xsl:if>
<li>
Esito:
<span><xsl:value-of select="Esito" /></span>
<xsl:variable name="EC">
<xsl:value-of select="Esito" />
</xsl:variable>
<xsl:choose>
<xsl:when test="$EC='EC01'"> (Accettazione)</xsl:when>
<xsl:when test="$EC='EC02'"> (Rifiuto)</xsl:when>
</xsl:choose>
</li>
<xsl:if test="Descrizione">
<li>
Descrizione:
<span><xsl:value-of select="Descrizione" /></span>
</li>
</xsl:if>
<xsl:if test="MessageIdCommittente">
<li>
Message Id Committente:
<span><xsl:value-of select="MessageIdCommittente" /></span>
</li>
</xsl:if>
</ul>
</div>
</div>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

136
plugins/xml/MC_v1.0.xsl Normal file
View File

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.fatturapa.gov.it/sdi/messaggi/v1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:param name="SV_OutputFormat" select="'HTML'"/>
<xsl:variable name="XML" select="/"/>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
#notifica-container { width: 100%; position: relative; font-family: sans-serif; }
#notifica { margin-left: auto; margin-right: auto; max-width: 1280px; min-width: 930px; padding: 0; }
#notifica h1 { padding: 20px 0 0 0; margin: 0; font-size: 30px; }
#notifica h2 { padding: 20px 0 0 0; margin: 0; font-size: 20px; border-bottom: 2px solid #333333; }
#notifica h3 { padding: 20px 0 0 0; margin: 0; font-size: 17px; }
#notifica h4 { padding: 20px 0 0 0; margin: 0; font-size: 15px; }
#notifica h5 { padding: 15px 0 0 0; margin: 0; font-size: 14px; font-style: italic; }
#notifica ul { list-style-type: none; margin: 0 !important; padding: 1em 0 1em 2em !important; }
#notifica ul li {}
#notifica ul li span { font-weight: bold; }
#notifica div { padding: 0; margin: 0; }
#notifica div.page {
background: #fff url("http://www.fatturapa.gov.it/img/sdi.png") right bottom no-repeat !important;
position: relative;
margin: 20px 0
50px 0;
padding: 60px;
background: -moz-linear-gradient(0% 0 360deg, #FFFFFF, #F2F2F2 20%, #FFFFFF) repeat scroll 0 0 transparent;
border: 1px solid #CCCCCC;
-webkitbox-shadow: 0 0 10px rgba(0, 0, 0,
0.3);
-mozbox-shadow: 0
0 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
#notifica div.header { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica div.footer { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica-container .versione { font-size: .7em; float:right; color: #777777; }
#notifica table { font-size: .9em; margin-top: 1em; border-collapse: collapse; border: 1px solid black; }
#notifica table caption { color: black; padding: .5em 0; font-weight: bold; }
#notifica table th { border: 1px solid black; background-color: #f0f0f0; padding: .2em .5em; }
#notifica table td { border: 1px solid black; padding: .2em .5em; }
#notifica table td:first-child { text-align: center; font-weight: bold; }
</style>
</head>
<body>
<xsl:for-each select="a:NotificaMancataConsegna">
<div id="notifica-container">
<div id="notifica">
<div class="page">
<div class="versione">
<xsl:if test="ds:Signature">
File con firma elettronica -
</xsl:if>
Versione <xsl:value-of select="@versione"/>
</div>
<h1>Notifica Mancata Consegna</h1>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="IdentificativoSdI" /></span>
</li>
<li>
Nome File:
<span><xsl:value-of select="NomeFile" /></span>
</li>
<li>
Data Ora Ricezione:
<span><xsl:value-of select="DataOraRicezione" /></span>
</li>
<xsl:if test="RiferimentoArchivio">
<li>
<h3>Riferimento Archivio</h3>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="RiferimentoArchivio/IdentificativoSdI" /></span>
</li>
<li>
Nome File:
<span><xsl:value-of select="RiferimentoArchivio/NomeFile" /></span>
</li>
</ul>
</li>
</xsl:if>
<xsl:if test="Descrizione">
<li>
Descrizione:
<span><xsl:value-of select="Descrizione" /></span>
</li>
</xsl:if>
<li>
Message Id:
<span><xsl:value-of select="MessageId" /></span>
</li>
<xsl:if test="PecMessageId">
<li>
Pec Message Id:
<span><xsl:value-of select="PecMessageId" /></span>
</li>
</xsl:if>
<xsl:if test="Note">
<li>
Note:
<span><xsl:value-of select="Note" /></span>
</li>
</xsl:if>
</ul>
</div>
</div>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

175
plugins/xml/NE_v1.0.xsl Normal file
View File

@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.fatturapa.gov.it/sdi/messaggi/v1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:param name="SV_OutputFormat" select="'HTML'"/>
<xsl:variable name="XML" select="/"/>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
#notifica-container { width: 100%; position: relative; font-family: sans-serif; }
#notifica { margin-left: auto; margin-right: auto; max-width: 1280px; min-width: 930px; padding: 0; }
#notifica h1 { padding: 20px 0 0 0; margin: 0; font-size: 30px; }
#notifica h2 { padding: 20px 0 0 0; margin: 0; font-size: 20px; border-bottom: 2px solid #333333; }
#notifica h3 { padding: 20px 0 0 0; margin: 0; font-size: 17px; }
#notifica h4 { padding: 20px 0 0 0; margin: 0; font-size: 15px; }
#notifica h5 { padding: 15px 0 0 0; margin: 0; font-size: 14px; font-style: italic; }
#notifica ul { list-style-type: none; margin: 0 !important; padding: 1em 0 1em 2em !important; }
#notifica ul li {}
#notifica ul li span { font-weight: bold; }
#notifica div { padding: 0; margin: 0; }
#notifica div.page {
background: #fff url("http://www.fatturapa.gov.it/img/sdi.png") right bottom no-repeat !important;
position: relative;
margin: 20px 0
50px 0;
padding: 60px;
background: -moz-linear-gradient(0% 0 360deg, #FFFFFF, #F2F2F2 20%, #FFFFFF) repeat scroll 0 0 transparent;
border: 1px solid #CCCCCC;
-webkitbox-shadow: 0 0 10px rgba(0, 0, 0,
0.3);
-mozbox-shadow: 0
0 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
#notifica div.header { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica div.footer { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica-container .versione { font-size: .7em; float:right; color: #777777; }
#notifica table { font-size: .9em; margin-top: 1em; border-collapse: collapse; border: 1px solid black; }
#notifica table caption { color: black; padding: .5em 0; font-weight: bold; }
#notifica table th { border: 1px solid black; background-color: #f0f0f0; padding: .2em .5em; }
#notifica table td { border: 1px solid black; padding: .2em .5em; }
#notifica table td:first-child { text-align: center; font-weight: bold; }
</style>
</head>
<body>
<xsl:for-each select="a:NotificaEsito">
<div id="notifica-container">
<div id="notifica">
<div class="page">
<div class="versione">
<xsl:if test="ds:Signature">
File con firma elettronica -
</xsl:if>
Versione <xsl:value-of select="@versione"/>
<br/>
<xsl:variable name="dupliceRuolo">
<xsl:value-of select="@IntermediarioConDupliceRuolo"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$dupliceRuolo='Si'"> Flusso semplificato</xsl:when>
</xsl:choose>
</div>
<h1>Notifica Esito</h1>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="IdentificativoSdI" /></span>
</li>
<li>
Nome File:
<span><xsl:value-of select="NomeFile" /></span>
</li>
<xsl:if test="MessageId">
<li>
Message Id:
<span><xsl:value-of select="MessageId" /></span>
</li>
</xsl:if>
<xsl:if test="PecMessageId">
<li>
PEC Message Id:
<span><xsl:value-of select="PecMessageId" /></span>
</li>
</xsl:if>
<xsl:if test="Note">
<li>
Note:
<span><xsl:value-of select="Note" /></span>
</li>
</xsl:if>
<h2>Esito Committente</h2>
<xsl:if test="EsitoCommittente/RiferimentoFattura">
<li>
<li>
Identificativo SdI:
<span><xsl:value-of select="EsitoCommittente/IdentificativoSdI" /></span>
</li>
<li>
<h3>Riferimento Fattura</h3>
<ul>
<li>
Numero Fattura:
<span><xsl:value-of select="EsitoCommittente/RiferimentoFattura/NumeroFattura" /></span>
</li>
<li>
Anno Fattura:
<span><xsl:value-of select="EsitoCommittente/RiferimentoFattura/AnnoFattura" /></span>
</li>
<xsl:if test="EsitoCommittente/RiferimentoFattura/PosizioneFattura">
<li>
Posizione Fattura:
<span><xsl:value-of select="EsitoCommittente/RiferimentoFattura/PosizioneFattura" /></span>
</li>
</xsl:if>
</ul>
</li>
</li>
</xsl:if>
<li>
Esito:
<span><xsl:value-of select="EsitoCommittente/Esito" /></span>
<xsl:variable name="EC">
<xsl:value-of select="EsitoCommittente/Esito" />
</xsl:variable>
<xsl:choose>
<xsl:when test="$EC='EC01'"> (Accettazione)</xsl:when>
<xsl:when test="$EC='EC02'"> (Rifiuto)</xsl:when>
</xsl:choose>
</li>
<xsl:if test="EsitoCommittente/Descrizione">
<li>
Descrizione:
<span><xsl:value-of select="EsitoCommittente/Descrizione" /></span>
</li>
</xsl:if>
<xsl:if test="EsitoCommittente/MessageIdCommittente">
<li>
Message Id Committente:
<span><xsl:value-of select="EsitoCommittente/MessageIdCommittente" /></span>
</li>
</xsl:if>
</ul>
</div>
</div>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

148
plugins/xml/NS_v1.0.xsl Normal file
View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.fatturapa.gov.it/sdi/messaggi/v1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:param name="SV_OutputFormat" select="'HTML'"/>
<xsl:variable name="XML" select="/"/>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
#notifica-container { width: 100%; position: relative; font-family: sans-serif; }
#notifica { margin-left: auto; margin-right: auto; max-width: 1280px; min-width: 930px; padding: 0; }
#notifica h1 { padding: 20px 0 0 0; margin: 0; font-size: 30px; }
#notifica h2 { padding: 20px 0 0 0; margin: 0; font-size: 20px; border-bottom: 2px solid #333333; }
#notifica h3 { padding: 20px 0 0 0; margin: 0; font-size: 17px; }
#notifica h4 { padding: 20px 0 0 0; margin: 0; font-size: 15px; }
#notifica h5 { padding: 15px 0 0 0; margin: 0; font-size: 14px; font-style: italic; }
#notifica ul { list-style-type: none; margin: 0 !important; padding: 1em 0 1em 2em !important; }
#notifica ul li {}
#notifica ul li span { font-weight: bold; }
#notifica div { padding: 0; margin: 0; }
#notifica div.page {
background: #fff url("http://www.fatturapa.gov.it/img/sdi.png") right bottom no-repeat !important;
position: relative;
margin: 20px 0
50px 0;
padding: 60px;
background: -moz-linear-gradient(0% 0 360deg, #FFFFFF, #F2F2F2 20%, #FFFFFF) repeat scroll 0 0 transparent;
border: 1px solid #CCCCCC;
-webkitbox-shadow: 0 0 10px rgba(0, 0, 0,
0.3);
-mozbox-shadow: 0
0 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
#notifica div.header { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica div.footer { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica-container .versione { font-size: 11px; float:right; color: #777777; }
#notifica table { font-size: .9em; margin-top: 1em; border-collapse: collapse; border: 1px solid black; }
#notifica table caption { color: black; padding: .5em 0; font-weight: bold; }
#notifica table th { border: 1px solid black; background-color: #f0f0f0; padding: .2em .5em; }
#notifica table td { border: 1px solid black; padding: .2em .5em; }
#notifica table td:first-child { text-align: center; font-weight: bold; }
</style>
</head>
<body>
<xsl:for-each select="a:NotificaScarto">
<div id="notifica-container">
<div id="notifica">
<div class="page">
<div class="versione">
<xsl:if test="ds:Signature">
File con firma elettronica -
</xsl:if>
Versione <xsl:value-of select="@versione"/>
</div>
<h1>Notifica Scarto</h1>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="IdentificativoSdI" /></span>
</li>
<li>
Nome File:
<span><xsl:value-of select="NomeFile" /></span>
</li>
<li>
Data Ora Ricezione:
<span><xsl:value-of select="DataOraRicezione" /></span>
</li>
<xsl:if test="RiferimentoArchivio">
<li>
<h3>Riferimento Archivio</h3>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="RiferimentoArchivio/IdentificativoSdI" /></span>
</li>
<li>
Nome File:
<span><xsl:value-of select="RiferimentoArchivio/NomeFile" /></span>
</li>
</ul>
</li>
</xsl:if>
<xsl:if test="MessageId">
<li>
Message Id:
<span><xsl:value-of select="MessageId" /></span>
</li>
</xsl:if>
<xsl:if test="PecMessageId">
<li>
Pec Message Id:
<span><xsl:value-of select="PecMessageId" /></span>
</li>
</xsl:if>
<xsl:if test="Note">
<li>
Note:
<span><xsl:value-of select="Note" /></span>
</li>
</xsl:if>
<li>
<table summaty="La tabella riporta gli errori riscontrati dal SdI nel file inviato">
<caption>Lista errori</caption>
<tr>
<th>Codice</th>
<th>Descrizione</th>
</tr>
<xsl:for-each select="ListaErrori/Errore">
<tr>
<td><xsl:value-of select="Codice"/></td>
<td><xsl:value-of select="Descrizione"/></td>
</tr>
</xsl:for-each>
</table>
</li>
</ul>
</div>
</div>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

144
plugins/xml/RC_v1.0.xsl Normal file
View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.fatturapa.gov.it/sdi/messaggi/v1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:param name="SV_OutputFormat" select="'HTML'"/>
<xsl:variable name="XML" select="/"/>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
#notifica-container { width: 100%; position: relative; font-family: sans-serif; }
#notifica { margin-left: auto; margin-right: auto; max-width: 1280px; min-width: 930px; padding: 0; }
#notifica h1 { padding: 20px 0 0 0; margin: 0; font-size: 30px; }
#notifica h2 { padding: 20px 0 0 0; margin: 0; font-size: 20px; border-bottom: 2px solid #333333; }
#notifica h3 { padding: 20px 0 0 0; margin: 0; font-size: 17px; }
#notifica h4 { padding: 20px 0 0 0; margin: 0; font-size: 15px; }
#notifica h5 { padding: 15px 0 0 0; margin: 0; font-size: 14px; font-style: italic; }
#notifica ul { list-style-type: none; margin: 0 !important; padding: 1em 0 1em 2em !important; }
#notifica ul li {}
#notifica ul li span { font-weight: bold; }
#notifica div { padding: 0; margin: 0; }
#notifica div.page {
background: #fff url("http://www.fatturapa.gov.it/img/sdi.png") right bottom no-repeat !important;
position: relative;
margin: 20px 0
50px 0;
padding: 60px;
background: -moz-linear-gradient(0% 0 360deg, #FFFFFF, #F2F2F2 20%, #FFFFFF) repeat scroll 0 0 transparent;
border: 1px solid #CCCCCC;
-webkitbox-shadow: 0 0 10px rgba(0, 0, 0,
0.3);
-mozbox-shadow: 0
0 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
#notifica div.header { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica div.footer { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica-container .versione { font-size: 11px; float:right; color: #777777; }
#notifica table { font-size: .9em; margin-top: 1em; border-collapse: collapse; border: 1px solid black; }
#notifica table caption { color: black; padding: .5em 0; font-weight: bold; }
#notifica table th { border: 1px solid black; background-color: #f0f0f0; padding: .2em .5em; }
#notifica table td { border: 1px solid black; padding: .2em .5em; }
#notifica table td:first-child { text-align: center; font-weight: bold; }
</style>
</head>
<body>
<xsl:for-each select="a:RicevutaConsegna">
<div id="notifica-container">
<div id="notifica">
<div class="page">
<div class="versione">
<xsl:if test="ds:Signature">
File con firma elettronica -
</xsl:if>
Versione <xsl:value-of select="@versione"/>
<br/>
<xsl:variable name="dupliceRuolo">
<xsl:value-of select="@IntermediarioConDupliceRuolo"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$dupliceRuolo='Si'"> Flusso semplificato</xsl:when>
</xsl:choose>
</div>
<h1>Ricevuta Consegna</h1>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="IdentificativoSdI" /></span>
</li>
<li>
Nome File:
<span><xsl:value-of select="NomeFile" /></span>
</li>
<li>
Data Ora Ricezione:
<span><xsl:value-of select="DataOraRicezione" /></span>
</li>
<li>
Data Ora Consegna:
<span><xsl:value-of select="DataOraConsegna" /></span>
</li>
<li>
Destinatario:
<span><xsl:value-of select="Destinatario" /></span>
</li>
<xsl:if test="RiferimentoArchivio">
<li>
<h3>Riferimento Archivio:</h3>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="RiferimentoArchivio/IdentificativoSdI" /></span>
</li>
<li>
Nome File:
<span><xsl:value-of select="RiferimentoArchivio/NomeFile" /></span>
</li>
</ul>
</li>
</xsl:if>
<li>
Message Id:
<span><xsl:value-of select="MessageId" /></span>
</li>
<xsl:if test="PecMessageId">
<li>
Pec Message-ID:
<span><xsl:value-of select="PecMessageId" /></span>
</li>
</xsl:if>
<xsl:if test="Note">
<li>
Note:
<span><xsl:value-of select="Note" /></span>
</li>
</xsl:if>
</ul>
</div>
</div>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

144
plugins/xml/SE_v1.0.xsl Normal file
View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.fatturapa.gov.it/sdi/messaggi/v1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:param name="SV_OutputFormat" select="'HTML'"/>
<xsl:variable name="XML" select="/"/>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
#notifica-container { width: 100%; position: relative; font-family: sans-serif; }
#notifica { margin-left: auto; margin-right: auto; max-width: 1280px; min-width: 930px; padding: 0; }
#notifica h1 { padding: 20px 0 0 0; margin: 0; font-size: 30px; }
#notifica h2 { padding: 20px 0 0 0; margin: 0; font-size: 20px; border-bottom: 2px solid #333333; }
#notifica h3 { padding: 20px 0 0 0; margin: 0; font-size: 17px; }
#notifica h4 { padding: 20px 0 0 0; margin: 0; font-size: 15px; }
#notifica h5 { padding: 15px 0 0 0; margin: 0; font-size: 14px; font-style: italic; }
#notifica ul { list-style-type: none; margin: 0 !important; padding: 1em 0 1em 2em !important; }
#notifica ul li {}
#notifica ul li span { font-weight: bold; }
#notifica div { padding: 0; margin: 0; }
#notifica div.page {
background: #fff url("http://www.fatturapa.gov.it/img/sdi.png") right bottom no-repeat !important;
position: relative;
margin: 20px 0
50px 0;
padding: 60px;
background: -moz-linear-gradient(0% 0 360deg, #FFFFFF, #F2F2F2 20%, #FFFFFF) repeat scroll 0 0 transparent;
border: 1px solid #CCCCCC;
-webkitbox-shadow: 0 0 10px rgba(0, 0, 0,
0.3);
-mozbox-shadow: 0
0 10px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
#notifica div.header { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica div.footer { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
#notifica-container .versione { font-size: 11px; float:right; color: #777777; }
#notifica table { font-size: .9em; margin-top: 1em; border-collapse: collapse; border: 1px solid black; }
#notifica table caption { color: black; padding: .5em 0; font-weight: bold; }
#notifica table th { border: 1px solid black; background-color: #f0f0f0; padding: .2em .5em; }
#notifica table td { border: 1px solid black; padding: .2em .5em; }
#notifica table td:first-child { text-align: center; font-weight: bold; }
</style>
</head>
<body>
<xsl:for-each select="a:ScartoEsitoCommittente">
<div id="notifica-container">
<div id="notifica">
<div class="page">
<div class="versione">
<xsl:if test="ds:Signature">
File con firma elettronica -
</xsl:if>
Versione <xsl:value-of select="@versione"/>
</div>
<h1>Scarto Esito committente</h1>
<ul>
<li>
Identificativo SdI:
<span><xsl:value-of select="IdentificativoSdI" /></span>
</li>
<xsl:if test="RiferimentoFattura">
<li>
<h3>Riferimento Fattura</h3>
<ul>
<li>
Numero Fattura:
<span><xsl:value-of select="RiferimentoFattura/NumeroFattura" /></span>
</li>
<li>
Anno Fattura:
<span><xsl:value-of select="RiferimentoFattura/AnnoFattura" /></span>
</li>
<xsl:if test="RiferimentoFattura/PosizioneFattura">
<li>
Posizione Fattura:
<span><xsl:value-of select="RiferimentoFattura/PosizioneFattura" /></span>
</li>
</xsl:if>
</ul>
</li>
</xsl:if>
<li>
Scarto:
<span><xsl:value-of select="Scarto" /></span>
<xsl:variable name="SC">
<xsl:value-of select="Scarto" />
</xsl:variable>
<xsl:choose>
<xsl:when test="$SC='EN00'"> (NOTIFICA NON CONFORME AL FORMATO)</xsl:when>
<xsl:when test="$SC='EN01'"> (NOTIFICA NON AMMISSIBILE)</xsl:when>
</xsl:choose>
</li>
<li>
Message Id:
<span><xsl:value-of select="MessageId" /></span>
</li>
<xsl:if test="MessageIdCommittente">
<li>
Message-ID committente:
<span><xsl:value-of select="MessageIdCommittente" /></span>
</li>
</xsl:if>
<xsl:if test="PecMessageId">
<li>
Pec Message-ID:
<span><xsl:value-of select="PecMessageId" /></span>
</li>
</xsl:if>
<xsl:if test="Note">
<li>
Note:
<span><xsl:value-of select="Note" /></span>
</li>
</xsl:if>
</ul>
</div>
</div>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

2858
plugins/xml/asso-invoice.xsl Normal file

File diff suppressed because it is too large Load Diff

View File

@ -15,17 +15,35 @@ $link = ROOTDIR.'/'.$file->filepath;
if ($file->isFatturaElettronica()) {
$content = file_get_contents(DOCROOT.'/'.$file->filepath);
// XML
$xml = new DOMDocument();
$xml->loadXML($content);
// Individuazione stylsheet
$stylesheet = 'asso-invoice';
// XSL
$xsl = new DOMDocument();
$xsl->load(DOCROOT.'/assets/src/xml/fe-stylesheet-1.2.1.xsl');
$name = basename($file->original);
$filename = explode('.', $name)[0];
$pieces = explode('_', $filename);
$codice = $pieces[2];
if (!empty($codice)) {
$stylesheet = $codice.'_v1.0';
}
$stylesheet = DOCROOT.'/plugins/xml/'.$stylesheet.'.xsl';
// Fix per ricevute con namespace errato
$content = str_replace('http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fattura/messaggi/v1.0', 'http://www.fatturapa.gov.it/sdi/messaggi/v1.0', $content);
// XML
$xml = DOMDocument::loadXML($content);
// XSLT
$xslt = new XSLTProcessor();
$xslt->importStylesheet($xsl);
$xslt->importStylesheet(DOMDocument::load($stylesheet));
echo '
<style>
#notifica {
min-width: 860px !important;
}
</style>';
echo $xslt->transformToXML($xml);
} else {