Localized invoices

This commit is contained in:
skyanth
2016-09-30 16:59:35 +02:00
parent b12cac52f4
commit 5025d92119
6 changed files with 107 additions and 33 deletions

View File

@@ -14,13 +14,15 @@
<xs:element ref="servicesdelivered" minOccurs="1" maxOccurs="1"/>
<xs:element ref="additionalcosts" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute ref="xml:lang"/>
<xs:attribute name="invoice_no" type="xs:string"/>
<xs:attribute name="date" type="xs:date" use="optional"/>
<xs:attribute name="denomination" use="optional" default="euro">
<xs:attribute name="denomination" use="optional" default="eur">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="euro"/>
<xs:enumeration value="dollar"/>
<xs:enumeration value="eur"/>
<xs:enumeration value="usd"/>
<xs:enumeration value="gbp"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>

View File

@@ -35,6 +35,68 @@
<translation xml:lang="nl">Kamer van Koophandel</translation>
<translation xml:lang="en">Chamber of Commerce</translation>
</string>
<string id="invoice_no">
<translation xml:lang="nl">Factuur nr.</translation>
<translation xml:lang="en">Invoice no.</translation>
</string>
<string id="invoice_fao">
<translation xml:lang="nl">T.a.v.</translation>
<translation xml:lang="en">F.a.o.</translation>
</string>
<string id="invoice_svcdeliv">
<translation xml:lang="nl">Geleverde diensten</translation>
<translation xml:lang="en">Services delivered</translation>
</string>
<string id="invoice_days">
<translation xml:lang="nl">daagse</translation>
<translation xml:lang="en">day</translation>
</string>
<string id="invoice_vat">
<translation xml:lang="nl">BTW</translation>
<translation xml:lang="en">VAT</translation>
</string>
<string id="invoice_vatno">
<translation xml:lang="nl">BTW-nummer</translation>
<translation xml:lang="en">VAT number</translation>
</string>
<string id="invoice_additional">
<translation xml:lang="nl">Extra gemaakte kosten</translation>
<translation xml:lang="en">Additional expenses</translation>
</string>
<string id="invoice_total">
<translation xml:lang="nl">Totaal te betalen</translation>
<translation xml:lang="en">Total amount to be paid</translation>
</string>
<string id="invoice_donation">
<translation xml:lang="nl">doneert > 90% van haar totale winst aan goede doelen.</translation>
<translation xml:lang="en">donates > 90% of its entire profits to
charity.</translation>
</string>
<string id="invoice_pleasepay">
<translation xml:lang="nl">Maak binnen 30 dagen het totale bedrag over op de volgende rekening:</translation>
<translation xml:lang="en">Please be so kind to pay within 30 days
by money transfer, to the following account:</translation>
</string>
<string id="invoice_iban">
<translation xml:lang="nl">IBAN</translation>
<translation xml:lang="en">IBAN</translation>
</string>
<string id="invoice_ref">
<translation xml:lang="nl">Referentie</translation>
<translation xml:lang="en">Reference</translation>
</string>
<string id="invoice_regards">
<translation xml:lang="nl">Met vriendelijke groet</translation>
<translation xml:lang="en">Kind regards</translation>
</string>
<string id="invoice_team">
<translation xml:lang="nl">uw team bij</translation>
<translation xml:lang="en">your dedicated team at</translation>
</string>
<string id="invoice_yaygreen">
<translation xml:lang="nl">Spaar papier — niet afdrukken tenzij absoluut noodzakelijk. Lees onze (unieke) voorwaarden op: https://radicallyopensecurity.com/TermsandConditions.pdf</translation>
<translation xml:lang="en">Please keep digital unless absolutely required. Read the (unique) terms and conditions of Radically Open Security at: https://radicallyopensecurity.com/TermsandConditions.pdf</translation>
</string>
<string id="qs2off_about">
<translation xml:lang="nl">Over <client_short/></translation>
<translation xml:lang="en">About <client_short/></translation>

View File

@@ -21,9 +21,11 @@
<xsl:import href="waiver.xslt"/>-->
<xsl:include href="styles_inv.xslt"/>
<xsl:include href="localisation.xslt"/>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:variable name="lang" select="/*/@xml:lang"/>
<!-- ****** AUTO_NUMBERING_FORMAT: value of the <xsl:number> element used for auto numbering -->
<!--<xsl:param name="AUTO_NUMBERING_FORMAT" select="'1.1.1'"/>-->
@@ -60,8 +62,9 @@
<xsl:variable name="vat" select="$fee div 100 * 21"/>
<xsl:variable name="denomination">
<xsl:choose>
<xsl:when test="/offerte/meta/pentestinfo/fee/@denomination = 'euro'"></xsl:when>
<xsl:when test="/offerte/meta/pentestinfo/fee/@denomination = 'dollar'">$</xsl:when>
<xsl:when test="/offerte/meta/pentestinfo/fee/@denomination = 'eur'"></xsl:when>
<xsl:when test="/offerte/meta/pentestinfo/fee/@denomination = 'gbp'">£</xsl:when>
<xsl:when test="/offerte/meta/pentestinfo/fee/@denomination = 'usd'">$</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="invoiceStart">
@@ -75,7 +78,8 @@
<fo:table-body>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block><xsl:value-of select="/offerte/meta/pentestinfo/duration"/>-day&#160;<xsl:value-of select="/offerte/meta/offered_service_short"/>&#160;<xsl:value-of select="/offerte/meta/permission_parties/client/short_name"/></fo:block>
<fo:block><xsl:value-of select="/offerte/meta/pentestinfo/duration"/>-
<xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_days'"/></xsl:call-template>&#160;<xsl:value-of select="/offerte/meta/offered_service_short"/>&#160;<xsl:value-of select="/offerte/meta/permission_parties/client/short_name"/></fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td align-right">
<fo:block xsl:use-attribute-sets="p"><xsl:value-of select="$denomination"/>&#160;<xsl:number value="$fee" grouping-separator="," grouping-size="3"/>.--</fo:block>
@@ -83,7 +87,7 @@
</fo:table-row>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>VAT 21%</fo:block>
<fo:block><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_vat'"/></xsl:call-template> 21%</fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td align-right">
<fo:block xsl:use-attribute-sets="p"><xsl:value-of select="$denomination"/>&#160;<xsl:number value="$vat" grouping-separator="," grouping-size="3"/>.--</fo:block>
@@ -91,7 +95,7 @@
</fo:table-row>
<fo:table-row xsl:use-attribute-sets="border-top bold">
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>Total amount to be paid</fo:block>
<fo:block><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_total'"/></xsl:call-template></fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td align-right">
<fo:block xsl:use-attribute-sets="p"><xsl:value-of select="$denomination"/>&#160;<xsl:number value="$vat + $fee" grouping-separator="," grouping-size="3"/>.--</fo:block>
@@ -108,8 +112,9 @@
<xsl:template name="custom_invoice">
<xsl:variable name="denomination">
<xsl:choose>
<xsl:when test="/invoice/@denomination = 'euro'"></xsl:when>
<xsl:when test="/invoice/@denomination = 'dollar'">$</xsl:when>
<xsl:when test="/invoice/@denomination = 'usd'">$</xsl:when>
<xsl:when test="/invoice/@denomination = 'eur'"></xsl:when>
<xsl:when test="/invoice/@denomination = 'gbp'">£</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="invoiceStart">
@@ -135,7 +140,7 @@
<xsl:if test="additionalcosts">
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td padding-top">
<fo:block xsl:use-attribute-sets="bold">Additional Expenses</fo:block>
<fo:block xsl:use-attribute-sets="bold"><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_additional'"/></xsl:call-template></fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td align-right padding-top">
<fo:block xsl:use-attribute-sets="p">&#160;</fo:block>
@@ -163,7 +168,7 @@
</xsl:variable>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td padding-top">
<fo:block>VAT 21%</fo:block>
<fo:block><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_vat'"/></xsl:call-template> 21%</fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td align-right padding-top">
<fo:block xsl:use-attribute-sets="p"><xsl:value-of select="$denomination"/>&#160;<xsl:number value="$vat" grouping-separator="," grouping-size="3"/>.--</fo:block>
@@ -171,7 +176,7 @@
</fo:table-row>
<fo:table-row xsl:use-attribute-sets="border-top bold">
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>Total amount to be paid</fo:block>
<fo:block><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_total'"/></xsl:call-template></fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td align-right">
<fo:block xsl:use-attribute-sets="p"><xsl:value-of select="$denomination"/>&#160;<xsl:number value="$total" grouping-separator="," grouping-size="3"/>.--</fo:block>
@@ -188,14 +193,14 @@
<xsl:template name="invoiceStart">
<xsl:param name="INVOICE_NO"/>
<xsl:param name="DATE"/>
<fo:block xsl:use-attribute-sets="title-0">Invoice nr. <xsl:value-of select="$INVOICE_NO"
<fo:block xsl:use-attribute-sets="title-0"><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_no'"/></xsl:call-template><xsl:text>&#160;</xsl:text><xsl:value-of select="$INVOICE_NO"
/></fo:block>
<fo:block>
<fo:block>
<xsl:value-of select="/*/meta//client/full_name"/>
</fo:block>
<fo:block>
<xsl:if test="/*/meta//client/invoice_rep">T.a.v. <xsl:value-of
<xsl:if test="/*/meta//client/invoice_rep"><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_fao'"/></xsl:call-template><xsl:text>&#160;</xsl:text><xsl:value-of
select="/offerte/meta/permission_parties/client/invoice_rep"/></xsl:if>
</fo:block>
<fo:block>
@@ -215,27 +220,26 @@
<fo:block xsl:use-attribute-sets="p big-space-below" text-align="right">
<xsl:value-of select="$DATE"/>
</fo:block>
<fo:block xsl:use-attribute-sets="title-2">Services Delivered</fo:block>
<fo:block xsl:use-attribute-sets="title-2"><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_svcdeliv'"/></xsl:call-template></fo:block>
</xsl:template>
<xsl:template name="invoiceEnd">
<xsl:param name="INVOICE_NO"/>
<fo:block xsl:use-attribute-sets="big-space-below"><xsl:value-of
select="/*/meta/company/full_name"/> donates > 90% of its entire profits to
charity.</fo:block>
<fo:block xsl:use-attribute-sets="big-space-below">Please be so kind to pay within 30 days
by money transfer, to the following account:</fo:block>
select="/*/meta/company/full_name"/><xsl:text>&#160;</xsl:text><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_donation'"/></xsl:call-template></fo:block>
<fo:block xsl:use-attribute-sets="big-space-below"><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_pleasepay'"/></xsl:call-template></fo:block>
<fo:block xsl:use-attribute-sets="big-space-below" margin-left="1.3cm">
<fo:block>
<xsl:value-of select="/*/meta/company/full_name"/>
</fo:block>
<fo:block>IBAN: <xsl:value-of select="/*/meta/company/iban"/></fo:block>
<fo:block>Reference: <xsl:value-of select="$INVOICE_NO"/></fo:block>
<fo:block>
<xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_iban'"/></xsl:call-template>: <xsl:value-of select="/*/meta/company/iban"/></fo:block>
<fo:block><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_ref'"/></xsl:call-template>: <xsl:value-of select="$INVOICE_NO"/></fo:block>
</fo:block>
<fo:block>Kind regards,</fo:block>
<fo:block>your dedicated team at</fo:block>
<fo:block><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_regards'"/></xsl:call-template>,</fo:block>
<fo:block><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_team'"/></xsl:call-template></fo:block>
<fo:block font-style="italic">
<xsl:value-of select="/*/meta/company/full_name"/>
</fo:block>
@@ -285,8 +289,8 @@
<fo:block xsl:use-attribute-sets="TinyFont">
<fo:block xsl:use-attribute-sets="bold orange-text"><xsl:value-of select="/*/meta/company/website"/></fo:block>
<fo:block><xsl:value-of select="/*/meta/company/email"/></fo:block>
<fo:block>Chamber of Commerce <xsl:value-of select="/*/meta/company/coc"/></fo:block>
<fo:block>VAT number <xsl:value-of select="/*/meta/company/vat_no"/></fo:block>
<fo:block><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'page_kvk'"/></xsl:call-template><xsl:text>&#160;</xsl:text><xsl:value-of select="/*/meta/company/coc"/></fo:block>
<fo:block><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_vatno'"/></xsl:call-template><xsl:text>&#160;</xsl:text><xsl:value-of select="/*/meta/company/vat_no"/></fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>
@@ -302,12 +306,12 @@
<xsl:template name="page_footer">
<fo:static-content flow-name="region-after-cover" xsl:use-attribute-sets="FooterFont">
<fo:block xsl:use-attribute-sets="footer">
<fo:inline xsl:use-attribute-sets="TinyFont orange-text">Please keep digital unless absolutely required. Read the (unique) terms and conditions of Radically Open Security at: https://radicallyopensecurity.com/TermsandConditions.pdf</fo:inline>
<fo:inline xsl:use-attribute-sets="TinyFont orange-text"><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_yaygreen'"/></xsl:call-template></fo:inline>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="region-after-content" xsl:use-attribute-sets="FooterFont">
<fo:block xsl:use-attribute-sets="footer">
<fo:inline xsl:use-attribute-sets="TinyFont orange-text">Please keep digital unless absolutely required. Read the (unique) terms and conditions of Radically Open Security at: https://radicallyopensecurity.com/TermsandConditions.pdf</fo:inline>
<fo:inline xsl:use-attribute-sets="TinyFont orange-text"><xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_yaygreen'"/></xsl:call-template></fo:inline>
</fo:block>
</fo:static-content>
</xsl:template>

View File

@@ -18,8 +18,7 @@
<xsl:import href="graphics.xslt"/>
<xsl:import href="generic.xslt"/>
<xsl:import href="numbering.xslt"/>
<xsl:import href="placeholders.xslt"/><!--
<xsl:import href="snippets.xslt"/>-->
<xsl:import href="placeholders.xslt"/>
<xsl:import href="waiver.xslt"/>
<xsl:include href="localisation.xslt"/>

View File

@@ -3,11 +3,15 @@
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="xs" version="2.0">
<xsl:include href="localisation.xslt"/>
<xsl:param name="INVOICE_NO">00/000</xsl:param>
<xsl:param name="DATE">
<xsl:value-of select="format-date(current-date(), '[Y]-[M,2]-[D,2]', 'en', (), ())"/>
</xsl:param>
<xsl:variable name="lang" select="/*/@xml:lang"/>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<!-- ROOT -->
@@ -22,6 +26,9 @@
<xsl:attribute name="invoice_no">
<xsl:value-of select="$INVOICE_NO"/>
</xsl:attribute>
<xsl:attribute name="xml:lang">
<xsl:value-of select="$lang"/>
</xsl:attribute>
<xsl:attribute name="denomination">
<xsl:value-of select="/offerte/meta/pentestinfo/fee/@denomination"/>
</xsl:attribute>
@@ -37,7 +44,7 @@
<service>
<description>
<xsl:value-of select="/offerte/meta/pentestinfo/duration"
/>-day&#160;<xsl:value-of select="/offerte/meta/offered_service_short"
/>-<xsl:call-template name="getString"><xsl:with-param name="stringID" select="'invoice_days'"/></xsl:call-template>&#160;<xsl:value-of select="/offerte/meta/offered_service_short"
/>&#160;<xsl:value-of
select="/offerte/meta/permission_parties/client/short_name"/>
</description>

View File

@@ -90,10 +90,10 @@
<xsl:value-of select="/*/pentest_info/type"/>
</type>
<xsl:comment>please choose one of the following: black-box, grey-box, crystal-box</xsl:comment>
<fee denomination="euro">
<fee denomination="eur">
<xsl:value-of select="/*/pentest_info/rate"/>
</fee>
<xsl:comment>(euro|dollar)</xsl:comment>
<xsl:comment>(eur|usd|gbp)</xsl:comment>
<xsl:if test="*/pentest_info/application_name">
<target_application><xsl:value-of select="/*/pentest_info/application_name"/></target_application>
<xsl:comment>name of application/service to be tested (if any; if none, DELETE target_application element)</xsl:comment>