modified account balance report rml and py file in account module

bzr revid: vinusoft85@gmail.com-20080925105639-tap15j3u3llrzh72
This commit is contained in:
Vinay Rana
2008-09-25 16:26:39 +05:30
parent 77892f79a9
commit 3d53d7f47d
2 changed files with 135 additions and 70 deletions
+4 -2
View File
@@ -117,7 +117,7 @@ class account_balance(report_sxw.rml_parse):
'debit': account.debit,
'credit': account.credit,
'balance': account.balance,
'leef': not bool(account.child_id)
'leef': not bool(account.child_id),
}
self.sum_debit += account.debit
self.sum_credit += account.credit
@@ -145,6 +145,8 @@ class account_balance(report_sxw.rml_parse):
if res1:
for r in res1:
result_acc.append(r)
if account.code=='0':
result_acc.pop(-1)
if account.child_id:
ids2 = [(x.code,x.id) for x in account.child_id]
ids2.sort()
@@ -155,7 +157,7 @@ class account_balance(report_sxw.rml_parse):
res={}
self.date_lst_string = '\'' + '\',\''.join(map(str,self.date_lst)) + '\''
self.cr.execute(
"SELECT l.id as lid,l.date,j.name as jname, l.ref, l.name as lname, l.debit as debit1, l.credit as credit1 " \
"SELECT l.id as lid,l.date,j.code as jname, l.ref, l.name as lname, l.debit as debit1, l.credit as credit1 " \
"FROM account_move_line l " \
"LEFT JOIN account_journal j " \
"ON (l.journal_id = j.id) " \
+131 -68
View File
@@ -2,56 +2,123 @@
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="35.0" y1="35.0" width="525" height="772"/>
<frame id="first" x1="57.0" y1="57.0" width="481" height="700"/>
<pageGraphics>
<drawRightString x="297.5" y="0.7cm"><pageNumber/> / </drawRightString>
<drawString x="297.5" y="0.7cm"><pageCount/></drawString>
<setFont name="Helvetica-Bold" size="9"/>
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawString x="16.2cm" y="28.1cm">Account Balance - [[ company.currency_id.name ]]</drawString>
<!--COL 2-->
<setFont name="Helvetica" size="9"/>
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%m-%d-%y %H:%M", time.localtime()) ]]</drawString>
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
<lineMode width="0.7"/>
<lines>1cm 27.7cm 20cm 27.7cm</lines>
<setFont name="Helvetica" size="8"/>
</pageGraphics>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Table1">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,0"/>
<blockTableStyle id="Table3">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockValign value="TOP"/>
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="9.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="2.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3a" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P10" fontName="Helvetica" fontSize="9.0" leading="14" spaceBefore="0.0" spaceAfter="6.0" alignment="RIGHT"/>
<paraStyle name="P9" fontName="Helvetica-Bold" alignment="CENTER" fontSize="12" leftIndent="-5.0"/>
<paraStyle name="P9b" fontName="Helvetica" fontSize="9" leftIndent="1.5" alignment="LEFT"/>
<paraStyle name="P9b" fontName="Helvetica" fontSize="9" leftIndent="0.0" alignment="LEFT"/>
<paraStyle name="P9a" fontName="Helvetica-Bold" fontSize="9" leftIndent="0.0" alignment="LEFT"/>
<paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P12a" fontName="Helvetica" fontSize="9.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P14" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica" fontSize="9.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P14" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
<blockTableStyle id="TrLevel7">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel6">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel5">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel4">
<lineStyle kind="LINEBELOW" colorName="#777777" start="1,0" stop="1,0"/>
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel3">
<lineStyle kind="LINEBELOW" colorName="#777777" start="1,0" stop="-1,0"/>
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel2">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
</blockTableStyle>
<paraStyle
name="Level7"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Level6"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Level5"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Level4"
fontName="Helvetica"
fontSize="8.0" />
<paraStyle
name="Level3"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle name="Level2"
fontSize="8.0"
fontName="Helvetica-Bold"
/>
</stylesheet>
<images/>
<story>
<para style="P2">
<font color="white"> </font>
</para>
<para style="P9"> Account Balance</para>
<para style="P2">
<font color="white"> </font>
</para>
<para style="P9b">Currency: [[ company.currency_id.name ]]</para>
<para style="P9b">[[ get_fiscalyear(data['form']) ]]: <i> [[ get_periods(data['form']) ]] </i></para>
<para style="P2">
<font color="white"> </font>
</para>
<blockTable colWidths="55.0,38.0,183.0,71.0,75.0,76.0" style="Table1" repeatRows="1">
<blockTable colWidths="527.00" style="Table4" repeatRows="1">
<tr>
<td>
<para style="P10">Date</para>
</td>
<td>
<para style="P12a">Code or Journal Name</para>
<para style="P9a">[[ get_fiscalyear(data['form']) or removeParentNode('tr') ]]:</para>
<para style="P9b"><i> [[ get_periods(data['form']) or removeParentNode('tr') ]]</i></para>
</td>
</tr>
</blockTable>
<para style="P2">
<font color="white"> </font>
</para>
<blockTable colWidths="50.0,248.0,73.0,72.0,87.0" style="Table1" repeatRows="1">
<tr>
<td>
<para style="P12a">Code</para>
</td>
<td>
<para style="P12">Account</para>
@@ -66,49 +133,45 @@
<para style="P10">Balance</para>
</td>
</tr>
</blockTable>
<section>
<para style="P2">[[ repeatIn(lines(data['form']), 'a') ]]</para>
<blockTable colWidths="55.0,38.0,183.0,71.0,75.0,76.0" style="Table2" repeatRows="1">
<tr>
<td>
<para style="P14"> </para>
</td>
<td><para style="P14"><i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
<td>
<para style="P14"><font color="white">[['... '*(a['level']-1)]]</font>[[ a['name'] ]]</para>
</td>
<td>
<para style="P3">[[ a['debit'] and '%.2f'%a['debit'] or '']]</para>
</td>
<td>
<para style="P3">[[ a['credit'] and '%.2f'%a['credit'] or '']]</para>
</td>
<td>
<para style="P3"><u>[[ (a['leef'] and removeParentNode('para')) or a['balance'] and '%.2f'%a['balance'] or '' ]]</u></para>
<para style="P3">[[ ((not a['leef']) and removeParentNode('para')) or a['balance'] and a['balance'] or '' ]]</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="52.0,38.0,183.0,71.0,75.0,76.0" style="Table3" repeatRows="1">
<tr>
<td><para style="P14">[[ a['date'] or removeParentNode('tr') ]]</para></td>
<td><para style="P14">[[ a['jname'] ]]</para></td>
<td>
<para style="P14"><font color="white">[['... '*(a['level']-1)]]</font>[[ a['lname'] ]]</para>
</td>
<td>
<para style="P3">[[ a['debit1'] and '%.2f'%a['debit1'] or '']]</para>
</td>
<td>
<para style="P3">[[ a['credit1'] and '%.2f'%a['credit1'] or '']]</para>
</td>
<td>
<para style="P3">[[ a['balance1'] and '%.2f'%a['balance1'] or '']]</para>
</td>
</tr>
</blockTable>
</section>
</story>
<tr>
<td>
<blockTable colWidths="50.0,248.0,73.0,72.0,82.0" style="Table3">
<para style="P2">[[ repeatIn(lines(data['form']), 'a') ]]</para>
<tr>
<td><para style="P14">[[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]]<i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
<td>
<para style="P14">[[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]]<font color="white">[[ (a['level']&lt;6 and removeParentNode('font') or '... '*(a['level']-4)) ]]</font>[[ setTag('blockTable','blockTable',{'style':'TrLevel'+str(a['level'])}) ]][[ a['name'] ]]</para>
</td>
<td>
<para style="P3">[[ formatLang(a['debit']) and '%.2f'%a['debit'] or '']]</para>
</td>
<td>
<para style="P3">[[ formatLang(a['credit']) and '%.2f'%a['credit'] or '']]</para>
</td>
<td>
<para style="P3">[[ (a['level']&lt;4) and setTag('para','para',{'style':'P3a'}) ]]<u>[[ (a['leef'] and removeParentNode('para')) or formatLang(a['balance']) and '%.2f'%a['balance'] or '' ]]</u></para>
<para style="P3">[[ ((not a['leef']) and removeParentNode('para')) or formatLang(a['balance']) and formatLang(a['balance']) or '' ]]</para>
</td>
</tr>
<tr>
<td><para style="P14">[[ a['jname'] or removeParentNode('tr') ]]</para></td>
<td>
<para style="P14"><font color="white">[[ '... '*(a['level']-3) ]]</font>[[ a['lname'] ]]</para>
</td>
<td>
<para style="P3">[[ formatLang(a['debit1']) and '%.2f'%a['debit1'] or '']]</para>
</td>
<td>
<para style="P3">[[ formatLang(a['credit1']) and '%.2f'%a['credit1'] or '']]</para>
</td>
<td>
<para style="P3">[[ formatLang(a['balance1']) and '%.2f'%a['balance1'] or '']]</para>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</story>
</document>