~technofluid-team/openobject-addons/technofluid_multiple_installations

« back to all changes in this revision

Viewing changes to product/report/product_label.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
        <xsl:variable name="initial_bottom_pos">24.5</xsl:variable>
 
4
        <xsl:variable name="initial_left_pos">0.5</xsl:variable>
 
5
        <xsl:variable name="height_increment">4.8</xsl:variable>
 
6
        <xsl:variable name="width_increment">10</xsl:variable>
 
7
        <xsl:variable name="frame_height">3cm</xsl:variable>
 
8
        <xsl:variable name="frame_width">9.3cm</xsl:variable>
 
9
        <xsl:variable name="number_columns">2</xsl:variable>
 
10
        <xsl:variable name="max_frames">16</xsl:variable>
 
11
 
 
12
        <xsl:template match="/">
 
13
                <xsl:apply-templates select="lots"/>
 
14
        </xsl:template>
 
15
 
 
16
        <xsl:template match="lots">
 
17
                <document>
 
18
                        <template leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm" bottomMargin="2.0cm" title="Address list" author="Generated by Tiny ERP">
 
19
                                <pageTemplate id="all">
 
20
                                        <pageGraphics/>
 
21
                                        <xsl:apply-templates select="lot-line" mode="frames"/>
 
22
                                </pageTemplate>
 
23
                        </template>
 
24
                        <stylesheet>
 
25
                                <paraStyle name="nospace" fontName="Courier" fontSize="10" spaceBefore="0" spaceAfter="0"/>
 
26
                                <blockTableStyle id="mytable">
 
27
                                        <blockBackground colorName="lightred" start="0,0" stop="0,0"/>
 
28
                                        <blockBackground colorName="lightgrey" start="1,0" stop="-1,0"/>
 
29
                                        <blockAlignment value="CENTER"/>
 
30
                                        <blockValign value="MIDDLE"/>
 
31
                                        <blockFont name="Helvetica-BoldOblique" size="14" start="0,0" stop="-1,0"/>
 
32
                                        <blockFont name="Helvetica" size="8" start="0,1" stop="-1,1"/>
 
33
                                        <lineStyle kind="GRID" colorName="black" tickness="1"/>
 
34
                                </blockTableStyle>
 
35
                        </stylesheet>
 
36
                        <story>
 
37
                                <xsl:apply-templates select="lot-line" mode="story"/>
 
38
                        </story>
 
39
                </document>
 
40
        </xsl:template>
 
41
 
 
42
        <xsl:template match="lot-line" mode="frames">
 
43
                <xsl:if test="position() &lt; $max_frames + 1">
 
44
                        <frame>
 
45
                                <xsl:attribute name="width">
 
46
                                        <xsl:value-of select="$frame_width"/>
 
47
                                </xsl:attribute>
 
48
                                <xsl:attribute name="height">
 
49
                                        <xsl:value-of select="$frame_height"/>
 
50
                                </xsl:attribute>
 
51
                                <xsl:attribute name="x1">
 
52
                                        <xsl:value-of select="$initial_left_pos + ((position()-1) mod $number_columns) * $width_increment"/>
 
53
                                        <xsl:text>cm</xsl:text>
 
54
                                </xsl:attribute>
 
55
                                <xsl:attribute name="y1">
 
56
                                        <xsl:value-of select="$initial_bottom_pos - floor((position()-1) div $number_columns) * $height_increment"/>
 
57
                                        <xsl:text>cm</xsl:text>
 
58
                                </xsl:attribute>
 
59
                        </frame>
 
60
                </xsl:if>
 
61
        </xsl:template>
 
62
 
 
63
        <xsl:template match="lot-line" mode="story">
 
64
                        <blockTable style="mytable" colWidths="2.8cm,5.4cm">
 
65
                        <tr>
 
66
                                <td>
 
67
                                        <para style="nospace"><xsl:value-of select="code"/></para>
 
68
                                </td><td>
 
69
                                        <para style="nospace"><xsl:value-of select="price"/> EUR</para>
 
70
                                </td>
 
71
                        </tr><tr>
 
72
                                <td>
 
73
                                        <barCode><xsl:value-of select="tracking"/></barCode>
 
74
                                </td><td>
 
75
                                        <para style="nospace"><xsl:value-of select="product"/></para><xsl:text>, </xsl:text>
 
76
                                        <para style="nospace"><xsl:value-of select="variant"/></para>
 
77
                                </td>
 
78
                        </tr>
 
79
                        </blockTable>
 
80
        <nextFrame/>
 
81
        </xsl:template>
 
82
</xsl:stylesheet>