3v1n0

Untitled

Jul 29th, 2019
1,047
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 109.54 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet
  3.     version="1.1"
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:b="http://www.fatturapa.gov.it/sdi/fatturapa/v1.1"
  6.     xmlns:c="http://www.fatturapa.gov.it/sdi/fatturapa/v1.0"
  7.     xmlns:a="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2"
  8.     xmlns:d="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.0">
  9.  
  10.   <xsl:output method="html" />
  11.   <xsl:decimal-format name="euro" decimal-separator="," grouping-separator="."/>
  12.  
  13.   <xsl:template name="FormatDateIta">
  14.     <xsl:param name="DateTime" />
  15.  
  16.     <xsl:variable name="year" select="substring($DateTime,1,4)" />
  17.     <xsl:variable name="month" select="substring($DateTime,6,2)" />
  18.     <xsl:variable name="day" select="substring($DateTime,9,2)" />
  19.  
  20.     <xsl:value-of select="$day" />
  21.     <xsl:value-of select="'-'" />
  22.     <xsl:value-of select="$month" />
  23.     <xsl:value-of select="'-'" />
  24.     <xsl:value-of select="$year" />
  25.  
  26.   </xsl:template>
  27.  
  28.   <xsl:template name="FormatIVA">
  29.     <xsl:param name="Natura" />
  30.     <xsl:param name="IVA" />
  31.     <xsl:choose>
  32.       <xsl:when test="$Natura">
  33.         <xsl:value-of select="$Natura" />
  34.       </xsl:when>
  35.       <xsl:otherwise>
  36.         <xsl:if test="$IVA">
  37.           <xsl:value-of select="format-number($IVA,  '###.###.##0,00', 'euro')" />
  38.         </xsl:if>
  39.       </xsl:otherwise>
  40.     </xsl:choose>
  41.   </xsl:template>
  42.  
  43.   <xsl:template name="FormatSconto">
  44.     <xsl:param name="tipo" />
  45.     <xsl:param name="percentuale" />
  46.     <xsl:param name="importo" />
  47.  
  48.     <xsl:choose>
  49.       <xsl:when test="$tipo = 'SC' ">
  50.         <xsl:text>-</xsl:text>
  51.       </xsl:when>
  52.       <xsl:when test="$tipo = 'MG'">
  53.         <xsl:text>+</xsl:text>
  54.  
  55.       </xsl:when>
  56.       <xsl:otherwise>
  57.  
  58.       </xsl:otherwise>
  59.     </xsl:choose>
  60.  
  61.  
  62.     <xsl:choose>
  63.       <xsl:when test="$percentuale">
  64.         <xsl:value-of select="$percentuale" />
  65.         <xsl:text>%</xsl:text>
  66.       </xsl:when>
  67.       <xsl:otherwise>
  68.         <xsl:if test="$importo">
  69.           <xsl:value-of select="format-number($importo,  '###.###.##0,00', 'euro')" />
  70.         </xsl:if>
  71.       </xsl:otherwise>
  72.     </xsl:choose>
  73.     <xsl:text> </xsl:text>
  74.  
  75.   </xsl:template>
  76.  
  77.   <xsl:template name="FormatColSconto">
  78.     <xsl:param name="tipo" />
  79.     <xsl:param name="percentuale" />
  80.     <xsl:param name="importo" />
  81.  
  82.     <xsl:choose>
  83.       <xsl:when test="$tipo = 'SC' ">
  84.         <xsl:text>-</xsl:text>
  85.       </xsl:when>
  86.       <xsl:when test="$tipo = 'MG'">
  87.         <xsl:text>+</xsl:text>
  88.  
  89.       </xsl:when>
  90.       <xsl:otherwise>
  91.  
  92.       </xsl:otherwise>
  93.     </xsl:choose>
  94.  
  95.  
  96.     <xsl:choose>
  97.       <xsl:when test="$percentuale">
  98.         <xsl:value-of select="$percentuale" />
  99.         <xsl:text>%</xsl:text>
  100.       </xsl:when>
  101.       <xsl:otherwise>
  102.         <xsl:if test="$importo">
  103.           <xsl:value-of select="format-number($importo,  '###.###.##0,00', 'euro')" />
  104.         </xsl:if>
  105.       </xsl:otherwise>
  106.     </xsl:choose>
  107.  
  108.   </xsl:template>
  109.  
  110.   <!--DatiOrdineAcquisto  Vs.Ord. XXXXXX del 26/09/2018 CUP:YYYYYY CIG:ZZZZZZZ-->
  111.   <!--DatiContratto  Contratto XXXXXX del 26/09/2018 CUP:YYYYYY CIG:ZZZZZZZ -->
  112.   <!--DatiConvenzione  Convenzione XXXXXX del 26/09/2018 CUP:YYYYYY CIG:ZZZZZZZ -->
  113.   <!--DatiRicezione  Ricezione XXXXXX del 26/09/2018 CUP:YYYYYY CIG:ZZZZZZZ -->
  114.   <!--Fatture collegate Fatt.coll. XXXXXX del 26/09/2018 CUP:YYYYYY CIG:ZZZZZZZ -->
  115.   <xsl:template name="DatiCorrelati">
  116.     <xsl:param name="Prefix" />
  117.     <xsl:param name="IdDocumento" />
  118.     <xsl:param name="Data" />
  119.     <xsl:param name="CodiceCUP" />
  120.     <xsl:param name="CodiceCIG" />
  121.     <xsl:variable name="descrizione" >
  122.       <xsl:value-of select="$Prefix" />
  123.       <xsl:value-of select="$IdDocumento" />
  124.       <xsl:if test="$Data">
  125.         <xsl:text> del </xsl:text>
  126.         <xsl:call-template name="FormatDateIta">
  127.           <xsl:with-param name="DateTime" select="$Data" />
  128.         </xsl:call-template>
  129.       </xsl:if>
  130.       <xsl:if test="$CodiceCUP">
  131.         <xsl:text> CUP: </xsl:text>
  132.         <xsl:value-of select="$CodiceCUP" />
  133.       </xsl:if>
  134.       <xsl:if test="$CodiceCIG">
  135.         <xsl:text> CIG: </xsl:text>
  136.         <xsl:value-of select="$CodiceCIG" />
  137.       </xsl:if>
  138.     </xsl:variable>
  139.     <xsl:if test="$descrizione">
  140.       <xsl:call-template name="AltraDescrizioneLinea">
  141.         <xsl:with-param name="textDescrizione" select = "$descrizione" />
  142.       </xsl:call-template>
  143.     </xsl:if>
  144.   </xsl:template>
  145.  
  146.   <xsl:template match="DatiDDT">
  147.       <xsl:variable name="descri_DAO" >
  148.  
  149.           <xsl:text>DDT </xsl:text>
  150.           <xsl:value-of select="NumeroDDT" />
  151.           <xsl:if test="DataDDT">
  152.             <xsl:text> del </xsl:text>
  153.             <xsl:call-template name="FormatDateIta">
  154.               <xsl:with-param name="DateTime" select="DataDDT" />
  155.             </xsl:call-template>
  156.           </xsl:if>
  157.  
  158.       </xsl:variable>
  159.  
  160.       <xsl:if test="$descri_DAO">
  161.         <xsl:call-template name="AltraDescrizioneLinea">
  162.           <xsl:with-param name="textDescrizione" select = "$descri_DAO" />
  163.         </xsl:call-template>
  164.       </xsl:if>
  165.   </xsl:template>
  166.  
  167.   <xsl:template match="DettaglioLinee">
  168.     <xsl:param name="r" />
  169.     <xsl:param name="posASWRELSTD" />
  170.     <xsl:param name="TipoFattura" />
  171.     <xsl:param name="IndiceBody" />
  172.  
  173.     <!--Numero Linea -->
  174.     <xsl:variable name="valNumeroLinea" >
  175.       <xsl:value-of select="number(NumeroLinea)" />
  176.     </xsl:variable>
  177.  
  178.     <!--Pre LINEA OpzPreLineaDatiDDT -->
  179.  
  180.     <xsl:choose>
  181.  
  182.       <xsl:when test="OpzPreLineaDatiDDT">
  183.         <!--Pre LINEA OpzPreLineaDatiDDT -->
  184.         <xsl:for-each select="OpzPreLineaDatiDDT"  >
  185.           <xsl:call-template name="AltraDescrizioneLinea">
  186.             <xsl:with-param name="textDescrizione" select = "." />
  187.           </xsl:call-template>
  188.         </xsl:for-each>
  189.  
  190.       </xsl:when>
  191.         <xsl:otherwise>
  192.  
  193.        <xsl:for-each select="$TipoFattura/FatturaElettronicaBody[$IndiceBody]/DatiGenerali/DatiDDT[ number(./RiferimentoNumeroLinea) = $valNumeroLinea] ">
  194.                 <xsl:apply-templates select="."/>   <!-- apply DatiDDT template -->
  195.         </xsl:for-each>
  196.  
  197.       </xsl:otherwise>
  198.     </xsl:choose>
  199.  
  200.  
  201.     <!--DatiOrdineAcquisto  -->
  202.     <xsl:choose>
  203.       <!--Pre LINEA OpzPreLineaDatiOrdineAcquisto  -->
  204.       <xsl:when test="OpzPreLineaDatiOrdineAcquisto ">
  205.         <xsl:for-each select="OpzPreLineaDatiOrdineAcquisto"  >
  206.           <xsl:call-template name="AltraDescrizioneLinea">
  207.             <xsl:with-param name="textDescrizione" select = "." />
  208.           </xsl:call-template>
  209.         </xsl:for-each>
  210.       </xsl:when>
  211.  
  212.       <xsl:otherwise>
  213.  
  214.       <xsl:for-each select="$TipoFattura/FatturaElettronicaBody[$IndiceBody]/DatiGenerali/DatiOrdineAcquisto[ number(./RiferimentoNumeroLinea) = $valNumeroLinea] ">
  215.             <xsl:call-template name="DatiCorrelati" >
  216.             <xsl:with-param name="Prefix"   select='"Vs.Ord. "'/>
  217.             <xsl:with-param name="IdDocumento" select="IdDocumento"/>
  218.             <xsl:with-param name="Data" select="Data"/>
  219.             <xsl:with-param name="CodiceCUP" select="CodiceCUP"/>
  220.             <xsl:with-param name="CodiceCIG" select="CodiceCIG"/>
  221.           </xsl:call-template >
  222.         </xsl:for-each>
  223.  
  224.  
  225.       </xsl:otherwise>
  226.     </xsl:choose>
  227.  
  228.     <!--DatiContratto  -->
  229.       <xsl:choose>
  230.       <!--Pre LINEA OpzPreLineaDatiContratto  -->
  231.       <xsl:when test="OpzPreLineaDatiContratto ">
  232.         <xsl:for-each select="OpzPreLineaDatiContratto"  >
  233.           <xsl:call-template name="AltraDescrizioneLinea">
  234.             <xsl:with-param name="textDescrizione" select = "." />
  235.           </xsl:call-template>
  236.         </xsl:for-each>
  237.       </xsl:when>
  238.  
  239.       <xsl:otherwise>
  240.         <xsl:for-each select="$TipoFattura/FatturaElettronicaBody[$IndiceBody]/DatiGenerali/DatiContratto[ number(./RiferimentoNumeroLinea) = $valNumeroLinea] ">
  241.         <xsl:call-template name="DatiCorrelati" >
  242.             <xsl:with-param name="Prefix"  select='"Contratto "'/>
  243.             <xsl:with-param name="IdDocumento" select="IdDocumento"/>
  244.             <xsl:with-param name="Data" select="Data"/>
  245.             <xsl:with-param name="CodiceCUP" select="CodiceCUP"/>
  246.             <xsl:with-param name="CodiceCIG" select="CodiceCIG"/>
  247.           </xsl:call-template >
  248.         </xsl:for-each>
  249.  
  250.       </xsl:otherwise>
  251.     </xsl:choose>
  252.  
  253.     <!--DatiConvenzione -->
  254.     <xsl:choose>
  255.       <!--Pre LINEA OpzPreLineaDatiConvenzione -->
  256.       <xsl:when test="OpzPreLineaDatiConvenzione ">
  257.         <xsl:for-each select="OpzPreLineaDatiConvenzione"  >
  258.           <xsl:call-template name="AltraDescrizioneLinea">
  259.             <xsl:with-param name="textDescrizione" select = "." />
  260.           </xsl:call-template>
  261.         </xsl:for-each>
  262.       </xsl:when>
  263.  
  264.       <xsl:otherwise>
  265.  
  266.       <xsl:for-each select="$TipoFattura/FatturaElettronicaBody[$IndiceBody]/DatiGenerali/DatiConvenzione[ number(./RiferimentoNumeroLinea) = $valNumeroLinea] ">
  267.           <xsl:call-template name="DatiCorrelati" >
  268.             <xsl:with-param name="Prefix"  select='"Convenzione "'/>
  269.             <xsl:with-param name="IdDocumento" select="IdDocumento"/>
  270.             <xsl:with-param name="Data" select="Data"/>
  271.             <xsl:with-param name="CodiceCUP" select="CodiceCUP"/>
  272.             <xsl:with-param name="CodiceCIG" select="CodiceCIG"/>
  273.           </xsl:call-template >
  274.         </xsl:for-each>
  275.  
  276.       </xsl:otherwise>
  277.     </xsl:choose>
  278.  
  279.     <!--DatiRicezione -->
  280.     <xsl:choose>
  281.       <!--Pre LINEA OpzPreLineaDatiRicezione -->
  282.       <xsl:when test="OpzPreLineaDatiRicezione ">
  283.         <xsl:for-each select="OpzPreLineaDatiRicezione"  >
  284.           <xsl:call-template name="AltraDescrizioneLinea">
  285.             <xsl:with-param name="textDescrizione" select = "." />
  286.           </xsl:call-template>
  287.         </xsl:for-each>
  288.       </xsl:when>
  289.  
  290.       <xsl:otherwise>
  291.  
  292.      <xsl:for-each select="$TipoFattura/FatturaElettronicaBody[$IndiceBody]/DatiGenerali/DatiRicezione[ number(./RiferimentoNumeroLinea) = $valNumeroLinea] ">
  293.           <xsl:call-template name="DatiCorrelati" >
  294.             <xsl:with-param name="Prefix"  select='"Ricezione "'/>
  295.             <xsl:with-param name="IdDocumento" select="IdDocumento"/>
  296.             <xsl:with-param name="Data" select="Data"/>
  297.             <xsl:with-param name="CodiceCUP" select="CodiceCUP"/>
  298.             <xsl:with-param name="CodiceCIG" select="CodiceCIG"/>
  299.           </xsl:call-template >
  300.         </xsl:for-each>
  301.  
  302.       </xsl:otherwise>
  303.     </xsl:choose>
  304.  
  305.     <!--DatiFattureCollegate-->
  306.     <xsl:choose>
  307.       <!--Pre LINEA OpzPreLineaDatiFattureCollegate-->
  308.       <xsl:when test="OpzPreLineaDatiFattureCollegate ">
  309.         <xsl:for-each select="OpzPreLineaDatiFattureCollegate"  >
  310.           <xsl:call-template name="AltraDescrizioneLinea">
  311.             <xsl:with-param name="textDescrizione" select = "." />
  312.           </xsl:call-template>
  313.         </xsl:for-each>
  314.       </xsl:when>
  315.       <xsl:otherwise>
  316.  
  317.      <xsl:for-each select="$TipoFattura/FatturaElettronicaBody[$IndiceBody]/DatiGenerali/DatiFattureCollegate[ number(./RiferimentoNumeroLinea) = $valNumeroLinea] ">
  318.           <xsl:call-template name="DatiCorrelati" >
  319.             <xsl:with-param name="Prefix"  select='"Fatt.coll. "'/>
  320.             <xsl:with-param name="IdDocumento" select="IdDocumento"/>
  321.             <xsl:with-param name="Data" select="Data"/>
  322.             <xsl:with-param name="CodiceCUP" select="CodiceCUP"/>
  323.             <xsl:with-param name="CodiceCIG" select="CodiceCIG"/>
  324.           </xsl:call-template >
  325.         </xsl:for-each>
  326.  
  327.       </xsl:otherwise>
  328.     </xsl:choose>
  329.  
  330.     <!--DETTAGLIO LINEE -->
  331.  
  332.     <xsl:choose>
  333.       <xsl:when test="$posASWRELSTD = $r">
  334.         <xsl:call-template name="DettaglioLineeASW"/>
  335.       </xsl:when>
  336.  
  337.       <xsl:otherwise>
  338.  
  339.         <tr>
  340.           <td>
  341.             <xsl:for-each select="CodiceArticolo"  >
  342.               <div class="tx-xsmall">
  343.                 <xsl:if test="CodiceValore">
  344.                   <xsl:text> </xsl:text>
  345.                   <xsl:value-of select="CodiceValore" />
  346.                 </xsl:if>
  347.                 <xsl:if test="CodiceTipo">
  348.                   (<xsl:value-of select="CodiceTipo" />)
  349.                 </xsl:if>
  350.               </div>
  351.             </xsl:for-each>
  352.           </td>
  353.           <td>
  354.  
  355.             <xsl:if test="Descrizione">
  356.               <xsl:value-of select="Descrizione" />
  357.             </xsl:if>
  358.  
  359.             <xsl:if test="TipoCessionePrestazione">
  360.               (<xsl:value-of select="TipoCessionePrestazione" />)
  361.             </xsl:if>
  362.  
  363.             <xsl:if test="DataInizioPeriodo or DataFinePeriodo">
  364.               <div class="tx-xsmall">
  365.                 <xsl:text>Periodo</xsl:text>
  366.                 <xsl:if test="DataInizioPeriodo">
  367.                   <xsl:text> da </xsl:text>
  368.                   <xsl:call-template name="FormatDateIta">
  369.                     <xsl:with-param name="DateTime" select="DataInizioPeriodo" />
  370.                   </xsl:call-template>
  371.                 </xsl:if>
  372.                 <xsl:if test="DataFinePeriodo">
  373.                   <xsl:text> a </xsl:text>
  374.                   <xsl:call-template name="FormatDateIta">
  375.                     <xsl:with-param name="DateTime" select="DataFinePeriodo" />
  376.                   </xsl:call-template>
  377.                 </xsl:if>
  378.               </div>
  379.  
  380.             </xsl:if>
  381.  
  382.  
  383.             <xsl:for-each select="AltriDatiGestionali"  >
  384.  
  385.               <xsl:if test=" translate( TipoDato,
  386.                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  387.                                     'abcdefghijklmnopqrstuvwxyz'
  388.                                    ) != 'aswrelstd'
  389.                                     and
  390.                                     translate( TipoDato,
  391.                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  392.                                     'abcdefghijklmnopqrstuvwxyz'
  393.                                    ) != 'aswswhouse'
  394.         and
  395.                                     translate( TipoDato,
  396.                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  397.                                     'abcdefghijklmnopqrstuvwxyz'
  398.                                    ) != 'aswtriga'   ">
  399.  
  400.  
  401.                 <div class="tx-xsmall">
  402.                   <xsl:text>Tipo dato: </xsl:text>
  403.                   <xsl:value-of select="TipoDato" />
  404.                   <xsl:if test=" translate( TipoDato,
  405.                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  406.                                     'abcdefghijklmnopqrstuvwxyz'
  407.                                    ) = 'aswlottsca' ">
  408.                     <xsl:text> (dati relativi a lotti e scadenze) </xsl:text>
  409.                   </xsl:if>
  410.  
  411.                 </div>
  412.  
  413.                 <xsl:if test="RiferimentoTesto">
  414.                   <div class="tx-xsmall">
  415.                     <xsl:choose>
  416.                       <xsl:when test=" translate( TipoDato,
  417.                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  418.                                     'abcdefghijklmnopqrstuvwxyz'
  419.                                    ) = 'aswlottsca' ">
  420.  
  421.                         <xsl:text>Lotto: </xsl:text>
  422.                       </xsl:when>
  423.                       <xsl:otherwise>
  424.                         <xsl:text>Rif. testo: </xsl:text>
  425.                       </xsl:otherwise>
  426.                     </xsl:choose>
  427.                     <xsl:value-of select="RiferimentoTesto" />
  428.                   </div>
  429.                 </xsl:if>
  430.  
  431.  
  432.  
  433.                 <xsl:if test="RiferimentoData">
  434.                   <div class="tx-xsmall">
  435.                     <xsl:choose>
  436.                       <xsl:when test=" translate( TipoDato,
  437.                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  438.                                     'abcdefghijklmnopqrstuvwxyz'
  439.                                    ) = 'aswlottsca' ">
  440.  
  441.                         <xsl:text>Scadenza: </xsl:text>
  442.                       </xsl:when>
  443.                       <xsl:otherwise>
  444.                         <xsl:text>Rif. data: </xsl:text>
  445.                       </xsl:otherwise>
  446.                     </xsl:choose>
  447.  
  448.                     <xsl:call-template name="FormatDateIta">
  449.                       <xsl:with-param name="DateTime" select="RiferimentoData" />
  450.                     </xsl:call-template>
  451.  
  452.                   </div>
  453.                 </xsl:if>
  454.  
  455.                 <xsl:if test="RiferimentoNumero">
  456.                   <div class="tx-xsmall">
  457.                     <xsl:choose>
  458.                       <xsl:when test=" translate( TipoDato,
  459.                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  460.                                     'abcdefghijklmnopqrstuvwxyz'
  461.                                    ) = 'aswlottsca' ">
  462.  
  463.                         <xsl:text>Quantità del suddetto lotto: </xsl:text>
  464.                       </xsl:when>
  465.                       <xsl:otherwise>
  466.                         <xsl:text>Rif. numero: </xsl:text>
  467.                       </xsl:otherwise>
  468.                     </xsl:choose>
  469.                     <xsl:value-of select="format-number(RiferimentoNumero,  '###.###.##0,00######', 'euro')" />
  470.                   </div>
  471.                 </xsl:if>
  472.  
  473.  
  474.  
  475.               </xsl:if>
  476.  
  477.             </xsl:for-each>
  478.  
  479.             <xsl:if test="RiferimentoAmministrazione">
  480.               <div class="tx-xsmall">
  481.                 RIF.AMM. <xsl:value-of select="RiferimentoAmministrazione" />
  482.               </div>
  483.             </xsl:if>
  484.  
  485.           </td>
  486.  
  487.  
  488.  
  489.           <td class="import2" >
  490.             <xsl:if test="Quantita">
  491.               <xsl:if test="number(Quantita)">
  492.                 <xsl:value-of select="format-number(Quantita,  '###.###.##0,00######', 'euro')" />
  493.               </xsl:if>
  494.             </xsl:if>
  495.           </td>
  496.  
  497.  
  498.  
  499.           <td class="import" >
  500.             <xsl:if test="PrezzoUnitario">
  501.               <xsl:if test="number(PrezzoTotale)">
  502.  
  503.                 <xsl:value-of select="format-number(PrezzoUnitario,  '###.###.##0,00######', 'euro')" />
  504.               </xsl:if>
  505.             </xsl:if>
  506.           </td>
  507.  
  508.           <td class="textCenter" >
  509.             <xsl:if test="UnitaMisura">
  510.               <xsl:value-of select="UnitaMisura" />
  511.             </xsl:if>
  512.  
  513.           </td>
  514.           <td class="import" >
  515.  
  516.             <xsl:for-each select="ScontoMaggiorazione" >
  517.  
  518.               <div>
  519.  
  520.                 <xsl:call-template name="FormatColSconto" >
  521.                   <xsl:with-param name="tipo" select="Tipo" />
  522.                   <xsl:with-param name="percentuale" select="Percentuale" />
  523.                   <xsl:with-param name="importo" select="Importo" />
  524.                 </xsl:call-template>
  525.  
  526.  
  527.               </div>
  528.             </xsl:for-each>
  529.  
  530.           </td>
  531.  
  532.           <td class="import" >
  533.  
  534.             <xsl:if test="number(PrezzoTotale)">
  535.  
  536.               <xsl:call-template name="FormatIVA">
  537.                 <xsl:with-param name="Natura" select="Natura" />
  538.                 <xsl:with-param name="IVA" select="AliquotaIVA" />
  539.               </xsl:call-template>
  540.             </xsl:if>
  541.  
  542.           </td>
  543.           <td>
  544.             <xsl:if test="PrezzoTotale">
  545.               <xsl:if test="number(PrezzoTotale)">
  546.  
  547.                 <div class="import">
  548.                   <xsl:value-of select="format-number(PrezzoTotale,  '###.###.##0,00######', 'euro')" />
  549.                 </div>
  550.               </xsl:if>
  551.  
  552.  
  553.               <xsl:if test="OpzPrezzoTotale">
  554.                 <div class="tx-xsmall">
  555.                   <xsl:value-of select="OpzPrezzoTotale" />
  556.                 </div>
  557.               </xsl:if>
  558.             </xsl:if>
  559.           </td>
  560.  
  561.         </tr>
  562.  
  563.       </xsl:otherwise>
  564.     </xsl:choose>
  565.  
  566.     <!--POST LINEA -->
  567.     <xsl:for-each select="OpzPostLinea"  >
  568.       <xsl:call-template name="AltraDescrizioneLinea">
  569.         <xsl:with-param name="textDescrizione" select = "." />
  570.       </xsl:call-template>
  571.     </xsl:for-each>
  572.  
  573.   </xsl:template>
  574.  
  575.  
  576.   <!-- Nel caso in cui ho un AltriDatiGestionali con aswrelstd o aswswhouse, mi permette
  577.  di stampare tutti alti dati ma non aswrelstd e aswswhouse -->
  578.   <xsl:template name="DettaglioLineeASW">
  579.     <tr >
  580.       <td>
  581.       </td>
  582.  
  583.       <td >
  584.         <xsl:text>------------------------</xsl:text>
  585.         <xsl:for-each select="AltriDatiGestionali"  >
  586.  
  587.           <xsl:if test=" translate( TipoDato,
  588.                                                          'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  589.                                                          'abcdefghijklmnopqrstuvwxyz'
  590.                                                         ) != 'aswrelstd'
  591.                                                         and
  592.                                                         translate( TipoDato,
  593.                                                          'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  594.                                                          'abcdefghijklmnopqrstuvwxyz'
  595.                                                         ) != 'aswswhouse'   ">
  596.  
  597.             <div class="tx-xsmall">
  598.               <xsl:value-of select="RiferimentoTesto" />
  599.               <xsl:text> </xsl:text>
  600.               <xsl:value-of select="TipoDato" />
  601.             </div>
  602.  
  603.           </xsl:if>
  604.  
  605.         </xsl:for-each>
  606.       </td>
  607.  
  608.       <td >
  609.       </td>
  610.  
  611.  
  612.       <td  >
  613.       </td>
  614.       <td >
  615.       </td>
  616.       <td  >
  617.       </td>
  618.  
  619.       <td  >
  620.       </td>
  621.       <td  >
  622.       </td>
  623.     </tr>
  624.  
  625.   </xsl:template>
  626.  
  627.   <xsl:template name="AltraDescrizioneLinea">
  628.     <xsl:param name = "textDescrizione" />
  629.     <!-- testo della descrizione -->
  630.     <tr>
  631.       <td >
  632.       </td>
  633.  
  634.       <td >
  635.         <div class="tx-xsmall">
  636.           <xsl:value-of select="$textDescrizione" />
  637.         </div>
  638.       </td>
  639.  
  640.       <td>
  641.       </td>
  642.  
  643.  
  644.       <td>
  645.       </td>
  646.       <td>
  647.       </td>
  648.       <td>
  649.       </td>
  650.  
  651.       <td>
  652.       </td>
  653.       <td>
  654.       </td>
  655.     </tr>
  656.  
  657.   </xsl:template>
  658.  
  659.   <xsl:template match="DatiRitenuta">
  660.  
  661.     <table class="tbFoglio">
  662.  
  663.       <thead>
  664.         <tr>
  665.           <th class="title"> Dati ritenuta d'acconto</th>
  666.           <th class="perc">Aliquota ritenuta</th>
  667.           <th>Causale   </th>
  668.           <th width="15%">Importo </th>
  669.         </tr>
  670.       </thead>
  671.       <tbody>
  672.         <tr>
  673.           <td >
  674.  
  675.             <xsl:if test="TipoRitenuta">
  676.  
  677.               <span>
  678.                 <xsl:value-of select="TipoRitenuta" />
  679.               </span>
  680.               <xsl:variable name="TR">
  681.                 <xsl:value-of select="TipoRitenuta" />
  682.               </xsl:variable>
  683.               <xsl:choose>
  684.                 <xsl:when test="$TR='RT01'">
  685.                   (ritenuta persone fisiche)
  686.                 </xsl:when>
  687.                 <xsl:when test="$TR='RT02'">
  688.                   (ritenuta persone giuridiche)
  689.                 </xsl:when>
  690.                 <xsl:when test="$TR=''">
  691.                 </xsl:when>
  692.                 <xsl:otherwise>
  693.                   <span>(!!! codice non previsto !!!)</span>
  694.                 </xsl:otherwise>
  695.               </xsl:choose>
  696.  
  697.             </xsl:if>
  698.           </td>
  699.  
  700.           <td class="import" >
  701.             <xsl:if test="AliquotaRitenuta">
  702.               <xsl:value-of select="format-number(AliquotaRitenuta,  '###.###.##0,00', 'euro')" />
  703.             </xsl:if>
  704.  
  705.           </td>
  706.  
  707.           <td >
  708.             <xsl:if test="CausalePagamento">
  709.  
  710.               <span>
  711.                 <xsl:value-of select="CausalePagamento" />
  712.               </span>
  713.               <xsl:variable name="CP">
  714.                 <xsl:value-of select="CausalePagamento" />
  715.               </xsl:variable>
  716.               <xsl:if test="$CP!=''">
  717.                 (decodifica come da modello 770S)
  718.               </xsl:if>
  719.  
  720.             </xsl:if>
  721.           </td>
  722.  
  723.           <td class="import" >
  724.             <xsl:if test="ImportoRitenuta">
  725.  
  726.               <xsl:value-of select="format-number(ImportoRitenuta,  '###.###.##0,00', 'euro')" />
  727.  
  728.             </xsl:if>
  729.           </td>
  730.  
  731.         </tr>
  732.       </tbody>
  733.     </table>
  734.   </xsl:template>
  735.  
  736.   <xsl:template match="DettaglioPagamento">
  737.  
  738.     <xsl:if test="Beneficiario">
  739.       Beneficiario  <xsl:value-of select="Beneficiario" /> <br/>
  740.     </xsl:if>
  741.  
  742.     <xsl:if test="IBAN">
  743.       IBAN
  744.       <xsl:value-of select="IBAN" /> <br/>
  745.     </xsl:if>
  746.  
  747.     <xsl:if test="ABI or CAB or BIC ">
  748.  
  749.       <xsl:if test="ABI">
  750.         ABI  <xsl:value-of select="ABI" />
  751.       </xsl:if>
  752.  
  753.       <xsl:if test="CAB">
  754.         CAB  <xsl:value-of select="CAB" />
  755.       </xsl:if>
  756.  
  757.       <xsl:if test="BIC">
  758.         BIC  <xsl:value-of select="BIC" />
  759.       </xsl:if>
  760.       <br/>
  761.     </xsl:if>
  762.  
  763.     <xsl:if test="IstitutoFinanziario">
  764.       <xsl:value-of select="IstitutoFinanziario" />
  765.       <br/>
  766.     </xsl:if>
  767.  
  768.     <xsl:if test="CodUfficioPostale">
  769.       Codice ufficio postale
  770.       <xsl:value-of select="CodUfficioPostale" />
  771.       <br/>
  772.     </xsl:if>
  773.  
  774.     <xsl:if test="TitoloQuietanzante or CognomeQuietanzante or NomeQuietanzante or CFQuietanzante">
  775.       Quietanzante
  776.       <xsl:value-of select="concat(TitoloQuietanzante , ' ',CognomeQuietanzante, ' ', NomeQuietanzante, ' ', CFQuietanzante )"/>
  777.       <br/>
  778.     </xsl:if>
  779.  
  780.     <xsl:if test="DataLimitePagamentoAnticipato or ScontoPagamentoAnticipato">
  781.  
  782.       <xsl:if test="DataLimitePagamentoAnticipato">
  783.         Data limite pagamento anticipato <xsl:call-template name="FormatDateIta">
  784.           <xsl:with-param name="DateTime" select="DataLimitePagamentoAnticipato" />
  785.         </xsl:call-template>
  786.       </xsl:if>
  787.  
  788.       <xsl:if test="ScontoPagamentoAnticipato">
  789.         Sconto anticipato
  790.         <xsl:value-of select="format-number(ScontoPagamentoAnticipato,  '###.###.##0,00', 'euro')" />
  791.       </xsl:if>
  792.       <br/>
  793.     </xsl:if>
  794.  
  795.     <xsl:if test="DataDecorrenzaPenale or PenalitaPagamentiRitardati">
  796.  
  797.       <xsl:if test="DataDecorrenzaPenale">
  798.         Data penale <xsl:call-template name="FormatDateIta">
  799.           <xsl:with-param name="DateTime" select="DataDecorrenzaPenale" />
  800.         </xsl:call-template>
  801.       </xsl:if>
  802.  
  803.       <xsl:if test="PenalitaPagamentiRitardati">
  804.         Importo penale
  805.         <xsl:value-of select="format-number(PenalitaPagamentiRitardati,  '###.###.##0,00', 'euro')" />
  806.       </xsl:if>
  807.  
  808.       <br/>
  809.     </xsl:if>
  810.  
  811.     <xsl:if test="CodicePagamento">
  812.       Codice pagamento  <xsl:value-of select="CodicePagamento" />
  813.     </xsl:if>
  814.  
  815.   </xsl:template>
  816.  
  817.   <xsl:template name="FatturaElettronica">
  818.  
  819.     <xsl:param name="TipoFattura" />
  820.     <xsl:param name="IsFPRS" />
  821.  
  822.     <xsl:if test="$TipoFattura">
  823.  
  824.  
  825.       <!--Variabile che contiene il codice destinatario dall'HEADER perchè viene visualizzato nella sezione BODY -->
  826.       <!--<xsl:variable name="CodiceDestinatario" select="$TipoFattura/FatturaElettronicaHeader/DatiTrasmissione/CodiceDestinatario"/>-->
  827.       <xsl:variable name="PecDestinatario" select="$TipoFattura/FatturaElettronicaHeader/DatiTrasmissione/PECDestinatario"/>
  828.  
  829.       <!--Variabile che contiene il codice destinatario dall'HEADER perchè viene visualizzato nella sezione BODY -->
  830.       <xsl:variable name="CodiceDestinatario" >
  831.  
  832.         <xsl:choose>
  833.           <xsl:when test="$TipoFattura/FatturaElettronicaHeader/DatiTrasmissione/CodiceDestinatario='0000000'">
  834.             <xsl:value-of select="$TipoFattura/FatturaElettronicaHeader/DatiTrasmissione/PECDestinatario" />
  835.           </xsl:when>
  836.           <xsl:otherwise>
  837.             <xsl:value-of select="$TipoFattura/FatturaElettronicaHeader/DatiTrasmissione/CodiceDestinatario" />
  838.           </xsl:otherwise>
  839.         </xsl:choose>
  840.       </xsl:variable>
  841.  
  842.       <div id="fattura-elettronica" class="page">
  843.  
  844.         <!-- FatturaElettronicaHeader -->
  845.         <xsl:if test="$TipoFattura/FatturaElettronicaHeader">
  846.  
  847.               <xsl:if test="$TipoFattura/FatturaElettronicaHeader/NomeDocumento">
  848.                   <table class="tbNoBorder">
  849.                   <tr >
  850.                         <td>
  851.                        <xsl:value-of select="$TipoFattura/FatturaElettronicaHeader/NomeDocumento"/>
  852.                   </td>
  853.                   </tr>
  854.                   </table>
  855.                 </xsl:if>
  856.  
  857.           <table id="tbHeader" class="tbHeader">
  858.  
  859.             <tr >
  860.               <td class="tdHead">
  861.  
  862.                 <table class="tableHead">
  863.                   <tr>
  864.  
  865.                     <td >
  866.  
  867.                       <!--INIZIO CEDENTE PRESTATORE-->
  868.                       <div class="headBorder" >
  869.  
  870.                         <label class= "headerLabel">Cedente/prestatore (fornitore) </label>
  871.                         <xsl:for-each select="$TipoFattura/FatturaElettronicaHeader/CedentePrestatore">
  872.  
  873.                           <xsl:choose>
  874.                             <xsl:when test="DatiAnagrafici">
  875.                               <!--DatiAnagrafici FPA\FPR-->
  876.  
  877.                               <xsl:for-each select="$TipoFattura/FatturaElettronicaHeader/CedentePrestatore/DatiAnagrafici">
  878.  
  879.                                 <div class="headContent mt5">
  880.                                   <xsl:if test="IdFiscaleIVA">
  881.  
  882.                                     Identificativo fiscale ai fini IVA:
  883.                                     <span>
  884.                                       <xsl:value-of select="IdFiscaleIVA/IdPaese" />
  885.                                       <xsl:value-of select="IdFiscaleIVA/IdCodice" />
  886.                                     </span>
  887.  
  888.                                   </xsl:if>
  889.                                 </div>
  890.  
  891.                                 <div class="headContent" >
  892.  
  893.                                   <xsl:if test="CodiceFiscale">
  894.  
  895.                                     Codice fiscale:
  896.                                     <span>
  897.                                       <xsl:value-of select="CodiceFiscale" />
  898.                                     </span>
  899.  
  900.                                   </xsl:if>
  901.  
  902.                                 </div>
  903.  
  904.                                 <div class="headContent" >
  905.  
  906.                                   <xsl:if test="Anagrafica/Denominazione">
  907.  
  908.                                     Denominazione:
  909.                                     <span>
  910.                                       <xsl:value-of select="Anagrafica/Denominazione" />
  911.                                     </span>
  912.  
  913.                                   </xsl:if>
  914.  
  915.                                 </div>
  916.  
  917.                                 <div class="headContent" >
  918.  
  919.                                   <xsl:if test="Anagrafica/Nome | Anagrafica/Cognome">
  920.  
  921.                                     Cognome nome:
  922.  
  923.                                     <xsl:if test="Anagrafica/Cognome">
  924.                                       <span>
  925.                                         <xsl:value-of select="Anagrafica/Cognome" />
  926.                                         <xsl:text> </xsl:text>
  927.                                       </span>
  928.                                     </xsl:if>
  929.                                     <xsl:if test="Anagrafica/Nome">
  930.                                       <span>
  931.                                         <xsl:value-of select="Anagrafica/Nome" />
  932.                                       </span>
  933.                                     </xsl:if>
  934.  
  935.                                   </xsl:if>
  936.  
  937.                                 </div>
  938.  
  939.  
  940.                                 <div class="headContent" >
  941.  
  942.                                   <xsl:if test="RegimeFiscale">
  943.  
  944.                                     Regime fiscale:
  945.                                     <span>
  946.                                       <xsl:value-of select="RegimeFiscale" />
  947.                                     </span>
  948.  
  949.                                     <xsl:variable name="RF">
  950.                                       <xsl:value-of select="RegimeFiscale" />
  951.                                     </xsl:variable>
  952.                                     <xsl:choose>
  953.                                       <xsl:when test="$RF='RF01'">
  954.                                         (ordinario)
  955.                                       </xsl:when>
  956.                                       <xsl:when test="$RF='RF02'">
  957.                                         (contribuenti minimi)
  958.                                       </xsl:when>
  959.                                       <xsl:when test="$RF='RF03'">
  960.                                         (nuove iniziative produttive)
  961.                                       </xsl:when>
  962.                                       <xsl:when test="$RF='RF04'">
  963.                                         (agricoltura e attività connesse e pesca)
  964.                                       </xsl:when>
  965.                                       <xsl:when test="$RF='RF05'">
  966.                                         (vendita sali e tabacchi)
  967.                                       </xsl:when>
  968.                                       <xsl:when test="$RF='RF06'">
  969.                                         (commercio fiammiferi)
  970.                                       </xsl:when>
  971.                                       <xsl:when test="$RF='RF07'">
  972.                                         (editoria)
  973.                                       </xsl:when>
  974.                                       <xsl:when test="$RF='RF08'">
  975.                                         (gestione servizi telefonia pubblica)
  976.                                       </xsl:when>
  977.                                       <xsl:when test="$RF='RF09'">
  978.                                         (rivendita documenti di trasporto pubblico e di sosta)
  979.                                       </xsl:when>
  980.                                       <xsl:when test="$RF='RF10'">
  981.                                         (intrattenimenti, giochi e altre attività di cui alla tariffa allegata al DPR 640/72)
  982.                                       </xsl:when>
  983.                                       <xsl:when test="$RF='RF11'">
  984.                                         (agenzie viaggi e turismo)
  985.                                       </xsl:when>
  986.                                       <xsl:when test="$RF='RF12'">
  987.                                         (agriturismo)
  988.                                       </xsl:when>
  989.                                       <xsl:when test="$RF='RF13'">
  990.                                         (vendite a domicilio)
  991.                                       </xsl:when>
  992.                                       <xsl:when test="$RF='RF14'">
  993.                                         (rivendita beni usati, oggetti d’arte,
  994.                                         d’antiquariato o da collezione)
  995.                                       </xsl:when>
  996.                                       <xsl:when test="$RF='RF15'">
  997.                                         (agenzie di vendite all’asta di oggetti d’arte,
  998.                                         antiquariato o da collezione)
  999.                                       </xsl:when>
  1000.                                       <xsl:when test="$RF='RF16'">
  1001.                                         (IVA per cassa P.A.)
  1002.                                       </xsl:when>
  1003.                                       <xsl:when test="$RF='RF17'">
  1004.                                         (IVA per cassa - art. 32-bis, D.L. 83/2012)
  1005.                                       </xsl:when>
  1006.                                       <xsl:when test="$RF='RF19'">
  1007.                                         (Regime forfettario)
  1008.                                       </xsl:when>
  1009.                                       <xsl:when test="$RF='RF18'">
  1010.                                         (altro)
  1011.                                       </xsl:when>
  1012.                                       <xsl:when test="$RF=''">
  1013.                                       </xsl:when>
  1014.                                       <xsl:otherwise>
  1015.                                         <span>(!!! codice non previsto !!!)</span>
  1016.                                       </xsl:otherwise>
  1017.                                     </xsl:choose>
  1018.  
  1019.                                   </xsl:if>
  1020.  
  1021.                                 </div>
  1022.  
  1023.                               </xsl:for-each>
  1024.  
  1025.                               <xsl:for-each select="$TipoFattura/FatturaElettronicaHeader/CedentePrestatore/Sede">
  1026.  
  1027.                                 <div class="headContent" >
  1028.  
  1029.                                   <xsl:if test="Indirizzo">
  1030.  
  1031.                                     Indirizzo:
  1032.                                     <span>
  1033.                                       <xsl:value-of select="Indirizzo" />
  1034.                                       <xsl:text> </xsl:text>
  1035.                                       <xsl:value-of select="NumeroCivico" />
  1036.                                     </span>
  1037.  
  1038.                                   </xsl:if>
  1039.  
  1040.                                 </div>
  1041.  
  1042.                                 <div class="headContent" >
  1043.                                   <span>
  1044.                                     <xsl:if test="Comune">
  1045.  
  1046.                                       Comune:
  1047.                                       <span>
  1048.                                         <xsl:value-of select="Comune" />
  1049.  
  1050.                                       </span>
  1051.  
  1052.                                     </xsl:if>
  1053.                                     <xsl:if test="Provincia">
  1054.  
  1055.                                       Provincia:
  1056.                                       <span>
  1057.                                         <xsl:value-of select="Provincia" />
  1058.  
  1059.                                       </span>
  1060.  
  1061.                                     </xsl:if>
  1062.                                   </span>
  1063.  
  1064.  
  1065.                                 </div>
  1066.                                 <div class="headContent" >
  1067.  
  1068.                                   <span>
  1069.                                     <xsl:if test="CAP">
  1070.                                       Cap:
  1071.                                       <span>
  1072.                                         <xsl:value-of select="CAP" />
  1073.  
  1074.                                       </span>
  1075.                                     </xsl:if>
  1076.  
  1077.                                     <xsl:if test="Nazione">
  1078.  
  1079.                                       Nazione:
  1080.                                       <span>
  1081.                                         <xsl:value-of select="Nazione" />
  1082.  
  1083.                                       </span>
  1084.  
  1085.                                     </xsl:if>
  1086.                                   </span>
  1087.  
  1088.                                 </div>
  1089.                               </xsl:for-each>
  1090.                               <div class="headContent" >
  1091.  
  1092.                                 <xsl:if test="$TipoFattura/FatturaElettronicaHeader/CedentePrestatore/Contatti/Telefono">
  1093.  
  1094.                                   Telefono:
  1095.                                   <span>
  1096.                                     <xsl:value-of select="$TipoFattura/FatturaElettronicaHeader/CedentePrestatore/Contatti/Telefono" />
  1097.  
  1098.                                   </span>
  1099.  
  1100.                                 </xsl:if>
  1101.  
  1102.  
  1103.                               </div>
  1104.  
  1105.                               <div class="headContent" >
  1106.  
  1107.                                 <xsl:if test="$TipoFattura/FatturaElettronicaHeader/CedentePrestatore/Contatti/Email">
  1108.  
  1109.                                   Email:
  1110.                                   <span>
  1111.                                     <xsl:value-of select="$TipoFattura/FatturaElettronicaHeader/CedentePrestatore/Contatti/Email" />
  1112.  
  1113.                                   </span>
  1114.  
  1115.                                 </xsl:if>
  1116.  
  1117.  
  1118.  
  1119.                               </div>
  1120.  
  1121.                               <div class="headContent" >
  1122.  
  1123.                                 <xsl:if test="$TipoFattura/FatturaElettronicaHeader/CedentePrestatore/RiferimentoAmministrazione">
  1124.  
  1125.                                   Riferimento Amministrazione:
  1126.                                   <span>
  1127.                                     <xsl:value-of select="$TipoFattura/FatturaElettronicaHeader/CedentePrestatore/RiferimentoAmministrazione" />
  1128.  
  1129.                                   </span>
  1130.  
  1131.                                 </xsl:if>
  1132.  
  1133.  
  1134.  
  1135.                               </div>
  1136.  
  1137.                             </xsl:when>
  1138.                             <xsl:otherwise>
  1139.                               <!--Anagrafica FPRS-->
  1140.                               <div class="headContent mt5">
  1141.                                 <xsl:if test="IdFiscaleIVA">
  1142.  
  1143.                                   Identificativo fiscale ai fini IVA:
  1144.                                   <span>
  1145.                                     <xsl:value-of select="IdFiscaleIVA/IdPaese" />
  1146.                                     <xsl:value-of select="IdFiscaleIVA/IdCodice" />
  1147.                                   </span>
  1148.  
  1149.                                 </xsl:if>
  1150.                               </div>
  1151.  
  1152.                               <div class="headContent" >
  1153.  
  1154.                                 <xsl:if test="CodiceFiscale">
  1155.  
  1156.                                   Codice fiscale:
  1157.                                   <span>
  1158.                                     <xsl:value-of select="CodiceFiscale" />
  1159.                                   </span>
  1160.  
  1161.                                 </xsl:if>
  1162.  
  1163.                               </div>
  1164.  
  1165.                               <xsl:if test="Denominazione">
  1166.                                 <div class="headContent">
  1167.  
  1168.                                   Denominazione:
  1169.                                   <span>
  1170.                                     <xsl:value-of select="Denominazione" />
  1171.                                   </span>
  1172.                                 </div>
  1173.                               </xsl:if>
  1174.  
  1175.                               <xsl:if test="Nome | Cognome">
  1176.                               <div class="headContent" >
  1177.  
  1178.                                   Cognome nome:
  1179.  
  1180.                                   <xsl:if test="Cognome">
  1181.                                     <span>
  1182.                                       <xsl:value-of select="Cognome" />
  1183.                                       <xsl:text> </xsl:text>
  1184.                                     </span>
  1185.                                   </xsl:if>
  1186.                                   <xsl:if test="Nome">
  1187.                                     <span>
  1188.                                       <xsl:value-of select="Nome" />
  1189.                                     </span>
  1190.                                   </xsl:if>
  1191.                               </div>
  1192.                               </xsl:if>
  1193.  
  1194.                               <div class="headContent" >
  1195.  
  1196.                                 <xsl:if test="RegimeFiscale">
  1197.  
  1198.                                   Regime fiscale:
  1199.                                   <span>
  1200.                                     <xsl:value-of select="RegimeFiscale" />
  1201.                                   </span>
  1202.  
  1203.                                   <xsl:variable name="RF">
  1204.                                     <xsl:value-of select="RegimeFiscale" />
  1205.                                   </xsl:variable>
  1206.                                   <xsl:choose>
  1207.                                     <xsl:when test="$RF='RF01'">
  1208.                                       (ordinario)
  1209.                                     </xsl:when>
  1210.                                     <xsl:when test="$RF='RF02'">
  1211.                                       (contribuenti minimi)
  1212.                                     </xsl:when>
  1213.                                     <xsl:when test="$RF='RF03'">
  1214.                                       (nuove iniziative produttive)
  1215.                                     </xsl:when>
  1216.                                     <xsl:when test="$RF='RF04'">
  1217.                                       (agricoltura e attività connesse e pesca)
  1218.                                     </xsl:when>
  1219.                                     <xsl:when test="$RF='RF05'">
  1220.                                       (vendita sali e tabacchi)
  1221.                                     </xsl:when>
  1222.                                     <xsl:when test="$RF='RF06'">
  1223.                                       (commercio fiammiferi)
  1224.                                     </xsl:when>
  1225.                                     <xsl:when test="$RF='RF07'">
  1226.                                       (editoria)
  1227.                                     </xsl:when>
  1228.                                     <xsl:when test="$RF='RF08'">
  1229.                                       (gestione servizi telefonia pubblica)
  1230.                                     </xsl:when>
  1231.                                     <xsl:when test="$RF='RF09'">
  1232.                                       (rivendita documenti di trasporto pubblico e di sosta)
  1233.                                     </xsl:when>
  1234.                                     <xsl:when test="$RF='RF10'">
  1235.                                       (intrattenimenti, giochi e altre attività di cui alla tariffa allegata al DPR 640/72)
  1236.                                     </xsl:when>
  1237.                                     <xsl:when test="$RF='RF11'">
  1238.                                       (agenzie viaggi e turismo)
  1239.                                     </xsl:when>
  1240.                                     <xsl:when test="$RF='RF12'">
  1241.                                       (agriturismo)
  1242.                                     </xsl:when>
  1243.                                     <xsl:when test="$RF='RF13'">
  1244.                                       (vendite a domicilio)
  1245.                                     </xsl:when>
  1246.                                     <xsl:when test="$RF='RF14'">
  1247.                                       (rivendita beni usati, oggetti d’arte,
  1248.                                       d’antiquariato o da collezione)
  1249.                                     </xsl:when>
  1250.                                     <xsl:when test="$RF='RF15'">
  1251.                                       (agenzie di vendite all’asta di oggetti d’arte,
  1252.                                       antiquariato o da collezione)
  1253.                                     </xsl:when>
  1254.                                     <xsl:when test="$RF='RF16'">
  1255.                                       (IVA per cassa P.A.)
  1256.                                     </xsl:when>
  1257.                                     <xsl:when test="$RF='RF17'">
  1258.                                       (IVA per cassa - art. 32-bis, D.L. 83/2012)
  1259.                                     </xsl:when>
  1260.                                     <xsl:when test="$RF='RF19'">
  1261.                                       (Regime forfettario)
  1262.                                     </xsl:when>
  1263.                                     <xsl:when test="$RF='RF18'">
  1264.                                       (altro)
  1265.                                     </xsl:when>
  1266.                                     <xsl:when test="$RF=''">
  1267.                                     </xsl:when>
  1268.                                     <xsl:otherwise>
  1269.                                       <span>(!!! codice non previsto !!!)</span>
  1270.                                     </xsl:otherwise>
  1271.                                   </xsl:choose>
  1272.  
  1273.                                 </xsl:if>
  1274.  
  1275.                               </div>
  1276.  
  1277.                               <xsl:for-each select="$TipoFattura/FatturaElettronicaHeader/CedentePrestatore/Sede">
  1278.  
  1279.                                 <div class="headContent" >
  1280.  
  1281.                                   <xsl:if test="Indirizzo">
  1282.  
  1283.                                     Indirizzo:
  1284.                                     <span>
  1285.                                       <xsl:value-of select="Indirizzo" />
  1286.                                       <xsl:text> </xsl:text>
  1287.                                       <xsl:value-of select="NumeroCivico" />
  1288.                                     </span>
  1289.  
  1290.                                   </xsl:if>
  1291.  
  1292.                                 </div>
  1293.  
  1294.                                 <div class="headContent" >
  1295.                                   <span>
  1296.                                     <xsl:if test="Comune">
  1297.  
  1298.                                       Comune:
  1299.                                       <span>
  1300.                                         <xsl:value-of select="Comune" />
  1301.  
  1302.                                       </span>
  1303.  
  1304.                                     </xsl:if>
  1305.                                     <xsl:if test="Provincia">
  1306.  
  1307.                                       Provincia:
  1308.                                       <span>
  1309.                                         <xsl:value-of select="Provincia" />
  1310.  
  1311.                                       </span>
  1312.  
  1313.                                     </xsl:if>
  1314.                                   </span>
  1315.  
  1316.  
  1317.                                 </div>
  1318.                                 <div class="headContent" >
  1319.  
  1320.                                   <span>
  1321.                                     <xsl:if test="CAP">
  1322.                                       Cap:
  1323.                                       <span>
  1324.                                         <xsl:value-of select="CAP" />
  1325.  
  1326.                                       </span>
  1327.                                     </xsl:if>
  1328.  
  1329.                                     <xsl:if test="Nazione">
  1330.  
  1331.                                       Nazione:
  1332.                                       <span>
  1333.                                         <xsl:value-of select="Nazione" />
  1334.  
  1335.                                       </span>
  1336.  
  1337.                                     </xsl:if>
  1338.                                   </span>
  1339.  
  1340.                                 </div>
  1341.                               </xsl:for-each>
  1342.                             </xsl:otherwise>
  1343.                           </xsl:choose>
  1344.  
  1345.                         </xsl:for-each>
  1346.  
  1347.                         <!--INIZIO TerzoIntermediarioOSoggettoEmittente-->
  1348.                         <xsl:if test="$TipoFattura/FatturaElettronicaHeader/TerzoIntermediarioOSoggettoEmittente">
  1349.                           <br/>
  1350.  
  1351.                           <xsl:choose>
  1352.                             <xsl:when test="$TipoFattura/FatturaElettronicaHeader/SoggettoEmittente='CC'">
  1353.                               <label class= "headerLabel">Soggetto Emittente (cessionario committente)  </label>
  1354.  
  1355.                             </xsl:when>
  1356.                             <xsl:when test="$TipoFattura/FatturaElettronicaHeader/SoggettoEmittente='TZ'">
  1357.                               <label class= "headerLabel">Terzo Intermediario  </label>
  1358.                             </xsl:when>
  1359.  
  1360.                             <xsl:otherwise>
  1361.                               <label class= "headerLabel">Terzo Intermediario o Soggetto Emittente </label>
  1362.                             </xsl:otherwise>
  1363.                           </xsl:choose>
  1364.  
  1365.                           <xsl:for-each select="$TipoFattura/FatturaElettronicaHeader/TerzoIntermediarioOSoggettoEmittente/DatiAnagrafici">
  1366.  
  1367.                             <div class="headContent mt5">
  1368.                               <xsl:if test="IdFiscaleIVA">
  1369.  
  1370.                                 Identificativo fiscale ai fini IVA:
  1371.                                 <span>
  1372.                                   <xsl:value-of select="IdFiscaleIVA/IdPaese" />
  1373.                                   <xsl:value-of select="IdFiscaleIVA/IdCodice" />
  1374.                                 </span>
  1375.  
  1376.                               </xsl:if>
  1377.                             </div>
  1378.  
  1379.                             <div class="headContent" >
  1380.  
  1381.                               <xsl:if test="CodiceFiscale">
  1382.  
  1383.                                 Codice fiscale:
  1384.                                 <span>
  1385.                                   <xsl:value-of select="CodiceFiscale" />
  1386.                                 </span>
  1387.  
  1388.                               </xsl:if>
  1389.  
  1390.                             </div>
  1391.  
  1392.                             <div class="headContent" >
  1393.  
  1394.                               <xsl:if test="Anagrafica/Denominazione">
  1395.  
  1396.                                 Denominazione:
  1397.                                 <span>
  1398.                                   <xsl:value-of select="Anagrafica/Denominazione" />
  1399.                                 </span>
  1400.  
  1401.                               </xsl:if>
  1402.  
  1403.                             </div>
  1404.  
  1405.                             <div class="headContent" >
  1406.  
  1407.                               <xsl:if test="Anagrafica/Nome | Anagrafica/Cognome">
  1408.  
  1409.                                 Cognome nome:
  1410.  
  1411.                                 <xsl:if test="Anagrafica/Cognome">
  1412.                                   <span>
  1413.                                     <xsl:value-of select="Anagrafica/Cognome" />
  1414.                                     <xsl:text> </xsl:text>
  1415.                                   </span>
  1416.                                 </xsl:if>
  1417.                                 <xsl:if test="Anagrafica/Nome">
  1418.                                   <span>
  1419.                                     <xsl:value-of select="Anagrafica/Nome" />
  1420.                                   </span>
  1421.                                 </xsl:if>
  1422.  
  1423.                               </xsl:if>
  1424.  
  1425.                             </div>
  1426.  
  1427.  
  1428.                              </xsl:for-each>
  1429.  
  1430.  
  1431.  
  1432.                         </xsl:if>
  1433.                         <!--FINE TerzoIntermediarioOSoggettoEmittente-->
  1434.  
  1435.                       </div>
  1436.                       <!--FINE CEDENTE PRESTATORE-->
  1437.  
  1438.                     </td>
  1439.                   </tr>
  1440.  
  1441.                 </table>
  1442.  
  1443.  
  1444.  
  1445.               </td>
  1446.               <td class="tdHead">
  1447.  
  1448.                 <!--INIZIO CESSIONARIO COMMITTENTE-->
  1449.                 <table class="tableHead">
  1450.                   <tr>
  1451.                     <td >
  1452.  
  1453.                       <div class="headBorder" >
  1454.                         <label class= "headerLabel"  >Cessionario/committente (cliente) </label>
  1455.                         <xsl:for-each select="$TipoFattura/FatturaElettronicaHeader/CessionarioCommittente">
  1456.                           <xsl:choose>
  1457.                             <xsl:when test="DatiAnagrafici">
  1458.                               <!--DatiAnagrafici FPA\FPR-->
  1459.                               <xsl:for-each select="DatiAnagrafici">
  1460.  
  1461.                                 <div class="headContent mt5" >
  1462.                                   <xsl:if test="IdFiscaleIVA">
  1463.  
  1464.                                     Identificativo fiscale ai fini IVA:
  1465.                                     <span>
  1466.                                       <xsl:value-of select="IdFiscaleIVA/IdPaese" />
  1467.                                       <xsl:value-of select="IdFiscaleIVA/IdCodice" />
  1468.                                     </span>
  1469.  
  1470.                                   </xsl:if>
  1471.                                 </div>
  1472.  
  1473.                                 <div class="headContent" >
  1474.  
  1475.                                   <xsl:if test="CodiceFiscale">
  1476.  
  1477.                                     Codice fiscale:
  1478.                                     <span>
  1479.                                       <xsl:value-of select="CodiceFiscale" />
  1480.                                     </span>
  1481.  
  1482.                                   </xsl:if>
  1483.  
  1484.                                 </div>
  1485.  
  1486.                                 <div class="headContent" >
  1487.  
  1488.                                   <xsl:if test="Anagrafica/Denominazione">
  1489.  
  1490.                                     Denominazione:
  1491.                                     <span>
  1492.                                       <xsl:value-of select="Anagrafica/Denominazione" />
  1493.                                     </span>
  1494.  
  1495.                                   </xsl:if>
  1496.  
  1497.                                 </div>
  1498.  
  1499.                                 <div class="headContent" >
  1500.  
  1501.                                   <xsl:if test="Anagrafica/Nome | Anagrafica/Cognome">
  1502.  
  1503.                                     Cognome nome:
  1504.  
  1505.                                     <xsl:if test="Anagrafica/Cognome">
  1506.                                       <span>
  1507.                                         <xsl:value-of select="Anagrafica/Cognome" />
  1508.                                         <xsl:text> </xsl:text>
  1509.                                       </span>
  1510.                                     </xsl:if>
  1511.                                     <xsl:if test="Anagrafica/Nome">
  1512.                                       <span>
  1513.                                         <xsl:value-of select="Anagrafica/Nome" />
  1514.                                       </span>
  1515.                                     </xsl:if>
  1516.  
  1517.                                   </xsl:if>
  1518.  
  1519.                                 </div>
  1520.  
  1521.  
  1522.                               </xsl:for-each>
  1523.  
  1524.                               <xsl:for-each select="Sede">
  1525.  
  1526.                                 <div class="headContent" >
  1527.  
  1528.                                   <xsl:if test="Indirizzo">
  1529.  
  1530.                                     Indirizzo:
  1531.                                     <span>
  1532.                                       <xsl:value-of select="Indirizzo" />
  1533.                                       <xsl:text> </xsl:text>
  1534.                                       <xsl:value-of select="NumeroCivico" />
  1535.                                     </span>
  1536.  
  1537.                                   </xsl:if>
  1538.  
  1539.                                 </div>
  1540.  
  1541.  
  1542.  
  1543.                                 <div class="headContent" >
  1544.                                   <span>
  1545.                                     <xsl:if test="Comune">
  1546.  
  1547.                                       Comune:
  1548.                                       <span>
  1549.                                         <xsl:value-of select="Comune" />
  1550.  
  1551.                                       </span>
  1552.  
  1553.                                     </xsl:if>
  1554.                                     <xsl:if test="Provincia">
  1555.  
  1556.                                       Provincia:
  1557.                                       <span>
  1558.                                         <xsl:value-of select="Provincia" />
  1559.  
  1560.                                       </span>
  1561.  
  1562.                                     </xsl:if>
  1563.                                   </span>
  1564.  
  1565.  
  1566.                                 </div>
  1567.                                 <div class="headContent" >
  1568.  
  1569.                                   <span>
  1570.                                     <xsl:if test="CAP">
  1571.                                       Cap:
  1572.                                       <span>
  1573.                                         <xsl:value-of select="CAP" />
  1574.  
  1575.                                       </span>
  1576.                                     </xsl:if>
  1577.  
  1578.                                     <xsl:if test="Nazione">
  1579.  
  1580.                                       Nazione:
  1581.                                       <span>
  1582.                                         <xsl:value-of select="Nazione" />
  1583.  
  1584.                                       </span>
  1585.  
  1586.                                     </xsl:if>
  1587.                                   </span>
  1588.  
  1589.                                 </div>
  1590.                                 <div class="headContent" >
  1591.  
  1592.                                   <xsl:if test="$PecDestinatario">
  1593.  
  1594.                                     Pec: <span>
  1595.                                       <xsl:value-of select="$PecDestinatario" />
  1596.                                     </span>
  1597.  
  1598.                                   </xsl:if>
  1599.  
  1600.                                 </div>
  1601.  
  1602.  
  1603.                               </xsl:for-each>
  1604.                             </xsl:when>
  1605.                             <xsl:otherwise>
  1606.                               <!--Anagrafica FPRS-->
  1607.                               <xsl:for-each select="$TipoFattura/FatturaElettronicaHeader/CessionarioCommittente/IdentificativiFiscali">
  1608.                                 <div class="headContent mt5" >
  1609.                                   <xsl:if test="IdFiscaleIVA">
  1610.  
  1611.                                     Identificativo fiscale ai fini IVA:
  1612.                                     <span>
  1613.                                       <xsl:value-of select="IdFiscaleIVA/IdPaese" />
  1614.                                       <xsl:value-of select="IdFiscaleIVA/IdCodice" />
  1615.                                     </span>
  1616.  
  1617.                                   </xsl:if>
  1618.                                 </div>
  1619.  
  1620.                                 <div class="headContent" >
  1621.  
  1622.                                   <xsl:if test="CodiceFiscale">
  1623.  
  1624.                                     Codice fiscale:
  1625.                                     <span>
  1626.                                       <xsl:value-of select="CodiceFiscale" />
  1627.                                     </span>
  1628.  
  1629.                                   </xsl:if>
  1630.  
  1631.                                 </div>
  1632.                               </xsl:for-each>
  1633.                               <xsl:for-each select="$TipoFattura/FatturaElettronicaHeader/CessionarioCommittente/AltriDatiIdentificativi">
  1634.                                 <div class="headContent" >
  1635.  
  1636.                                   <xsl:if test="Denominazione">
  1637.  
  1638.                                     Denominazione:
  1639.                                     <span>
  1640.                                       <xsl:value-of select="Denominazione" />
  1641.                                     </span>
  1642.  
  1643.                                   </xsl:if>
  1644.  
  1645.                                 </div>
  1646.  
  1647.                                 <div class="headContent" >
  1648.  
  1649.                                   <xsl:if test="Nome | Cognome">
  1650.  
  1651.                                     Cognome nome:
  1652.  
  1653.                                     <xsl:if test="Cognome">
  1654.                                       <span>
  1655.                                         <xsl:value-of select="Cognome" />
  1656.                                         <xsl:text> </xsl:text>
  1657.                                       </span>
  1658.                                     </xsl:if>
  1659.                                     <xsl:if test="Nome">
  1660.                                       <span>
  1661.                                         <xsl:value-of select="Nome" />
  1662.                                       </span>
  1663.                                     </xsl:if>
  1664.  
  1665.                                   </xsl:if>
  1666.  
  1667.                                 </div>
  1668.  
  1669.                                 <xsl:for-each select="$TipoFattura/FatturaElettronicaHeader/CessionarioCommittente/AltriDatiIdentificativi/Sede">
  1670.  
  1671.                                   <div class="headContent" >
  1672.  
  1673.                                     <xsl:if test="Indirizzo">
  1674.  
  1675.                                       Indirizzo:
  1676.                                       <span>
  1677.                                         <xsl:value-of select="Indirizzo" />
  1678.                                         <xsl:text> </xsl:text>
  1679.                                         <xsl:value-of select="NumeroCivico" />
  1680.                                       </span>
  1681.  
  1682.                                     </xsl:if>
  1683.  
  1684.                                   </div>
  1685.  
  1686.  
  1687.  
  1688.                                   <div class="headContent" >
  1689.                                     <span>
  1690.                                       <xsl:if test="Comune">
  1691.  
  1692.                                         Comune:
  1693.                                         <span>
  1694.                                           <xsl:value-of select="Comune" />
  1695.  
  1696.                                         </span>
  1697.  
  1698.                                       </xsl:if>
  1699.                                       <xsl:if test="Provincia">
  1700.  
  1701.                                         Provincia:
  1702.                                         <span>
  1703.                                           <xsl:value-of select="Provincia" />
  1704.  
  1705.                                         </span>
  1706.  
  1707.                                       </xsl:if>
  1708.                                     </span>
  1709.  
  1710.  
  1711.                                   </div>
  1712.                                   <div class="headContent" >
  1713.  
  1714.                                     <span>
  1715.                                       <xsl:if test="CAP">
  1716.                                         Cap:
  1717.                                         <span>
  1718.                                           <xsl:value-of select="CAP" />
  1719.  
  1720.                                         </span>
  1721.                                       </xsl:if>
  1722.  
  1723.                                       <xsl:if test="Nazione">
  1724.  
  1725.                                         Nazione:
  1726.                                         <span>
  1727.                                           <xsl:value-of select="Nazione" />
  1728.  
  1729.                                         </span>
  1730.  
  1731.                                       </xsl:if>
  1732.                                     </span>
  1733.  
  1734.                                   </div>
  1735.                                   <div class="headContent" >
  1736.  
  1737.                                     <xsl:if test="$PecDestinatario">
  1738.  
  1739.                                       Pec: <span>
  1740.                                         <xsl:value-of select="$PecDestinatario" />
  1741.                                       </span>
  1742.  
  1743.                                     </xsl:if>
  1744.  
  1745.                                   </div>
  1746.  
  1747.  
  1748.                                 </xsl:for-each>
  1749.  
  1750.                               </xsl:for-each>
  1751.                             </xsl:otherwise>
  1752.                           </xsl:choose>
  1753.                         </xsl:for-each>
  1754.                       </div>
  1755.  
  1756.                     </td>
  1757.                   </tr>
  1758.  
  1759.                 </table>
  1760.                 <!--FINE CESSIONARIO COMMITTENTE-->
  1761.               </td>
  1762.             </tr>
  1763.  
  1764.  
  1765.           </table>
  1766.  
  1767.  
  1768.         </xsl:if>
  1769.         <div style="height:10px" > </div>
  1770.  
  1771.         <!-- FINE FatturaElettronicaHeader -->
  1772.  
  1773.         <!--INIZIO BODY-->
  1774.  
  1775.         <xsl:for-each select="$TipoFattura/FatturaElettronicaBody" >
  1776.  
  1777.  
  1778.           <xsl:variable name="BodyIndex" select="position()"/>
  1779.  
  1780.           <!-- Conforme Standard AssoSoftware se altridatigestionali presenta ASWRELSTD   -->
  1781.           <xsl:variable name="posASWRELSTD" >
  1782.             <xsl:for-each select="DatiBeniServizi/DettaglioLinee">
  1783.               <xsl:variable name="DettaglioLinee" select="."/>
  1784.  
  1785.               <xsl:variable name="posDettaglioLinee" select="position()"/>
  1786.               <xsl:for-each select="AltriDatiGestionali">
  1787.  
  1788.                 <xsl:if test=" translate( TipoDato,
  1789.                                     'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  1790.                                     'abcdefghijklmnopqrstuvwxyz'
  1791.                                    ) = 'aswrelstd'">
  1792.  
  1793.                   <xsl:value-of select="number($posDettaglioLinee)"/>
  1794.  
  1795.                 </xsl:if>
  1796.               </xsl:for-each>
  1797.  
  1798.             </xsl:for-each>
  1799.           </xsl:variable>
  1800.           <!-- FINE conforme AssoSoftware -->
  1801.  
  1802.  
  1803.           <table class="tbFoglio">
  1804.  
  1805.             <!-- TIPOLOGIA DOCUMENTO TESTATA-->
  1806.             <thead>
  1807.               <tr>
  1808.  
  1809.                 <th>Tipologia documento</th>
  1810.                 <th class="perc">Art. 73</th>
  1811.                 <th >Numero documento</th>
  1812.                 <th class="data">Data documento</th>
  1813.                 <th >Codice destinatario</th>
  1814.  
  1815.               </tr>
  1816.             </thead>
  1817.             <tbody>
  1818.               <tr>
  1819.                 <td>
  1820.                   <xsl:if test="DatiGenerali/DatiGeneraliDocumento/TipoDocumento">
  1821.  
  1822.                     <xsl:value-of select="DatiGenerali/DatiGeneraliDocumento/TipoDocumento" />
  1823.  
  1824.  
  1825.                     <xsl:variable name="TD">
  1826.                       <xsl:value-of select="DatiGenerali/DatiGeneraliDocumento/TipoDocumento" />
  1827.                     </xsl:variable>
  1828.                     <xsl:choose>
  1829.                       <xsl:when test="$TD='TD01'">
  1830.                         (fattura)
  1831.                       </xsl:when>
  1832.                       <xsl:when test="$TD='TD02'">
  1833.                         (acconto/anticipo su fattura)
  1834.                       </xsl:when>
  1835.                       <xsl:when test="$TD='TD03'">
  1836.                         (acconto/anticipo su parcella)
  1837.                       </xsl:when>
  1838.                       <xsl:when test="$TD='TD04'">
  1839.                         (nota di credito)
  1840.                       </xsl:when>
  1841.                       <xsl:when test="$TD='TD05'">
  1842.                         (nota di debito)
  1843.                       </xsl:when>
  1844.                       <xsl:when test="$TD='TD06'">
  1845.                         (parcella)
  1846.                       </xsl:when>
  1847.                       <xsl:when test="$TD='TD20'">
  1848.                         (autofattura)
  1849.                       </xsl:when>
  1850.                       <!--FPRS-->
  1851.                       <xsl:when test="$TD='TD07'">
  1852.                         (fattura semplificata)
  1853.                       </xsl:when>
  1854.                       <xsl:when test="$TD='TD08'">
  1855.                         (nota di credito semplificata)
  1856.                       </xsl:when>
  1857.                       <xsl:when test="$TD='TD09'">
  1858.                         (nota di debito semplificata)
  1859.                       </xsl:when>
  1860.                       <xsl:when test="$TD=''">
  1861.                       </xsl:when>
  1862.                       <xsl:otherwise>
  1863.                         <span>(!!! codice non previsto !!!)</span>
  1864.                       </xsl:otherwise>
  1865.                     </xsl:choose>
  1866.  
  1867.                   </xsl:if>
  1868.                 </td>
  1869.  
  1870.                 <td class="ritenuta"  >
  1871.                   <xsl:if test="DatiGenerali/DatiGeneraliDocumento/Art73">
  1872.                     <xsl:value-of select="DatiGenerali/DatiGeneraliDocumento/Art73" />
  1873.                   </xsl:if>
  1874.                 </td>
  1875.  
  1876.                 <td class="textCenter" >
  1877.  
  1878.                   <xsl:if test="DatiGenerali/DatiGeneraliDocumento/Numero">
  1879.                     <xsl:value-of select="DatiGenerali/DatiGeneraliDocumento/Numero" />
  1880.                   </xsl:if>
  1881.                 </td>
  1882.                 <td class="data" >
  1883.  
  1884.                   <xsl:if test="DatiGenerali/DatiGeneraliDocumento/Data">
  1885.                     <xsl:call-template name="FormatDateIta">
  1886.                       <xsl:with-param name="DateTime" select="DatiGenerali/DatiGeneraliDocumento/Data" />
  1887.                     </xsl:call-template>
  1888.                   </xsl:if>
  1889.  
  1890.                 </td>
  1891.  
  1892.                 <td class="textCenter" >
  1893.                   <xsl:choose>
  1894.                     <xsl:when test="$PecDestinatario">
  1895.                       Indicata PEC
  1896.                     </xsl:when>
  1897.  
  1898.                     <xsl:otherwise>
  1899.                       <xsl:if test="$CodiceDestinatario">
  1900.                         <xsl:value-of select="$CodiceDestinatario" />
  1901.                       </xsl:if>
  1902.                     </xsl:otherwise>
  1903.                   </xsl:choose>
  1904.                 </td>
  1905.  
  1906.               </tr>
  1907.  
  1908.               <!--FINE TIPOLOGIA Documento TESTATA-->
  1909.             </tbody>
  1910.           </table>
  1911.  
  1912.           <xsl:if test="DatiGenerali/DatiGeneraliDocumento/Causale">
  1913.             <div class="separa"> </div>
  1914.             <table class="tbFoglio">
  1915.  
  1916.               <!-- TIPOLOGIA DOCUMENTO TESTATA - parte causale-->
  1917.               <thead>
  1918.                 <tr>
  1919.                   <th>Causale</th>
  1920.                 </tr>
  1921.               </thead>
  1922.               <tbody>
  1923.                 <tr>
  1924.  
  1925.                   <td >
  1926.                     <xsl:if test="DatiGenerali/DatiGeneraliDocumento/Causale">
  1927.  
  1928.                       <xsl:for-each select="DatiGenerali/DatiGeneraliDocumento/Causale"  >
  1929.                         <xsl:value-of select="." />
  1930.                       </xsl:for-each>
  1931.  
  1932.                     </xsl:if>
  1933.                   </td>
  1934.  
  1935.                 </tr>
  1936.  
  1937.                 <!--FINE TIPOLOGIA Documento TESTATA - parte causale -->
  1938.               </tbody>
  1939.             </table>
  1940.           </xsl:if>
  1941.  
  1942.           <div class="separa"> </div>
  1943.  
  1944.           <xsl:choose>
  1945.             <xsl:when test="$IsFPRS='1'">
  1946.  
  1947.               <!--  Dettaglio Linee   -->
  1948.               <table class="tbFoglio"  >
  1949.  
  1950.                 <thead>
  1951.                   <tr>
  1952.                     <th>Descrizione</th>
  1953.                     <th class="perc">Imposta</th>
  1954.                     <th class="perc2">%IVA</th>
  1955.                     <th class="ximport">Prezzo totale</th>
  1956.  
  1957.                   </tr>
  1958.                 </thead>
  1959.                 <tbody>
  1960.  
  1961.                   <xsl:for-each select="DatiBeniServizi" >
  1962.  
  1963.                     <tr>
  1964.                       <td>
  1965.  
  1966.                         <xsl:if test="Descrizione">
  1967.                           <xsl:value-of select="Descrizione" />
  1968.                         </xsl:if>
  1969.  
  1970.                         <xsl:if test="RiferimentoNormativo">
  1971.                           <div class="tx-xsmall">
  1972.                             RIF.NORM. <xsl:value-of select="RiferimentoNormativo" />
  1973.                           </div>
  1974.                         </xsl:if>
  1975.  
  1976.                       </td>
  1977.                       <td class="import" >
  1978.  
  1979.                         <xsl:if test="DatiIVA/Imposta">
  1980.                           <xsl:value-of select="format-number(DatiIVA/Imposta,  '###.###.##0,00', 'euro')" />
  1981.                         </xsl:if>
  1982.                       </td>
  1983.                       <td class="import" >
  1984.  
  1985.                         <xsl:call-template name="FormatIVA">
  1986.                           <xsl:with-param name="Natura" select="Natura" />
  1987.                           <xsl:with-param name="IVA" select="DatiIVA/Aliquota" />
  1988.                         </xsl:call-template>
  1989.  
  1990.                       </td>
  1991.                       <td class="import" >
  1992.                         <xsl:if test="Importo">
  1993.                           <xsl:value-of select="format-number(Importo,  '###.###.##0,00', 'euro')" />
  1994.                         </xsl:if>
  1995.                       </td>
  1996.                     </tr>
  1997.  
  1998.                   </xsl:for-each>
  1999.  
  2000.  
  2001.                 </tbody>
  2002.  
  2003.               </table>
  2004.  
  2005.             </xsl:when>
  2006.             <xsl:otherwise>
  2007.  
  2008.               <!--  Dettaglio Linee   -->
  2009.               <table class="tbFoglio"  >
  2010.  
  2011.                 <thead>
  2012.                   <tr>
  2013.                     <th width="80px">Cod. articolo</th>
  2014.                     <th>Descrizione</th>
  2015.                     <th class="import2" >Quantità</th>
  2016.                     <th class="import2">Prezzo unitario</th>
  2017.                     <th class="perc2">UM</th>
  2018.                     <th class="perc">Sconto o magg.</th>
  2019.                     <th class="perc2">%IVA</th>
  2020.                     <th class="ximport">Prezzo totale</th>
  2021.  
  2022.                   </tr>
  2023.                 </thead>
  2024.                 <tbody>
  2025.  
  2026.  
  2027.                   <xsl:if test="count(DatiGenerali/DatiOrdineAcquisto[not(./RiferimentoNumeroLinea) or normalize-space(./RiferimentoNumeroLinea)='']) +
  2028.                   count(DatiGenerali/DatiContratto[not(./RiferimentoNumeroLinea) or normalize-space(./RiferimentoNumeroLinea)='']) +
  2029.                   count(DatiGenerali/DatiDDT[not(./RiferimentoNumeroLinea) or normalize-space(./RiferimentoNumeroLinea)='']) +
  2030.                   count(DatiGenerali/DatiFattureCollegate[not(./RiferimentoNumeroLinea) or  normalize-space(./RiferimentoNumeroLinea)='']) +
  2031.                   count(DatiGenerali/DatiConvenzione[not(./RiferimentoNumeroLinea) or  normalize-space(./RiferimentoNumeroLinea)=''])+
  2032.                   count(DatiGenerali/DatiRicezione[not(./RiferimentoNumeroLinea) or  normalize-space(./RiferimentoNumeroLinea)=''])  > 0 " >
  2033.  
  2034.  
  2035.                     <!-- Verifica che DatiOrdineAcquisto non siano senza riferimento numero linea in questo modo bisogna creare la linea di info      -->
  2036.                     <xsl:for-each select="DatiGenerali/DatiOrdineAcquisto[not(./RiferimentoNumeroLinea) or  normalize-space(./RiferimentoNumeroLinea)=''] " >
  2037.  
  2038.                       <xsl:call-template name="DatiCorrelati" >
  2039.                         <xsl:with-param name="Prefix"   select='"Vs.Ord. "'/>
  2040.                         <xsl:with-param name="IdDocumento" select="IdDocumento"/>
  2041.                         <xsl:with-param name="Data" select="Data"/>
  2042.                         <xsl:with-param name="CodiceCUP" select="CodiceCUP"/>
  2043.                         <xsl:with-param name="CodiceCIG" select="CodiceCIG"/>
  2044.                       </xsl:call-template >
  2045.                     </xsl:for-each>
  2046.  
  2047.                     <!-- Verifica che DatiContratto non siano senza riferimento numero linea in questo modo bisogna creare la linea di info       -->
  2048.  
  2049.                     <xsl:for-each select="DatiGenerali/DatiContratto[not(./RiferimentoNumeroLinea) or  normalize-space(./RiferimentoNumeroLinea)=''] " >
  2050.                       <xsl:call-template name="DatiCorrelati" >
  2051.                         <xsl:with-param name="Prefix"   select='"Contratto "'/>
  2052.                         <xsl:with-param name="IdDocumento" select="IdDocumento"/>
  2053.                         <xsl:with-param name="Data" select="Data"/>
  2054.                         <xsl:with-param name="CodiceCUP" select="CodiceCUP"/>
  2055.                         <xsl:with-param name="CodiceCIG" select="CodiceCIG"/>
  2056.                       </xsl:call-template >
  2057.  
  2058.                     </xsl:for-each>
  2059.  
  2060.                     <!-- Verifica che DatiConvenzione non siano senza riferimento numero linea in questo modo bisogna creare la linea di info     -->
  2061.  
  2062.                     <xsl:for-each select="DatiGenerali/DatiConvenzione[not(./RiferimentoNumeroLinea) or  normalize-space(./RiferimentoNumeroLinea)=''] " >
  2063.                       <xsl:call-template name="DatiCorrelati" >
  2064.                         <xsl:with-param name="Prefix"   select='"Convenzione "'/>
  2065.                         <xsl:with-param name="IdDocumento" select="IdDocumento"/>
  2066.                         <xsl:with-param name="Data" select="Data"/>
  2067.                         <xsl:with-param name="CodiceCUP" select="CodiceCUP"/>
  2068.                         <xsl:with-param name="CodiceCIG" select="CodiceCIG"/>
  2069.                       </xsl:call-template >
  2070.  
  2071.                     </xsl:for-each>
  2072.  
  2073.                     <!-- Verifica che DatiRicezione non siano senza riferimento numero linea in questo modo bisogna creare la linea di info       -->
  2074.                     <xsl:for-each select="DatiGenerali/DatiRicezione[not(./RiferimentoNumeroLinea) or  normalize-space(./RiferimentoNumeroLinea)=''] " >
  2075.                       <xsl:call-template name="DatiCorrelati" >
  2076.                         <xsl:with-param name="Prefix"   select='"Ricezione "'/>
  2077.                         <xsl:with-param name="IdDocumento" select="IdDocumento"/>
  2078.                         <xsl:with-param name="Data" select="Data"/>
  2079.                         <xsl:with-param name="CodiceCUP" select="CodiceCUP"/>
  2080.                         <xsl:with-param name="CodiceCIG" select="CodiceCIG"/>
  2081.                       </xsl:call-template >
  2082.  
  2083.                     </xsl:for-each>
  2084.  
  2085.                     <!-- Verifica che DatiFattureCollegate non siano senza riferimento numero linea in questo modo bisogna creare la linea di info    -->
  2086.  
  2087.                     <xsl:for-each select="DatiGenerali/DatiFattureCollegate[not(./RiferimentoNumeroLinea) or normalize-space(./RiferimentoNumeroLinea)=''] " >
  2088.  
  2089.                       <xsl:call-template name="DatiCorrelati" >
  2090.                         <xsl:with-param name="Prefix"   select='"Fatt.Coll. "'/>
  2091.                         <xsl:with-param name="IdDocumento" select="IdDocumento"/>
  2092.                         <xsl:with-param name="Data" select="Data"/>
  2093.                         <xsl:with-param name="CodiceCUP" select="CodiceCUP"/>
  2094.                         <xsl:with-param name="CodiceCIG" select="CodiceCIG"/>
  2095.                       </xsl:call-template >
  2096.  
  2097.                     </xsl:for-each>
  2098.  
  2099.                     <xsl:for-each select="DatiGenerali/DatiDDT[not(./RiferimentoNumeroLinea) or normalize-space(./RiferimentoNumeroLinea)=''] ">
  2100.                       <xsl:apply-templates select="."/> <!-- apply DatiDDT template -->
  2101.                     </xsl:for-each>
  2102.  
  2103.                     <xsl:call-template name="AltraDescrizioneLinea">
  2104.                       <xsl:with-param name="textDescrizione" select = '"------------------------"' />
  2105.                     </xsl:call-template>
  2106.                   </xsl:if>
  2107.  
  2108.  
  2109.  
  2110.                   <xsl:for-each select="DatiBeniServizi/DettaglioLinee" >
  2111.                     <xsl:apply-templates select=".">
  2112.                       <xsl:with-param name="r" select="position()"/>
  2113.                       <xsl:with-param name="posASWRELSTD" select="$posASWRELSTD"/>
  2114.                       <xsl:with-param name="TipoFattura" select="$TipoFattura"/>
  2115.                       <xsl:with-param name="IndiceBody" select="$BodyIndex"/>
  2116.                     </xsl:apply-templates>
  2117.                   </xsl:for-each>
  2118.  
  2119.  
  2120.                 </tbody>
  2121.  
  2122.               </table>
  2123.  
  2124.               <!--   Dati Cassa Prevvidenziale    -->
  2125.               <xsl:if test="DatiGenerali/DatiGeneraliDocumento/DatiCassaPrevidenziale">
  2126.                 <div class="separa"> </div>
  2127.  
  2128.                 <table class="tbFoglio">
  2129.  
  2130.                   <thead>
  2131.                     <tr>
  2132.                       <th class="title">Dati Cassa Previdenziale</th>
  2133.                       <th>Imponibile</th>
  2134.                       <th class="perc">%Contr.</th>
  2135.                       <th class="perc">Ritenuta</th>
  2136.                       <th class="perc">%IVA</th>
  2137.                       <th >Importo</th>
  2138.                     </tr>
  2139.                   </thead>
  2140.                   <tbody>
  2141.                     <xsl:for-each select="DatiGenerali/DatiGeneraliDocumento/DatiCassaPrevidenziale"  >
  2142.  
  2143.                       <tr>
  2144.                         <td>
  2145.                           <xsl:if test="TipoCassa">
  2146.  
  2147.                             <span>
  2148.                               <xsl:value-of select="TipoCassa" />
  2149.                             </span>
  2150.                             <xsl:variable name="TC">
  2151.                               <xsl:value-of select="TipoCassa" />
  2152.                             </xsl:variable>
  2153.                             <xsl:choose>
  2154.                               <xsl:when test="$TC='TC01'">
  2155.                                 (Cassa Nazionale Previdenza e Assistenza Avvocati
  2156.                                 e Procuratori legali)
  2157.                               </xsl:when>
  2158.                               <xsl:when test="$TC='TC02'">
  2159.                                 (Cassa Previdenza Dottori Commercialisti)
  2160.                               </xsl:when>
  2161.                               <xsl:when test="$TC='TC03'">
  2162.                                 (Cassa Previdenza e Assistenza Geometri)
  2163.                               </xsl:when>
  2164.                               <xsl:when test="$TC='TC04'">
  2165.                                 (Cassa Nazionale Previdenza e Assistenza
  2166.                                 Ingegneri e Architetti liberi profess.)
  2167.                               </xsl:when>
  2168.                               <xsl:when test="$TC='TC05'">
  2169.                                 (Cassa Nazionale del Notariato)
  2170.                               </xsl:when>
  2171.                               <xsl:when test="$TC='TC06'">
  2172.                                 (Cassa Nazionale Previdenza e Assistenza
  2173.                                 Ragionieri e Periti commerciali)
  2174.                               </xsl:when>
  2175.                               <xsl:when test="$TC='TC07'">
  2176.                                 (Ente Nazionale Assistenza Agenti e Rappresentanti
  2177.                                 di Commercio-ENASARCO)
  2178.                               </xsl:when>
  2179.                               <xsl:when test="$TC='TC08'">
  2180.                                 (Ente Nazionale Previdenza e Assistenza Consulenti
  2181.                                 del Lavoro-ENPACL)
  2182.                               </xsl:when>
  2183.                               <xsl:when test="$TC='TC09'">
  2184.                                 (Ente Nazionale Previdenza e Assistenza
  2185.                                 Medici-ENPAM)
  2186.                               </xsl:when>
  2187.                               <xsl:when test="$TC='TC10'">
  2188.                                 (Ente Nazionale Previdenza e Assistenza
  2189.                                 Farmacisti-ENPAF)
  2190.                               </xsl:when>
  2191.                               <xsl:when test="$TC='TC11'">
  2192.                                 (Ente Nazionale Previdenza e Assistenza
  2193.                                 Veterinari-ENPAV)
  2194.                               </xsl:when>
  2195.                               <xsl:when test="$TC='TC12'">
  2196.                                 (Ente Nazionale Previdenza e Assistenza Impiegati
  2197.                                 dell'Agricoltura-ENPAIA)
  2198.                               </xsl:when>
  2199.                               <xsl:when test="$TC='TC13'">
  2200.                                 (Fondo Previdenza Impiegati Imprese di Spedizione
  2201.                                 e Agenzie Marittime)
  2202.                               </xsl:when>
  2203.                               <xsl:when test="$TC='TC14'">
  2204.                                 (Istituto Nazionale Previdenza Giornalisti
  2205.                                 Italiani-INPGI)
  2206.                               </xsl:when>
  2207.                               <xsl:when test="$TC='TC15'">
  2208.                                 (Opera Nazionale Assistenza Orfani Sanitari
  2209.                                 Italiani-ONAOSI)
  2210.                               </xsl:when>
  2211.                               <xsl:when test="$TC='TC16'">
  2212.                                 (Cassa Autonoma Assistenza Integrativa
  2213.                                 Giornalisti Italiani-CASAGIT)
  2214.                               </xsl:when>
  2215.                               <xsl:when test="$TC='TC17'">
  2216.                                 (Ente Previdenza Periti Industriali e Periti
  2217.                                 Industriali Laureati-EPPI)
  2218.                               </xsl:when>
  2219.                               <xsl:when test="$TC='TC18'">
  2220.                                 (Ente Previdenza e Assistenza
  2221.                                 Pluricategoriale-EPAP)
  2222.                               </xsl:when>
  2223.                               <xsl:when test="$TC='TC19'">
  2224.                                 (Ente Nazionale Previdenza e Assistenza
  2225.                                 Biologi-ENPAB)
  2226.                               </xsl:when>
  2227.                               <xsl:when test="$TC='TC20'">
  2228.                                 (Ente Nazionale Previdenza e Assistenza
  2229.                                 Professione Infermieristica-ENPAPI)
  2230.                               </xsl:when>
  2231.                               <xsl:when test="$TC='TC21'">
  2232.                                 (Ente Nazionale Previdenza e Assistenza
  2233.                                 Psicologi-ENPAP)
  2234.                               </xsl:when>
  2235.                               <xsl:when test="$TC='TC22'">
  2236.                                 (INPS)
  2237.                               </xsl:when>
  2238.                               <xsl:when test="$TC=''">
  2239.                               </xsl:when>
  2240.                               <xsl:otherwise>
  2241.                                 <span>(!!! codice non previsto !!!)</span>
  2242.                               </xsl:otherwise>
  2243.                             </xsl:choose>
  2244.  
  2245.                           </xsl:if>
  2246.                         </td>
  2247.                         <td class="import">
  2248.                           <xsl:if test="ImponibileCassa">
  2249.                             <xsl:value-of select="format-number(ImponibileCassa,  '###.###.##0,00', 'euro')" />
  2250.                           </xsl:if>
  2251.                         </td>
  2252.  
  2253.                         <td class="import">
  2254.                           <xsl:if test="AlCassa">
  2255.  
  2256.                             <xsl:value-of select="format-number(AlCassa,  '###.###.##0,00', 'euro')" />
  2257.  
  2258.                           </xsl:if>
  2259.  
  2260.                         </td>
  2261.  
  2262.                         <td  class="Ritenuta" >
  2263.                           <xsl:if test="Ritenuta">
  2264.  
  2265.                             <xsl:value-of select="Ritenuta" />
  2266.  
  2267.                           </xsl:if>
  2268.                         </td>
  2269.  
  2270.                         <td class="import" >
  2271.  
  2272.                           <xsl:choose>
  2273.                             <xsl:when test="Natura">
  2274.  
  2275.                               <xsl:value-of select="Natura" />
  2276.  
  2277.                             </xsl:when>
  2278.                             <xsl:otherwise>
  2279.                               <xsl:if test="AliquotaIVA">
  2280.  
  2281.                                 <xsl:value-of select="format-number(AliquotaIVA,  '###.###.##0,00', 'euro')" />
  2282.  
  2283.                               </xsl:if>
  2284.                             </xsl:otherwise>
  2285.                           </xsl:choose>
  2286.  
  2287.                         </td>
  2288.  
  2289.                         <td class="import">
  2290.                           <xsl:if test="ImportoContributoCassa">
  2291.  
  2292.                             <xsl:value-of select="format-number(ImportoContributoCassa,  '###.###.##0,00', 'euro')" />
  2293.  
  2294.                           </xsl:if>
  2295.  
  2296.                         </td>
  2297.  
  2298.                       </tr>
  2299.  
  2300.                     </xsl:for-each>
  2301.  
  2302.  
  2303.                   </tbody>
  2304.                 </table>
  2305.  
  2306.  
  2307.               </xsl:if>
  2308.               <!--  Fine Cassa Prevvidenziale    -->
  2309.  
  2310.  
  2311.               <div class="separa" > </div>
  2312.               <!-- Dati RIEPILOGO-->
  2313.  
  2314.               <table class="tbTitolo">
  2315.                 <thead>
  2316.                   <tr>
  2317.                     <th>RIEPILOGHI IVA E TOTALI</th>
  2318.                   </tr>
  2319.                 </thead>
  2320.               </table>
  2321.  
  2322.  
  2323.  
  2324.               <table class="tbFoglio">
  2325.                 <thead>
  2326.                   <tr >
  2327.  
  2328.                     <th colspan="3" >esigibilità iva / riferimenti normativi</th>
  2329.                     <th class="perc">%IVA</th>
  2330.                     <th>Spese accessorie</th>
  2331.                      <th class="perc">Arr.</th>
  2332.                     <th colspan="2" >Totale imponibile</th>
  2333.                     <th colspan="2" >Totale imposta</th>
  2334.                   </tr>
  2335.                 </thead>
  2336.                 <tbody>
  2337.  
  2338.                   <xsl:for-each select="DatiBeniServizi/DatiRiepilogo" >
  2339.  
  2340.                     <xsl:if test="number(ImponibileImporto)">
  2341.  
  2342.                       <tr>
  2343.                         <td colspan="3" >
  2344.                           <xsl:choose>
  2345.                             <xsl:when test="EsigibilitaIVA">
  2346.  
  2347.                               <span>
  2348.                                 <xsl:value-of select="EsigibilitaIVA" />
  2349.                               </span>
  2350.                               <xsl:variable name="EI">
  2351.                                 <xsl:value-of select="EsigibilitaIVA" />
  2352.                               </xsl:variable>
  2353.                               <xsl:choose>
  2354.                                 <xsl:when test="$EI='I'">
  2355.                                   (esigibilità immediata)
  2356.                                 </xsl:when>
  2357.                                 <xsl:when test="$EI='D'">
  2358.                                   (esigibilità differita)
  2359.                                 </xsl:when>
  2360.                                 <xsl:when test="$EI='S'">
  2361.                                   (scissione dei pagamenti)
  2362.                                 </xsl:when>
  2363.                                 <xsl:otherwise>
  2364.                                   <span>(!!! codice non previsto !!!)</span>
  2365.                                 </xsl:otherwise>
  2366.                               </xsl:choose>
  2367.                             </xsl:when>
  2368.  
  2369.                             <xsl:otherwise>
  2370.  
  2371.                               <span>Esigib. non dich. (si presume immediata)</span>
  2372.  
  2373.                             </xsl:otherwise>
  2374.                           </xsl:choose>
  2375.  
  2376.                           <xsl:if test="RiferimentoNormativo">
  2377.                             <div class="tx-xsmall">
  2378.                               <xsl:value-of select="RiferimentoNormativo" />
  2379.                             </div>
  2380.                           </xsl:if>
  2381.                         </td>
  2382.  
  2383.  
  2384.                         <td class="import" >
  2385.  
  2386.                           <xsl:call-template name="FormatIVA">
  2387.                             <xsl:with-param name="Natura" select="Natura" />
  2388.                             <xsl:with-param name="IVA" select="AliquotaIVA" />
  2389.                           </xsl:call-template>
  2390.  
  2391.  
  2392.                         </td>
  2393.  
  2394.  
  2395.                         <td class="import">
  2396.  
  2397.                           <xsl:if test="SpeseAccessorie">
  2398.                             <xsl:value-of select="format-number(SpeseAccessorie,  '###.###.##0,00', 'euro')" />
  2399.                           </xsl:if>
  2400.                         </td>
  2401.  
  2402.  
  2403.                          <td class="import">
  2404.  
  2405.                         <xsl:if test="Arrotondamento">
  2406.                           <xsl:value-of select="format-number(Arrotondamento,  '###.###.##0,00', 'euro')" />
  2407.                         </xsl:if>
  2408.                       </td>
  2409.                         <td  colspan="2" class="import" >
  2410.  
  2411.                           <xsl:if test="ImponibileImporto">
  2412.                             <xsl:value-of select="format-number(ImponibileImporto,  '###.###.##0,00', 'euro')" />
  2413.                           </xsl:if>
  2414.                         </td>
  2415.  
  2416.                         <td colspan="2"  class="import" >
  2417.  
  2418.                           <xsl:if test="Imposta">
  2419.  
  2420.                             <xsl:choose>
  2421.                               <xsl:when test="Imposta = 0">
  2422.                                 <xsl:text>0</xsl:text>
  2423.                               </xsl:when>
  2424.                               <xsl:otherwise>
  2425.                                 <xsl:value-of select="format-number(Imposta,  '###.###.##0,00', 'euro')" />
  2426.                               </xsl:otherwise>
  2427.                             </xsl:choose>
  2428.  
  2429.  
  2430.  
  2431.                           </xsl:if>
  2432.                         </td>
  2433.  
  2434.                       </tr>
  2435.  
  2436.                     </xsl:if>
  2437.  
  2438.                   </xsl:for-each>
  2439.  
  2440.                   <!-- Importo Totale  -->
  2441.                   <tr >
  2442.  
  2443.                     <th  colspan="2">
  2444.                       Importo bollo
  2445.                     </th>
  2446.                     <th  colspan="3">
  2447.                       Sconto/Maggiorazione
  2448.                     </th>
  2449.  
  2450.  
  2451.  
  2452.                      <th class="perc">Arr.</th>
  2453.                     <th colspan="4" >
  2454.                       Totale documento
  2455.                     </th>
  2456.  
  2457.  
  2458.                   </tr>
  2459.  
  2460.                   <tr >
  2461.                     <td colspan="2" class="import" >
  2462.                       <xsl:if test="DatiGenerali/DatiGeneraliDocumento/DatiBollo/ImportoBollo">
  2463.  
  2464.                         <xsl:value-of select="format-number(DatiGenerali/DatiGeneraliDocumento/DatiBollo/ImportoBollo,  '###.###.##0,00', 'euro')" />
  2465.  
  2466.                       </xsl:if>
  2467.                     </td>
  2468.                     <td colspan="3" class="import">
  2469.                       <xsl:for-each select="DatiGenerali/DatiGeneraliDocumento/ScontoMaggiorazione"  >
  2470.  
  2471.                         <xsl:call-template name="FormatSconto" >
  2472.                           <xsl:with-param name="tipo" select="Tipo" />
  2473.                           <xsl:with-param name="percentuale" select="Percentuale" />
  2474.                           <xsl:with-param name="importo" select="Importo" />
  2475.                         </xsl:call-template>
  2476.  
  2477.  
  2478.                       </xsl:for-each>
  2479.                     </td>
  2480.  
  2481.  
  2482.  
  2483.  
  2484.                     <td class="import">
  2485.  
  2486.                       <xsl:if test="DatiGenerali/DatiGeneraliDocumento/Arrotondamento">
  2487.  
  2488.                         <xsl:value-of select="format-number(DatiGenerali/DatiGeneraliDocumento/Arrotondamento,  '###.###.##0,00', 'euro')" />
  2489.  
  2490.                       </xsl:if>
  2491.                     </td>
  2492.  
  2493.                     <td colspan="4" class="import">
  2494.  
  2495.                       <xsl:if test="DatiGenerali/DatiGeneraliDocumento/ImportoTotaleDocumento">
  2496.  
  2497.                         <xsl:value-of select="format-number(DatiGenerali/DatiGeneraliDocumento/ImportoTotaleDocumento,  '###.###.##0,00', 'euro')" />
  2498.  
  2499.                       </xsl:if>
  2500.                     </td>
  2501.  
  2502.                   </tr>
  2503.  
  2504.                   <!-- FINE Importo Totale  -->
  2505.                 </tbody>
  2506.               </table>
  2507.               <!--  FINE Dettaglio Linee   -->
  2508.  
  2509.  
  2510.               <!--   Dati Ritenuta Acconto   -->
  2511.               <xsl:if test="DatiGenerali/DatiGeneraliDocumento/DatiRitenuta">
  2512.                 <div class="separa"> </div>
  2513.                 <xsl:apply-templates select="DatiGenerali/DatiGeneraliDocumento/DatiRitenuta"/>
  2514.               </xsl:if>
  2515.               <!--  Fine Dati Ritenuta   -->
  2516.  
  2517.  
  2518.               <div class="separa"> </div>
  2519.  
  2520.  
  2521.               <!--   Dati Pagamento   -->
  2522.  
  2523.               <table class="tbFoglio" >
  2524.                 <thead>
  2525.                   <tr>
  2526.                     <th style="width:200px">Modalità pagamento</th>
  2527.                     <th>Dettagli</th>
  2528.                     <th  style="width:180px">Scadenze</th>
  2529.                     <th class="ximport">Importo</th>
  2530.                   </tr>
  2531.                 </thead>
  2532.                 <tbody>
  2533.                   <xsl:for-each select="DatiPagamento" >
  2534.  
  2535.                     <xsl:variable name="CountDettaglioPagamento">
  2536.                       <xsl:value-of select="count(DettaglioPagamento)" />
  2537.                     </xsl:variable>
  2538.  
  2539.  
  2540.                     <xsl:for-each select="DettaglioPagamento">
  2541.  
  2542.                       <tr>
  2543.                         <td>
  2544.  
  2545.                           <xsl:if test="ModalitaPagamento">
  2546.                             <span>
  2547.                               <xsl:value-of select="ModalitaPagamento" />
  2548.                             </span>
  2549.                             <xsl:variable name="MP">
  2550.                               <xsl:value-of select="ModalitaPagamento" />
  2551.                             </xsl:variable>
  2552.                             <xsl:choose>
  2553.                               <xsl:when test="$MP='MP01'">
  2554.                                 Contanti
  2555.                               </xsl:when>
  2556.                               <xsl:when test="$MP='MP02'">
  2557.                                 Assegno
  2558.                               </xsl:when>
  2559.                               <xsl:when test="$MP='MP03'">
  2560.                                 Assegno circolare
  2561.                               </xsl:when>
  2562.                               <xsl:when test="$MP='MP04'">
  2563.                                 Contanti presso Tesoreria
  2564.                               </xsl:when>
  2565.                               <xsl:when test="$MP='MP05'">
  2566.                                 Bonifico
  2567.                               </xsl:when>
  2568.                               <xsl:when test="$MP='MP06'">
  2569.                                 Vaglia cambiario
  2570.                               </xsl:when>
  2571.                               <xsl:when test="$MP='MP07'">
  2572.                                 Bollettino bancario
  2573.                               </xsl:when>
  2574.                               <xsl:when test="$MP='MP08'">
  2575.                                 Carta di pagamento
  2576.                               </xsl:when>
  2577.                               <xsl:when test="$MP='MP09'">
  2578.                                 RID
  2579.                               </xsl:when>
  2580.                               <xsl:when test="$MP='MP10'">
  2581.                                 RID utenze
  2582.                               </xsl:when>
  2583.                               <xsl:when test="$MP='MP11'">
  2584.                                 RID veloce
  2585.                               </xsl:when>
  2586.                               <xsl:when test="$MP='MP12'">
  2587.                                 RIBA
  2588.                               </xsl:when>
  2589.                               <xsl:when test="$MP='MP13'">
  2590.                                 MAV
  2591.                               </xsl:when>
  2592.                               <xsl:when test="$MP='MP14'">
  2593.                                 Quietanza erario
  2594.                               </xsl:when>
  2595.                               <xsl:when test="$MP='MP15'">
  2596.                                 Giroconto su conti di contabilità speciale
  2597.                               </xsl:when>
  2598.                               <xsl:when test="$MP='MP16'">
  2599.                                 Domiciliazione bancaria
  2600.                               </xsl:when>
  2601.                               <xsl:when test="$MP='MP17'">
  2602.                                 Domiciliazione postale
  2603.                               </xsl:when>
  2604.                               <xsl:when test="$MP='MP18'">
  2605.                                 Bollettino di c/c postale
  2606.                               </xsl:when>
  2607.                               <xsl:when test="$MP='MP19'">
  2608.                                 SEPA Direct Debit
  2609.                               </xsl:when>
  2610.                               <xsl:when test="$MP='MP20'">
  2611.                                 SEPA Direct Debit CORE
  2612.                               </xsl:when>
  2613.                               <xsl:when test="$MP='MP21'">
  2614.                                 SEPA Direct Debit B2B
  2615.                               </xsl:when>
  2616.                               <xsl:when test="$MP='MP22'">
  2617.                                 Trattenuta su somme già riscosse
  2618.                               </xsl:when>
  2619.                               <xsl:when test="$MP=''">
  2620.                               </xsl:when>
  2621.                               <xsl:otherwise>
  2622.                                 <span></span>
  2623.                               </xsl:otherwise>
  2624.                             </xsl:choose>
  2625.                             <span>
  2626.                               <xsl:value-of select="OpzDescrizionePagamento" />
  2627.                             </span>
  2628.                           </xsl:if>
  2629.  
  2630.                         </td>
  2631.  
  2632.  
  2633.                           <td>
  2634.                             <xsl:apply-templates select="."/>
  2635.                             <xsl:if test="(position( )) !=  $CountDettaglioPagamento">
  2636.                               <xsl:if test="Beneficiario or CodUfficioPostale or CognomeQuietanzante or CognomeQuietanzante or CFQuietanzante or TitoloQuietanzante
  2637.                             or IstitutoFinanziario or IBAN or ABI or CAB or BIC or ScontoPagamentoAnticipato or DataLimitePagamentoAnticipato or PenalitaPagamentiRitardati
  2638.                             or DataDecorrenzaPenale or CodicePagamento">
  2639.                                 <xsl:text>------------------------</xsl:text>
  2640.                               </xsl:if>
  2641.                             </xsl:if>
  2642.  
  2643.                           </td>
  2644.  
  2645.                         <td>
  2646.  
  2647.                           <xsl:if test="DataRiferimentoTerminiPagamento or GiorniTerminiPagamento">
  2648.  
  2649.                             <xsl:choose>
  2650.                               <xsl:when test="DataRiferimentoTerminiPagamento">
  2651.                                 <xsl:text>Data termine </xsl:text>
  2652.                                 <xsl:call-template name="FormatDateIta">
  2653.                                   <xsl:with-param name="DateTime" select="DataRiferimentoTerminiPagamento" />
  2654.                                 </xsl:call-template>
  2655.  
  2656.                                 <xsl:if test="GiorniTerminiPagamento">
  2657.                                   <xsl:text> </xsl:text><xsl:value-of select="GiorniTerminiPagamento" />gg
  2658.                                 </xsl:if>
  2659.                               </xsl:when>
  2660.                               <xsl:otherwise>
  2661.                                 <xsl:text>Giorni termine </xsl:text>
  2662.                                 <xsl:value-of select="GiorniTerminiPagamento" />
  2663.  
  2664.                               </xsl:otherwise>
  2665.                             </xsl:choose>
  2666.                             <br/>
  2667.                           </xsl:if>
  2668.  
  2669.                           <xsl:if test="DataScadenzaPagamento">
  2670.                             Data scadenza <xsl:call-template name="FormatDateIta">
  2671.                               <xsl:with-param name="DateTime" select="DataScadenzaPagamento" />
  2672.                             </xsl:call-template>
  2673.                           </xsl:if>
  2674.                         </td>
  2675.                         <td class="import">
  2676.  
  2677.                           <xsl:if test="ImportoPagamento">
  2678.  
  2679.                             <xsl:value-of select="format-number(ImportoPagamento,  '###.###.##0,00', 'euro')" />
  2680.  
  2681.                           </xsl:if>
  2682.                         </td>
  2683.                       </tr>
  2684.                     </xsl:for-each>
  2685.  
  2686.                   </xsl:for-each>
  2687.                 </tbody>
  2688.               </table>
  2689.               <!-- FINE   Dati Pagamento   -->
  2690.  
  2691.               <div style="height:10px" > </div>
  2692.  
  2693.               <xsl:for-each select="OpzRiepilogoIVA"  >
  2694.                 <div class="tx-xsmall">
  2695.                   * <xsl:value-of select="." />
  2696.                 </div>
  2697.  
  2698.               </xsl:for-each>
  2699.               <xsl:if test="OpzRiepilogoIVA">
  2700.                 <div style="height:10px" > </div>
  2701.               </xsl:if>
  2702.  
  2703.             </xsl:otherwise>
  2704.  
  2705.           </xsl:choose>
  2706.  
  2707.           <!-- Definizione degli allegati -->
  2708.           <xsl:if test="Allegati">
  2709.  
  2710.             <div class="tx-small" >Allegati:</div>
  2711.  
  2712.             <ul class="ulAllegati">
  2713.               <xsl:for-each select="Allegati">
  2714.                 <li>
  2715.                   <div class="tx-small">
  2716.  
  2717.                     <xsl:value-of select="NomeAttachment" />
  2718.                     <xsl:text> </xsl:text>
  2719.                     <xsl:value-of select="DescrizioneAttachment" />
  2720.                   </div>
  2721.                 </li>
  2722.  
  2723.  
  2724.               </xsl:for-each>
  2725.  
  2726.             </ul>
  2727.  
  2728.           </xsl:if>
  2729.  
  2730.           <!--Definizione se fattura è AssoSofware-->
  2731.  
  2732.           <xsl:if test="$posASWRELSTD &gt; 0 ">
  2733.             <div class="dtASWRELSTD">
  2734.  
  2735.               <label class="headerLabel">Conforme Standard AssoSoftware</label>
  2736.  
  2737.             </div>
  2738.  
  2739.           </xsl:if>
  2740.  
  2741.  
  2742.           <!-- FINE    ASWRELSTD  -->
  2743.  
  2744.  
  2745.         </xsl:for-each>
  2746.         <!--FINE BODY-->
  2747.  
  2748.       </div>
  2749.  
  2750.  
  2751.  
  2752.     </xsl:if>
  2753.   </xsl:template>
  2754.  
  2755.   <xsl:template match="/">
  2756.     <html>
  2757.       <head>
  2758.         <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  2759.         <style type="text/css">
  2760.  
  2761.           #fattura-elettronica
  2762.           {
  2763.           font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  2764.           margin-left: auto;
  2765.           margin-right: auto;
  2766.           max-width: 1280px;
  2767.           min-width: 800px;
  2768.           padding: 0;  }
  2769.  
  2770.           #fattura-elettronica
  2771.           div.page {
  2772.           }
  2773.  
  2774.           .tbHeader
  2775.           {
  2776.           width: 800px;
  2777.           border: 2px solid black;
  2778.           }
  2779.  
  2780.  
  2781.           tr td {vertical-align: top;}
  2782.  
  2783.           .tdHead {
  2784.           width: 50%;
  2785.           height: 91px;
  2786.           border: 1px solid black;
  2787.           }
  2788.  
  2789.           .tableHead
  2790.           {
  2791.           font-size:smaller;
  2792.           width: 100%;
  2793.           }
  2794.  
  2795.           .headBorder
  2796.           {
  2797.           <!--border: 2px solid black;
  2798.             width:100%;
  2799.             height: 210px;
  2800.             border-bottom-left-radius:30px;
  2801.             border-bottom-right-radius:30px; -->
  2802.           }
  2803.  
  2804.           .headerLabel
  2805.           {
  2806.           color:#282828;
  2807.           font-weight:bold;
  2808.  
  2809.  
  2810.           }
  2811.  
  2812.           .headContent
  2813.           {
  2814.           margin-left:10px;
  2815.           margin-bottom:0px
  2816.           }
  2817.  
  2818.           .mt5
  2819.           {
  2820.           margin-top:5px
  2821.           }
  2822.  
  2823.  
  2824.           tr.break { page-break-after: always; }
  2825.  
  2826.           .ulAllegati
  2827.           {
  2828.           margin-top:0px;
  2829.           }
  2830.  
  2831.  
  2832.           .separa
  2833.           {
  2834.           height:20px;
  2835.           }
  2836.  
  2837.           table.tbTitolo
  2838.           {
  2839.           width: 800px;
  2840.           table-layout: fixed;
  2841.           border-collapse: collapse;
  2842.           word-wrap:normal; <!--break-word;-->
  2843.           }
  2844.           table.tbTitolo th {
  2845.           padding-left: 5px;
  2846.           padding-right: 5px;
  2847.           border: solid 1px #000000;
  2848.           border-bottom: none;
  2849.           background-color: LightCyan;
  2850.           font-size:x-small;
  2851.  
  2852.           }
  2853.  
  2854.  
  2855.           table.tbFoglio
  2856.           {
  2857.           width: 800px;
  2858.           table-layout: fixed;
  2859.           border-collapse: collapse;
  2860.           word-wrap:break-word;
  2861.           }
  2862.  
  2863.           table.tbFoglio th {
  2864.           padding-left: 5px;
  2865.           padding-right: 5px;
  2866.           border: solid 1px #000000;
  2867.           background-color: LightGrey;
  2868.  
  2869.           <!-- text-transform: uppercase; -->
  2870.           font-size:x-small;
  2871.  
  2872.  
  2873.           }
  2874.  
  2875.           table.tbFoglio tbody
  2876.           {
  2877.           border: solid 1px #000000;
  2878.           }
  2879.  
  2880.           table.tbFoglio th .perc
  2881.           {
  2882.           width:50px;
  2883.           }
  2884.  
  2885.           table.tbFoglio td {
  2886.           font-size:small;
  2887.  
  2888.           border-right: solid 1px #000000;
  2889.           border-bottom: none;
  2890.           border-left: solid 1px #000000;
  2891.           }
  2892.  
  2893.           table.tbFoglio tr {
  2894.  
  2895.  
  2896.           }
  2897.  
  2898.           .textRight
  2899.           {
  2900.           text-align:right;
  2901.           }
  2902.  
  2903.           .textCenter
  2904.           {
  2905.           text-align:center;
  2906.           }
  2907.  
  2908.           .textPerc
  2909.           {
  2910.           width:50px;
  2911.           }
  2912.  
  2913.           td.Ritenuta
  2914.           {
  2915.           width:50px;
  2916.           text-align:center;
  2917.           }
  2918.  
  2919.           th.title, .title td {
  2920.           width:48%
  2921.           }
  2922.  
  2923.           th.perc {
  2924.           width:50px;
  2925.           }
  2926.  
  2927.           th.perc2 {
  2928.           width:40px;
  2929.           }
  2930.  
  2931.           th.data {
  2932.           width:80px;
  2933.           }
  2934.  
  2935.           th.import
  2936.           {
  2937.           width:100px;
  2938.           }
  2939.  
  2940.           td.import
  2941.           {
  2942.           text-align:right;
  2943.           }
  2944.  
  2945.           th.import2
  2946.           {
  2947.           width:80px;
  2948.           }
  2949.  
  2950.           td.import2
  2951.           {
  2952.           text-align:right;
  2953.           }
  2954.  
  2955.           th.ximport
  2956.           {
  2957.           width:100px;
  2958.           }
  2959.  
  2960.           td.ximport
  2961.           {
  2962.           text-align:center;
  2963.           }
  2964.  
  2965.           th.ximport2
  2966.           {
  2967.           width:80px;
  2968.           }
  2969.  
  2970.           td.ximport2
  2971.           {
  2972.           text-align:center;
  2973.           }
  2974.  
  2975.           td.data
  2976.           {
  2977.           text-align:center;
  2978.           }
  2979.  
  2980.           .tx-xsmall {
  2981.           font-size:x-small;
  2982.           }
  2983.  
  2984.           .tx-small {
  2985.           font-size:small;
  2986.           }
  2987.  
  2988.           .import
  2989.           {
  2990.           text-align:right;
  2991.           }
  2992.  
  2993.           table.tbNoBorder
  2994.           {
  2995.               border-collapse: collapse;
  2996.               margin-bottom: 5px;
  2997.               font-size:small;
  2998.               text-align:center;
  2999.               width:800px;
  3000.           }
  3001.  
  3002.         </style>
  3003.       </head>
  3004.       <body>
  3005.         <div id="fattura-container">
  3006.  
  3007.           <xsl:choose>
  3008.             <xsl:when test="d:FatturaElettronicaSemplificata">
  3009.               <!--versione 1.0 SEMPLIFICATA-->
  3010.               <xsl:call-template name="FatturaElettronica">
  3011.                 <xsl:with-param name="TipoFattura" select="d:FatturaElettronicaSemplificata" />
  3012.                 <xsl:with-param name="IsFPRS" select="1" />
  3013.               </xsl:call-template>
  3014.             </xsl:when>
  3015.             <xsl:when test="c:FatturaElettronica">
  3016.               <!--versione 1.0-->
  3017.               <xsl:call-template name="FatturaElettronica">
  3018.                 <xsl:with-param name="TipoFattura" select="c:FatturaElettronica" />
  3019.                 <xsl:with-param name="IsFPRS" select="0" />
  3020.               </xsl:call-template>
  3021.             </xsl:when>
  3022.             <xsl:when test="b:FatturaElettronica">
  3023.               <!--versione 1.1-->
  3024.               <xsl:call-template name="FatturaElettronica">
  3025.                 <xsl:with-param name="TipoFattura" select="b:FatturaElettronica" />
  3026.                 <xsl:with-param name="IsFPRS" select="0" />
  3027.               </xsl:call-template>
  3028.             </xsl:when>
  3029.             <xsl:otherwise>
  3030.               <xsl:call-template name="FatturaElettronica">
  3031.                 <!--versione 1.2-->
  3032.                 <xsl:with-param name="TipoFattura" select="a:FatturaElettronica" />
  3033.                 <xsl:with-param name="IsFPRS" select="0" />
  3034.               </xsl:call-template>
  3035.             </xsl:otherwise>
  3036.           </xsl:choose>
  3037.  
  3038.  
  3039.  
  3040.         </div>
  3041.       </body>
  3042.     </html>
  3043.   </xsl:template>
  3044. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment