[MERGE]: Merge with lp:openobject-addons
[odoo/odoo.git] / addons / product / report / product_price.xsl
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet version="1.0"
3     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4     xmlns:fo="http://www.w3.org/1999/XSL/Format">
5    <xsl:import href="../../base/report/corporate_defaults.xsl" />
6     <xsl:template match="/">
7                 <xsl:call-template name="rml" />
8     </xsl:template>
9
10
11     <xsl:template name="rml" match="/">
12                 <document filename="example.pdf">
13                         <template>
14                                 <pageTemplate id="first">
15                                         <frame id="first" x1="1cm" y1="2.5cm" width="19.0cm" height="23.0cm"/>
16                                         <pageGraphics>
17                                                 <xsl:apply-imports />
18                                         </pageGraphics>
19                                 </pageTemplate>
20                         </template>
21                         <stylesheet>
22                                 <paraStyle name="normal" fontName="Times-Roman" fontSize="12"  />
23                                 <paraStyle name="title" fontName="Times-Bold" fontSize="15" alignment="center" />
24                                 <paraStyle name="table_title" fontName="Times-Bold" fontSize="12" alignment="center" />
25                                 <paraStyle name="product1" fontName="Times-Roman" fontSize="8" />
26                                 <paraStyle name="categ" fontName="Times-Bold" fontSize="10"  textColor="blue"/>
27                                 <paraStyle name="price" fontName="Times-Roman" fontSize="8" alignment="right" />
28
29                                 <blockTableStyle id="main_title">
30                                         <blockAlignment value="CENTER" />
31                                         <lineStyle kind="GRID" colorName="black"/>
32                                         <blockBackground colorName="#e6e6e6" />
33                                         <blockValign value="TOP"/>
34                                 </blockTableStyle>
35
36                                 <blockTableStyle id="product">
37                                         <blockAlignment value="LEFT" />
38                                         <xsl:for-each select="/report/title">
39                                                 <xsl:variable name="col" select="attribute::number" />
40                                                 <blockBackground>
41                                                         <xsl:attribute name="colorName">#e6e6e6</xsl:attribute>
42                                                         <xsl:attribute name="start">
43                                                                 <xsl:value-of select="$col" />
44                                                                 <xsl:text>,0</xsl:text>
45                                                         </xsl:attribute>
46                                                         <xsl:attribute name="stop">
47                                                                 <xsl:value-of select="$col" />
48                                                                 <xsl:text>,0</xsl:text>
49                                                         </xsl:attribute>
50                                                 </blockBackground>
51                                         </xsl:for-each>
52                                         <lineStyle kind="LINEABOVE" colorName="black" start="0,0" stop="-1,-1" />
53                                         <lineStyle kind="LINEBEFORE" colorName="black" start="0,0" stop="-1,-1"/>
54                                         <lineStyle kind="LINEAFTER" colorName="black" start="-1,0" stop="-1,-1"/>
55                                         <lineStyle kind="LINEBELOW" colorName="black" start="0,-1" stop="-1,-1"/>
56                                         <blockValign value="TOP"/>
57                                 </blockTableStyle>
58                         </stylesheet >
59                         <story>
60                                 <xsl:call-template name="story"/>
61                         </story>
62                 </document>
63     </xsl:template>
64
65     <xsl:template name="story">
66                 <spacer length="1cm" />
67                 <blockTable   rowHeights="1cm">
68                         <xsl:attribute name="style">main_title</xsl:attribute>
69                         <tr> <td> <para style="title" t="1">Products Price List</para> </td> </tr>
70                 </blockTable>
71                 <spacer length="1cm" />
72                 <para style="normal" t="1">Price List Name :<xsl:value-of select="report/pricelist" /></para>
73                 <para style="normal" t="1">Currency : <xsl:value-of select="report/currency" /></para>
74                 <para style="normal" t="1">Printing Date : <xsl:value-of select="report/date" /></para>
75                 <spacer length="0.7cm" />
76                 <blockTable>
77                         <xsl:attribute name="style">product</xsl:attribute>
78                         <xsl:attribute name="colWidths"><xsl:value-of select="report/cols" /></xsl:attribute>
79                         <tr>
80                                 <xsl:for-each select="report/title" >
81                         <td><para style="table_title"> <xsl:value-of select="attribute::name" /> </para></td>
82                     </xsl:for-each>
83             </tr>
84
85                         <xsl:for-each select="report/product/pro" >
86                 <tr>
87                     <xsl:choose>
88                                         <xsl:when test="@categ">
89                                                 <td> <para style="categ"><xsl:value-of select="attribute::name" /> </para> </td>
90                                         </xsl:when>
91                                         <xsl:otherwise>
92                                     <td> <para style="product1">   <xsl:value-of select="attribute::name" /> </para> </td>
93
94                                 </xsl:otherwise>
95                                 </xsl:choose>
96                     <xsl:for-each select="price" >
97                         <td><para style="price"> <xsl:value-of select="attribute::name" /> </para> </td>
98                 </xsl:for-each>
99                 </tr>
100                 </xsl:for-each>
101         </blockTable>
102  </xsl:template>
103
104 </xsl:stylesheet>