~openerp-groupes/openobject-server/6.0-fix-setup-windows

« back to all changes in this revision

Viewing changes to bin/addons/base/res/partner/report/business_card.xsl

  • Committer: pinky
  • Date: 2006-12-07 13:41:40 UTC
  • Revision ID: pinky-3f10ee12cea3c4c75cef44ab04ad33ef47432907
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:variable name="initial_bottom_pos">20.5</xsl:variable>
 
5
<xsl:variable name="initial_left_pos">0.5</xsl:variable>
 
6
<xsl:variable name="height_increment">5.5</xsl:variable>
 
7
<xsl:variable name="width_increment">8.5</xsl:variable>
 
8
<xsl:variable name="frame_height">5.5cm</xsl:variable>
 
9
<xsl:variable name="frame_width">8.5cm</xsl:variable>
 
10
<xsl:variable name="number_columns">3</xsl:variable>
 
11
<xsl:variable name="max_cards">8</xsl:variable>
 
12
 
 
13
<xsl:template match="/">
 
14
        <xsl:apply-templates select="addresses"/>
 
15
</xsl:template>
 
16
 
 
17
<xsl:template match="addresses">
 
18
        <document>
 
19
                <template leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm" bottomMargin="2.0cm" title="Address list" author="Generated by Tiny ERP, Fabien Pinckaers">
 
20
                <pageTemplate id="all">
 
21
                        <pageGraphics/>
 
22
                                <xsl:apply-templates select="address" mode="frames"/>
 
23
                        </pageTemplate>
 
24
                </template>
 
25
                <stylesheet>
 
26
                        <paraStyle name="nospace" fontName="Courier" fontSize="12" spaceBefore="0" spaceAfter="0"/>
 
27
                </stylesheet>
 
28
                <story>
 
29
                        <xsl:apply-templates select="address" mode="story"/>
 
30
                </story>
 
31
        </document>
 
32
</xsl:template>
 
33
 
 
34
<xsl:template match="address" mode="frames">
 
35
        <xsl:if test="position() &lt; $max_frames + 1">
 
36
                <frame>
 
37
                        <xsl:attribute name="width">
 
38
                                <xsl:value-of select="$frame_width"/>
 
39
                        </xsl:attribute>
 
40
                        <xsl:attribute name="height">
 
41
                                <xsl:value-of select="$frame_height"/>
 
42
                        </xsl:attribute>
 
43
                        <xsl:attribute name="x1">
 
44
                                <xsl:value-of select="$initial_left_pos + ((position()-1) mod $number_columns) * $width_increment"/>
 
45
                                <xsl:text>cm</xsl:text>
 
46
                        </xsl:attribute>
 
47
                        <xsl:attribute name="y1">
 
48
                                <xsl:value-of select="$initial_bottom_pos - floor((position()-1) div $number_columns) * $height_increment"/>
 
49
                                <xsl:text>cm</xsl:text>
 
50
                        </xsl:attribute>
 
51
                </frame>
 
52
        </xsl:if>
 
53
</xsl:template>
 
54
 
 
55
<xsl:template match="address" mode="story">
 
56
        
 
57
                <drawCentredString x="105mm" y="28cm" t="1">PICKINGLIST</drawCentredString>
 
58
                <image x="5mm" y="5m" file="addons/base/report/logo-tiny.png"/>
 
59
<blockTable colWidths="3cm,3cm" style="infos">
 
60
                <tr>
 
61
                        <td>Logo</td>
 
62
                        <td/>
 
63
                </tr><tr>
 
64
                        <td><para><xsl:value-of select="client-id"/></para></td>
 
65
                        <td><para><xsl:value-of select="shipping-id"/></para></td>
 
66
                        <td><para><xsl:value-of select="picking-date"/></para></td>
 
67
                        <td><para><xsl:value-of select="expedition-date"/></para></td>
 
68
                        <td><para><xsl:value-of select="command-number"/></para></td>
 
69
                </tr>
 
70
                </blockTable>
 
71
        
 
72
        <para style="nospace"><xsl:value-of select="company"/></para>
 
73
        <para style="nospace"><xsl:value-of select="partner_name"/></para>
 
74
        <para style="nospace"><xsl:value-of select="street"/></para>
 
75
        <para style="nospace"><xsl:value-of select="zip"/><xsl:text> </xsl:text><xsl:value-of select="city"/></para>
 
76
        <para style="nospace"><xsl:value-of select="country"/></para>
 
77
        <nextFrame/>
 
78
</xsl:template>
 
79
</xsl:stylesheet>