~technofluid-team/openobject-addons/technofluid_multiple_installations

« back to all changes in this revision

Viewing changes to mrp/report/bom.xsl

  • Committer: pinky
  • Date: 2006-12-07 13:41:40 UTC
  • Revision ID: pinky-dedd7f8a42bd4557112a0513082691b8590ad6cc
New trunk

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:template match="/">
 
5
                <document xmlns:fo="http://www.w3.org/1999/XSL/Format">
 
6
                        <template leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm"
 
7
                                bottomMargin="2.0cm" title="Bill of material"
 
8
                                author="Generated by Tiny ERP" allowSplitting="20">
 
9
                                <xsl:for-each select="/boms/bom">
 
10
                                        <pageTemplate>
 
11
                                                <xsl:attribute name="id">
 
12
                                                        <xsl:value-of select="position()" />
 
13
                                                </xsl:attribute>
 
14
                                                <pageGraphics>
 
15
                                                        <!--page bottom-->
 
16
                                                        <place x="1cm" y="1.5cm" width="19cm" height="3cm">
 
17
                                                                <blockTable colWidths="11cm,4cm,4cm" style="cadre">
 
18
                                                                        <tr>
 
19
                                                                                <td>
 
20
                                                                                        <para style="huge">
 
21
                                                                                                <xsl:value-of select="name" />
 
22
                                                                                        </para>
 
23
                                                                                        <spacer length="5mm" />
 
24
                                                                                        <para>
 
25
                                                                                                <xsl:value-of select="product" />
 
26
                                                                                        </para>
 
27
                                                                                </td>
 
28
                                                                                <td>
 
29
                                                                                        <para style="huge">
 
30
                                                                                                <xsl:text>N° </xsl:text><xsl:value-of select="id" />
 
31
                                                                                        </para>
 
32
                                                                                </td>
 
33
                                                                                <td>
 
34
                                                                                        <para>INDICE</para>
 
35
                                                                                        <para>
 
36
                                                                                                <xsl:value-of 
 
37
                                                                                                        select="revision[last()]/indice" />
 
38
                                                                                        </para>
 
39
                                                                                </td>
 
40
                                                                        </tr>
 
41
                                                                </blockTable>
 
42
                                                        </place>
 
43
                                                </pageGraphics>
 
44
                                                <frame id="list" x1="1cm" y1="1.0cm" width="19.0cm" height="24.5cm" />
 
45
                                        </pageTemplate>
 
46
                                </xsl:for-each>
 
47
                        </template>
 
48
                        <stylesheet>
 
49
                                <paraStyle name="huge" fontSize="15" />
 
50
                                <blockTableStyle id="bom">
 
51
                                        <blockValign value="TOP" />
 
52
                                        <blockTextColor colorName="white" start="0,0" stop="-1,0" />
 
53
                                        <blockBackground colorName="grey" start="0,0" stop="-1,0" />
 
54
                                        <lineStyle kind="LINEABOVE" thickness="0.5" start="0,0"
 
55
                                                stop="-1,0" colorName="black" />
 
56
                                        <lineStyle kind="LINEBELOW" thickness="0.5" colorName="black" />
 
57
                                        <lineStyle kind="LINEBEFORE" thickness="0.5" colorName="black" />
 
58
                                        <lineStyle kind="LINEAFTER" thickness="0.5" colorName="black" />
 
59
                                </blockTableStyle>
 
60
 
 
61
                                <blockTableStyle id="cadre">
 
62
                                        <blockValign value="TOP" />
 
63
                                        <lineStyle kind="LINEABOVE" thickness="0.5" start="0,0"
 
64
                                                stop="-1,0" colorName="black" />
 
65
                                        <lineStyle kind="LINEBELOW" thickness="0.5" colorName="black" />
 
66
                                        <lineStyle kind="LINEBEFORE" thickness="0.5" colorName="black" />
 
67
                                        <lineStyle kind="LINEAFTER" thickness="0.5" colorName="black" />
 
68
                                </blockTableStyle>
 
69
 
 
70
                                <blockTableStyle id="cadre2">
 
71
                                        <blockValign value="TOP" />
 
72
                                        <lineStyle kind="LINEBELOW" thickness="0.5" colorName="black" start="0,0" stop="-1,-2"/>
 
73
                                </blockTableStyle>
 
74
                        </stylesheet>
 
75
                        <story>
 
76
                                <xsl:apply-templates select="/boms/bom" />
 
77
                        </story>
 
78
                </document>
 
79
 
 
80
        </xsl:template>
 
81
 
 
82
        <xsl:template match="bom">
 
83
                <blockTable repeatRows="1" colWidths="1.5cm,1.5cm,8cm,4cm"
 
84
                        style="bom">
 
85
                        <tr>
 
86
                                <td>Pos.</td>
 
87
                                <td>Qty</td>
 
88
                                <td>Designation</td>
 
89
                                <td>Ref</td>
 
90
                        </tr>
 
91
                        <xsl:for-each select="bom-line">
 
92
                                <tr>
 
93
                                        <td>
 
94
                                                <xsl:value-of select="pos" />
 
95
                                        </td>
 
96
                                        <td>
 
97
                                                <xsl:value-of select="qty" />
 
98
                                        </td>
 
99
                                        <td>
 
100
                                                <xsl:value-of select="name" />
 
101
                                        </td>
 
102
                                        <td/>
 
103
                                </tr>
 
104
                        </xsl:for-each>
 
105
                </blockTable>
 
106
                <blockTable colWidths="11cm,4cm,4cm" style="cadre">
 
107
                        <tr>
 
108
                                <td>
 
109
                                        <blockTable colWidths="1cm,5cm,2cm,2cm"
 
110
                                                style="cadre2">
 
111
                                                <tr>
 
112
                                                        <td>Indice</td>
 
113
                                                        <td>Modification</td>
 
114
                                                        <td>Author</td>
 
115
                                                        <td>Date</td>
 
116
                                                </tr>
 
117
                                                <xsl:for-each select="revision">
 
118
                                                        <tr>
 
119
                                                                <td>
 
120
                                                                        <xsl:value-of select="indice" />
 
121
                                                                </td>
 
122
                                                                <td>
 
123
                                                                        <xsl:value-of select="modif" />
 
124
                                                                </td>
 
125
                                                                <td>
 
126
                                                                        <xsl:value-of select="author" />
 
127
                                                                </td>
 
128
                                                                <td>
 
129
                                                                        <xsl:value-of select="date" />
 
130
                                                                </td>
 
131
                                                        </tr>
 
132
                                                </xsl:for-each>
 
133
                                        </blockTable>
 
134
                                </td>
 
135
                                <td>
 
136
                                        <para>
 
137
                                                <xsl:text>Date </xsl:text>
 
138
                                        </para>
 
139
                                        <para>
 
140
                                                <xsl:value-of select="date" />
 
141
                                        </para>
 
142
                                </td>
 
143
                                <td>
 
144
                                        <xsl:text>Page </xsl:text>
 
145
                                </td>
 
146
                        </tr>
 
147
                </blockTable>
 
148
 
 
149
                <xsl:if test="position() &lt; count(/boms/bom)">
 
150
                        <setNextTemplate>
 
151
                                <xsl:attribute name="name">
 
152
                                        <xsl:value-of select="position()+1" />
 
153
                                </xsl:attribute>
 
154
                        </setNextTemplate>
 
155
                </xsl:if>
 
156
                <pageBreak />
 
157
        </xsl:template>
 
158
</xsl:stylesheet>