~openerp-commiter/openobject-addons/trunk-extra-addons

« back to all changes in this revision

Viewing changes to auction/report/results.xsl

bugfix in overlay creation system

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="utf-8"?>
2
 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
3
 
 
4
 
<xsl:variable name="number_columns">6</xsl:variable>
5
 
 
6
 
<xsl:variable name="initial_left_pos">1.2</xsl:variable>
7
 
<xsl:variable name="width_increment">3.3</xsl:variable>
8
 
<xsl:variable name="frame_width">3.0cm</xsl:variable>
9
 
 
10
 
<xsl:variable name="width_col1">1.2cm</xsl:variable>
11
 
<xsl:variable name="width_col2">1.8cm</xsl:variable>
12
 
 
13
 
<xsl:variable name="bottom_pos">2.4cm</xsl:variable>
14
 
<xsl:variable name="frame_height">26cm</xsl:variable>
15
 
 
16
 
<xsl:template match="/">
17
 
        <xsl:apply-templates select="results"/>
18
 
</xsl:template>
19
 
 
20
 
<xsl:template match="results">
21
 
        <document filename="example_5.pdf">
22
 
        <template pageSize="21cm,29.7cm" leftMargin="1.5cm" rightMargin="1.5cm" topMargin="1.5cm" bottomMargin="1.5cm" title="Bordereau acheteur" author="Generated by Tiny ERP, Fabien Pinckaers" allowSplitting="20">
23
 
                <pageTemplate id="main">
24
 
                        <pageGraphics>
25
 
                                <fill color="(0.4,0.4,0.4)"/>
26
 
                                <stroke color="(0.4,0.4,0.4)"/>
27
 
                                <setFont name="Helvetica" size="8"/>
28
 
                                <drawString x="1.8cm" y="1.4cm"><xsl:value-of select="auction/name"/></drawString>
29
 
                                <drawRightString x="19.2cm" y="1.4cm"><xsl:value-of select="auction/date-au1"/></drawRightString>
30
 
                                <lineMode width="0.2mm"/>
31
 
                                <lines>1.8cm 1.8cm 19.2cm 1.8cm</lines>
32
 
                        </pageGraphics>
33
 
                        <xsl:apply-templates select="lines/lot" mode="frames"/>
34
 
                </pageTemplate>
35
 
        </template>
36
 
 
37
 
        <stylesheet>
38
 
                <paraStyle name="name" fontName="Helvetica-Bold" fontSize="16" alignment="center"/>
39
 
                <blockTableStyle id="result">
40
 
                         <blockValign value="TOP"/>
41
 
                         <blockAlignment value="RIGHT" start="-1,0" stop="-1,-1"/>
42
 
                         <blockAlignment value="CENTER" start="0,0" stop="0,-1"/>
43
 
                         <blockFont name="Helvetica-BoldOblique" size="12" start="0,0" stop="-1,0"/>
44
 
                         <blockBackground colorName="grey" start="0,0" stop="-1,0"/>
45
 
                         <blockTextColor colorName="white" start="0,0" stop="-1,0"/>
46
 
                         <lineStyle kind="LINEBELOW" colorName="red" start="0,0" stop="-1,0"/>
47
 
                         <lineStyle kind="LINEBEFORE" colorName="grey" start="-1,0" stop="-1,-1"/>
48
 
                         <lineStyle kind="LINEBEFORE" colorName="black" start="0,1" stop="0,-1"/>
49
 
                         <lineStyle kind="LINEAFTER" colorName="black" start="-1,1" stop="-1,-1"/>
50
 
                </blockTableStyle>
51
 
        </stylesheet>
52
 
        
53
 
        <story>
54
 
                <xsl:apply-templates select="lines"/>
55
 
        </story>
56
 
        
57
 
        </document>
58
 
</xsl:template>
59
 
 
60
 
<xsl:template match="lines/lot" mode="frames">
61
 
        <xsl:if test="position() &lt; $number_columns + 1">
62
 
                <frame>
63
 
                        <xsl:attribute name="width">
64
 
                                <xsl:value-of select="$frame_width"/>
65
 
                        </xsl:attribute>
66
 
                        <xsl:attribute name="height">
67
 
                                <xsl:value-of select="$frame_height"/>
68
 
                        </xsl:attribute>
69
 
                        <xsl:attribute name="x1">
70
 
                                <xsl:value-of select="$initial_left_pos + (position()-1) * $width_increment"/>
71
 
                                <xsl:text>cm</xsl:text>
72
 
                        </xsl:attribute>
73
 
                        <xsl:attribute name="y1">
74
 
                                <xsl:value-of select="$bottom_pos"/>
75
 
                        </xsl:attribute>
76
 
                </frame>
77
 
        </xsl:if>
78
 
</xsl:template>
79
 
 
80
 
<xsl:template match="lines">
81
 
        <blockTable repeatRows="1" style="result">
82
 
                <xsl:attribute name="colWidths">
83
 
                        <xsl:value-of select="$width_col1"/>
84
 
                        <xsl:text>, </xsl:text>
85
 
                        <xsl:value-of select="$width_col2"/>
86
 
                </xsl:attribute>
87
 
                        
88
 
                <tr>
89
 
                        <td t="1">Num</td>
90
 
                        <td t="1">Adj.</td>
91
 
                </tr>
92
 
                <xsl:apply-templates select="lot" mode="story"/>
93
 
        </blockTable>
94
 
        <pageBreak/>
95
 
</xsl:template>
96
 
 
97
 
<xsl:template match="lot" mode="story">
98
 
        <tr>
99
 
                <td>
100
 
                        <xsl:value-of select="lot-number"/>
101
 
                </td>
102
 
                <td>
103
 
                        <xsl:if test="lot-price!=''">
104
 
                                <xsl:value-of select="round(lot-price)"/>
105
 
                        </xsl:if>
106
 
                </td>
107
 
        </tr>
108
 
</xsl:template>
109
 
 
110
 
</xsl:stylesheet>