[fix] problem in o2m
[odoo/odoo.git] / addons / auction / report / lots_list.xsl
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
4         <xsl:import href="corporate_defaults.xsl"/>
5         <xsl:template match="/">
6                 <xsl:apply-templates select="lots"/>
7         </xsl:template>
8
9         <xsl:template match="/">
10                 <document xmlns:fo="http://www.w3.org/1999/XSL/Format">
11                         <template >
12                                 <pageTemplate id="all">
13                                         <frame id="list" x1="1.0cm" y1="0.0cm" width="19.0cm" height="24cm"/>
14                                         <pageGraphics>
15                                                 <xsl:apply-imports/>
16                                         </pageGraphics>
17                                 </pageTemplate>
18                         </template>
19
20                         <stylesheet>
21                                 <paraStyle name="small" fontName="Courier" fontSize="12" spaceBefore="0mm" spaceAfter="0mm"/>
22                                 <paraStyle name="verysmall" fontSize="10" fontName="Courier" spaceBefore="0mm" spaceAfter="0mm"/>
23                                 <paraStyle name="smallest" fontSize="8" fontName="Courier" spaceBefore="-1mm" spaceAfter="-1Mm"/>
24
25                                 <blockTableStyle id="left">
26                                         <blockValign value="TOP"/>
27                                         <blockAlignment value="LEFT"/>
28                                         <blockFont name="Helvetica-Bold" size="10"/>
29                                         <blockTextColor colorName="black"/>
30                                         <lineStyle kind="LINEABOVE" thickness="0.5" colorName="black" start="0,0" stop="-1,0"/>
31                                         <lineStyle kind="LINEABOVE" thickness="0.5" colorName="black" start="0,0" stop="-1,0"/>
32                                         <lineStyle kind="LINEBELOW" thickness="0.5" colorName="black"/>
33                                         <lineStyle kind="LINEBEFORE" thickness="0.5" colorName="black" start="0,0" stop="-1,-1"/>
34                                         <lineStyle kind="LINEBEFORE" thickness="0.5" colorName="black" start="0,0" stop="0,-1"/>
35                                         <lineStyle kind="LINEAFTER" thickness="0.5" colorName="black" start="-1,0" stop="-1,-1"/>
36                                         <blockBackground colorName="(1,1,1)" start="0,0" stop="-1,-1"/>
37                                         <blockBackground colorName="(0.88,0.88,0.88)" start="0,0" stop="-1,0"/>
38                                 </blockTableStyle>
39                         </stylesheet>
40
41                         <story>
42                                 <blockTable repeatRows="1" style="left" colWidths="1.8cm,10.0cm,2.0cm,1.6cm,2.3cm,2cm">
43                                         <tr>
44                                                 <td>
45                                                         <para style="small"><b t="1">Cat. N.</b></para>
46                                                 </td><td>
47                                                         <para style="small"><b t="1">Description and bids</b></para>
48                                                 </td><td>
49                                                         <para style="small"><b t="1">Est.</b></para>
50                                                 </td><td>
51                                                         <para style="small"><b t="1">Limit</b></para>
52                                                 </td><td>
53                                                         <para style="small"><b t="1">Inv, Name</b></para>
54                                                 </td><td>
55                                                         <para style="small"><b t="1">Buyer, Price</b></para>
56                                                 </td>
57                                         </tr>
58                                         <xsl:apply-templates select="lots/lot"/>
59                                 </blockTable>
60                         </story>
61                 </document>
62         </xsl:template>
63
64         <xsl:template match="lots/lot">
65                 <tr>
66                         <td>
67                                 <para style="verysmall"><xsl:value-of select="lot_num"/></para>
68                         </td><td>
69                                 <para style="verysmall">
70                                     <b><xsl:value-of select="artist"/></b>
71                                 </para>
72                                 <para style="verysmall">
73                                     <xsl:value-of select="lot_desc"/>
74                                 </para>
75                                 <xsl:for-each select="bid">
76                                         <xsl:sort order="descending" select="bid_prix"/>
77                                         <para style="smallest">
78                                                 <xsl:choose>
79                                                         <xsl:when test="bid_tel_ok='1'">
80                                                                 <b t="1">TEL:</b>
81                                                         </xsl:when>
82                                                         <xsl:otherwise t="1">
83                                                                 BID:
84                                                         </xsl:otherwise>
85                                                 </xsl:choose>
86
87                                                 <xsl:value-of select="bid_name"/>
88                                                 <xsl:text>(</xsl:text><xsl:value-of select="bid_id"/><xsl:text>)</xsl:text>
89                                                 <xsl:if test="round(bid_prix)&gt;0">
90                                                         <xsl:text> </xsl:text><b><xsl:value-of select="round(bid_prix)"/><xsl:text> EUR</xsl:text></b>
91                                                 </xsl:if>
92                                                 <xsl:if test="bid_tel_ok='1'">
93                                                         <b><xsl:text t="1">, TEL:</xsl:text><xsl:value-of select="bid_tel"/></b>
94                                                 </xsl:if>
95                                         </para>
96                                 </xsl:for-each>
97                         </td><td>
98                                 <para style="verysmall">
99                                         <xsl:if test="lot_est1 != ''">
100                                                 <xsl:value-of select="round(lot_est1)"/>
101                                         </xsl:if>
102                                         <xsl:text>-</xsl:text>
103                                         <xsl:if test="lot_est2 != ''">
104                                                 <xsl:value-of select="round(lot_est2)"/>
105                                         </xsl:if>
106                                 </para>
107                         </td><td>
108                                 <xsl:if test="lot_limit != ''">
109                                         <para style="verysmall">
110                                                 <b><xsl:value-of select="round(lot_limit)"/></b>
111                                         </para>
112                                 </xsl:if>
113                                 <xsl:if test="lot_limit_net != ''">
114                                         <para style="verysmall">
115                                                 <b t="1">NET</b>
116                                         </para>
117                                 </xsl:if>
118                         </td><td>
119                                 <para style="verysmall"><xsl:value-of select="deposit_num"/>
120                                         <xsl:text> </xsl:text><xsl:value-of select="substring(lot_seller_ref,0,5)"/>
121                                         <xsl:text> </xsl:text><xsl:value-of select="substring(lot_seller,0,9)"/>
122                                 </para>
123                         </td><td>
124                                 <para style="verysmall">
125                                         <xsl:value-of select="buyer_login"/>
126                                         <xsl:if test="obj_price &gt; 0">
127                                                 <xsl:text>, </xsl:text>
128                                                 <xsl:value-of select="obj_price"/>
129                                         </xsl:if>
130                                 </para>
131                         </td>
132                 </tr>
133         </xsl:template>
134 </xsl:stylesheet>