Implemented Rate Cards
This commit is contained in:
@@ -1,17 +1,41 @@
|
||||
RELEASE NOTES
|
||||
=============
|
||||
|
||||
March 20th, 2017
|
||||
----------------
|
||||
|
||||
### Rate cards
|
||||
|
||||
The file client_info.xml, now accepts standard rates for the client. These can be called from the snippet ratecard.xml to generate a rate card, i.e. a PDF specifying the rates a client can expect to pay. Note that the 'average rate per hour per pentester' indication is currently based on the average of the junior and medior pentester rate, rounded up to the nearest 5, +/- 10.
|
||||
|
||||
In client_info.xml, we want the following info (everything except junior and medior pentester is optional, other entries can be added if needed):
|
||||
|
||||
```
|
||||
<rates denomination="eur" lastrevisiondate="2017-03-01">
|
||||
<rate title="juniorpentester">100</rate>
|
||||
<rate title="mediorpentester">200</rate>
|
||||
<rate title="seniorpentester">500</rate>
|
||||
<rate title="expertpentester">1000</rate>
|
||||
<rate title="juniormanager">100</rate>
|
||||
<rate title="seniormanager">125</rate>
|
||||
</rates>
|
||||
```
|
||||
|
||||
|
||||
Usage: `snippets/ratecard/ratecard.xml --> ratecard.pdf (using generate_ratecard.xsl and fop)`
|
||||
|
||||
|
||||
February 27th, 2017
|
||||
-------------------
|
||||
|
||||
###Optional extra info field in invoices
|
||||
### Optional extra info field in invoices
|
||||
|
||||
An extra element with the imaginative name `<invoice_extra_field>` has been added to client_info.xml. In this field you can enter a line requested by the client, such as creditor number, cost centre, internal account number or whatever info they need for their internal administration. If not needed, delete or leave empty.
|
||||
|
||||
February 24th, 2017
|
||||
-------------------
|
||||
|
||||
###Pie chart linking
|
||||
### Pie chart linking
|
||||
|
||||
All pie charts now show a finding count in the legend label.
|
||||
|
||||
@@ -21,7 +45,7 @@ The summary table is now ordered on threat level severity and each finding ID in
|
||||
|
||||
Generated links (e.g. `<a href="#finding1"/>`) now have an optional attribute `@includepage` which can be set to `yes` or `no` (default is `yes`). If set to `yes`, the link will be generated as it was up till now (e.g. "SID-001 (page 4)"); if set to `no`, the link will be generated without the page number in parenthesis.
|
||||
|
||||
###The big pre/code/monospace switch
|
||||
### The big pre/code/monospace switch
|
||||
|
||||
To have better compatibility with HTML and markdown-to-xml scripts, we have slimmed down and mixed up the `<pre>`, `<code>` and `<monospace>` tags. I tried to describe what was what and is now something else, but it became way too confusing. To keep it simple, just know this:
|
||||
|
||||
@@ -31,7 +55,7 @@ To have better compatibility with HTML and markdown-to-xml scripts, we have slim
|
||||
January 12th, 2017
|
||||
------------------
|
||||
|
||||
###Pie charts
|
||||
### Pie charts
|
||||
|
||||
You can now generate pie charts for any countable data that might be in the report. You can do so using the element `<generate_piechart pieAttr="x" pieElem="y" pieHeight="z">`, where `x` is the attribute value of any element `y` in the document (useful charts would be `threatLevel` for `x` and `finding` for `y` to show a pie chart of the share of findings by threat level, or `type` for `x` and `finding` for `y` to show a pie chart of the share of findings by type). The height (and width) of the pie is set in the pieHeight attribute, where `z` is the height of the pie chart in px.
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
<xs:element ref="invoice_mail"/>
|
||||
<xs:element ref="invoice_extra_field" minOccurs="0"/>
|
||||
<xs:element ref="vat_no"/>
|
||||
<xs:element ref="rates"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute ref="xml:base"/>
|
||||
<xs:attribute ref="xml:lang"/>
|
||||
@@ -106,6 +107,24 @@
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="rates">
|
||||
<xs:complexType>
|
||||
<xs:choice maxOccurs="unbounded" minOccurs="1">
|
||||
<xs:element ref="rate"/>
|
||||
</xs:choice>
|
||||
<xs:attribute ref="denomination"/>
|
||||
<xs:attribute name="lastrevisiondate" type="xs:date"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="rate">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:float">
|
||||
<xs:attribute name="title" type="xs:string"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="permission_parties">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
@@ -242,8 +261,11 @@
|
||||
<xs:element ref="img"/>
|
||||
</xs:choice>
|
||||
<xs:attribute ref="xml:base"/>
|
||||
<xs:attribute ref="class" use="optional"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:attribute name="class" type="xs:string"/>
|
||||
|
||||
<xs:element name="version_history">
|
||||
<xs:complexType>
|
||||
@@ -430,6 +452,16 @@
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
|
||||
<xs:attribute name="denomination" default="eur">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="eur"/>
|
||||
<xs:enumeration value="usd"/>
|
||||
<xs:enumeration value="gbp"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
|
||||
<xs:element name="author">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
|
||||
@@ -17,15 +17,7 @@
|
||||
<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="eur">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="eur"/>
|
||||
<xs:enumeration value="usd"/>
|
||||
<xs:enumeration value="gbp"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute ref="denomination" use="optional"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="meta">
|
||||
|
||||
58
xml/dtd/ratecard.xsd
Normal file
58
xml/dtd/ratecard.xsd
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.0" vc:maxVersion="1.1">
|
||||
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
|
||||
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
|
||||
<xs:import namespace="http://www.w3.org/2001/XInclude"
|
||||
schemaLocation="http://www.w3.org/2001/XInclude/XInclude.xsd"/>
|
||||
<xs:include schemaLocation="common.xsd"/>
|
||||
<xs:element name="ratecard">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="meta"/>
|
||||
<xs:element ref="title"/>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element ref="pre"/>
|
||||
<xs:element name="p" type="block"/>
|
||||
<xs:element ref="table"/>
|
||||
<xs:element ref="ul"/>
|
||||
<xs:element ref="ol"/>
|
||||
<xs:element ref="img"/>
|
||||
<xs:element name="div" type="block"/>
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
<xs:attribute ref="xml:lang"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="meta">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="company"/>
|
||||
<xs:element ref="client"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="generate_raterevisiondate"/>
|
||||
<xs:complexType name="block" mixed="true">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:group ref="inline-all"/>
|
||||
<xs:group ref="placeholders"/>
|
||||
<xs:element ref="generate_raterevisiondate"/>
|
||||
</xs:choice>
|
||||
<xs:attribute ref="xml:base"/>
|
||||
<xs:attribute ref="class"/>
|
||||
</xs:complexType>
|
||||
<!-- Placeholders -->
|
||||
<xs:group name="placeholders">
|
||||
<xs:choice>
|
||||
<xs:element name="client_long"/>
|
||||
<xs:element name="client_short"/>
|
||||
<xs:element name="client_rate"/>
|
||||
<xs:element name="client_average_rate"/>
|
||||
<xs:element name="company_long"/>
|
||||
<xs:element name="company_short"/>
|
||||
<xs:element name="company_poc1"/>
|
||||
</xs:choice>
|
||||
</xs:group>
|
||||
</xs:schema>
|
||||
@@ -7,24 +7,32 @@
|
||||
|
||||
<client xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../dtd/offerte.xsd" id="client">
|
||||
<full_name>Sitting Duck B.V.</full_name>
|
||||
<!-- long client name, e.g. Sitting Duck B.V. -->
|
||||
<short_name>Sitting Duck</short_name>
|
||||
<!-- short client name, e.g. Sitting Duck; if no short name: same as long name -->
|
||||
<legal_rep>I.M. Portant</legal_rep>
|
||||
<!-- customer legal representative (to sign offer) -->
|
||||
<waiver_rep>B.I.G. Wig</waiver_rep>
|
||||
<!-- customer legal representative (to sign waiver; can be same person as legal_rep) -->
|
||||
<poc1>Sir Knowsalot</poc1>
|
||||
<!-- first point of contact for customer (during pentest); can be same person as above -->
|
||||
<address>Reed Street 42</address>
|
||||
<postal_code>0000</postal_code>
|
||||
<city>Pond City</city>
|
||||
<country>Amazonia</country>
|
||||
<coc nationality="Dutch">9999999</coc>
|
||||
<!-- chamber of commerce number; if no chamber of commerce number, please delete the whole element -->
|
||||
<invoice_rep></invoice_rep>
|
||||
<invoice_mail>freemoney@sittingduck.com</invoice_mail>
|
||||
<invoice_extra_field></invoice_extra_field>
|
||||
<vat_no>0000000000B01</vat_no>
|
||||
<full_name>Sitting Duck B.V.</full_name>
|
||||
<!-- long client name, e.g. Sitting Duck B.V. -->
|
||||
<short_name>Sitting Duck</short_name>
|
||||
<!-- short client name, e.g. Sitting Duck; if no short name: same as long name -->
|
||||
<legal_rep>I.M. Portant</legal_rep>
|
||||
<!-- customer legal representative (to sign offer) -->
|
||||
<waiver_rep>B.I.G. Wig</waiver_rep>
|
||||
<!-- customer legal representative (to sign waiver; can be same person as legal_rep) -->
|
||||
<poc1>Sir Knowsalot</poc1>
|
||||
<!-- first point of contact for customer (during pentest); can be same person as above -->
|
||||
<address>Reed Street 42</address>
|
||||
<postal_code>0000</postal_code>
|
||||
<city>Pond City</city>
|
||||
<country>Amazonia</country>
|
||||
<coc nationality="Dutch">9999999</coc>
|
||||
<!-- chamber of commerce number; if no chamber of commerce number, please delete the whole element -->
|
||||
<invoice_rep/>
|
||||
<invoice_mail>freemoney@sittingduck.com</invoice_mail>
|
||||
<invoice_extra_field/>
|
||||
<vat_no>0000000000B01</vat_no>
|
||||
<rates denomination="eur" lastrevisiondate="2017-03-01">
|
||||
<rate title="juniorpentester">100</rate>
|
||||
<rate title="mediorpentester">125</rate>
|
||||
<rate title="seniorpentester">150</rate>
|
||||
<rate title="expertpentester">1000</rate>
|
||||
<rate title="juniormanager">100</rate>
|
||||
<rate title="seniormanager">125</rate>
|
||||
</rates>
|
||||
</client>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
<legal_rep>Melanie Rieback
|
||||
</legal_rep><!-- ROS legal representative (to sign offerte) -->
|
||||
<poc1>Melanie Rieback</poc1><!-- first point of contact for ROS -->
|
||||
<address>Overdiemerweg 28</address>
|
||||
<postal_code>1111 PP</postal_code>
|
||||
<city>Diemen</city>
|
||||
<address>Zieseniskade 21</address>
|
||||
<postal_code>1017 RT</postal_code>
|
||||
<city>Amsterdam</city>
|
||||
<country>The Netherlands</country>
|
||||
<phone>+31 6 10 21 32 40</phone>
|
||||
<email>info@radicallyopensecurity.com</email>
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
exclude-result-prefixes="xs" xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||
version="2.0">
|
||||
|
||||
|
||||
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format" version="2.0">
|
||||
|
||||
<xsl:template match="@class">
|
||||
<xsl:call-template name="use-att-set">
|
||||
<xsl:with-param name="CLASS" select="string(.)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="use-att-set">
|
||||
<xsl:param name="CLASS" select="."/>
|
||||
<xsl:param name="SUFFIX"/>
|
||||
@@ -27,22 +30,22 @@
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- att-set handles only one single class -->
|
||||
<xsl:template name="att-set">
|
||||
<xsl:param name="CLASS"/>
|
||||
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="normalize-space($CLASS)=''"/>
|
||||
<xsl:when test="normalize-space($CLASS) = ''"/>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="$CLASSES[@name=$CLASS]/@use-attribute-sets">
|
||||
<xsl:if test="$CLASSES[@name = $CLASS]/@use-attribute-sets">
|
||||
<xsl:call-template name="use-att-set">
|
||||
<xsl:with-param name="CLASS"
|
||||
select="$CLASSES[@name=$CLASS]/@use-attribute-sets"/>
|
||||
select="$CLASSES[@name = $CLASS]/@use-attribute-sets"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:for-each select="$CLASSES[@name=$CLASS]/xsl:attribute">
|
||||
|
||||
<xsl:for-each select="$CLASSES[@name = $CLASS]/xsl:attribute">
|
||||
<xsl:attribute name="{@name}">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:attribute>
|
||||
@@ -50,5 +53,5 @@
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
@@ -833,5 +833,22 @@
|
||||
<xsl:otherwise>black</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="generate_average_rate">
|
||||
<xsl:if test="not(//meta//client/rates/rate[@title='juniorpentester']) or not(//meta//client/rates/rate[@title='mediorpentester'])">
|
||||
<fo:block xsl:use-attribute-sets="errortext">Generated average rate is based on 'juniorpentester' and 'mediorpentester' roles, which cannot be found in client_info.xml</fo:block>
|
||||
</xsl:if>
|
||||
<xsl:variable name="juniorrate" select="//meta//client/rates/rate[@title='juniorpentester'] * 1"/>
|
||||
<xsl:variable name="mediorrate" select="//meta//client/rates/rate[@title='mediorpentester'] * 1"/>
|
||||
<xsl:variable name="avg" select="($juniorrate + $mediorrate) div 2"/>
|
||||
<xsl:variable name="roundedavg" select="round($avg div 5) * 5"/>
|
||||
<xsl:value-of select="$denomination"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="$roundedavg - 10"/>
|
||||
<xsl:text> - </xsl:text>
|
||||
<xsl:value-of select="$denomination"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="$roundedavg + 10"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
@@ -1,60 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
exclude-result-prefixes="xs" xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||
version="2.0">
|
||||
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format" version="2.0">
|
||||
|
||||
<xsl:template name="checkIfLast">
|
||||
<!-- Checks if an element is last in the section / appendix and adds some space after it if it is -->
|
||||
<xsl:if
|
||||
test="(parent::section and not(following-sibling::*)) or
|
||||
(parent::appendix and not(following-sibling::*)) or
|
||||
(ancestor::section and not(following-sibling::*) and not(parent::*/following-sibling::*) and not(parent::div) and not(parent::li)) or
|
||||
(ancestor::appendix and not(following-sibling::*) and not(parent::*/following-sibling::*) and not(parent::div) and not(parent::li)) or
|
||||
(not(self::title) and following-sibling::*[1][self::section]) or
|
||||
(not(self::title) and following-sibling::*[1][self::finding]) or
|
||||
(not(self::title) and following-sibling::*[1][self::non-finding])">
|
||||
test="
|
||||
(parent::section and not(following-sibling::*)) or
|
||||
(parent::appendix and not(following-sibling::*)) or
|
||||
(ancestor::section and not(following-sibling::*) and not(parent::*/following-sibling::*) and not(parent::div) and not(parent::li)) or
|
||||
(ancestor::appendix and not(following-sibling::*) and not(parent::*/following-sibling::*) and not(parent::div) and not(parent::li)) or
|
||||
(not(self::title) and following-sibling::*[1][self::section]) or
|
||||
(not(self::title) and following-sibling::*[1][self::finding]) or
|
||||
(not(self::title) and following-sibling::*[1][self::non-finding])">
|
||||
<xsl:attribute name="margin-bottom" select="$very-large-space"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="company/address">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="br">
|
||||
<fo:block/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="p">
|
||||
<fo:block xsl:use-attribute-sets="p">
|
||||
<xsl:call-template name="checkIfLast"/>
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="li/p">
|
||||
<fo:block xsl:use-attribute-sets="li">
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="p" mode="summarytable">
|
||||
<xsl:apply-templates mode="summarytable"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="pre">
|
||||
<fo:block xsl:use-attribute-sets="pre">
|
||||
<xsl:call-template name="checkIfLast"/>
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="div"><!-- div doesn't do anything, it's just there to make snippets more flexible -->
|
||||
|
||||
<xsl:template match="div">
|
||||
<!-- div doesn't do anything, it's just there to make snippets more flexible -->
|
||||
<fo:block>
|
||||
<xsl:call-template name="checkIfLast"/>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:apply-templates select="@* | node()"/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
170
xml/xslt/generate_ratecard.xsl
Normal file
170
xml/xslt/generate_ratecard.xsl
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
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:import href="pages.xslt"/>
|
||||
<xsl:import href="block.xslt"/>
|
||||
<xsl:import href="inline.xslt"/>
|
||||
<xsl:import href="auto.xslt"/>
|
||||
<xsl:import href="placeholders.xslt"/>
|
||||
<xsl:import href="structure.xslt"/>
|
||||
<xsl:import href="lists.xslt"/>
|
||||
<xsl:import href="generic.xslt"/>
|
||||
<xsl:import href="att-set.xslt"/>
|
||||
<xsl:import href="table.xslt"/>
|
||||
<xsl:include href="styles_rat.xslt"/>
|
||||
<xsl:include href="localisation.xslt"/>
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
|
||||
|
||||
|
||||
<!-- params & keys not needed but required by shared code -->
|
||||
<xsl:param name="AUTO_NUMBERING_FORMAT" select="'1.1.1'"/>
|
||||
<xsl:param name="EXEC_SUMMARY" select="false()"/>
|
||||
<xsl:key name="rosid" match="section|finding|appendix|non-finding" use="@id"/>
|
||||
<xsl:key name="biblioid" match="biblioentry" use="@id"/>
|
||||
<xsl:variable name="fee" select="/contract/meta/contractor/hourly_fee * 1"/>
|
||||
<xsl:variable name="plannedHours" select="/contract/meta/work/planning/hours * 1"/>
|
||||
<xsl:variable name="total_fee" select="$fee * $plannedHours"/>
|
||||
|
||||
<!-- the ones below actually *are* used -->
|
||||
<xsl:variable name="CLASSES" select="document('../xslt/styles_rat.xslt')/*/xsl:attribute-set"/>
|
||||
<xsl:variable name="lang" select="/*/@xml:lang"/>
|
||||
<xsl:variable name="latestVersionDate">
|
||||
<xsl:for-each select="/*/meta/client/rates/latestrevisiondate">
|
||||
<xsl:sort select="xs:dateTime(@date)" order="descending"/>
|
||||
<xsl:if test="position() = 1">
|
||||
<xsl:value-of select="format-dateTime(@date, '[MNn] [D1], [Y]', en, (), ())"/>
|
||||
<!-- Note: this should be:
|
||||
<xsl:value-of select="format-dateTime(@date, $localDateFormat, $lang, (), ())"/>
|
||||
to properly be localised, but we're using Saxon HE instead of PE/EE and having localised month names
|
||||
would require creating a LocalizerFactory
|
||||
See http://www.saxonica.com/html/documentation/extensibility/config-extend/localizing/ for more info
|
||||
sounds like I'd have to know Java for that so for now, the date isn't localised. :) -->
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="denomination">
|
||||
<xsl:choose>
|
||||
<xsl:when test="//meta/client/rates/@denomination = 'eur'">€</xsl:when>
|
||||
<xsl:when test="//meta/client/rates/@denomination = 'gbp'">£</xsl:when>
|
||||
<xsl:when test="//meta/client/rates/@denomination = 'usd'">$</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:template match="ratecard">
|
||||
<!-- Invoice is generated straight from offerte -->
|
||||
<fo:root>
|
||||
<xsl:call-template name="layout-master-set"/>
|
||||
<xsl:call-template name="Content"/>
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
|
||||
<!-- overrules for pages.xslt -->
|
||||
<xsl:template name="Content">
|
||||
<fo:page-sequence master-reference="Report">
|
||||
<xsl:call-template name="page_header"/>
|
||||
<xsl:call-template name="page_footer"/>
|
||||
<fo:flow flow-name="region-body" xsl:use-attribute-sets="DefaultFont">
|
||||
<fo:block>
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
<fo:block id="EndOfDoc"/>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="meta">
|
||||
<!-- not doing anything here, ratecard meta is only for placeholder references -->
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="page_header">
|
||||
<fo:static-content flow-name="region-before-cover" xsl:use-attribute-sets="HeaderFont">
|
||||
<fo:block>
|
||||
<fo:table width="100%" table-layout="fixed">
|
||||
<fo:table-column column-width="proportional-column-width(40)"/>
|
||||
<fo:table-column column-width="proportional-column-width(20)"/>
|
||||
<fo:table-column column-width="proportional-column-width(40)"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell text-align="right" display-align="after"
|
||||
padding-bottom="5mm">
|
||||
<fo:block xsl:use-attribute-sets="TinyFont">
|
||||
<fo:block xsl:use-attribute-sets="bold orange-text">
|
||||
<xsl:value-of select="/*/meta/company/full_name"/>
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
<xsl:value-of select="/*/meta/company/address"/>
|
||||
</fo:block>
|
||||
<fo:block><xsl:value-of select="/*/meta/company/postal_code"
|
||||
/> <xsl:value-of select="/*/meta/company/city"
|
||||
/></fo:block>
|
||||
<fo:block>
|
||||
<xsl:value-of select="/*/meta/company/country"/>
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell text-align="center">
|
||||
<fo:block>
|
||||
<fo:external-graphic xsl:use-attribute-sets="logo"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell display-align="after" padding-bottom="5mm">
|
||||
<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>
|
||||
<xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'page_kvk'"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> </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> </xsl:text>
|
||||
<xsl:value-of select="/*/meta/company/vat_no"/>
|
||||
</fo:block>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
<fo:static-content flow-name="region-before-content" xsl:use-attribute-sets="HeaderFont">
|
||||
<fo:block xsl:use-attribute-sets="header"/>
|
||||
</fo:static-content>
|
||||
</xsl:template>
|
||||
|
||||
<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">
|
||||
<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">
|
||||
<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>
|
||||
</xsl:stylesheet>
|
||||
@@ -1,8 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:my="http://radical.sexy"
|
||||
exclude-result-prefixes="xs"
|
||||
version="2.0">
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||
xmlns:my="http://radical.sexy" exclude-result-prefixes="xs" version="2.0">
|
||||
<!-- PLACEHOLDERS -->
|
||||
<xsl:template match="client_long">
|
||||
<xsl:param name="placeholderElement" select="/*/meta//client/full_name"/>
|
||||
@@ -35,8 +34,7 @@
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
<xsl:template match="client_legal_rep">
|
||||
<xsl:param name="placeholderElement"
|
||||
select="/*/meta//client/legal_rep"/>
|
||||
<xsl:param name="placeholderElement" select="/*/meta//client/legal_rep"/>
|
||||
<xsl:call-template name="checkPlaceholder">
|
||||
<xsl:with-param name="placeholderElement" select="$placeholderElement"/>
|
||||
</xsl:call-template>
|
||||
@@ -59,6 +57,13 @@
|
||||
<xsl:with-param name="placeholderElement" select="$placeholderElement"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
<xsl:template match="client_rate">
|
||||
<xsl:param name="roleTitle" select="@title"/>
|
||||
<xsl:param name="placeholderElement" select="/*/meta//client/rates/rate[@title=$roleTitle]"/>
|
||||
<xsl:call-template name="checkPlaceholder">
|
||||
<xsl:with-param name="placeholderElement" select="$placeholderElement"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
<xsl:template match="company_long">
|
||||
<xsl:param name="placeholderElement" select="/*/meta/company/full_name"/>
|
||||
<xsl:call-template name="checkPlaceholder">
|
||||
@@ -246,9 +251,9 @@
|
||||
</xsl:call-template>
|
||||
<xsl:if test="/contract/meta/contractor/ctcompany">
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:call-template name="checkPlaceholder">
|
||||
<xsl:with-param name="placeholderElement" select="$placeholderElement2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="checkPlaceholder">
|
||||
<xsl:with-param name="placeholderElement" select="$placeholderElement2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
@@ -334,6 +339,12 @@
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
<xsl:template match="generate_raterevisiondate">
|
||||
<xsl:param name="placeholderElement" select="//meta//client/rates/@lastrevisiondate"/>
|
||||
<xsl:call-template name="checkPlaceholder">
|
||||
<xsl:with-param name="placeholderElement" select="$placeholderElement"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
<xsl:template name="checkPlaceholder">
|
||||
<xsl:param name="placeholderElement" select="/"/>
|
||||
<xsl:param name="caps" select="'none'"/>
|
||||
@@ -341,21 +352,20 @@
|
||||
<xsl:when test="normalize-space($placeholderElement)">
|
||||
<!-- placeholder exists and contains text -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="self::client_rate">
|
||||
<xsl:value-of select="$denomination"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="$placeholderElement"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="self::p_fee or self::contractor_hourly_fee">
|
||||
<!-- pretty numbering for fee -->
|
||||
<xsl:variable name="fee" select="$placeholderElement * 1"/>
|
||||
<xsl:number value="$fee" grouping-separator="," grouping-size="3"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="self::contract_end_date">
|
||||
<xsl:when test="self::contract_end_date or self::contract_start_date or self::generate_raterevisiondate">
|
||||
<!-- pretty printing for date -->
|
||||
<xsl:value-of
|
||||
select="format-date(/contract/meta/work/end_date, '[MNn] [D1], [Y]', 'en', (), ())"
|
||||
/>
|
||||
</xsl:when>
|
||||
<xsl:when test="self::contract_start_date">
|
||||
<!-- pretty printing for date -->
|
||||
<xsl:value-of
|
||||
select="format-date(/contract/meta/work/start_date, '[MNn] [D1], [Y]', 'en', (), ())"
|
||||
select="format-date($placeholderElement, '[MNn] [D1], [Y]', 'en', (), ())"
|
||||
/>
|
||||
</xsl:when>
|
||||
<xsl:when
|
||||
@@ -368,52 +378,70 @@
|
||||
<xsl:when test="self::contractor_possessive_pronoun">
|
||||
<!-- some sexy logic -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="//contractor/@sex = 'M'"><xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'possessive_m'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template></xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'F'"><xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'possessive_f'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template></xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'O'"><xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'possessive_o'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template></xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'M'">
|
||||
<xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'possessive_m'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'F'">
|
||||
<xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'possessive_f'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'O'">
|
||||
<xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'possessive_o'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="self::contractor_subject_pronoun">
|
||||
<!-- some sexy logic -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="//contractor/@sex = 'M'"><xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'subject_m'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template></xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'F'"><xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'subject_f'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template></xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'O'"><xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'subject_o'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template></xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'M'">
|
||||
<xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'subject_m'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'F'">
|
||||
<xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'subject_f'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'O'">
|
||||
<xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'subject_o'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="self::contractor_object_pronoun">
|
||||
<!-- some sexy logic -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="//contractor/@sex = 'M'"><xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'object_m'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template></xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'F'"><xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'object_f'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template></xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'O'"><xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'object_o'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template></xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'M'">
|
||||
<xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'object_m'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'F'">
|
||||
<xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'object_f'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="//contractor/@sex = 'O'">
|
||||
<xsl:call-template name="getString">
|
||||
<xsl:with-param name="stringID" select="'object_o'"/>
|
||||
<xsl:with-param name="caps" select="$caps"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
@@ -458,28 +486,28 @@
|
||||
<xsl:variable name="endMonth" as="xs:integer" select="month-from-date($enddate)"/>
|
||||
<xsl:variable name="endDay" as="xs:integer" select="day-from-date($enddate)"/>
|
||||
<xsl:variable name="startMonthNumberOfDays">
|
||||
<xsl:choose>
|
||||
<xsl:when test="xs:string($startMonth) = '1'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '2'">
|
||||
<!-- I hate february -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$startYear mod 4 != 0">28</xsl:when>
|
||||
<xsl:when test="$startYear mod 100 != 0">29</xsl:when>
|
||||
<xsl:when test="$startYear mod 400 != 0">28</xsl:when>
|
||||
<xsl:otherwise>29</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '3'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '4'">30</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '5'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '6'">30</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '7'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '8'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '9'">30</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '10'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '11'">30</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '12'">31</xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:choose>
|
||||
<xsl:when test="xs:string($startMonth) = '1'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '2'">
|
||||
<!-- I hate february -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$startYear mod 4 != 0">28</xsl:when>
|
||||
<xsl:when test="$startYear mod 100 != 0">29</xsl:when>
|
||||
<xsl:when test="$startYear mod 400 != 0">28</xsl:when>
|
||||
<xsl:otherwise>29</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '3'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '4'">30</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '5'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '6'">30</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '7'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '8'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '9'">30</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '10'">31</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '11'">30</xsl:when>
|
||||
<xsl:when test="xs:string($startMonth) = '12'">31</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="numYears">
|
||||
<xsl:choose>
|
||||
@@ -525,8 +553,12 @@
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>-->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$endDay - $startDay < 0"><xsl:value-of select="$startMonthNumberOfDays - $startDay + $endDay"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$endDay - $startDay"/></xsl:otherwise>
|
||||
<xsl:when test="$endDay - $startDay < 0">
|
||||
<xsl:value-of select="$startMonthNumberOfDays - $startDay + $endDay"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$endDay - $startDay"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:if test="$numYears > 0">
|
||||
@@ -535,12 +567,15 @@
|
||||
<xsl:if test="$numYears > 1">
|
||||
<xsl:text>s</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:choose><xsl:when test="($numMonths > 0 and $numDays = 0) or ($numMonths = 0 and $numDays > 0)">
|
||||
<xsl:text> and</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$numMonths > 0 and $numDays > 0">
|
||||
<xsl:text>,</xsl:text>
|
||||
</xsl:when></xsl:choose>
|
||||
<xsl:choose>
|
||||
<xsl:when
|
||||
test="($numMonths > 0 and $numDays = 0) or ($numMonths = 0 and $numDays > 0)">
|
||||
<xsl:text> and</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$numMonths > 0 and $numDays > 0">
|
||||
<xsl:text>,</xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
<xsl:if test="$numMonths > 0">
|
||||
<xsl:sequence select="$numMonths"/>
|
||||
@@ -560,4 +595,4 @@
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:function>
|
||||
</xsl:stylesheet>
|
||||
</xsl:stylesheet>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<xsl:attribute name="font-family">LiberationSansNarrow</xsl:attribute>
|
||||
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
||||
<xsl:attribute name="color">black</xsl:attribute>
|
||||
<xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="HeaderFont" use-attribute-sets="DefaultFont"/>
|
||||
<xsl:attribute-set name="FooterFont" use-attribute-sets="DefaultFont"/>
|
||||
|
||||
119
xml/xslt/styles_rat.xslt
Normal file
119
xml/xslt/styles_rat.xslt
Normal file
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
exclude-result-prefixes="xs"
|
||||
version="2.0">
|
||||
|
||||
<xsl:import href="styles.xslt"/>
|
||||
|
||||
<!-- variables -->
|
||||
|
||||
<xsl:variable name="medium-space">12pt</xsl:variable>
|
||||
|
||||
<xsl:attribute-set name="title" use-attribute-sets="bold">
|
||||
<xsl:attribute name="keep-with-next.within-page">always</xsl:attribute>
|
||||
<xsl:attribute name="text-align">center</xsl:attribute>
|
||||
<xsl:attribute name="color">white</xsl:attribute>
|
||||
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
||||
<xsl:attribute name="text-transform">uppercase</xsl:attribute>
|
||||
<!-- letter spacing is dodgy in fop when there are certain characters in the string (e.g. a 'V'); commenting this out until that is fixed -->
|
||||
<!-- it's also dodgy in combination with centered text, btw -->
|
||||
<!--<xsl:attribute name="letter-spacing.precedence">0</xsl:attribute>
|
||||
<xsl:attribute name="letter-spacing.optimum">3mm</xsl:attribute>
|
||||
<xsl:attribute name="letter-spacing.minimum">3mm</xsl:attribute>
|
||||
<xsl:attribute name="letter-spacing.maximum">3mm</xsl:attribute>-->
|
||||
</xsl:attribute-set>
|
||||
|
||||
<xsl:attribute-set name="PortraitPage">
|
||||
<xsl:attribute name="margin-top">0.5cm</xsl:attribute>
|
||||
<xsl:attribute name="margin-bottom">1.5cm</xsl:attribute>
|
||||
<xsl:attribute name="margin-left">1.5cm</xsl:attribute>
|
||||
<xsl:attribute name="margin-right">1.5cm</xsl:attribute>
|
||||
<xsl:attribute name="page-height">29.7cm</xsl:attribute>
|
||||
<xsl:attribute name="page-width">21.0cm</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="region-body-cover">
|
||||
<xsl:attribute name="margin-top">3.6cm</xsl:attribute>
|
||||
<xsl:attribute name="margin-bottom">1cm</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="region-before-cover">
|
||||
<xsl:attribute name="precedence">true</xsl:attribute>
|
||||
<xsl:attribute name="extent">2.7cm</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="region-after-cover">
|
||||
<xsl:attribute name="precedence">true</xsl:attribute>
|
||||
<xsl:attribute name="extent">0.6cm</xsl:attribute>
|
||||
<xsl:attribute name="padding">0</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="region-body-content">
|
||||
<xsl:attribute name="margin-top">2cm</xsl:attribute>
|
||||
<xsl:attribute name="margin-bottom">1cm</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="region-before-content">
|
||||
<xsl:attribute name="precedence">true</xsl:attribute>
|
||||
<xsl:attribute name="extent">0.6cm</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="region-after-content">
|
||||
<xsl:attribute name="precedence">true</xsl:attribute>
|
||||
<xsl:attribute name="extent">0.6cm</xsl:attribute>
|
||||
<xsl:attribute name="padding">0</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="header">
|
||||
<xsl:attribute name="text-align">right</xsl:attribute>
|
||||
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="footer">
|
||||
<xsl:attribute name="text-align">center</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="logo">
|
||||
<xsl:attribute name="padding-top">0cm</xsl:attribute>
|
||||
<xsl:attribute name="padding-bottom">0cm</xsl:attribute>
|
||||
<xsl:attribute name="src">url(../graphics/logo_alt.png)</xsl:attribute>
|
||||
<xsl:attribute name="width">30mm</xsl:attribute>
|
||||
<xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
|
||||
<xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
|
||||
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="title-0" use-attribute-sets="title">
|
||||
<xsl:attribute name="font-size">18pt</xsl:attribute>
|
||||
<xsl:attribute name="background-color">#FF5C00</xsl:attribute>
|
||||
<xsl:attribute name="margin-top">1cm</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="title-2" use-attribute-sets="title">
|
||||
<xsl:attribute name="font-style">normal</xsl:attribute>
|
||||
<xsl:attribute name="font-size">18pt</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="border-top">
|
||||
<xsl:attribute name="border-before-width">
|
||||
<xsl:value-of select="$border-width"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="border-before-style">
|
||||
<xsl:value-of select="$border-style"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="border-before-color">
|
||||
<xsl:value-of select="$border-color"/>
|
||||
</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="td">
|
||||
<xsl:attribute name="border-collapse">separate</xsl:attribute>
|
||||
<xsl:attribute name="border-spacing">5mm</xsl:attribute>
|
||||
<xsl:attribute name="padding-bottom"><xsl:value-of select="$medium-space"/></xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="padding-top">
|
||||
<xsl:attribute name="padding-top">5pt</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="table-shading">
|
||||
<xsl:attribute name="background-color">#EEEEEE</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="important">
|
||||
<xsl:attribute name="text-align">center</xsl:attribute>
|
||||
<xsl:attribute name="font-size">16pt</xsl:attribute>
|
||||
<xsl:attribute name="margin-top">1cm</xsl:attribute>
|
||||
<xsl:attribute name="margin-bottom">1cm</xsl:attribute>
|
||||
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:attribute-set name="p">
|
||||
<xsl:attribute name="padding-bottom"><xsl:value-of select="$medium-space"/></xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -5,7 +5,7 @@
|
||||
version="2.0">
|
||||
|
||||
<xsl:template match="table">
|
||||
<fo:block xsl:use-attribute-sets="p"><fo:table table-layout="fixed" width="100%">
|
||||
<fo:block xsl:use-attribute-sets="p"><fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table">
|
||||
<xsl:call-template name="checkIfLast"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@cols">
|
||||
|
||||
Reference in New Issue
Block a user