[IMP]: Cost structure report with internal header.

bzr revid: rch_open_erp-20100913132841-p03ebf1pot6xp2dj
This commit is contained in:
rch (Open ERP) 2010-09-13 18:58:41 +05:30
parent 651c90d0af
commit d0edd204c0
3 changed files with 51 additions and 25 deletions

View File

@ -1,7 +1,7 @@
<?xml version = '1.0' encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="signature">Axair</xsl:variable>
<xsl:variable name="signature" select="//corporate-header/user/signature"/>
<xsl:variable name="title">Open ERP Report</xsl:variable>
<xsl:variable name="leftMargin">1cm</xsl:variable>
<xsl:variable name="rightMargin">1cm</xsl:variable>
@ -11,26 +11,49 @@
<xsl:variable name="page_format">a4_letter</xsl:variable>
<xsl:template name="first_page_graphics_corporation">
<!--logo-->
<fill color="black"/>
<stroke color="black"/>
<setFont name="DejaVu Sans" size="8"/>
<drawString x="1.3cm" y="28.3cm"><xsl:value-of select="//date"/></drawString>
<setFont name="DejaVu Sans Bold" size="10"/>
<drawString x="9.8cm" y="28.3cm"><xsl:value-of select="//company"/></drawString>
<setFont name="DejaVu Sans" size="8"/>
<drawRightString x="19.7cm" y="28.3cm"><pageNumber/> / </drawRightString>
<stroke color="#000000"/>
<lines>1.3cm 28.1cm 20cm 28.1cm</lines>
</xsl:template>
<xsl:template name="other_pages_graphics_corporation">
<!--logo-->
<fill color="black"/>
<stroke color="black"/>
<setFont name="DejaVu Sans" size="8"/>
<drawString x="1.3cm" y="28.3cm"><xsl:value-of select="//date"/></drawString>
<setFont name="DejaVu Sans Bold" size="10"/>
<drawString x="9.8cm" y="28.3cm"><xsl:value-of select="//company"/></drawString>
<setFont name="DejaVu Sans" size="8"/>
<drawRightString x="19.7cm" y="28.3cm"><pageNumber/> / </drawRightString>
<stroke color="#000000"/>
<lines>1.3cm 28.1cm 20cm 28.1cm</lines>
</xsl:template>
<xsl:template name="first_page_frames">
<frame id="column" x1="1.5cm" y1="1.5cm">
<xsl:attribute name="width">
<xsl:value-of select="/report/config/PageWidth - 85"/>
</xsl:attribute>
<xsl:attribute name="height">
<xsl:value-of select="/report/config/PageHeight - 100"/>
</xsl:attribute>
</frame>
<xsl:if test="$page_format='a4_normal'">
<frame id="main" x1="1cm" y1="2.5cm" width="21.0cm" height="29.0cm"/>
</xsl:if>
<xsl:if test="$page_format='a4_letter'">
<frame id="address" x1="11cm" y1="21.5cm" width="6cm" height="4cm"/>
<frame id="main" x1="1cm" y1="2.5cm" width="19.0cm" height="17.5cm"/>
</xsl:if>
</xsl:template>
<xsl:template name="other_pages_frames">
<frame id="column" x1="1.5cm" y1="1.5cm">
<xsl:attribute name="width">
<xsl:value-of select="/report/config/PageWidth - 85"/>
</xsl:attribute>
<xsl:attribute name="height">
<xsl:value-of select="/report/config/PageHeight - 100"/>
</xsl:attribute>
</frame>
<frame id="main" x1="1cm" y1="2.5cm" width="21.0cm" height="29cm"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -4,7 +4,7 @@
<xsl:template name="first_page_graphics_report"/>
<xsl:template name="other_pages_graphics_report"/>
<xsl:template name="rml">
<document>
<template author="Generated by Open ERP, Fabien Pinckaers">
@ -19,11 +19,11 @@
<xsl:attribute name="rightMargin">
<xsl:value-of select="$rightMargin"/>
</xsl:attribute>
<xsl:attribute name="topMargin">
<xsl:value-of select="$topMargin"/>
</xsl:attribute>
<xsl:attribute name="bottomMargin">
<xsl:value-of select="$bottomMargin"/>
</xsl:attribute>
@ -31,9 +31,10 @@
<xsl:attribute name="title">
<xsl:value-of select="$title"/>
</xsl:attribute>
<pageTemplate id="first_page">
<pageGraphics>
<xsl:call-template name="first_page_graphics_corporation"/>
<xsl:call-template name="first_page_graphics_report"/>
</pageGraphics>
@ -42,9 +43,10 @@
<pageTemplate id="other_pages">
<pageGraphics>
<xsl:call-template name="other_pages_graphics_corporation"/>
<xsl:call-template name="other_pages_graphics_report"/>
</pageGraphics>
<xsl:call-template name="other_pages_frames"/>
</pageTemplate>
</template>

View File

@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import ir
import pooler
from report.interface import report_rml
@ -95,12 +95,13 @@ class report_custom(report_rml):
xml = ''
config_start = """
<config>
<date>09/09/2005</date>
<date>%s</date>
<company>%s</company>
<PageSize>210.00mm,297.00mm</PageSize>
<PageWidth>595.27</PageWidth>
<PageHeight>841.88</PageHeight>
<tableSize>55.00mm,55.00mm, 20.00mm, 22.00mm, 22.00mm, 25.00mm</tableSize>
"""
""" % (time.strftime('%m/%d/%Y %H:%M'),user_pool.browse(cr, uid, uid).company_id.name)
config_stop = """
<report-footer>Generated by OpenERP</report-footer>
</config>