[MERGE] base: raise an exception if the format of the bank account is wrong
[odoo/odoo.git] / openerp / addons / base / report / custom_new.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="../../base/report/custom_default_printscreen.xsl"/>
5         <xsl:import href="../../base/report/custom_rml_printscreen.xsl"/>
6         <xsl:template match="/">
7                 <xsl:call-template name="rml">
8                         <xsl:with-param name="pageSize" select="report/config/PageSize"/>
9                         <xsl:with-param name="page_format" select="report/config/PageFormat"/>
10                 </xsl:call-template>
11         </xsl:template>
12
13         <!-- stylesheet -->
14
15         <xsl:template name="stylesheet">
16                 <paraStyle name="title" fontName="Helvetica-Bold" fontSize="22" alignment="center"/>
17                 <paraStyle name="test" alignment="left" />
18         <paraStyle name="float_right" alignment="left"/>
19         <paraStyle name="tbl_heading" alignment="left"/>
20                 <blockTableStyle id="products">
21                         <!--<blockBackground colorName="grey" start="0,0" stop="-1,0"/> -->
22                         <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
23                         <blockValign value="TOP"/>
24                          <blockAlignment value="RIGHT"/>
25                          <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
26                         <!-- <lineStyle kind="GRID" colorName="black"/> -->
27                 </blockTableStyle>
28         </xsl:template>
29
30         <xsl:template name="story">
31                 <xsl:apply-templates select="report"/>
32         </xsl:template>
33
34         <xsl:template match="report">
35                 <xsl:apply-templates select="config"/>
36                 <!--<setNextTemplate name="other_pages"/>-->
37                 <blockTable style="products">
38                 <xsl:if test="string-length(./config/tableSize)&gt;1">
39                         <xsl:attribute name="colWidths">
40                                  <xsl:value-of select="./config/tableSize"/>
41                         </xsl:attribute>
42                 </xsl:if>
43
44                 <xsl:apply-templates select="header"/>
45                 <xsl:apply-templates select="lines"/>
46                 </blockTable>
47         </xsl:template>
48
49         <xsl:template match="config">
50                 <para style="title">
51                 <xsl:value-of select="report-header"/>
52                 </para>
53                 <spacer length="1cm" width="2mm"/>
54         </xsl:template>
55
56         <xsl:template match="header">
57                 <tr>
58                 <xsl:for-each select="field">
59                         <td>
60                         <para style="tbl_heading"><font fontName="Helvetica-Bold" fontSize="9">
61                         <xsl:value-of select="."/></font>
62                         </para>
63                         </td>
64                 </xsl:for-each>
65                 </tr>
66         </xsl:template>
67
68         <xsl:template match="lines">
69                 <xsl:apply-templates select="row"/>
70         </xsl:template>
71
72         <xsl:template match="row">
73                 <tr>
74                 <xsl:apply-templates select="col"/>
75                 </tr>
76         </xsl:template>
77
78         <xsl:template match="col">
79                 <td>
80                         <xsl:choose>
81                                 <xsl:when test="@para='yes'">
82                                         <xsl:choose>
83                                                 <xsl:when test="@tree='yes'">
84                                                         <para style="test">
85                                                                 <xsl:attribute name="leftIndent"><xsl:value-of select="@space"/></xsl:attribute>
86                                                                 <font fontName="Helvetica" fontSize="9">
87                                                                 <xsl:value-of select="."/>
88                                                                 </font>
89                                                         </para>
90                                                 </xsl:when>
91                        <xsl:when test="@tree='float'">
92                            <para style="float_right"><font fontName="Helvetica" fontSize="9">
93                                <xsl:value-of select="."/>
94                                </font></para>
95                        </xsl:when>
96
97                                                 <xsl:otherwise>
98                                                         <para style="test">
99                                                                 <font fontName="Helvetica" fontSize="9">
100                                                                 <xsl:value-of select="."/>
101                                                                 </font>
102                                                         </para>
103                                                 </xsl:otherwise>
104                                         </xsl:choose>
105                                 </xsl:when>
106                                 <xsl:when test="@para='group'">
107                                         <xsl:choose>
108                                                 <xsl:when test="@tree='yes'">
109                                                         <para>
110                                                                 <xsl:attribute name="leftIndent"><xsl:value-of select="@space"/></xsl:attribute>
111                                                                 <font fontName="Helvetica-bold" fontSize="9">
112                                                                 <xsl:value-of select="."/>
113                                                                 </font>
114                                                         </para>
115                                                 </xsl:when>
116                        <xsl:when test="@tree='float'">
117                            <para style="float_right"><font fontName="Helvetica-bold" fontSize="9" color="black">
118                                <xsl:value-of select="."/>
119                                </font></para>
120                        </xsl:when>
121                        <xsl:when test="@tree='undefined'">
122                             <para>
123                                 <xsl:attribute name="leftIndent">
124                                     <xsl:value-of select="@space"/>
125                                 </xsl:attribute>
126                                 <font fontName="Helvetica-Bold" fontSize="9" color="gray">
127                                     <xsl:value-of select="."/>
128                                 </font>
129                             </para>
130                        </xsl:when>
131
132                                                 <xsl:otherwise>
133                                                         <para>
134                                                                 <font fontName="Helvetica-bold" fontSize="9" color="black">
135                                                                 <xsl:value-of select="."/>
136                                                                 </font>
137                                                         </para>
138                                                 </xsl:otherwise>
139                                         </xsl:choose>
140
141                                 </xsl:when>
142                                 <xsl:otherwise>
143                                         <xpre>
144                                                 <xsl:value-of select="."/>
145                                         </xpre>
146                                 </xsl:otherwise>
147                         </xsl:choose>
148                 </td>
149         </xsl:template>
150
151
152 <!--    <xsl:template match="col">
153                 <td>
154                 <xsl:if test="@tree='yes'">
155                         <xsl:choose>
156                                 <xsl:when test="@para='yes'">
157                                         <para>
158                                                 <xsl:attribute name="leftIndent"><xsl:value-of select="@space"/></xsl:attribute>
159                                                 <xsl:value-of select="."/>
160                                         </para>
161                                 </xsl:when>
162                                 <xsl:otherwise>
163                                         <xpre>
164                                                 <xsl:value-of select="."/>
165                                         </xpre>
166                                 </xsl:otherwise>
167                         </xsl:choose>
168                 </xsl:if>
169                 <xsl:if test="@tree!='yes'">
170                         <xpre>
171                         <xsl:value-of select="."/>
172                         </xpre>
173                 </xsl:if>
174                 </td>
175         </xsl:template>
176 -->
177 </xsl:stylesheet>