bugfix
[odoo/odoo.git] / addons / auction / report / ach_bordereau_photo.xsl
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:import href="../../custom/corporate_defaults.xsl"/>
5         <xsl:import href="../../base/report/rml_template.xsl"/>
6
7         <xsl:template match="/">
8                 <xsl:call-template name="rml"/>
9         </xsl:template>
10
11         <xsl:template name="stylesheet">
12                 <paraStyle name="login-title" fontName="Helvetica" fontSize="12"/>
13                 <paraStyle name="login" fontName="Helvetica-Bold" fontSize="16"/>
14
15                 <blockTableStyle id="objects">
16                          <blockFont name="Helvetica-BoldOblique" size="12" start="0,0" stop="-1,0"/>
17                          <blockValign value="TOP"/>
18                          <blockAlignment value="RIGHT" start="-1,0" stop="-1,-1"/>
19                          <lineStyle kind="LINEBELOW" start="0,0" stop="-1,0"/>
20                 </blockTableStyle>
21
22                 <blockTableStyle id="object-totals">
23                          <blockValign value="TOP"/>
24                          <blockAlignment value="RIGHT"/>
25                          <lineStyle kind="LINEABOVE" start="-1,0" stop="-1,0"/>
26                          <lineStyle kind="LINEABOVE" start="-1,-1" stop="-1,-1"/>
27                 </blockTableStyle>
28         </xsl:template>
29
30         <xsl:template name="story">
31                 <xsl:apply-templates select="borderform-list"/>
32         </xsl:template>
33
34         <xsl:template match="borderform-list">
35                 <xsl:apply-templates select="borderform">
36                         <xsl:sort order="ascending" select="client_info/name"/>
37                 </xsl:apply-templates>
38         </xsl:template>
39
40         <xsl:template match="client_info">
41                 <para>
42                         <b>
43                                 <xsl:value-of select="title" />
44                                 <xsl:text> </xsl:text>
45                                 <xsl:value-of select="name"/>
46                         </b>
47                 </para>
48                 <para><xsl:value-of select="street"/></para>
49                 <para><xsl:value-of select="street2"/></para>
50                 <para>
51                         <xsl:value-of select="zip"/>
52                         <xsl:text> </xsl:text>
53                         <xsl:value-of select="city"/>
54                 </para>
55 <!--            <para><xsl:value-of select="country"/></para>-->
56         </xsl:template>
57
58         <xsl:template match="borderform">
59                 <xsl:apply-templates select="client_info"/>
60
61                 <setNextTemplate name="other_pages"/>
62                 <nextFrame/>
63
64                 <para style="login-title" t="1">Plate Number:</para>
65                 <para style="login"><xsl:value-of select="login"/></para>
66
67                 <spacer length="1cm"/>
68
69                 <para>
70                         <b t="1">Document</b>: <xsl:text t="1">Buyer form</xsl:text>
71                 </para><para>
72                         <b t="1">Auction</b>: <xsl:value-of select="title"/>
73                 </para>
74
75                 <xsl:if test="client_info">
76                         <para>
77                                 <b t="1">Customer Contact</b>:
78                                 <xsl:value-of select="client_info/phone"/>
79                                 <xsl:if test="number(string-length(client_info/mobile) &gt; 0) + number(string-length(client_info/phone) &gt; 0) = 2">
80                                         <xsl:text> - </xsl:text>
81                                 </xsl:if>
82                                 <xsl:value-of select="client_info/mobile"/>
83                         </para><para>
84                                 <b t="1">Customer Reference</b>: <xsl:value-of select="client_info/ref"/>
85                         </para>
86                 </xsl:if>
87
88                 <spacer length="1cm"/>
89
90                 <xsl:apply-templates select="objects"/>
91
92                 <setNextTemplate name="first_page"/>
93                 <pageBreak/>
94         </xsl:template>
95
96         <xsl:template match="objects">
97                 <blockTable colWidths="3.1cm,1.8cm,9.6cm,1.5cm,2.2cm" style="objects">
98                         <tr>
99                                 <td/>
100                                 <td t="1">Cat. N.</td>
101                                 <td t="1">Description</td>
102                                 <td t="1">Paid</td>
103                                 <td t="1">Adj.(EUR)</td>
104                         </tr>
105                         <xsl:apply-templates select="object"/>
106                 </blockTable>
107                 <condPageBreak height="3.2cm"/>
108                 <blockTable colWidths="3.1cm,1.8cm,9.6cm,1.5cm,2.2cm" style="object-totals">
109                         <tr>
110                                 <td/>
111                                 <td/>
112                                 <td/>
113                                 <td t="1">Subtotal:</td>
114                                 <td><xsl:value-of select="format-number(sum(object[price != '']/price), '#,##0.00')"/></td>
115                         </tr>
116                         <xsl:apply-templates select="cost"/>
117                         <tr>
118                                 <td/>
119                                 <td/>
120                                 <td/>
121                                 <td t="1">Total:</td>
122                                 <td><xsl:value-of select="format-number(sum(object[price != '']/price) + sum(cost/amount), '#,##0.00')"/></td>
123                         </tr>
124                 </blockTable>
125         </xsl:template>
126
127         <xsl:template match="cost">
128                 <tr>
129                         <td/>
130                         <td/>
131                         <td/>
132                         <td><xsl:value-of select="name"/>:</td>
133                         <td><xsl:value-of select="format-number(amount, '#,##0.00')"/></td>
134                 </tr>
135         </xsl:template>
136
137         <xsl:template match="object">
138                 <tr>
139                         <td>
140                                 <xsl:if test="image">
141                                         <image width="2.5cm" height="2.2cm">
142                                                 <xsl:attribute name="name"><xsl:value-of select="image"/></xsl:attribute>
143                                         </image>
144                                 </xsl:if>
145                         </td>
146                         <td><xsl:value-of select="ref"/></td>
147                         <td>
148                                 <para>
149                                         <b><xsl:value-of select="title"/><xsl:text>. </xsl:text></b>
150                                         <xsl:value-of select="desc"/>
151                                 </para>
152                         </td>
153                         <td><xsl:if test="state='paid'"><xsl:text>X</xsl:text></xsl:if></td>
154                         <td>
155                                 <xsl:if test="price!=''">
156                                         <xsl:value-of select="format-number(price, '#,##0.00')"/>
157                                 </xsl:if>
158                         </td>
159                 </tr>
160         </xsl:template>
161
162 </xsl:stylesheet>