<!--     Descrizione documento:     Foglio di stile per Fattura italiana UBL 2.1 PEPPOL BIS 3	Versione : 				   2.0.3    Prodotto il :              Febbraio 2023    Prodotto da :             Intercent-ER    Ambito:                    Intercent-ER - Piloti Peppol -->
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:in="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cr="http://www.ubl-italia.org/ns/CrossReference" version="2.0" exclude-result-prefixes="cac cbc in">
	<xd:doc xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet">
		<xd:desc>
			<xd:p>
				<xd:b>Created on:</xd:b>
Oct 05, 2020
</xd:p>
			<xd:p>
				<xd:b>Author:</xd:b>
Intercent-ER
</xd:p>
			<xd:p/>
		</xd:desc>
	</xd:doc>
	<xsl:param name="xclUnitOfMeasureCode"/>
	<xsl:param name="xclPaymentMeansCode"/>
	<xsl:param name="xclProvinceItaliane"/>
	<xsl:decimal-format name="number" decimal-separator="," grouping-separator="."/>
	<xsl:template match="/">
		<html>
			<head>
				<title>Nota di Credito</title>
				<style type="text/css"> .in-body { font-family: serif } .in-box-label { font-family: "Arial", sans-serif; font-style:italic; font-size:72%; margin-left: 1pt; margin-right:1pt; margin-top:1pt } .box-text { font-family: "Arial", sans-serif; font-size:70%; line-height:15pt; margin-left: 1pt; margin-right:1pt } .title-text { font-family:"Arial", sans-serif; font-weight:bold; font-size:90% margin-left:10pt; } .subtitle-text { font-family:"Arial", sans-serif; font-weight:bold; font-size:80%; margin-left: 1pt; margin-right:1pt } .in-table { border-collapse:collapse; border-color: #000000; table-layout:fixed } .in-form-column { width:8.33% } .in-counter-cell { border:none } .riferimenti-table h3{ margin: 0px; display: inline} .in-cell-data { margin-top:0pt; margin-bottom:0pt } .in-cell-data-background { } .in-cell-data-center { text-align:center } .in-cell-base { border:solid; border-width:1pt } .in-cell-end-override { border-right-style:none } .in-cell-after-override { border-bottom-style:none } .in-cell-line-background { background-color:#b8b8b8; font-weight:bold } .in-cell-filler-background { background-color:#e8e8e8 } .fixed-height{ min-height: 40px; display:block; } .law-warning{ font-style: italic; font-size: 70%; } .border-left{ border-left: 1px solid; } .no-bottom-border{ border-bottom: none; } .allowance-charge{ list-style-type: none; padding: 0px; margin: 0px; } .allowance-charge LI{ } H1{ font-size:120%; font-family: "Arial", sans-serif; } H2{ font-family: "Arial", sans-serif; font-size:100%; } H3{ font-size:90%; } .padded{ padding-top:20px; padding-bottom:10px; display:block; } .riepilogo-fattura{ width:100%; border:1px solid black; padding: 0; margin: 0; border-spacing: 0; border-collapse: collapse; } .dati-fattura{ width:100%; height:150px; border: none; padding: 0; margin: 0; border-spacing: 0; border-collapse: collapse; } .dati-documento{ width:100%; height:50px; border: none; padding: 0; margin: 0; border-spacing: 0; border-collapse: collapse; } .no-border{ border:0 !important; } .riepilogo-fattura TD{ border:1px solid black; padding: 0; margin: 0; vertical-align: top; } .party-row{ height:150px; } .h50{ Nota di Creditoght: 50px; } .h80{ height: 80px; } .h100px{ height: 100px; } .h150px{height:150px} .border-bottom{ border-bottom:1px solid black !important; } .border-right{ border-right:1px solid black !important; } .border-left{ border-left:1px solid black !important; } .party-column{ width:50%; } .riepilogo-PDC{ width:100%; border:1px solid black; padding: 0; margin: 0; border-spacing: 0; border-collapse: collapse; } .riepilogo-PDC TH{ font-family: "Arial", sans-serif; font-size:70%; font-style:italic; border-right:1px solid black; height:30px; } .w-50 { width:50%; } .w-66 { width:67%; } .w-90 { width:90%; } .w-33 { width:33%; } .w-40{ width:40%; } .w-30{ width:30%; } .w-25{ width:25%; } .w-20{ width: 20%} .w-16{ width: 16% } .w-75{width:75%; } .w-15{ width:15%; } .w-10{ width:10%; } .w-5{ width:5%; } .w-100{ width:100%; } .righe-fattura{ width:100%; border:1px solid black; padding: 0; margin: 0; border-spacing: 0; border-collapse: collapse; } .righe-fattura TH{ font-family: "Arial", sans-serif; font-size:70%; font-style:italic; border-right:1px solid black; height:30px; } .empty-cell-filler{ height: 1.5em; } .page-break{ page-break-inside:avoid } table { page-break-inside:auto } tr { page-break-inside:avoid; page-break-after:auto } thead { display:table-header-group } tfoot { display:table-footer-group } .block{ display:block; } .h100{ height:100%; } .attachment-list{ list-style-type: none; } .floatright{ float:right; } .float-right{ float:right; margin-top:20px; clear:both; } .float-right-last{ float:right; margin-bottom: 30px; display:block; clear:both; } .nowraptext{ white-space: nowrap; word-break: break-all; } .bold{ font-weight:bold; } .margin-right{ margin-right:20px; } .header-linea{ padding-top: 5px; padding-bottom:3px; margin:0; } .no-margin{ margin:0; padding:0; } .font-size-80 { font-size: 80%; } </style>
			</head>
			<body class="in-body">
				<div class="page-break">
					<h1>Nota di Credito</h1>
					<h2>Rappresentazione UBL PEPPOL BIS 3</h2>
					<div class="box-text">
CustomizationID:
<xsl:value-of select="/in:CreditNote/cbc:CustomizationID"/>
						<br/>
ProfileID:
<xsl:value-of select="/in:CreditNote/cbc:ProfileID"/>
					</div>
					<table class="riepilogo-fattura" summary="riepilogo fattura">
						<tr class="party-row">
							<td class="party-column h150px">
								<h2 class="in-box-label">Fornitore</h2>
								<xsl:call-template name="in-supplier"/>
								<xsl:if test="/in:CreditNote/cac:PayeeParty">
									<div class="box-text ">
										<b>Beneficiario:</b>
									</div>
									<div>
										<xsl:call-template name="in-party">
											<xsl:with-param name="party" select="/in:CreditNote/cac:PayeeParty"/>
										</xsl:call-template>
									</div>
								</xsl:if>
							</td>
							<td class="h150px">
								<table class="dati-fattura h100" summary="dati fattura">
									<tr class="h50">
										<td class="no-border border-right border-bottom h50 w-25 in-cell-filler-background">
											<h2 class="in-box-label">Numero Nota di Credito</h2>
											<xsl:call-template name="in-id"/>
										</td>
										<td class="no-border border-right border-bottom h50 w-25 in-cell-filler-background">
											<h2 class="in-box-label">Data Nota di Credito</h2>
											<div class="box-text">
												<xsl:call-template name="format-date">
													<xsl:with-param name="date">
														<xsl:value-of select="/in:CreditNote/cbc:IssueDate"/>
													</xsl:with-param>
												</xsl:call-template>
											</div>
										</td>
										<td class="no-border border-right border-bottom h50 w-25 in-cell-filler-background">
											<h2 class="in-box-label">Data scadenza pagamento</h2>
											<xsl:for-each select="/in:CreditNote/cac:PaymentMeans">
												<div class="box-text">
													<xsl:call-template name="format-date">
														<xsl:with-param name="date">
															<xsl:value-of select="cbc:PaymentDueDate"/>
														</xsl:with-param>
													</xsl:call-template>
												</div>
											</xsl:for-each>
										</td>
										<td class="no-border border-bottom h50 w-25 in-cell-filler-background">
											<h2 class="in-box-label">Valuta</h2>
											<xsl:call-template name="in-currency"/>
										</td>
									</tr>
									<tr class="h100px">
										<td class="no-border border-right h100px" colspan="2">
											<xsl:call-template name="transport-data"/>
										</td>
										<td class="no-border border-right" colspan="2">
											<h2 class="in-box-label">Dati della ricezione</h2>
											<xsl:if test="/in:CreditNote/cac:ReceiptDocumentReference">
												<div class="box-text">
													<xsl:value-of select="/in:CreditNote/cac:ReceiptDocumentReference/cbc:ID"/>
												</div>
											</xsl:if>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr class="party-row">
							<td class="h150px">
								<h2 class="in-box-label">Cliente</h2>
								<xsl:call-template name="in-party">
									<xsl:with-param name="party" select="/in:CreditNote/cac:AccountingCustomerParty/cac:Party"/>
								</xsl:call-template>
							</td>
							<td class="h150px">
								<table class="dati-fattura h100" summary="Note e riferimento amministrativo">
									<tr>
										<td class="w-50 no-border border-right">
											<h2 class="in-box-label">Periodo di riferimento</h2>
											<xsl:call-template name="in-invoice-period"/>
										</td>
										<td class="w-50 no-border">
											<h2 class="in-box-label">Note/Causale Documento</h2>
											<xsl:if test="/in:CreditNote/cbc:Note">
												<xsl:choose>
													<xsl:when test="contains(/in:CreditNote/cbc:Note, '#')">
														<div class="box-text">
															<xsl:value-of select="replace(/in:CreditNote/cbc:Note, '#', ' - ')"/>
														</div>
													</xsl:when>
													<xsl:otherwise>
														<div class="box-text">
															<xsl:value-of select="/in:CreditNote/cbc:Note"/>
														</div>
													</xsl:otherwise>
												</xsl:choose>
											</xsl:if>
											<xsl:if test="/in:CreditNote/cbc:BuyerReference">
												<div class="box-text">
													<br/>
													<h3 style="margin: 0; display: inline">Riferimento cliente: </h3>
													<br/>
													<xsl:value-of select="/in:CreditNote/cbc:BuyerReference"/>
												</div>
											</xsl:if>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr class="h100px">
							<td class="h100px">
								<h2 class="in-box-label">Rappresentante fiscale</h2>
								<xsl:if test="/in:CreditNote/cac:TaxRepresentativeParty">
									<xsl:call-template name="in-party">
										<xsl:with-param name="party" select="/in:CreditNote/cac:TaxRepresentativeParty"/>
									</xsl:call-template>
								</xsl:if>
							</td>
							<td class="h100px">
								<table class="dati-documento h100" summary="Dati ordine e contratto">
									<tr>
										<td class="w-33 no-border border-right">
											<h2 class="in-box-label">Dati dell'ordine</h2>
											<xsl:if test="/in:CreditNote/cac:OrderReference">
												<div class="box-text">
													<xsl:if test="/in:CreditNote/cac:OrderReference/cbc:ID != '#MULTI#'">
Identificativo ordine:
<xsl:value-of select="/in:CreditNote/cac:OrderReference/cbc:ID"/>
														<br/>
														<xsl:if test="/in:CreditNote/cac:OrderReference/cbc:IssueDate">
Data:
<xsl:value-of select="/in:CreditNote/cac:OrderReference/cbc:IssueDate"/>
															<br/>
														</xsl:if>
													</xsl:if>
													<xsl:if test="/in:CreditNote/cac:OrderReference/cbc:SalesOrderID">
Identificativo ordine di vendita:
<xsl:value-of select="/in:CreditNote/cac:OrderReference/cbc:SalesOrderID"/>
													</xsl:if>
													<xsl:if test="string-length(/in:CreditNote/cbc:BuyerReference)-string-length(translate(/in:CreditNote/cbc:BuyerReference,'#','')) >= 2">
Tripletta:
<xsl:value-of select="/in:CreditNote/cbc:BuyerReference"/>
													</xsl:if>
												</div>
											</xsl:if>
										</td>
										<td class="w-33 no-border border-right">
											<h2 class="in-box-label">Dati del contratto</h2>
											<xsl:if test="/in:CreditNote/cac:ContractDocumentReference">
												<div class="box-text">
Identificativo contratto:
<xsl:value-of select="/in:CreditNote/cac:ContractDocumentReference/cbc:ID"/>
													<br/>
												</div>
											</xsl:if>
											<xsl:if test="/in:CreditNote/cac:OriginatorDocumentReference">
												<div class="box-text">
Codice CIG:
<xsl:value-of select="/in:CreditNote/cac:OriginatorDocumentReference/cbc:ID"/>
													<br/>
												</div>
											</xsl:if>
											<xsl:if test="/in:CreditNote/cac:AdditionalDocumentReference/cbc:DocumentTypeCode = '50'">
												<div class="box-text">
Codice CUP:
<xsl:value-of select="/in:CreditNote/cac:AdditionalDocumentReference[cbc:DocumentTypeCode = '50']/cbc:ID"/>
												</div>
											</xsl:if>
										</td>
										<td class="w-33 no-border">
											<h2 class="in-box-label">Dati della convenzione</h2>
											<xsl:if test="/in:CreditNote/cac:AdditionalDocumentReference/cbc:ID[@schemeID ='AVV']">
												<div class="box-text">
Convenzione:
<xsl:value-of select="/in:CreditNote/cac:AdditionalDocumentReference/cbc:ID[@schemeID ='AVV']"/>
													<br/>
												</div>
											</xsl:if>
											<xsl:if test="/in:CreditNote/cac:AdditionalDocumentReference[cbc:ID[@schemeID ='AVV']]/cbc:DocumentDescription">
Descrizione:
<xsl:value-of select="cbc:DocumentDescription"/>
											</xsl:if>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr class="h100px">
							<td class="h100px">
								<h2 class="in-box-label">Dati del terzo intermediario soggetto emittente</h2>
								<xsl:if test="/in:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:ServiceProviderParty">
									<xsl:for-each select="/in:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:ServiceProviderParty/cac:Party/cac:PartyIdentification">
										<div class="box-text">
											<xsl:value-of select="cbc:ID"/>
										</div>
									</xsl:for-each>
								</xsl:if>
								<xsl:if test="/in:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:ServiceProviderParty/cac:Party/cac:PartyName">
									<div class="box-text">
										<xsl:value-of select="/in:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:ServiceProviderParty/cac:Party/cac:PartyName/cbc:Name"/>
									</div>
								</xsl:if>
								<div class="box-text">
									<xsl:call-template name="party-tax-scheme">
										<xsl:with-param name="scheme" select="/in:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:ServiceProviderParty/cac:Party/cac:PartyTaxScheme"/>
									</xsl:call-template>
								</div>
								<xsl:if test="/in:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:ServiceProviderParty/cac:Party/cac:Person">
									<div class="box-text">
										<xsl:value-of select="/in:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:ServiceProviderParty/cac:Party/cac:Person/cbc:FirstName"/>
										<span style="min-width:1em;display:inline-block;"/>
										<xsl:value-of select="/in:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:ServiceProviderParty/cac:Party/cac:Person/cbc:FamilyName"/>
									</div>
								</xsl:if>
							</td>
							<td class="h100px">
								<table class="dati-documento riferimenti-table h100" summary="Dati trasporto e documenti di trasporto">
									<tr>
										<td class="w-50 no-border border-right">
											<h2 class="in-box-label">Altri riferimenti</h2>
											<xsl:if test="/in:CreditNote/cac:BillingReference">
												<xsl:for-each select="/in:CreditNote/cac:BillingReference">
													<div class="box-text">
														<h3 style="margin: 0; display: inline">Fattura collegata: </h3>
														<xsl:value-of select="cac:InvoiceDocumentReference/cbc:ID"/>
														<xsl:if test="cac:InvoiceDocumentReference/cbc:IssueDate">
															<xsl:text> del </xsl:text>
															<xsl:call-template name="format-date">
																<xsl:with-param name="date">
																	<xsl:value-of select="cac:InvoiceDocumentReference/cbc:IssueDate"/>
																</xsl:with-param>
															</xsl:call-template>
														</xsl:if>
													</div>
													<xsl:if test="cac:AdditionalDocumentReference">
														<div class="box-text">
															<h3 style="margin: 0; display: inline">Riferimento alla fattura principale: </h3>
															<xsl:value-of select="cac:AdditionalDocumentReference/cbc:ID"/>
															<xsl:text> del </xsl:text>
															<xsl:call-template name="format-date">
																<xsl:with-param name="date">
																	<xsl:value-of select="cac:AdditionalDocumentReference/cbc:IssueDate"/>
																</xsl:with-param>
															</xsl:call-template>
														</div>
													</xsl:if>
												</xsl:for-each>
											</xsl:if>
											<xsl:if test="/in:CreditNote/cac:AdditionalDocumentReference">
												<xsl:for-each select="/in:CreditNote/cac:AdditionalDocumentReference">
													<xsl:if test="not (cac:Attachment) and not(cbc:ID/@schemeID eq 'AVV') and not(cbc:DocumentTypeCode = '50')">
														<div class="box-text">
															<xsl:choose>
																<xsl:when test="cbc:ID/@schemeID and cbc:ID/@schemeID eq 'AOR'">
																	<h3>SAL: </h3>
																</xsl:when>
																<xsl:otherwise>
																	<xsl:text>Id doc.: </xsl:text>
																</xsl:otherwise>
															</xsl:choose>
															<xsl:value-of select="cbc:ID"/>
															<xsl:if test="cbc:DocumentDescription">
																<xsl:text>, descrizione: </xsl:text>
																<xsl:value-of select="cbc:DocumentDescription"/>
															</xsl:if>
														</div>
													</xsl:if>
												</xsl:for-each>
											</xsl:if>
											<xsl:if test="/in:CreditNote/cbc:AccountingCost">
												<div class="box-text">
													<h3>Centro di costo/Riferimento amministrazione: </h3>
													<xsl:value-of select="/in:CreditNote/cbc:AccountingCost[1]"/>
												</div>
											</xsl:if>
										</td>
										<td class="w-50 no-border border-right">
											<h2 class="in-box-label">Documento di trasporto</h2>
											<xsl:if test="in:CreditNote/cac:DespatchDocumentReference">
												<div class="box-text">
													<xsl:value-of select="in:CreditNote/cac:DespatchDocumentReference/cbc:ID"/>
													<xsl:text> (</xsl:text>
													<xsl:call-template name="format-date">
														<xsl:with-param name="date">
															<xsl:value-of select="in:CreditNote/cac:DespatchDocumentReference/cbc:IssueDate"/>
														</xsl:with-param>
													</xsl:call-template>
													<xsl:text>)</xsl:text>
												</div>
											</xsl:if>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</div>
				<div class="page-break">
					<h1>Righe Nota di Credito</h1>
					<table class="righe-fattura" summary="righe fattura">
						<thead>
							<tr>
								<th scope="col" class="in-cell-filler-background" style="width: 14.2%">Nome / Descrizione / Note</th>
								<th scope="col" class="in-cell-filler-background" style="width: 7.1%">Cod. Articolo</th>
								<th scope="col" class="in-cell-filler-background" style="width: 7.1%">Quantità</th>
								<th scope="col" class="in-cell-filler-background" style="min-width: 40px; width: 7.1%">UdM</th>
								<th scope="col" class="in-cell-filler-background" style="width: 7.1%">Periodo di Riferimento</th>
								<th scope="col" class="in-cell-filler-background" style="width: 7.1%">Ordine di Acquisto</th>
								<th scope="col" class="in-cell-filler-background" style="width: 7.1%">Riferimento DDT</th>
								<th scope="col" class="in-cell-filler-background" style="width: 7.1%">Centro di Costo</th>
								<th scope="col" class="in-cell-filler-background" style="width: 7.1%">Prezzo Unitario</th>
								<th scope="col" class="in-cell-filler-background" style="width: 7.1%">Sconti / Maggiorazioni</th>
								<th scope="col" class="in-cell-filler-background" style="width: 7.1%">Imponibile</th>
								<th scope="col" class="in-cell-filler-background" style="width: 7.1%">Aliquota IVA</th>
								<th scope="col" class="in-cell-filler-background" style="min-width: 40px; width: 7.1%">Natura</th>
							</tr>
						</thead>
						<tbody>
							<xsl:for-each select="/in:CreditNote/cac:CreditNoteLine">
								<xsl:variable name="current-line" select="position()"/>
								<tr>
									<!--  Nome/Descrizione/Note  -->
									<td class="in-cell-base">
										<div class="box-text">
											<div class="no-margin">
												<xsl:value-of select="cac:Item/cbc:Name"/>
												<xsl:if test="cac:Item/cbc:Description">
													<xsl:text>: </xsl:text>
													<xsl:value-of select="cac:Item/cbc:Description"/>
												</xsl:if>
												<span style="width: 0.7em; display: inline-block;"> </span>
												<xsl:if test="cbc:Note">
													<xsl:value-of select="cbc:Note"/>
												</xsl:if>
												<xsl:if test="cac:Item/cac:AdditionalItemProperty">
													<xsl:for-each select="cac:Item/cac:AdditionalItemProperty">
														<ul style="border:0;margin:0;padding:0">
															<xsl:if test="not(cbc:Name eq 'NATURA')">
																<li style="list-style-type:none;">
																	<xsl:value-of select="cbc:Name"/>
																	<xsl:text>: </xsl:text>
																	<xsl:call-template name="format-pipe">
																		<xsl:with-param name="value">
																			<xsl:value-of select="./cbc:Value"/>
																		</xsl:with-param>
																	</xsl:call-template>
																	<xsl:if test="not(cbc:Name eq 'NATURA') and cbc:Name eq 'RITENUTA'">
																		<xsl:text> (</xsl:text>
																		<xsl:for-each select="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[contains(ext:ExtensionURI, 'urn:fdc:agid.gov.it:fatturapa:TipoRitenuta::')]">
																			<xsl:variable name="current-rt" select="position()"/>
																			<xsl:if test="substring-after(ext:ExtensionURI, 'urn:fdc:agid.gov.it:fatturapa:TipoRitenuta::') eq xs:string($current-line)">
																				<xsl:if test="not(xs:string($current-rt) eq xs:string('1'))">
																					<xsl:text>, </xsl:text>
																				</xsl:if>
																				<xsl:value-of select="ext:ExtensionContent/cbc:TypeCode"/>
																			</xsl:if>
																		</xsl:for-each>
																		<xsl:text>)</xsl:text>
																	</xsl:if>
																</li>
															</xsl:if>
														</ul>
													</xsl:for-each>
												</xsl:if>
											</div>
										</div>
										<xsl:if test="cac:Item/cac:CommodityClassification">
											<div class="box-text">
												<xsl:text>Categoria merceologica: </xsl:text>
												<ul style="border:0;margin:0;padding:0">
													<xsl:for-each select="cac:Item/cac:CommodityClassification">
														<li style="list-style-type:none;">
															<xsl:value-of select="cbc:ItemClassificationCode/@listID"/>
:
<xsl:value-of select="cbc:ItemClassificationCode"/>
														</li>
													</xsl:for-each>
												</ul>
											</div>
										</xsl:if>
									</td>
									<!--  Cod. Articolo  -->
									<td class="in-cell-base in-cell-data-center">
										<xsl:if test="cac:Item/cac:BuyersItemIdentification">
											<div class="box-text">
Identificativo del cliente:
<xsl:value-of select="cac:Item/cac:BuyersItemIdentification/cbc:ID"/>
											</div>
										</xsl:if>
										<xsl:if test="cac:Item/cac:SellersItemIdentification">
											<div class="box-text">
Identificativo del fornitore:
<xsl:value-of select="cac:Item/cac:SellersItemIdentification/cbc:ID"/>
											</div>
										</xsl:if>
										<xsl:if test="cac:Item/cac:StandardItemIdentification">
											<div class="box-text">
Identificativo standard:
<xsl:value-of select="cac:Item/cac:StandardItemIdentification/cbc:ID/@schemeID"/>
:
<xsl:value-of select="cac:Item/cac:StandardItemIdentification/cbc:ID"/>
											</div>
										</xsl:if>
									</td>
									<!--  Quantità  -->
									<td class="in-cell-base in-cell-data-center">
										<div class="box-text" align="right">
											<xsl:value-of select="format-number(cbc:CreditedQuantity, '#.##0,00########', 'number')"/>
										</div>
									</td>
									<!--  UdM  -->
									<td class="in-cell-base in-cell-data-center">
										<div class="box-text">
											<xsl:value-of select="if (document($xclUnitOfMeasureCode)//Value[@ColumnRef='xname']/SimpleValue[../../Value[@ColumnRef='code']/SimpleValue=current()/cbc:CreditedQuantity/@unitCode]) then document($xclUnitOfMeasureCode)//Value[@ColumnRef='xname']/SimpleValue[../../Value[@ColumnRef='code']/SimpleValue=current()/cbc:CreditedQuantity/@unitCode][1] else cbc:CreditedQuantity/@unitCode"/>
										</div>
									</td>
									<!--  Periodo di riferimento  -->
									<td class="in-cell-base in-cell-data-center">
										<xsl:if test="cac:InvoicePeriod">
											<div class="box-text">
												<xsl:if test="cac:InvoicePeriod/cbc:StartDate">
													<xsl:call-template name="format-date">
														<xsl:with-param name="date">
															<xsl:value-of select="cac:InvoicePeriod/cbc:StartDate"/>
														</xsl:with-param>
													</xsl:call-template>
												</xsl:if>
												<xsl:if test="cac:InvoicePeriod/cbc:StartDate and cac:InvoicePeriod/cbc:EndDate"> - </xsl:if>
												<xsl:if test="cac:InvoicePeriod/cbc:EndDate">
													<xsl:call-template name="format-date">
														<xsl:with-param name="date">
															<xsl:value-of select="cac:InvoicePeriod/cbc:EndDate"/>
														</xsl:with-param>
													</xsl:call-template>
												</xsl:if>
											</div>
										</xsl:if>
									</td>
									<!--  Ordine di Acquisto  -->
									<td class="in-cell-base ">
										<xsl:if test="cac:OrderLineReference">
											<xsl:for-each select="cac:OrderLineReference">
												<div class="box-text">
Riga Ordine:
<xsl:value-of select="cbc:LineID"/>
													<xsl:if test="cac:OrderReference">
														<br/>
														<xsl:text>Ordine: </xsl:text>
														<xsl:value-of select="cac:OrderReference/cbc:ID"/>
														<xsl:if test="cac:OrderReference/cbc:IssueDate">
															<xsl:text> del </xsl:text>
															<xsl:call-template name="format-date">
																<xsl:with-param name="date">
																	<xsl:value-of select="cac:OrderReference/cbc:IssueDate"/>
																</xsl:with-param>
															</xsl:call-template>
														</xsl:if>
													</xsl:if>
												</div>
											</xsl:for-each>
										</xsl:if>
										<xsl:if test="cac:DocumentReference">
											<xsl:for-each select="cac:DocumentReference">
												<div class="box-text">
													<xsl:if test="cbc:ID">
														<xsl:choose>
															<xsl:when test="cbc:ID/@schemeID='CT'">
																<xsl:text>Contratto: </xsl:text>
															</xsl:when>
															<xsl:when test="cbc:ID/@schemeID='ON'">
																<xsl:text>Tripletta: </xsl:text>
															</xsl:when>
															<xsl:when test="cbc:ID/@schemeID='AGB'">
																<xsl:text>CIG: </xsl:text>
															</xsl:when>
															<xsl:when test="cbc:ID/@schemeID='AEP'">
																<xsl:text>CUP: </xsl:text>
															</xsl:when>
															<xsl:when test="cbc:ID/@schemeID='AVV'">
																<xsl:text>Convenzione: </xsl:text>
															</xsl:when>
															<xsl:when test="cbc:ID/@schemeID='AOR'">
																<xsl:text>SAL: </xsl:text>
															</xsl:when>
															<xsl:otherwise>
																<xsl:text>Riferimento documento (</xsl:text>
																<xsl:value-of select="cbc:ID/@schemeID"/>
																<xsl:text>): </xsl:text>
															</xsl:otherwise>
														</xsl:choose>
													</xsl:if>
													<xsl:if test="not (cbc:ID/@schemeID)">
														<xsl:text>Riferimento documento: </xsl:text>
													</xsl:if>
													<xsl:value-of select="cbc:ID"/>
												</div>
											</xsl:for-each>
										</xsl:if>
									</td>
									<!--  Riferimento DDT  -->
									<td class="in-cell-base">
										<xsl:if test="cac:DespatchLineReference">
											<xsl:for-each select="cac:DespatchLineReference">
												<div class="box-text" align="left">
Riga
<xsl:value-of select="cbc:LineID"/>
													<xsl:text> (DDT n. </xsl:text>
													<xsl:value-of select="cac:DocumentReference/cbc:ID"/>
													<xsl:text> del </xsl:text>
													<xsl:call-template name="format-date">
														<xsl:with-param name="date">
															<xsl:value-of select="cac:DocumentReference/cbc:IssueDate"/>
														</xsl:with-param>
													</xsl:call-template>
													<xsl:text>)</xsl:text>
												</div>
											</xsl:for-each>
										</xsl:if>
									</td>
									<!--  Centro di Costo  -->
									<td class="in-cell-base in-cell-data-center">
										<div class="box-text" align="right">
											<xsl:value-of select="cbc:AccountingCost"/>
										</div>
									</td>
									<!--  Prezzo Unitario  -->
									<td class="in-cell-base in-cell-data-center">
										<div class="box-text" align="right">
											<xsl:call-template name="format-amount">
												<xsl:with-param name="amount">
													<xsl:value-of select="cac:Price/cbc:PriceAmount"/>
												</xsl:with-param>
											</xsl:call-template>
										</div>
									</td>
									<!-- Sconti / Magg. -->
									<td class="in-cell-base in-cell-data-center">
										<div class="box-text" align="right">
											<ul class="allowance-charge">
												<xsl:if test="cac:AllowanceCharge">
													<xsl:for-each select="cac:AllowanceCharge">
														<li>
															<xsl:if test="cbc:ChargeIndicator eq 'false'">
																<xsl:text>Sconto: </xsl:text>
															</xsl:if>
															<xsl:if test="cbc:ChargeIndicator eq 'true'">
																<xsl:text>Maggiorazione: </xsl:text>
															</xsl:if>
															<xsl:call-template name="format-amount-nofloat">
																<xsl:with-param name="amount">
																	<xsl:value-of select="cbc:Amount"/>
																</xsl:with-param>
															</xsl:call-template>
															<xsl:if test="cbc:BaseAmount">
																<xsl:text> su </xsl:text>
																<xsl:call-template name="format-amount-nofloat">
																	<xsl:with-param name="amount">
																		<xsl:value-of select="cbc:BaseAmount"/>
																	</xsl:with-param>
																</xsl:call-template>
															</xsl:if>
														</li>
													</xsl:for-each>
												</xsl:if>
												<xsl:if test="cac:Price/cac:AllowanceCharge">
													<li>
														<xsl:if test="cac:Price/cac:AllowanceCharge/cbc:ChargeIndicator eq 'false'">
															<xsl:text>Sconto sul prezzo: </xsl:text>
														</xsl:if>
														<xsl:if test="cac:Price/cac:AllowanceCharge/cbc:ChargeIndicator eq 'true'">
															<xsl:text>Maggiorazione sul prezzo: </xsl:text>
														</xsl:if>
														<xsl:call-template name="format-amount-nofloat">
															<xsl:with-param name="amount">
																<xsl:value-of select="cac:Price/cac:AllowanceCharge/cbc:Amount"/>
															</xsl:with-param>
														</xsl:call-template>
														<xsl:if test="cac:Price/cac:AllowanceCharge/cbc:BaseAmount">
															<xsl:text> su </xsl:text>
															<xsl:call-template name="format-amount-nofloat">
																<xsl:with-param name="amount">
																	<xsl:value-of select="cac:Price/cac:AllowanceCharge/cbc:BaseAmount"/>
																</xsl:with-param>
															</xsl:call-template>
														</xsl:if>
													</li>
												</xsl:if>
											</ul>
										</div>
									</td>
									<!--  Importo Imponibile  -->
									<td class="in-cell-base in-cell-data-center">
										<div class="box-text" align="right">
											<xsl:call-template name="format-amount">
												<xsl:with-param name="amount">
													<xsl:value-of select="cbc:LineExtensionAmount"/>
												</xsl:with-param>
											</xsl:call-template>
										</div>
									</td>
									<!--  Aliquota IVA  -->
									<td class="in-cell-base in-cell-data-center">
										<xsl:if test="cac:Item/cac:ClassifiedTaxCategory/cbc:Percent">
											<div class="box-text" align="center">
												<xsl:call-template name="format-amount">
													<xsl:with-param name="amount">
														<xsl:value-of select="cac:Item/cac:ClassifiedTaxCategory/cbc:Percent"/>
													</xsl:with-param>
												</xsl:call-template>
												<xsl:text>%</xsl:text>
											</div>
										</xsl:if>
									</td>
									<!--  Natura  -->
									<td class="in-cell-base in-cell-data-center">
										<xsl:if test="cac:Item/cac:AdditionalItemProperty">
											<xsl:for-each select="cac:Item/cac:AdditionalItemProperty">
												<xsl:if test="cbc:Name eq 'NATURA'">
													<div class="box-text" align="right">
														<xsl:value-of select="cbc:Value"/>
													</div>
												</xsl:if>
											</xsl:for-each>
										</xsl:if>
									</td>
								</tr>
							</xsl:for-each>
						</tbody>
					</table>
				</div>
				<xsl:if test="/in:CreditNote/cac:AllowanceCharge">
					<div class="page-break">
						<h1>Sconti/Maggiorazioni sul documento</h1>
						<table class="riepilogo-PDC" style="width: 33.4%">
							<thead>
								<tr>
									<th scope="col" class="w-50 in-cell-filler-background">Descrizione</th>
									<th scope="col" class="w-50 in-cell-filler-background">Importo</th>
								</tr>
							</thead>
							<tbody>
								<xsl:for-each select="/in:CreditNote/cac:AllowanceCharge">
									<xsl:if test="not(cbc:AllowanceChargeReasonCode eq'ZZZ') and not(upper-case(cbc:AllowanceChargeReason)='BOLLO')">
										<tr>
											<td class="in-cell-base in-cell-data-center">
												<xsl:if test="cbc:AllowanceChargeReason">
													<div class="box-text" align="left">
														<xsl:value-of select="cbc:AllowanceChargeReason"/>
													</div>
												</xsl:if>
											</td>
											<td class="in-cell-base in-cell-data-center w-20" style="min-width: 115px">
												<span class="box-text">
													<xsl:if test="cbc:ChargeIndicator eq 'false'">Sconto</xsl:if>
													<xsl:if test="cbc:ChargeIndicator eq 'true'">Maggiorazione</xsl:if>
													<xsl:if test="cbc:MultiplierFactorNumeric">
														<xsl:text> (</xsl:text>
														<xsl:value-of select="cbc:MultiplierFactorNumeric"/>
														<xsl:text>%)</xsl:text>
													</xsl:if>
													<xsl:text>: </xsl:text>
													<xsl:call-template name="format-amount">
														<xsl:with-param name="amount">
															<xsl:value-of select="cbc:Amount"/>
														</xsl:with-param>
													</xsl:call-template>
												</span>
											</td>
										</tr>
									</xsl:if>
									<xsl:if test="upper-case(cbc:AllowanceChargeReason)='BOLLO'">
										<tr>
											<td class="in-cell-base in-cell-data-center">
												<xsl:if test="cbc:AllowanceChargeReason">
													<div class="box-text" align="left">
														<xsl:value-of select="cbc:AllowanceChargeReason"/>
														<br/>
														<text class="law-warning" align="left">Bollo assolto virtualmente in ottemperanza all'art. 6, comma 2, del DM 17 Giugno 2014</text>
													</div>
												</xsl:if>
											</td>
											<td class="in-cell-base in-cell-data-center" style="min-width: 115px">
												<span class="box-text">
													<xsl:if test="cbc:ChargeIndicator eq 'false'">Sconto</xsl:if>
													<xsl:if test="cbc:ChargeIndicator eq 'true'">Maggiorazione</xsl:if>
													<xsl:if test="cbc:MultiplierFactorNumeric">
														<xsl:text> (</xsl:text>
														<xsl:value-of select="cbc:MultiplierFactorNumeric"/>
														<xsl:text>%)</xsl:text>
													</xsl:if>
													<xsl:text>: </xsl:text>
													<xsl:call-template name="format-amount">
														<xsl:with-param name="amount">
															<xsl:value-of select="cbc:Amount"/>
														</xsl:with-param>
													</xsl:call-template>
												</span>
											</td>
										</tr>
									</xsl:if>
								</xsl:for-each>
							</tbody>
						</table>
					</div>
				</xsl:if>
				<xsl:if test="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension">
					<xsl:for-each select="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension">
						<xsl:if test="ext:ExtensionURI eq 'urn:fdc:agid.gov.it:fatturapa:ScontoMaggiorazione'">
							<div class="page-break">
								<h1>Sconti/Maggiorazioni sul documento che non modificano l'Imponibile</h1>
								<table class="riepilogo-PDC" style="width: 16.7%">
									<thead>
										<tr>
											<th scope="col" class="w-100 in-cell-filler-background">Importo</th>
										</tr>
									</thead>
									<tbody>
										<xsl:for-each select="ext:ExtensionContent/cac:AllowanceCharge">
											<tr>
												<td class="in-cell-base in-cell-data-center" style="min-width: 115px">
													<span class="box-text">
														<xsl:if test="cbc:ChargeIndicator eq 'false'">Sconto</xsl:if>
														<xsl:if test="cbc:ChargeIndicator eq 'true'">Maggiorazione</xsl:if>
														<xsl:if test="cbc:MultiplierFactorNumeric">
															<xsl:text> (</xsl:text>
															<xsl:value-of select="cbc:MultiplierFactorNumeric"/>
															<xsl:text>%)</xsl:text>
														</xsl:if>
														<xsl:text>: </xsl:text>
														<xsl:call-template name="format-amount">
															<xsl:with-param name="amount">
																<xsl:value-of select="cbc:Amount"/>
															</xsl:with-param>
														</xsl:call-template>
													</span>
												</td>
											</tr>
										</xsl:for-each>
									</tbody>
								</table>
							</div>
						</xsl:if>
					</xsl:for-each>
				</xsl:if>
				<xsl:if test="/in:CreditNote/cac:CreditNoteLine/cbc:AccountingCost">
					<div class="page-break">
						<h1>Riepilogo Piano dei Conti</h1>
						<table id="riepilogo-PDC" class="riepilogo-PDC" style="width: 50.1%" summary="Riepilogo PDC">
							<thead>
								<tr>
									<th scope="col" class="in-cell-filler-background" style="width: 33.3%">Centro di Costo</th>
									<th scope="col" class="in-cell-filler-background" style="width: 33.3%">Totale Imponibile</th>
									<th scope="col" class="in-cell-filler-background" style="width: 33.3%">Totale Imposte</th>
								</tr>
							</thead>
							<tbody>
								<xsl:if test="not(/in:CreditNote/cac:CreditNoteLine/cbc:AccountingCost)">
									<tr>
										<td class="in-cell-base in-cell-data-center empty-cell-filler">
											<span class="box-text"> </span>
										</td>
										<td class="in-cell-base in-cell-data-center empty-cell-filler">
											<span class="box-text empty-cell-filler"> </span>
										</td>
										<td class="in-cell-base in-cell-data-center empty-cell-filler">
											<span class="box-text empty-cell-filler"> </span>
										</td>
									</tr>
								</xsl:if>
								<xsl:for-each-group select="/in:CreditNote/cac:CreditNoteLine" group-by="cbc:AccountingCost">
									<tr>
										<td class="in-cell-base in-cell-data-center">
											<div class="box-text" align="left">
												<xsl:value-of select="current-grouping-key()"/>
											</div>
										</td>
										<td class="in-cell-base in-cell-data-center">
											<div class="box-text" align="right">
												<xsl:call-template name="format-amount">
													<xsl:with-param name="amount">
														<xsl:value-of select="sum(current-group()/cbc:LineExtensionAmount/xs:decimal(.))"/>
													</xsl:with-param>
												</xsl:call-template>
											</div>
										</td>
										<td class="in-cell-base">
											<div class="box-text" align="right">
												<xsl:call-template name="format-amount">
													<xsl:with-param name="amount">
														<xsl:value-of select="sum(for $i in current-group() return $i/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent * $i/cbc:LineExtensionAmount div 100)"/>
													</xsl:with-param>
												</xsl:call-template>
											</div>
										</td>
									</tr>
								</xsl:for-each-group>
							</tbody>
						</table>
					</div>
				</xsl:if>
				<xsl:if test="//cac:WithholdingTaxTotal">
					<div class="page-break">
						<h1>Dati Ritenuta</h1>
						<table id="datiritenuta" class="riepilogo-PDC" style="width: 66.8%" summary="Dati Ritenuta">
							<thead>
								<tr>
									<th scope="col" class="w-25 in-cell-filler-background">Tipo Ritenuta</th>
									<th scope="col" class="w-25 in-cell-filler-background">Importo</th>
									<th scope="col" class="w-25 in-cell-filler-background">Imponibile</th>
									<th scope="col" class="w-25 in-cell-filler-background">Aliquota Ritenuta</th>
									<th scope="col" class="w-25 in-cell-filler-background">Causale Pagamento</th>
								</tr>
							</thead>
							<tbody>
								<xsl:for-each select="//cac:WithholdingTaxTotal/cac:TaxSubtotal">
									<tr>
										<td class="in-cell-base in-cell-data-center">
											<div class="box-text" align="center">
												<xsl:if test="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[contains(ext:ExtensionURI, 'TipoRitenuta')]">
													<xsl:variable name="index">
														<xsl:value-of select="position()"/>
													</xsl:variable>
													<xsl:choose>
														<xsl:when test="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[ext:ExtensionURI=concat('urn:fdc:agid.gov.it:fatturapa:TipoRitenuta::',$index)]/ext:ExtensionContent/cbc:TypeCode = 'RT01'">
															<span>Ritenuta Persone Fisiche (RT01)</span>
														</xsl:when>
														<xsl:when test="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[ext:ExtensionURI=concat('urn:fdc:agid.gov.it:fatturapa:TipoRitenuta::',$index)]/ext:ExtensionContent/cbc:TypeCode = 'RT02'">
															<span>Ritenuta persone giuridiche (RT02)</span>
														</xsl:when>
														<xsl:when test="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[ext:ExtensionURI=concat('urn:fdc:agid.gov.it:fatturapa:TipoRitenuta::',$index)]/ext:ExtensionContent/cbc:TypeCode = 'RT03'">
															<span>Contributo INPS (RT03)</span>
														</xsl:when>
														<xsl:when test="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[ext:ExtensionURI=concat('urn:fdc:agid.gov.it:fatturapa:TipoRitenuta::',$index)]/ext:ExtensionContent/cbc:TypeCode = 'RT04'">
															<span>Contributo Enasarco (RT04)</span>
														</xsl:when>
														<xsl:when test="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[ext:ExtensionURI=concat('urn:fdc:agid.gov.it:fatturapa:TipoRitenuta::',$index)]/ext:ExtensionContent/cbc:TypeCode = 'RT05'">
															<span>Contributo ENPAM (RT05)</span>
														</xsl:when>
														<xsl:when test="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[ext:ExtensionURI=concat('urn:fdc:agid.gov.it:fatturapa:TipoRitenuta::',$index)]/ext:ExtensionContent/cbc:TypeCode = 'RT06'">
															<span>Altro contributo previdenziale (RT06)</span>
														</xsl:when>
													</xsl:choose>
												</xsl:if>
												<xsl:if test="not(/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[contains(ext:ExtensionURI, 'TipoRitenuta')])">
													<xsl:choose>
														<xsl:when test="contains(upper-case(/in:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName), 'COGNOME') and contains(upper-case(/in:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName), 'NOME')">
															<span>Ritenuta Persone Fisiche (RT01)</span>
														</xsl:when>
														<xsl:otherwise>
															<span>Ritenuta Persone Giuridiche(RT02)</span>
														</xsl:otherwise>
													</xsl:choose>
												</xsl:if>
											</div>
										</td>
										<td class="in-cell-base in-cell-data-center">
											<div class="box-text" align="center">
												<xsl:call-template name="format-amount">
													<xsl:with-param name="amount">
														<xsl:value-of select="cbc:TaxAmount"/>
													</xsl:with-param>
												</xsl:call-template>
											</div>
										</td>
										<td class="in-cell-base in-cell-data-center">
											<div class="box-text" align="center">
												<xsl:call-template name="format-amount">
													<xsl:with-param name="amount">
														<xsl:value-of select="cbc:TaxableAmount"/>
													</xsl:with-param>
												</xsl:call-template>
											</div>
										</td>
										<td class="in-cell-base in-cell-data-center">
											<xsl:if test="cac:TaxCategory/cbc:Percent">
												<div class="box-text" align="center">
													<xsl:call-template name="format-amount">
														<xsl:with-param name="amount">
															<xsl:value-of select="cac:TaxCategory/cbc:Percent"/>
														</xsl:with-param>
													</xsl:call-template>
													<xsl:text>%</xsl:text>
												</div>
											</xsl:if>
										</td>
										<td class="in-cell-base in-cell-data-center">
											<div class="box-text" align="center">
												<xsl:value-of select="cac:TaxCategory/cac:TaxScheme/cbc:TaxTypeCode"/>
											</div>
										</td>
									</tr>
								</xsl:for-each>
							</tbody>
						</table>
					</div>
				</xsl:if>
				<xsl:variable name="reasonCode">
					<xsl:value-of select="/in:CreditNote/cac:AllowanceCharge/cbc:AllowanceChargeReasonCode"/>
				</xsl:variable>
				<xsl:if test="/in:CreditNote/cac:AllowanceCharge and contains(normalize-space($reasonCode), 'ZZZ')">
					<div class="page-break">
						<h1>Dati Cassa Previdenziale</h1>
						<table id="dati-cassa" class="riepilogo-PDC" summary="Dati Cassa Previdenziale">
							<thead>
								<tr>
									<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Tipo Cassa</th>
									<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Aliquota Cassa</th>
									<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Importo</th>
									<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Imponibile</th>
									<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Ritenuta</th>
									<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Natura</th>
								</tr>
							</thead>
							<tbody>
								<xsl:for-each select="/in:CreditNote/cac:AllowanceCharge">
									<xsl:if test="cbc:AllowanceChargeReasonCode eq 'ZZZ'">
										<xsl:variable name="charge-reason" select="cbc:AllowanceChargeReason"/>
										<tr>
											<td class="in-cell-base in-cell-data-center">
												<xsl:if test="cbc:AllowanceChargeReason">
													<div class="box-text" align="center">
														<xsl:value-of select="substring-before($charge-reason, '#')"/>
													</div>
												</xsl:if>
											</td>
											<td class="in-cell-base in-cell-data-center">
												<div class="box-text" align="center">
													<xsl:call-template name="format-amount">
														<xsl:with-param name="amount">
															<xsl:value-of select="cbc:MultiplierFactorNumeric"/>
														</xsl:with-param>
													</xsl:call-template>
													<xsl:text>%</xsl:text>
												</div>
											</td>
											<td class="in-cell-base in-cell-data-center">
												<div class="box-text" align="right">
													<xsl:call-template name="format-amount">
														<xsl:with-param name="amount">
															<xsl:value-of select="cbc:Amount"/>
														</xsl:with-param>
													</xsl:call-template>
												</div>
											</td>
											<td class="in-cell-base in-cell-data-center">
												<div class="box-text" align="right">
													<xsl:call-template name="format-amount">
														<xsl:with-param name="amount">
															<xsl:if test="cbc:BaseAmount">
																<xsl:value-of select="cbc:BaseAmount"/>
															</xsl:if>
														</xsl:with-param>
													</xsl:call-template>
												</div>
											</td>
											<td class="in-cell-base in-cell-data-center">
												<div class="box-text" align="right">
													<xsl:choose>
														<xsl:when test="contains(cbc:AllowanceChargeReason, 'SI')">SI</xsl:when>
														<xsl:when test="contains(cbc:AllowanceChargeReason, 'NO')">NO</xsl:when>
													</xsl:choose>
												</div>
											</td>
											<td class="in-cell-base in-cell-data-center">
												<xsl:if test="cbc:AllowanceChargeReason">
													<div class="box-text" align="center">
														<xsl:value-of select="tokenize($charge-reason, '#')[last()]"/>
													</div>
												</xsl:if>
											</td>
										</tr>
									</xsl:if>
								</xsl:for-each>
							</tbody>
						</table>
					</div>
				</xsl:if>
				<xsl:for-each select="in:CreditNote/cac:TaxTotal">
					<xsl:if test="cac:TaxSubtotal">
						<div class="page-break">
							<h1>Subtotali</h1>
							<h3 class="box-text">Riepilogo per imposta</h3>
							<h3 class="box-text">
								<xsl:if test="/in:CreditNote/cac:InvoicePeriod/cbc:DescriptionCode">
									<span>
IVA Esigibilità:
<xsl:choose>
											<xsl:when test="(/in:CreditNote/cac:InvoicePeriod/cbc:DescriptionCode = '3') or (/in:CreditNote/cac:InvoicePeriod/cbc:DescriptionCode ='35')"> I (esigibilità immediata) </xsl:when>
											<xsl:when test="/in:CreditNote/cac:InvoicePeriod/cbc:DescriptionCode = '432'"> D (esigibilità differita) </xsl:when>
											<xsl:otherwise> S (split payment) </xsl:otherwise>
										</xsl:choose>
									</span>
								</xsl:if>
								<xsl:if test="not(/in:CreditNote/cac:InvoicePeriod/cbc:DescriptionCode) and (/in:CreditNote/cac:TaxTotal//cac:TaxSubtotal/cac:TaxCategory/cbc:ID ='B')">
									<span>IVA Esigibilità: S (split payment)</span>
								</xsl:if>
							</h3>
							<table id="subtotali" class="riepilogo-PDC" summary="Subtotali">
								<thead>
									<tr>
										<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Natura</th>
										<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Categoria IVA</th>
										<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Imponibile</th>
										<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Aliquota IVA</th>
										<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Imposta</th>
										<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Arrotondamento</th>
									</tr>
								</thead>
								<tbody>
									<xsl:for-each select="cac:TaxSubtotal">
										<tr>
											<!--  Natura  -->
											<td class="in-cell-base in-cell-data-center">
												<xsl:if test="cac:TaxCategory/cbc:ID = 'Z'">
													<div class="box-text" align="center">N1 (escluse ex art. 15)</div>
												</xsl:if>
												<xsl:if test="cac:TaxCategory/cbc:TaxExemptionReason or cac:TaxCategory/cbc:TaxExemptionReasonCode">
													<div class="box-text" align="center">
														<xsl:variable name="exemption-reason" select="cac:TaxCategory/cbc:TaxExemptionReason"/>
														<xsl:choose>
															<xsl:when test="cac:TaxCategory/cbc:TaxExemptionReason and contains($exemption-reason, '#')">
																<xsl:value-of select="substring-before($exemption-reason, '#')"/>
																<xsl:text> (</xsl:text>
																<xsl:choose>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N1'">escluse ex art. 15</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N2.1'">non soggette ad IVA ai sensi degli artt. da 7 a 7-septies del DPR 633/72</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N2.2'">non soggette - altri casi</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N3.1'">non imponibili - esportazioni</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N3.2'">non imponibili - cessioni intracomunitarie</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N3.3'">non imponibili - cessioni verso San Marino</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N3.4'">non imponibili - operazioni assimilate alle cessioni all'esportazione</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N3.5'">non imponibili - a seguito di dichiarazioni d'intento</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N3.6'">non imponibili - altre operazioni</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N4'">esenti</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N5'">regime del margine / IVA non esposta in fattura</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N6.1'">inversione contabile - cessione di rottami e altri materiali di recupero</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N6.2'">inversione contabile - cessione di oro e argento puro</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N6.3'">inversione contabile - subappalto nel settore edile</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N6.4'">inversione contabile - cessione di fabbricati</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N6.5'">inversione contabile - cessione di telefoni cellulari</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N6.6'">inversione contabile - cessione di prodotti elettronici</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N6.7'">inversione contabile - prestazioni comparto edile e settori connessi</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N6.8'">inversione contabile - operazioni settore energetico</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N6.9'">inversione contabile - altri casi</xsl:when>
																	<xsl:when test="substring-before($exemption-reason, '#') eq 'N7'">IVA assolta in altro stato UE (vendite a distanza ex art. 40 c. 3 e 4 e art. 41 c. 1 lett. b, DL 331/93; prestazione di servizi di telecomunicazioni, teleradiodiffusione ed elettronici ex art. 7-sexies lett. f, g, art. 74-sexies DPR 633/72)</xsl:when>
																</xsl:choose>
																<xsl:text>)</xsl:text>
															</xsl:when>
															<xsl:when test="$exemption-reason and not(contains($exemption-reason, '#'))">
																<xsl:value-of select="$exemption-reason"/>
																<xsl:text> (</xsl:text>
																<xsl:choose>
																	<xsl:when test="$exemption-reason eq 'N1'">escluse ex art. 15</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N2.1'">non soggette ad IVA ai sensi degli artt. da 7 a 7-septies del DPR 633/72</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N2.2'">non soggette - altri casi</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N3.1'">non imponibili - esportazioni</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N3.2'">non imponibili - cessioni intracomunitarie</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N3.3'">non imponibili - cessioni verso San Marino</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N3.4'">non imponibili - operazioni assimilate alle cessioni all'esportazione</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N3.5'">non imponibili - a seguito di dichiarazioni d'intento</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N3.6'">non imponibili - altre operazioni</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N4'">esenti</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N5'">regime del margine / IVA non esposta in fattura</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N6.1'">inversione contabile - cessione di rottami e altri materiali di recupero</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N6.2'">inversione contabile - cessione di oro e argento puro</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N6.3'">inversione contabile - subappalto nel settore edile</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N6.4'">inversione contabile - cessione di fabbricati</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N6.5'">inversione contabile - cessione di telefoni cellulari</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N6.6'">inversione contabile - cessione di prodotti elettronici</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N6.7'">inversione contabile - prestazioni comparto edile e settori connessi</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N6.8'">inversione contabile - operazioni settore energetico</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N6.9'">inversione contabile - altri casi</xsl:when>
																	<xsl:when test="$exemption-reason eq 'N7'">IVA assolta in altro stato UE (vendite a distanza ex art. 40 c. 3 e 4 e art. 41 c. 1 lett. b, DL 331/93; prestazione di servizi di telecomunicazioni, teleradiodiffusione ed elettronici ex art. 7-sexies lett. f, g, art. 74-sexies DPR 633/72)</xsl:when>
																</xsl:choose>
																<xsl:text>)</xsl:text>
															</xsl:when>
															<xsl:otherwise>
																<xsl:if test="cac:TaxCategory/cbc:TaxExemptionReasonCode">
																	<xsl:text>Codice esenzione: </xsl:text>
																	<xsl:value-of select="cac:TaxCategory/cbc:TaxExemptionReasonCode"/>
																</xsl:if>
															</xsl:otherwise>
														</xsl:choose>
													</div>
												</xsl:if>
												<xsl:if test="cac:TaxCategory/cbc:TaxExemptionReason and contains(cac:TaxCategory/cbc:TaxExemptionReason, '#')">
													<div class="box-text" align="center">
														<b>Riferimento Normativo: </b>
														<xsl:value-of select="substring-after(cac:TaxCategory/cbc:TaxExemptionReason, '#')"/>
													</div>
												</xsl:if>
											</td>
											<!--  Categoria IVA  -->
											<td class="in-cell-base in-cell-data-center">
												<div class="box-text" align="center">
													<xsl:variable name="tax-category" select="cac:TaxCategory/cbc:ID"/>
													<xsl:value-of select="$tax-category"/>
													<xsl:text> (</xsl:text>
													<xsl:choose>
														<xsl:when test="$tax-category eq 'AE'">Inversione contabile</xsl:when>
														<xsl:when test="$tax-category eq 'Z'">Zero</xsl:when>
														<xsl:when test="$tax-category eq 'G'">Esportazioni/importazioni extracomunitarie</xsl:when>
														<xsl:when test="$tax-category eq 'E'">Esente</xsl:when>
														<xsl:when test="$tax-category eq 'S'">Imposta standard</xsl:when>
														<xsl:when test="$tax-category eq 'Z'">Esclusa ex art. 15</xsl:when>
														<xsl:when test="$tax-category eq 'G'">Non Imponibile (per le esportazioni)</xsl:when>
														<xsl:when test="$tax-category eq 'O'">Fuori campo IVA</xsl:when>
														<xsl:when test="$tax-category eq 'K'">Non Imponibile (per le esportazioni intra-EEA)</xsl:when>
														<xsl:when test="$tax-category eq 'L'">Imposta indiretta delle Isole Canarie</xsl:when>
														<xsl:when test="$tax-category eq 'M'">Imposta per la produzione, servizi e importazione in Ceuta e Melilla</xsl:when>
														<xsl:when test="$tax-category eq 'B'">Regime di Split Payment</xsl:when>
													</xsl:choose>
													<xsl:text>)</xsl:text>
												</div>
											</td>
											<!--  Imponibile  -->
											<td class="w-16 in-cell-base in-cell-data-center">
												<div class="box-text" align="right">
													<xsl:call-template name="format-amount">
														<xsl:with-param name="amount">
															<xsl:value-of select="cbc:TaxableAmount"/>
														</xsl:with-param>
													</xsl:call-template>
												</div>
											</td>
											<!--  Aliquota IVA  -->
											<td class="w-16 in-cell-base in-cell-data-center ">
												<xsl:if test="cac:TaxCategory/cbc:Percent">
													<div class="box-text" align="center">
														<xsl:call-template name="format-amount">
															<xsl:with-param name="amount">
																<xsl:value-of select="cac:TaxCategory/cbc:Percent"/>
															</xsl:with-param>
														</xsl:call-template>
														<xsl:text>%</xsl:text>
													</div>
												</xsl:if>
											</td>
											<!--  Imposta  -->
											<td class="w-16 in-cell-base in-cell-data-center">
												<div class="box-text" align="right">
													<xsl:call-template name="format-amount">
														<xsl:with-param name="amount">
															<xsl:value-of select="cbc:TaxAmount"/>
														</xsl:with-param>
													</xsl:call-template>
												</div>
											</td>
											<!--  Arrotondamento  -->
											<td class="w-16 in-cell-base in-cell-data-center">
												<div class="box-text" align="right">
													<xsl:variable name="index">
														<xsl:value-of select="position()"/>
													</xsl:variable>
													<xsl:call-template name="format-amount">
														<xsl:with-param name="amount">
															<xsl:value-of select="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[ext:ExtensionURI=concat('urn:fdc:agid.gov.it:fatturapa:RiepilogoIVA:Arrotondamento::',$index)]/ext:ExtensionContent/cbc:Amount"/>
														</xsl:with-param>
													</xsl:call-template>
												</div>
											</td>
										</tr>
									</xsl:for-each>
								</tbody>
							</table>
						</div>
					</xsl:if>
				</xsl:for-each>
				<xsl:if test="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionURI = 'urn:fdc:agid.gov.it:fatturapa:ScontoMaggiorazione'">
					<div class="page-break">
						<h1>Bollo</h1>
						<xsl:if test="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[ext:ExtensionURI = 'urn:fdc:agid.gov.it:fatturapa:ScontoMaggiorazione']/ext:ExtensionContent/cbc:Amount">
							<h3 class="box-text" style="margin-bottom:10px">
Importo bollo:
<xsl:value-of select="/in:CreditNote/ext:UBLExtensions/ext:UBLExtension[ext:ExtensionURI = 'urn:fdc:agid.gov.it:fatturapa:ScontoMaggiorazione']/ext:ExtensionContent/cbc:Amount"/>
EUR
</h3>
						</xsl:if>
						<span class="law-warning">Bollo assolto virtualmente in ottemperanza all'art. 6, comma 2, del DM 17 Giugno 2014 </span>
					</div>
				</xsl:if>
				<div class="page-break">
					<h1>Modalità  di pagamento</h1>
					<table id="info-pagamento" class="riepilogo-PDC" style="width: 50.1%" summary="Info pagamento">
						<thead>
							<tr>
								<th scope="col" class="in-cell-filler-background" style="width: 33.3%">Modalità di pagamento</th>
								<th scope="col" class="in-cell-filler-background" style="width: 33.3%">Estremi Pagamento</th>
								<th scope="col" class="in-cell-filler-background" style="width: 33.3%">Codice Identificativo Pagamento</th>
							</tr>
						</thead>
						<tbody>
							<xsl:for-each select="/in:CreditNote/cac:PaymentMeans">
								<tr>
									<td class="in-cell-base in-cell-data-center">
										<div class="box-text" align="left">
											<xsl:variable name="MP" select="cbc:PaymentMeansCode"/>
											<xsl:value-of select="$MP"/>
											<xsl:text>: </xsl:text>
											<xsl:choose>
												<xsl:when test="$MP eq '1'">contanti</xsl:when>
												<xsl:when test="$MP eq '2'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '3'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '4'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '5'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '6'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '7'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '8'">RIBA</xsl:when>
												<xsl:when test="$MP eq '9'">PagoPA</xsl:when>
												<xsl:when test="$MP eq '10'">Contanti</xsl:when>
												<xsl:when test="$MP eq '11'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '12'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '13'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '14'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '15'">bonifico</xsl:when>
												<xsl:when test="$MP eq '16'">bonifico</xsl:when>
												<xsl:when test="$MP eq '17'">contanti</xsl:when>
												<xsl:when test="$MP eq '18'">contanti</xsl:when>
												<xsl:when test="$MP eq '19'">contanti</xsl:when>
												<xsl:when test="$MP eq '20'">Assegno.</xsl:when>
												<xsl:when test="$MP eq '21'">Assegno Circolare.</xsl:when>
												<xsl:when test="$MP eq '22'">Assegno Circolare.</xsl:when>
												<xsl:when test="$MP eq '23'">Assegno Circolare.</xsl:when>
												<xsl:when test="$MP eq '24'">MAV</xsl:when>
												<xsl:when test="$MP eq '25'">Assegno</xsl:when>
												<xsl:when test="$MP eq '26'">Assegno</xsl:when>
												<xsl:when test="$MP eq '27'">contanti</xsl:when>
												<xsl:when test="$MP eq '28'">contanti</xsl:when>
												<xsl:when test="$MP eq '29'">contanti</xsl:when>
												<xsl:when test="$MP eq '30'">Bonifico</xsl:when>
												<xsl:when test="$MP eq '31'">MAV</xsl:when>
												<xsl:when test="$MP eq '32'">contanti</xsl:when>
												<xsl:when test="$MP eq '33'">contanti</xsl:when>
												<xsl:when test="$MP eq '34'">contanti</xsl:when>
												<xsl:when test="$MP eq '35'">contanti</xsl:when>
												<xsl:when test="$MP eq '36'">contanti</xsl:when>
												<xsl:when test="$MP eq '37'">contanti</xsl:when>
												<xsl:when test="$MP eq '38'">contanti</xsl:when>
												<xsl:when test="$MP eq '39'">contanti</xsl:when>
												<xsl:when test="$MP eq '40'">contanti</xsl:when>
												<xsl:when test="$MP eq '41'">contanti</xsl:when>
												<xsl:when test="$MP eq '42'">domiciliazione postale</xsl:when>
												<xsl:when test="$MP eq '43'">contanti</xsl:when>
												<xsl:when test="$MP eq '44'">RIBA</xsl:when>
												<xsl:when test="$MP eq '45'">bonifico</xsl:when>
												<xsl:when test="$MP eq '46'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '47'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '48'">Carte di pagamento</xsl:when>
												<xsl:when test="$MP eq '49'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '50'">Bollettino di c/c postale.</xsl:when>
												<xsl:when test="$MP eq '51'">bonifico</xsl:when>
												<xsl:when test="$MP eq '52'">contanti</xsl:when>
												<xsl:when test="$MP eq '53'">contanti</xsl:when>
												<xsl:when test="$MP eq '54'">Carte di pagamento</xsl:when>
												<xsl:when test="$MP eq '55'">Carte di pagamento</xsl:when>
												<xsl:when test="$MP eq '56'">bonifico</xsl:when>
												<xsl:when test="$MP eq '57'">Giroconto su conti di contabilità speciale</xsl:when>
												<xsl:when test="$MP eq '58'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '59'">SEPA Direct Debit</xsl:when>
												<xsl:when test="$MP eq '60'">Vaglia Cambiario</xsl:when>
												<xsl:when test="$MP eq '61'">Vaglia Cambiario</xsl:when>
												<xsl:when test="$MP eq '62'">Vaglia Cambiario</xsl:when>
												<xsl:when test="$MP eq '63'">Vaglia Cambiario</xsl:when>
												<xsl:when test="$MP eq '64'">Vaglia Cambiario</xsl:when>
												<xsl:when test="$MP eq '65'">Vaglia Cambiario</xsl:when>
												<xsl:when test="$MP eq '66'">Vaglia Cambiario</xsl:when>
												<xsl:when test="$MP eq '67'">Vaglia Cambiario</xsl:when>
												<xsl:when test="$MP eq '68'">bonifico</xsl:when>
												<xsl:when test="$MP eq '70'">RI.BA.</xsl:when>
												<xsl:when test="$MP eq '74'">MAV</xsl:when>
												<xsl:when test="$MP eq '75'">MAV</xsl:when>
												<xsl:when test="$MP eq '76'">MAV</xsl:when>
												<xsl:when test="$MP eq '77'">MAV</xsl:when>
												<xsl:when test="$MP eq '78'">MAV</xsl:when>
												<xsl:when test="$MP eq '91'">Assegno Circolare.</xsl:when>
												<xsl:when test="$MP eq '92'">Assegno.</xsl:when>
												<xsl:when test="$MP eq '93'">bonifico</xsl:when>
												<xsl:when test="$MP eq '94'">bonifico</xsl:when>
												<xsl:when test="$MP eq '95'">bonifico</xsl:when>
												<xsl:when test="$MP eq '96'">contanti</xsl:when>
												<xsl:when test="$MP eq '97'">Trattenuta su somme già riscosse</xsl:when>
												<xsl:when test="$MP eq 'ZZZ'">Contanti presso Tesoreria</xsl:when>
												<xsl:otherwise>
													<span>(!!! codice non previsto !!!)</span>
												</xsl:otherwise>
											</xsl:choose>
										</div>
									</td>
									<td class="in-cell-base in-cell-data-center">
										<div class="box-text" align="center">
											<xsl:if test="cac:PayeeFinancialAccount/cbc:ID">
												<span class="block">
													<xsl:text>IBAN: </xsl:text>
													<xsl:value-of select="cac:PayeeFinancialAccount/cbc:ID"/>
												</span>
											</xsl:if>
											<xsl:if test="cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID">
												<span class="block">
													<xsl:text>BIC: </xsl:text>
													<xsl:value-of select="cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID"/>
												</span>
											</xsl:if>
										</div>
									</td>
									<td class="in-cell-base in-cell-data-center">
										<div class="box-text">
											<xsl:value-of select="cbc:PaymentID"/>
										</div>
									</td>
								</tr>
							</xsl:for-each>
						</tbody>
					</table>
				</div>
				<div class="page-break">
					<h1>Termini di Pagamento</h1>
					<table id="termini-pagamento" class="riepilogo-PDC w-100" summary="Termini pagamento">
						<thead>
							<tr>
								<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Termine di Pagamento</th>
								<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Sconto Pagamento Anticipato</th>
								<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Data Limite Pagamento Anticipato</th>
								<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Penalità Pagamento Ritardato</th>
								<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Decorrenza Penalità </th>
								<th scope="col" class="in-cell-filler-background" style="width: 16.7%">Importo pagamento</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td class="in-cell-base in-cell-data-center">
									<div class="box-text" align="left">
										<xsl:variable name="paymentterms-note" select="/in:CreditNote/cac:PaymentTerms/cbc:Note"/>
										<xsl:choose>
											<xsl:when test="contains($paymentterms-note, '#')">
												<xsl:value-of select="substring-before($paymentterms-note, '#')"/>
												<xsl:text> - </xsl:text>
												<xsl:value-of select="substring-after($paymentterms-note, '#')"/>
												<xsl:text>gg</xsl:text>
											</xsl:when>
											<xsl:otherwise>
												<xsl:value-of select="$paymentterms-note"/>
											</xsl:otherwise>
										</xsl:choose>
									</div>
								</td>
								<td class="in-cell-base in-cell-data-center">
									<div class="box-text" align="right">
										<xsl:call-template name="format-amount">
											<xsl:with-param name="amount">
												<xsl:value-of select="/in:CreditNote/cac:PaymentTerms/cbc:SettlementDiscountAmount"/>
											</xsl:with-param>
										</xsl:call-template>
									</div>
								</td>
								<td class="in-cell-base in-cell-data-center">
									<div class="box-text">
										<xsl:call-template name="format-date">
											<xsl:with-param name="date">
												<xsl:value-of select="/in:CreditNote/cac:PaymentTerms/cac:SettlementPeriod/cbc:EndDate"/>
											</xsl:with-param>
										</xsl:call-template>
									</div>
								</td>
								<td class="in-cell-base in-cell-data-center">
									<div class="box-text" align="right">
										<xsl:call-template name="format-amount">
											<xsl:with-param name="amount">
												<xsl:value-of select="/in:CreditNote/cac:PaymentTerms/cbc:PenaltyAmount"/>
											</xsl:with-param>
										</xsl:call-template>
									</div>
								</td>
								<td class="in-cell-base in-cell-data-center">
									<div class="box-text">
										<xsl:call-template name="format-date">
											<xsl:with-param name="date">
												<xsl:value-of select="/in:CreditNote/cac:PaymentTerms/cac:PenaltyPeriod/cbc:StartDate"/>
											</xsl:with-param>
										</xsl:call-template>
									</div>
								</td>
								<td class="in-cell-base in-cell-data-center">
									<div class="box-text" align="right">
										<xsl:call-template name="format-amount">
											<xsl:with-param name="amount">
												<xsl:value-of select="/in:CreditNote/cac:LegalMonetaryTotal/cbc:PayableAmount"/>
											</xsl:with-param>
										</xsl:call-template>
									</div>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="page-break float-right-last">
					<h1>
Totale Documento:
<xsl:call-template name="format-amount">
							<xsl:with-param name="amount">
								<xsl:value-of select="/in:CreditNote/cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount"/>
							</xsl:with-param>
						</xsl:call-template>
						<xsl:text> </xsl:text>
						<xsl:value-of select="/in:CreditNote/cac:LegalMonetaryTotal/cbc:PayableAmount/@currencyID"/>
					</h1>
				</div>
				<xsl:if test="in:CreditNote/cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject">
					<xsl:variable name="NumAllegati">
						<xsl:value-of select="count(in:CreditNote/cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject)"/>
					</xsl:variable>
					<div style="margin-top: 10px" class="box-text">
						<span style="font-weight: bold">
							<xsl:if test="$NumAllegati =1 ">E' presente un allegato: </xsl:if>
							<xsl:if test="$NumAllegati >1">
Sono presenti
<xsl:value-of select="$NumAllegati"/>
allegati:
</xsl:if>
						</span>
						<ul class="attachment-list">
							<xsl:for-each select="in:CreditNote/cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject">
								<li style="list-style-type:disc">
									<xsl:value-of select="../../cbc:ID"/>
									<xsl:if test="../../cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@mimeCode">
(
<xsl:value-of select="../../cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@mimeCode"/>
)
</xsl:if>
								</li>
							</xsl:for-each>
						</ul>
					</div>
				</xsl:if>
			</body>
		</html>
	</xsl:template>
	<xsl:template name="in-id">
		<span class="box-text">
			<xsl:apply-templates mode="line" select="/in:CreditNote/cbc:ID"/>
		</span>
		<xsl:if test="/in:CreditNote/cbc:ID/@schemeID='art73dpr633/72'">
			<div class="box-text"> Art. 73 DPR 633/72: SI </div>
		</xsl:if>
	</xsl:template>
	<xsl:template name="format-amount-nofloat">
		<xsl:param name="amount"/>
		<xsl:if test="$amount and $amount != ''">
			<span nowrap="nowrap">
				<xsl:value-of select="format-number($amount, '#.##0,00########', 'number')"/>
			</span>
		</xsl:if>
	</xsl:template>
	<xsl:template name="in-currency">
		<span class="box-text">
			<xsl:apply-templates mode="line" select="/in:CreditNote/cbc:DocumentCurrencyCode"/>
		</span>
	</xsl:template>
	<xsl:template name="in-invoice-period">
		<xsl:if test="/in:CreditNote/cac:InvoicePeriod">
			<div class="box-text">
				<xsl:if test="/in:CreditNote/cac:InvoicePeriod/cbc:StartDate">
					<xsl:call-template name="format-date">
						<xsl:with-param name="date">
							<xsl:value-of select="/in:CreditNote/cac:InvoicePeriod/cbc:StartDate"/>
						</xsl:with-param>
					</xsl:call-template>
				</xsl:if>
				<xsl:if test="/in:CreditNote/cac:InvoicePeriod/cbc:StartDate and /in:CreditNote/cac:InvoicePeriod/cbc:EndDate"> - </xsl:if>
				<xsl:if test="/in:CreditNote/cac:InvoicePeriod/cbc:EndDate">
					<xsl:call-template name="format-date">
						<xsl:with-param name="date">
							<xsl:value-of select="/in:CreditNote/cac:InvoicePeriod/cbc:EndDate"/>
						</xsl:with-param>
					</xsl:call-template>
				</xsl:if>
			</div>
		</xsl:if>
	</xsl:template>
	<xsl:template name="format-date">
		<xsl:param name="date"/>
		<xsl:if test="$date and $date != ''">
			<xsl:value-of select="format-date($date, '[D01]/[M01]/[Y0001]')"/>
		</xsl:if>
	</xsl:template>
	<xsl:template name="in-supplier">
		<xsl:call-template name="in-party">
			<xsl:with-param name="party" select="/in:CreditNote/cac:AccountingSupplierParty/cac:Party"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template name="in-customer">
		<xsl:call-template name="in-party">
			<xsl:with-param name="party" select="/in:CreditNote/cac:AccountingCustomerParty/cac:Party"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template name="address">
		<xsl:param name="address"/>
		<xsl:if test="$address/cbc:StreetName">
			Indirizzo:  <xsl:value-of select="concat($address/cbc:StreetName, ' ')"/>
		</xsl:if>
		<xsl:if test="$address/cbc:AdditionalStreetName">
			<xsl:value-of select="concat($address/cbc:AdditionalStreetName, ' ')"/>
		</xsl:if>
		<xsl:if test="$address/cbc:PostalZone">
			<xsl:if test="$address/cbc:StreetName or $address/cbc:AdditionalStreetName">
				<xsl:text>- </xsl:text>
			</xsl:if>
			<xsl:value-of select="concat($address/cbc:PostalZone, ' ')"/>
		</xsl:if>
		<xsl:if test="$address/cbc:CityName">
			<xsl:value-of select="concat($address/cbc:CityName, ' ')"/>
		</xsl:if>
		<xsl:if test="$address/cbc:CountrySubentity">
			<xsl:text>(</xsl:text>
			<xsl:value-of select="$address/cbc:CountrySubentity"/>
			<xsl:text>) </xsl:text>
		</xsl:if>
		<xsl:if test="$address/cac:AddressLine/cbc:Line">
			<br/>
			<xsl:text>Ulteriori informazioni indirizzo: </xsl:text>
			<xsl:value-of select="$address/cac:AddressLine/cbc:Line"/>
		</xsl:if>
		<br/>
		<xsl:text>Codice Paese: </xsl:text>
		<xsl:value-of select="$address/cac:Country/cbc:IdentificationCode"/>
	</xsl:template>
	<xsl:template name="party-identification">
		<xsl:param name="identification"/>
		<xsl:if test="$identification/cbc:ID and not(contains($identification/cbc:ID, 'REA:'))">
			<div class="box-text">
Identificativo
<xsl:if test="$identification/cbc:ID/@schemeID">
					<xsl:choose>
						<xsl:when test="$identification/cbc:ID/@schemeID = '0211'">P.IVA</xsl:when>
						<xsl:when test="$identification/cbc:ID/@schemeID = '0210'">CF</xsl:when>
						<xsl:when test="$identification/cbc:ID/@schemeID = '0201'">IPA</xsl:when>
					</xsl:choose>
					<xsl:text> (</xsl:text>
					<xsl:value-of select="$identification/cbc:ID/@schemeID"/>
					<xsl:text>)</xsl:text>
					<xsl:text>: </xsl:text>
				</xsl:if>
				<xsl:value-of select="$identification/cbc:ID"/>
			</div>
		</xsl:if>
		<xsl:if test="$identification/cbc:ID and contains($identification/cbc:ID, 'REA:')">
			<div class="box-text">
Reg. Imprese della provincia di
<xsl:value-of select="substring-after(substring-before($identification/cbc:ID, '#'), 'REA:')"/>
n.
<xsl:value-of select="substring-after($identification/cbc:ID, '#')"/>
			</div>
		</xsl:if>
	</xsl:template>
	<xsl:template name="party-tax-scheme">
		<xsl:param name="scheme"/>
		<xsl:if test="$scheme/cac:TaxScheme/cbc:ID = 'VAT'">
			<span style="width:150px;display:inline-block;">
P.IVA:
<xsl:value-of select="$scheme/cbc:CompanyID"/>
			</span>
		</xsl:if>
	</xsl:template>
	<xsl:template name="party-legal-entity">
		<xsl:param name="legal-entity"/>
		<xsl:choose>
			<xsl:when test="contains($legal-entity/cbc:RegistrationName, 'Nome#Cognome')">
				<span>
Nome e Cognome:
<xsl:value-of select="replace(substring-after($legal-entity/cbc:RegistrationName, ':'), '#', ' ')"/>
				</span>
				<br/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$legal-entity/cbc:RegistrationName"/>
				<br/>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:if test="$legal-entity/cbc:CompanyID">
			<xsl:choose>
				<xsl:when test="$legal-entity/cbc:CompanyID/@schemeID = '0211'">P.IVA: </xsl:when>
				<xsl:when test="$legal-entity/cbc:CompanyID/@schemeID = '0210'">CF: </xsl:when>
			</xsl:choose>
			<xsl:value-of select="$legal-entity/cbc:CompanyID"/>
			<br/>
		</xsl:if>
		<xsl:if test="$legal-entity/cbc:CompanyLegalForm">
			<span>
Capitale sociale:
<xsl:value-of select="substring-before($legal-entity/cbc:CompanyLegalForm, '#')"/>
			</span>
			<br/>
			<xsl:choose>
				<xsl:when test="contains($legal-entity/cbc:CompanyLegalForm, '#SU')">
					<span>Tipo proprietario: SU (Socio Unico)</span>
					<br/>
				</xsl:when>
				<xsl:when test="contains($legal-entity/cbc:CompanyLegalForm, '#SM')">
					<span>Tipo proprietario: SM (più soci)</span>
					<br/>
				</xsl:when>
			</xsl:choose>
			<xsl:choose>
				<xsl:when test="contains($legal-entity/cbc:CompanyLegalForm, '#LN')">
					<span>Stato di liquidazione: Non in liquidazione</span>
					<br/>
				</xsl:when>
				<xsl:when test="contains($legal-entity/cbc:CompanyLegalForm, '#LS')">
					<span>Stato di liquidazione: In liquidazione</span>
					<br/>
				</xsl:when>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template name="party-name">
		<xsl:param name="name"/>
		<xsl:value-of select="$name/cbc:Name"/>
	</xsl:template>
	<xsl:template name="in-party">
		<xsl:param name="party"/>
		<xsl:choose>
			<xsl:when test="$party/cac:PartyName">
				<div class="box-text">
					<xsl:if test="$party = /in:CreditNote/cac:Delivery/cac:DeliveryParty">
						<xsl:text>Nome ricevente dei beni/servizi: </xsl:text>
					</xsl:if>
					<xsl:call-template name="party-name">
						<xsl:with-param name="name" select="$party/cac:PartyName"/>
					</xsl:call-template>
				</div>
			</xsl:when>
			<xsl:when test="(not ($party/cac:PartyName)) and $party/cac:PartyLegalEntity">
				<div class="box-text">
					<xsl:call-template name="party-legal-entity">
						<xsl:with-param name="legal-entity" select="$party/cac:PartyLegalEntity"/>
					</xsl:call-template>
				</div>
			</xsl:when>
		</xsl:choose>
		<xsl:if test="$party/cac:Contact/cac:Person">
			<div class="box-text">
				<xsl:value-of select="$party/cac:Contact/cac:Person/cbc:FirstName"/>
				<span style="min-width:1em;display:inline-block;"/>
				<xsl:value-of select="$party/cac:Contact/cac:Person/cbc:FamilyName"/>
			</div>
		</xsl:if>
		<xsl:if test="$party/cac:Person">
			<div class="box-text">
				<xsl:value-of select="$party/cac:Person/cbc:FirstName"/>
				<xsl:text> </xsl:text>
				<xsl:value-of select="$party/cac:Person/cbc:FamilyName"/>
				<xsl:if test="$party/cac:Person/cac:IdentityDocumentReference">
					<xsl:text> - documento di identità: </xsl:text>
					<xsl:value-of select="$party/cac:Person/cac:IdentityDocumentReference/cbc:ID"/>
				</xsl:if>
			</div>
		</xsl:if>
		<xsl:if test="$party/cbc:EndpointID">
			<div class="box-text">
				<xsl:text>Identificativo endpoint: </xsl:text>
				<xsl:value-of select="$party/cbc:EndpointID/@schemeID"/>
				<xsl:text>:</xsl:text>
				<xsl:value-of select="$party/cbc:EndpointID"/>
			</div>
		</xsl:if>
		<xsl:if test="$party/cbc:EndpointID[@schemeID='0201']">
			<div class="box-text">
				<xsl:text>Codice IPA: </xsl:text>
				<xsl:value-of select="$party/cbc:EndpointID"/>
			</div>
		</xsl:if>
		<xsl:if test="$party/cac:PartyIdentification">
			<xsl:for-each select="$party/cac:PartyIdentification">
				<xsl:call-template name="party-identification">
					<xsl:with-param name="identification" select="current()"/>
				</xsl:call-template>
			</xsl:for-each>
		</xsl:if>
		<xsl:if test="$party/cac:PostalAddress">
			<div class="box-text">
				<xsl:call-template name="address">
					<xsl:with-param name="address" select="$party/cac:PostalAddress"/>
				</xsl:call-template>
			</div>
		</xsl:if>
		<xsl:if test="$party/cac:PartyTaxScheme">
			<div class="box-text">
				<xsl:call-template name="party-tax-scheme">
					<xsl:with-param name="scheme" select="$party/cac:PartyTaxScheme"/>
				</xsl:call-template>
				<xsl:if test="$party/cac:PartyTaxScheme/cbc:TaxLevelCode">
					<br/>
					<xsl:text>Regime fiscale: </xsl:text>
					<xsl:value-of select="$party/cac:PartyTaxScheme/cbc:TaxLevelCode"/>
				</xsl:if>
			</div>
		</xsl:if>
		<xsl:if test="$party/cac:PartyName and $party/cac:PartyLegalEntity">
			<div class="box-text">
				<xsl:call-template name="party-legal-entity">
					<xsl:with-param name="legal-entity" select="$party/cac:PartyLegalEntity"/>
				</xsl:call-template>
			</div>
		</xsl:if>
		<xsl:if test="$party/cac:Contact">
			<div class="box-text">
				<xsl:if test="$party/cac:Contact/cbc:Name">
					<span>
Referente:
<xsl:value-of select="$party/cac:Contact/cbc:Name"/>
					</span>
					<br/>
				</xsl:if>
				<xsl:if test="$party/cac:Contact/cbc:Telephone">
					<span>
Telefono:
<xsl:value-of select="$party/cac:Contact/cbc:Telephone"/>
					</span>
					<br/>
				</xsl:if>
				<xsl:if test="$party/cac:Contact/cbc:ElectronicMail">
					<span>
Email:
<xsl:value-of select="$party/cac:Contact/cbc:ElectronicMail"/>
					</span>
					<br/>
				</xsl:if>
			</div>
		</xsl:if>
		<xsl:if test="$party/cac:AgentParty">
			<div class="box-text">
				<b>Stabile Organizzazione del Cedente/Prestatore:</b>
			</div>
			<div class="box-text">
				<xsl:call-template name="address">
					<xsl:with-param name="address" select="$party/cac:AgentParty/cac:PostalAddress"/>
				</xsl:call-template>
			</div>
		</xsl:if>
	</xsl:template>
	<xsl:template name="format-pipe">
		<xsl:param name="value"/>
		<xsl:if test="$value and $value != ''">
			<xsl:for-each select="tokenize($value,'\|')">
				<xsl:if test=". != ''">
					<xsl:sequence select="."/>
				</xsl:if>
			</xsl:for-each>
		</xsl:if>
	</xsl:template>
	<xsl:template name="format-amount">
		<xsl:param name="amount"/>
		<xsl:if test="$amount and $amount != ''">
			<xsl:choose>
				<xsl:when test="matches($amount, '^\-?[\d\.,]*[Ee][+\-]*\d*$')">
					<span nowrap="nowrap">
						<xsl:value-of select="format-number(number($amount), '#.##0,00########', 'number')"/>
					</span>
				</xsl:when>
				<xsl:otherwise>
					<span nowrap="nowrap">
						<xsl:value-of select="format-number(xs:decimal($amount), '#.##0,00########', 'number')"/>
					</span>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template name="allowance-charge">
		<xsl:param name="charge-indicator"/>
		<xsl:param name="amount"/>
		<xsl:if test="$charge-indicator = 'false'">-</xsl:if>
		<xsl:call-template name="format-amount">
			<xsl:with-param name="amount">
				<xsl:value-of select="$amount"/>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<xsl:template name="transport-data">
		<h2 class="in-box-label">Dati del trasporto</h2>
		<xsl:if test="/in:CreditNote/cac:Delivery/cac:Shipment/cbc:GrossWeightMeasure">
			<div class="box-text">
				<xsl:text>Peso lordo: </xsl:text>
				<xsl:value-of select="/in:CreditNote/cac:Delivery/cac:Shipment/cbc:GrossWeightMeasure"/>
				<xsl:text> </xsl:text>
				<xsl:value-of select="if (document($xclUnitOfMeasureCode)//Value[@ColumnRef='xname']/SimpleValue[../../Value[@ColumnRef='code']/SimpleValue=current()/in:CreditNote/cac:Delivery/cac:Shipment/cbc:GrossWeightMeasure/@unitCode]) then document($xclUnitOfMeasureCode)//Value[@ColumnRef='xname']/SimpleValue[../../Value[@ColumnRef='code']/SimpleValue=current()/in:CreditNote/cac:Delivery/cac:Shipment/cbc:GrossWeightMeasure/@unitCode][1] else /in:CreditNote/cac:Delivery/cac:Shipment/cbc:GrossWeightMeasure/@unitCode"/>
			</div>
		</xsl:if>
		<xsl:if test="/in:CreditNote/cac:Delivery/cac:Shipment/cbc:NetWeightMeasure">
			<div class="box-text">
				<xsl:text>Peso netto: </xsl:text>
				<xsl:value-of select="/in:CreditNote/cac:Delivery/cac:Shipment/cbc:NetWeightMeasure"/>
				<xsl:text> </xsl:text>
				<xsl:value-of select="if (document($xclUnitOfMeasureCode)//Value[@ColumnRef='xname']/SimpleValue[../../Value[@ColumnRef='code']/SimpleValue=current()/in:CreditNote/cac:Delivery/cac:Shipment/cbc:NetWeightMeasure/@unitCode]) then document($xclUnitOfMeasureCode)//Value[@ColumnRef='xname']/SimpleValue[../../Value[@ColumnRef='code']/SimpleValue=current()/in:CreditNote/cac:Delivery/cac:Shipment/cbc:NetWeightMeasure/@unitCode][1] else /in:CreditNote/cac:Delivery/cac:Shipment/cbc:NetWeightMeasure/@unitCode"/>
			</div>
		</xsl:if>
		<xsl:if test="/in:CreditNote/cac:Delivery/cac:Shipment/cbc:NetWeightMeasure">
			<div class="box-text">
				<xsl:text>Numero Colli: </xsl:text>
				<xsl:value-of select="/in:CreditNote/cac:Delivery/cac:Shipment/cbc:TotalTransportHandlingUnitQuantity"/>
			</div>
		</xsl:if>
		<xsl:if test="/in:CreditNote/cac:Delivery/cac:Shipment/cac:GoodsItem">
			<div class="box-text">
				<xsl:text>Descrizione: </xsl:text>
				<xsl:value-of select="/in:CreditNote/cac:Delivery/cac:Shipment/cac:GoodsItem/cbc:Description"/>
			</div>
		</xsl:if>
		<xsl:if test="/in:CreditNote/cac:Delivery/cac:Shipment/cac:ShipmentStage">
			<div class="box-text">
				<xsl:text>Mezzo di trasporto: </xsl:text>
				<xsl:value-of select="/in:CreditNote/cac:Delivery/cac:Shipment/cac:ShipmentStage/cbc:TransportMeansTypeCode"/>
			</div>
		</xsl:if>
		<xsl:if test="/in:CreditNote/cac:DeliveryTerms">
			<div class="box-text">
				<xsl:text>Tipo resa: </xsl:text>
				<xsl:value-of select="/in:CreditNote/cac:DeliveryTerms/cbc:ID"/>
			</div>
		</xsl:if>
		<xsl:if test="/in:CreditNote/cac:Delivery/cac:DeliveryLocation/cbc:ID or /in:CreditNote/cac:Delivery/cac:DeliveryLocation/cac:Address">
			<div class="box-text">
				<xsl:text>Indirizzo di resa: </xsl:text>
				<xsl:if test="/in:CreditNote/cac:Delivery/cac:DeliveryLocation/cbc:ID">
					<xsl:value-of select="/in:CreditNote/cac:Delivery/cac:DeliveryLocation/cbc:ID"/>
				</xsl:if>
				<xsl:if test="/in:CreditNote/cac:Delivery/cac:DeliveryLocation/cbc:ID and /in:CreditNote/cac:Delivery/cac:DeliveryLocation/cac:Address">
					<xsl:text>, </xsl:text>
				</xsl:if>
				<xsl:call-template name="address">
					<xsl:with-param name="address" select="/in:CreditNote/cac:Delivery/cac:DeliveryLocation/cac:Address"/>
				</xsl:call-template>
			</div>
		</xsl:if>
		<xsl:if test="/in:CreditNote/cac:Delivery/cac:DeliveryParty">
			<xsl:call-template name="in-party">
				<xsl:with-param name="party" select="/in:CreditNote/cac:Delivery/cac:DeliveryParty"/>
			</xsl:call-template>
		</xsl:if>
		<xsl:if test="/in:CreditNote/cac:Delivery/cac:Despatch/cbc:RequestedDespatchDate">
			<div class="box-text">
				<xsl:text>Data del ritiro della merce: </xsl:text>
				<xsl:call-template name="format-date">
					<xsl:with-param name="date">
						<xsl:value-of select="/in:CreditNote/cac:Delivery/cac:Despatch/cbc:RequestedDespatchDate"/>
					</xsl:with-param>
				</xsl:call-template>
			</div>
		</xsl:if>
		<xsl:if test="/in:CreditNote/cac:Delivery/cac:Despatch/cbc:RequestedDespatchTime">
			<div class="box-text">
				<xsl:text>Ora del ritiro della merce: </xsl:text>
				<xsl:value-of select="/in:CreditNote/cac:Delivery/cac:Despatch/cbc:RequestedDespatchTime"/>
			</div>
		</xsl:if>
		<xsl:if test="/in:CreditNote/cac:Delivery/cac:Despatch/cbc:ActualDespatchDate">
			<div class="box-text">
				<xsl:text>Data inizio trasporto: </xsl:text>
				<xsl:call-template name="format-date">
					<xsl:with-param name="date">
						<xsl:value-of select="/in:CreditNote/cac:Delivery/cac:Despatch/cbc:ActualDespatchDate"/>
					</xsl:with-param>
				</xsl:call-template>
			</div>
		</xsl:if>
		<xsl:if test="/in:CreditNote/cac:Delivery/cac:CarrierParty">
			<div class="box-text">
				<b>Vettore:</b>
			</div>
			<xsl:call-template name="in-party">
				<xsl:with-param name="party" select="/in:CreditNote/cac:Delivery/cac:CarrierParty"/>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>