MARX#36636: aansluiten leverancier Aalberts Bouw BV

svn path=/Website/branches/v2016.2/; revision=30936
This commit is contained in:
Marcel Bourseau
2016-09-30 13:19:39 +00:00
parent 36f1922ac7
commit 4982078c9f

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:etim="http://etim.nl/xmlschemas/messageservice/2.40" version="1.0">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="Invoice">
<xsl:comment>woconr;leveranciernr;factuurnr;factuurdatum;onderwerp;opdrachtnr;omschrijving;bedrag;btwperc;btwbedrag;btw_verlegd;document;iban;G_iban;G_bedrag</xsl:comment>
<xsl:for-each select="InvoiceLine">
<xsl:value-of select="../Invoicee/GLN"/>;<xsl:value-of select="../Invoicer/GLN"/>;<xsl:value-of select="../InvoiceNumber"/>;<xsl:value-of select="../InvoiceDate"/>;<xsl:call-template name="vrije_tekst"><xsl:with-param name="p_string" select="../FreeText"/></xsl:call-template>;<xsl:value-of select="../BuyersOrderNumber"/>;<xsl:call-template name="vrije_tekst"><xsl:with-param name="p_string" select="FreeText"/></xsl:call-template>;<xsl:value-of select="NetLineAmount"/>;<xsl:apply-templates select="VATInformation"/>;<xsl:value-of select="../Attachment/FileName"/>;<xsl:value-of select="../Supplier/AccountInformation/IBAN"/>;<xsl:value-of select="../PaymentOnBlockedAccount/IBAN"/>;<xsl:value-of select="../PaymentOnBlockedAccount/Amount"/>;&#10;</xsl:for-each>
</xsl:template>
<xsl:template match="VATInformation">
<!-- Deze template levert het gedeelte [btwperc;btwbedrag;btw_verlegd] op -->
<!-- Let even op: geen voorgaande ; en zeker ook geen ; op einde, dat gebeurt in de aanroepende regel (hierboven dus) -->
<!-- Let op: btw bedrag wordt niet uit SidB uit de node InvoiceLine aangeboden, dus deze is hier altijd leeg. -->
<xsl:choose>
<xsl:when test="VATRate = 'E'">
<!-- BTW verlegd = Ja, en neem BTW-percentage over uit XML, indien deze NIET(!) staat ingevuld (hoeft kennelijk niet in SidB/volgens wet, zet dan hard 21% hier in -->
<xsl:choose>
<xsl:when test="VATPercentage != ''"><xsl:value-of select="VATPercentage"/>;;Ja</xsl:when>
<xsl:otherwise>21;;Ja</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- BTW verlegd = Nee (Vatrate is dan S), veld btw_verlegd in CSV gewoon leeg laten, en neem BTW-percentage over uit XML -->
<xsl:otherwise><xsl:value-of select="VATPercentage"/>;;</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="vrije_tekst">
<xsl:param name="p_string"/>
<xsl:variable name="l_string_esc_quotes"><xsl:call-template name="escape_quote"><xsl:with-param name="string" select="$p_string"/></xsl:call-template></xsl:variable>
<xsl:variable name="l_string_esc_linebreaks"><xsl:call-template name="escape_linebreaks"><xsl:with-param name="string" select="$l_string_esc_quotes"/></xsl:call-template></xsl:variable>"<xsl:value-of select="$l_string_esc_linebreaks"/>"</xsl:template>
<xsl:template name="escape_quote">
<xsl:param name="string"/>
<xsl:choose>
<xsl:when test="contains($string, '&quot;')"><xsl:value-of select="substring-before($string, '&quot;')"/>&quot;&quot;<xsl:call-template name="escape_quote">
<xsl:with-param name="string" select="substring-after($string, '&quot;')"/></xsl:call-template></xsl:when>
<xsl:otherwise><xsl:value-of select="$string"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="escape_linebreaks">
<xsl:param name="string"/>
<xsl:choose>
<xsl:when test="contains($string, '&#xA;')"><xsl:value-of select="substring-before($string, '&#xA;')"/>@@<xsl:call-template name="escape_linebreaks">
<xsl:with-param name="string" select="substring-after($string, '&#xA;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="$string"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="//etim:MsgContent"/>
</xsl:template>
</xsl:stylesheet>