[MERGE] addons 16 survey
[odoo/odoo.git] / addons / stock / report / lot_move_label.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         <xsl:variable name="initial_bottom_pos">24.5</xsl:variable>
4         <xsl:variable name="initial_left_pos">1</xsl:variable>
5         <xsl:variable name="height_increment">3.8</xsl:variable>
6         <xsl:variable name="width_increment">7</xsl:variable>
7         <xsl:variable name="frame_height">3.5cm</xsl:variable>
8         <xsl:variable name="frame_width">6.5cm</xsl:variable>
9         <xsl:variable name="number_columns">3</xsl:variable>
10         <xsl:variable name="max_frames">21</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 Open 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                         </stylesheet>
27                         <story>
28                                 <xsl:apply-templates select="lot-line" mode="story"/>
29                         </story>
30                 </document>
31         </xsl:template>
32
33         <xsl:template match="lot-line" mode="frames">
34                 <xsl:if test="position() &lt; $max_frames + 1">
35                         <frame>
36                                 <xsl:attribute name="width">
37                                         <xsl:value-of select="$frame_width"/>
38                                 </xsl:attribute>
39                                 <xsl:attribute name="height">
40                                         <xsl:value-of select="$frame_height"/>
41                                 </xsl:attribute>
42                                 <xsl:attribute name="x1">
43                                         <xsl:value-of select="$initial_left_pos + ((position()-1) mod $number_columns) * $width_increment"/>
44                                         <xsl:text>cm</xsl:text>
45                                 </xsl:attribute>
46                                 <xsl:attribute name="y1">
47                                         <xsl:value-of select="$initial_bottom_pos - floor((position()-1) div $number_columns) * $height_increment"/>
48                                         <xsl:text>cm</xsl:text>
49                                 </xsl:attribute>
50                         </frame>
51                 </xsl:if>
52         </xsl:template>
53
54         <xsl:template match="lot-line" mode="story">
55                 <para style="nospace"><xsl:value-of select="code"/><xsl:text>, </xsl:text><xsl:value-of select="quantity"/><xsl:text> </xsl:text><xsl:value-of select="uom"/></para>
56                 <para style="nospace"><xsl:value-of select="product"/><xsl:text> </xsl:text><xsl:value-of select="variant"/></para>
57                 <para style="nospace">Serial: <xsl:value-of select="serial"/></para>
58                 <para style="nospace">Tracking: <xsl:value-of select="serial"/></para>
59                 <spacer length="0.3cm"/>
60                 <barCode><xsl:value-of select="tracking"/></barCode>
61                 <nextFrame/>
62         </xsl:template>
63 </xsl:stylesheet>