<ViewDefinitions xmlns="http://www.windex.nl/schemas/viewdefinition/2007">
	<Views>
		<View Name="WebPartPage_FaultedSyncInvoiceView" HiddenColumnIds="0;7;8" ColumnWidths="110px;100px;105px;250px;50px;40px;35px;auto" DefaultOrderColumn="1">
			<Popup Ordinal="9" Width="500px">
				<Data>
					<Collection Name="ExternalSyncStatuses">
						<Property Name="ExternalSystem"/>
						<Property Name="SyncTimestamp"/>
						<Property Name="ApiResponse"/>
					</Collection>
				</Data>
				<Transform>
					<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
						<xsl:output method="html" indent="yes"/>

						<xsl:template match='/Invoice'>
							<table style="line-height: 16px;">
								<tr>
									<td>
										<b>Extern systeem</b>
										<hr/>
									</td>
									<td>
										<b>Resultaat laatste synchronisatie</b>
										<hr/>
									</td>
								</tr>
								<xsl:apply-templates select="ExternalSyncStatus"/>
							</table>
						</xsl:template>

						<xsl:template match='ExternalSyncStatus'>
							<tr>
								<td style="white-space: nowrap;">
									<xsl:value-of select="@ExternalSystem/."/>
								</td>
								<td>
									<xsl:choose>
										<xsl:when test="@ApiResponse/. = ''">
											<font color="green">
												Gesynchroniseerd op <xsl:value-of select="@SyncTimestamp/."/>
											</font>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="@ApiResponse/." disable-output-escaping="yes"/>
										</xsl:otherwise>
									</xsl:choose>
								</td>
							</tr>
						</xsl:template>

					</xsl:stylesheet>
				</Transform>
			</Popup>
			<Columns>
				<XsltColumn HeaderText="Factuurdatum" Ordinal="2" OrderBy="Date">
					<Transform>
						<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
							<xsl:output method="html" indent="yes"/>
							<xsl:template match="/Row">
								<xsl:variable name="date" select="Column[@name='Datum']/."/>
								<xsl:variable name="time" select="substring-after($date, ' ')"/>
								<xsl:choose>
									<xsl:when test="$time = '0:00:00'">
										<xsl:value-of select="substring-before($date, ' ')"/>
									</xsl:when>
									<xsl:otherwise>
										<xsl:value-of select="substring($date, 1, string-length($date) - 3)"/>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:template>
						</xsl:stylesheet>
					</Transform>
				</XsltColumn>
				<XsltColumn HeaderText="PDF" Ordinal="9" OrderBy="PDFUrl">
					<Transform>
						<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
							<xsl:output method="html" indent="yes"/>
							<xsl:template match="/Row">
								<a target="_blank">
									<xsl:attribute name="href">
										<xsl:value-of select="Column[@name='PDFUrl']/."/>
									</xsl:attribute>
									Link
								</a>
							</xsl:template>
						</xsl:stylesheet>
					</Transform>
				</XsltColumn>
			</Columns>
		</View>
		<View Name="WebPartPage_FaultedSyncOrganizationView" HiddenColumnIds="0" ColumnWidths="100px;250px;200px;auto" DefaultOrderColumn="2">
			<Popup Ordinal="5" Width="500px">
				<Data>
					<Collection Name="ExternalSyncStatuses">
						<Property Name="ExternalSystem"/>
						<Property Name="SyncTimestamp"/>
						<Property Name="ApiResponse"/>
					</Collection>
				</Data>
				<Transform>
					<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
						<xsl:output method="html" indent="yes"/>

						<xsl:template match='/Organization'>
							<table style="line-height: 16px;">
								<tr>
									<td>
										<b>Extern systeem</b>
										<hr/>
									</td>
									<td>
										<b>Resultaat laatste synchronisatie</b>
										<hr/>
									</td>
								</tr>
								<xsl:apply-templates select="ExternalSyncStatus"/>
							</table>
						</xsl:template>

						<xsl:template match='ExternalSyncStatus'>
							<tr>
								<td style="white-space: nowrap;">
									<xsl:value-of select="@ExternalSystem/."/>
								</td>
								<td>
									<xsl:choose>
										<xsl:when test="@ApiResponse/. = ''">
											<font color="green">
												Gesynchroniseerd op <xsl:value-of select="@SyncTimestamp/."/>
											</font>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="@ApiResponse/." disable-output-escaping="yes"/>
										</xsl:otherwise>
									</xsl:choose>
								</td>
							</tr>
						</xsl:template>

					</xsl:stylesheet>
				</Transform>
			</Popup>
		</View>
		<View Name="WebPartPage_FaultedSyncPersonView" HiddenColumnIds="0" ColumnWidths="100px;250px;200px;auto" DefaultOrderColumn="2">
			<Popup Ordinal="5" Width="500px">
				<Data>
					<Collection Name="ExternalSyncStatuses">
						<Property Name="ExternalSystem"/>
						<Property Name="SyncTimestamp"/>
						<Property Name="ApiResponse"/>
					</Collection>
				</Data>
				<Transform>
					<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
						<xsl:output method="html" indent="yes"/>

						<xsl:template match='/Person'>
							<table style="line-height: 16px;">
								<tr>
									<td>
										<b>Extern systeem</b>
										<hr/>
									</td>
									<td>
										<b>Resultaat laatste synchronisatie</b>
										<hr/>
									</td>
								</tr>
								<xsl:apply-templates select="ExternalSyncStatus"/>
							</table>
						</xsl:template>

						<xsl:template match='ExternalSyncStatus'>
							<tr>
								<td style="white-space: nowrap;">
									<xsl:value-of select="@ExternalSystem/."/>
								</td>
								<td>
									<xsl:choose>
										<xsl:when test="@ApiResponse/. = ''">
											<font color="green">
												Gesynchroniseerd op <xsl:value-of select="@SyncTimestamp/."/>
											</font>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="@ApiResponse/." disable-output-escaping="yes"/>
										</xsl:otherwise>
									</xsl:choose>
								</td>
							</tr>
						</xsl:template>

					</xsl:stylesheet>
				</Transform>
			</Popup>
		</View>
	</Views>
</ViewDefinitions>