Commit 9538d33b authored by Jérome Perrin's avatar Jérome Perrin

imporved journal report


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4726 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 551563c9
......@@ -76,6 +76,7 @@ return a list of dictionnaries like that : \n
{\n
\'date\' : Date\n
\'description\' : String\n
\'currency\' : String\n
\'lines\' : {\n
\'debtor\' : Bool, \n
\'account_gap_id\' : String\n
......@@ -93,7 +94,7 @@ transaction_portal_type = request[\'transaction_portal_type\']\n
from_date = request.get(\'from_date\', None)\n
\n
params = {\n
\'sort_on\' : \'delivery.stop_date\',\n
\'sort_on\' : \'delivery.start_date\',\n
\'at_date\' : at_date,\n
\'simulation_state\': transaction_simulation_state,\n
\'section_category\' : transaction_section_category,\n
......@@ -103,17 +104,22 @@ if from_date:\n
params[\'from_date\'] = from_date\n
\n
result=[]\n
journal_total_debit = 0\n
journal_total_credit = 0\n
for transaction in context\\\n
.AccountingTransactionModule_zGetAccountingTransactionList(\n
selection_params = params, selection=None, **params):\n
transaction = transaction.getObject()\n
lines = []\n
date = transaction.getStopDate() or transaction.getStartDate()\n
transaction_dict={\'date\' : str(date)[:10], #XXX dangerous for i18n\n
\'description\':"%s (source reference: %s)"%(\n
transaction.getTitle() or \'\',\n
transaction.getSourceReference() or \'\'),\n
\'lines\' : lines }\n
transaction_dict={\'date\' : context.Base_FormatDate(transaction.getStartDate()),\n
\'description\' : context.Base_TranslateString(\n
"${transaction_title} (Transaction Reference = ${transaction_source_reference},\\n Creation Date = ${creation_date} \\n Currency = ${currency_title})" ,\n
mapping = { "transaction_title": unicode(transaction.getTitle() or \'\', \'utf8\'),\n
"transaction_source_reference": unicode(transaction.getSourceReference() or \'\', \'utf8\'),\n
"creation_date" : context.Base_FormatDate(transaction.getCreationDate()),\n
"currency_title" : transaction.getResourceTitle() or \'\'}),\n
\'lines\' : lines, }\n
\n
result.append(transaction_dict)\n
transaction_lines = transaction.contentValues(\n
filter = {\'portal_type\' : [ \'Accounting Transaction Line\',\n
......@@ -150,7 +156,11 @@ for transaction in context\\\n
or (line.getSourceCredit() \\\n
- line.getSourceDebit())\n
})\n
\n
if debtor :\n
journal_total_debit += line.getSourceDebit()\n
else:\n
journal_total_credit += line.getSourceCredit()\n
\n
# internal mouvements, ie when we are destination and source\n
if line.getDestinationSection() == line.getSourceSection() :\n
debtor = (line.getDestinationDebit() > line.getDestinationCredit())\n
......@@ -177,8 +187,12 @@ for transaction in context\\\n
or (line.getDestinationCredit() \\\n
- line.getDestinationDebit())\n
})\n
\n
return result\n
if debtor :\n
journal_total_debit += line.getSourceDebit()\n
else:\n
journal_total_credit += line.getSourceCredit()\n
\n
return result + [{"journal_total_debit": journal_total_debit, "journal_total_credit": journal_total_credit}]\n
# vim: syntax=python\n
......@@ -186,79 +200,91 @@ return result\n
</item>
<item>
<key> <string>_code</string> </key>
<value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAAAAABkAAABCAAAAQwAA
AHMyBQAAdAAAdAEAZAEAgwIAfQIAdAMAfAIAZAIAgwIAfQQAdAMAfAIAZAMAgwIAfQUAdAMAfAIA
<value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAAAAABoAAABKAAAAQwAA
AHMVBgAAdAAAdAEAZAEAgwIAfQIAdAMAfAIAZAIAgwIAfQQAdAMAfAIAZAMAgwIAfQUAdAMAfAIA
ZAQAgwIAfQYAdAMAfAIAZAUAgwIAfQcAdAAAfAIAZAYAgwIAZAcAdAgAgwIAfQkAaAAABGQIAGQJ
AAM8BGQCAHwEAAM8BGQKAHwGAAM8BGQLAHwFAAM8BGQMAHwHAAM8fQoAfAkAbxQAAXwJAHQLAHwK
AIMBAGQHADxuAQABZwAAfQwAeHAEdA0AdA4AdAAAdAEAZA0AgwIAZA4AfAoAZA8AdAgAfAoAjQEC
gwEARF1EBH0PAHQAAHwPAGQQAIMCA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bnNhY3Rpb25zBQAAAGxpbmVz
cwcAAAB1bmljb2RlcxAAAAB0cmFuc2FjdGlvbl9kaWN0cxEAAAB0cmFuc2FjdGlvbl9saW5lc3ME
AAAAbGluZXMGAAAAZGVidG9ycwcAAABhY2NvdW50cxMAAABhY2NvdW50X2Rlc2NyaXB0aW9uKAAA
AAAoAAAAAHMPAAAAU2NyaXB0IChQeXRob24pcz8AAABBY2NvdW50aW5nVHJhbnNhY3Rpb25Nb2R1
bGVfZ2V0Sm91cm5hbEFjY291bnRpbmdUcmFuc2FjdGlvbkxpc3QBAAAAc6QAAAAAEg8BDwEPAQ8B
DwEYAhACCQEJAQkBCAIHARQCBgEGAQYBGAIZARIBBgEuAQ8CLAEoASQBHgELAhABDwEkBhMCDQAG
ARIBJAESARQBHwEGAQ8BFwEfAwYBDwEXAhUBEAEMARIBCQEZARQBDwETAgcBGgIWAyUBJAESARQB
GQEGAQ8BFwEfAwYBDwEXAhUBEAEMARIBCQEZARQBDwETAgcBGgIiAigBAAAAcz8AAABBY2NvdW50
aW5nVHJhbnNhY3Rpb25Nb2R1bGVfZ2V0Sm91cm5hbEFjY291bnRpbmdUcmFuc2FjdGlvbkxpc3Qo
AQAAAHM/AAAAQWNjb3VudGluZ1RyYW5zYWN0aW9uTW9kdWxlX2dldEpvdXJuYWxBY2NvdW50aW5n
VHJhbnNhY3Rpb25MaXN0KAAAAAAoAAAAAHMPAAAAU2NyaXB0IChQeXRob24pcwgAAAA8bW9kdWxl
PgEAAABzAAAAAA==</string> </value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
......@@ -268,7 +294,7 @@ AQAAAHMAAAAA</string> </value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/erp5_accounting/AccountingTransactionModule_getJournalAccountingTransactionList</string> </value>
<value> <string>Script (Python):/nexedi/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalAccountingTransactionList</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
......@@ -311,12 +337,13 @@ AQAAAHMAAAAA</string> </value>
<string>params</string>
<string>_write_</string>
<string>result</string>
<string>journal_total_debit</string>
<string>journal_total_credit</string>
<string>_getiter_</string>
<string>_apply_</string>
<string>transaction</string>
<string>lines</string>
<string>date</string>
<string>str</string>
<string>unicode</string>
<string>transaction_dict</string>
<string>transaction_lines</string>
<string>line</string>
......
......@@ -52,14 +52,27 @@
<template bottommargin=\'2cm\' showboundary=\'0\' topmargin=\'2cm\' \n
rightmargin=\'2cm\' tal:define=\'portal python:here.portal_url.getPortalObject()\' \n
filename=\'journal.pdf\' pagesize=\'A4\' allowsplitting=\'1\' landscape=\'0\' leftmargin=\'2cm\'>\n
\n
<pagetemplate startframe=\'content\' id=\'FirstPage\'>\n
<static/>\n
<static>\n
<infostring align="left" x="1cm" y= "29cm" size="8" font="Helvetica" color="(0,0,0)"\n
tal:content="python: here.translation_service.translate(\'ui\', \'Printed by %(user)s at %(date)s\') % {\'user\':user.getUserName(), \'date\':DateTime()}" >Printed by</infostring>\n
<infostring align="left" x="18cm" y= "0.5cm" size="10" font="Helvetica" color="(0,0,0)" >Page %(page)s</infostring>\n
</static>\n
<frame showBoundary=\'0\' leftpadding=\'0.1cm\' height=\'23.94cm\' width=\'17.59cm\' rightpadding=\'0.1cm\' y=\'2cm\' x=\'2cm\' nextid=\'content\' toppadding=\'0.2cm\' id=\'content\' bottompadding=\'0.5cm\'/>\n
</pagetemplate>\n
\n
<stylesheet>\n
<paragraphstyle name="Title" parent="Normal" fontname="Helvetica-Bold" fontsize="32" align="CENTER"/>\n
<tablestyle name=\'default\'>\n
<stylecmd expr="(\'GRID\', (0,0), (-1,-1), 0.1, colors.black)"/>\n
</tablestyle>\n
<paragraphstyle name="TableStandard" parent="Normal" fontname="Helvetica" fontsize="8" alignment="left" />\n
<paragraphstyle name="TableStandardLeftAligned" parent="Normal" fontname="Helvetica" fontsize="7" alignment="left" />\n
<paragraphstyle name="TableStandardRightAligned" parent="Normal" fontname="Helvetica" fontsize="7" alignment="right" />\n
<paragraphstyle name="TableHeader" parent="Normal" fontname="Helvetica-Oblique" fontsize="9" alignment="left" />\n
<paragraphstyle name="TableLastLine" parent="Normal" fontname="Helvetica-Oblique" fontsize="11" alignment="left" />\n
\n
<tablestyle name=\'transaction_header\'>\n
<stylecmd expr="(\'LINEBELOW\', (2,0), (2,0), 0.1, colors.black)"/> \n
<stylecmd expr="(\'LINEBELOW\', (-3,0), (-3,0), 0.1, colors.black)"/> \n
......@@ -92,6 +105,14 @@
<stylecmd expr="(\'TOPPADDING\', (0,0), (-1,-1), 1)"/>\n
</tablestyle>\n
\n
<tablestyle name="AttributesTable">\n
<stylecmd expr="(\'INNERGRID\', (0,0), (-1,-1), 1, (0.5,0.5,0.5))"/>\n
<stylecmd expr="(\'FONT\', (0,0), (-1,-1), \'Helvetica\', 8)"/>\n
<stylecmd expr="(\'BOX\', (0,0), (-1,-1), 1, colors.black)"/>\n
<stylecmd expr="(\'BACKGROUND\', (0,0), (0,-1), (0.9,0.9,0.9))"/>\n
<stylecmd expr="(\'ALIGN\', (0,0), (-1,-1), \'CENTER\')"/>\n
<stylecmd expr="(\'VALIGN\', (0,0), (-1,-1), \'TOP\')"/>\n
</tablestyle>\n
\n
</stylesheet>\n
</template>\n
......
......@@ -55,30 +55,59 @@
<value> <string encoding="cdata"><![CDATA[
<?xml version="1.0" encoding="latin1"?>\n
<document filename="journal.pdf" tal:define="portal python:here.portal_url.getPortalObject()">\n
<title>Title</title>\n
<author>Author</author>\n
<subject>Subject</subject>\n
<document filename="journal.pdf" tal:define="portal here/portal_url/getPortalObject;\n
transaction_list here/AccountingTransactionModule_getJournalAccountingTransactionList">\n
<title>Journal</title>\n
<author>ERP5</author>\n
<subject>Journal</subject>\n
<content xmlns:tal="http://xml.zope.org/namespaces/tal">\n
<para style="Title" i18n:translate="" i18n:domain="ui">Journal</para>\n
<action name="nextPageTemplate">\n
<parameter>FirstPage</parameter>\n
</action>\n
<spacer height="50"/>\n
\n
<table splitbyrow="1" repeatrows="0" repeatcols="0" style="AttributesTable" >\n
<tr tal:condition="python: request.get(\'from_date\', 0)">\n
<td colwidth="5cm"> <para style="TableHeader" tal:content="python: here.Base_TranslateString(\'From Date\')"/> </td>\n
<td colwidth="15cm"> <para style="TableStandardRightAligned" tal:content="python: here.Base_FormatDate(request.get(\'from_date\'))"/></td> </tr>\n
<tr>\n
<td colwidth="5cm"> <para style="TableHeader" tal:content="python: here.Base_TranslateString(\'At Date\')"/> </td>\n
<td colwidth="15cm"> <para style="TableStandardRightAligned" tal:content="python: here.Base_FormatDate(request.get(\'at_date\'))"/></td> </tr>\n
<tr>\n
<td colwidth="5cm"> <para style="TableHeader" tal:content="python: here.Base_TranslateString(\'Section\')"/> </td>\n
<td colwidth="15cm"> <para style="TableStandardRightAligned" tal:content="python: here.portal_categories.restrictedTraverse(request.get(\'transaction_section_category\')).getLogicalPath()"/></td> </tr>\n
<tr>\n
<td colwidth="5cm"> <para style="TableHeader" tal:content="python: here.Base_TranslateString(\'Transactions Simulation State\')"/> </td>\n
<td colwidth="15cm"> <tal:block tal:repeat="state python:request.get(\'transaction_simulation_state\', [])">\n
<para style="TableStandardRightAligned" tal:content="state"/> </tal:block> </td> </tr>\n
<tr>\n
<td colwidth="5cm"> <para style="TableHeader" tal:content="python: here.Base_TranslateString(\'Journal Type\')"/> </td>\n
<td colwidth="15cm"> <tal:block tal:repeat="type python:request.get(\'transaction_portal_type\', [])">\n
<para style="TableStandardRightAligned" tal:content="python: here.Base_TranslateString(type)"/> </tal:block> </td> </tr>\n
\n
</table>\n
<spacer height="10"/>\n
\n
<table style="top_of_page" splitbyrow="1" repeatrows="0" repeatcols="0">\n
<tr rowheight="0.512cm">\n
<td colwidth="1.5cm">Debit</td>\n
<td colwidth="1.5cm">Credit</td>\n
<td colwidth="13cm">Account Title</td>\n
<td colwidth="2cm">Debit</td>\n
<td colwidth="2cm">Credit</td>\n
<td colwidth="12cm">Account Title</td>\n
<td colwidth="2.5cm">Debit</td>\n
<td colwidth="2.5cm">Credit</td>\n
</tr>\n
</table>\n
<tal:block tal:repeat="transaction python:here.AccountingTransactionModule_getJournalAccountingTransactionList()">\n
<tal:block tal:repeat="transaction python:transaction_list[:-1]">\n
<table style="transaction_header" splitbyrow="1" repeatrows="0" repeatcols="0">\n
<tr rowheight="0.5cm">\n
<td colwidth="1.5cm"/>\n
<td colwidth="1.5cm"/>\n
<td colwidth="5cm"/>\n
<td colwidth="4.5cm"/>\n
<td colwidth="3cm" tal:content="transaction/date">Date</td>\n
<td colwidth="5cm"/>\n
<td colwidth="2cm"/>\n
<td colwidth="2cm"/>\n
<td colwidth="4.5cm"/>\n
<td colwidth="2.5cm"/>\n
<td colwidth="2.5cm"/>\n
</tr>\n
</table>\n
<tal:block tal:repeat="line transaction/lines">\n
......@@ -90,9 +119,9 @@
<td colwidth="2cm"/>\n
</tal:block>\n
<td colwidth="modified"\n
tal:attributes="colwidth python: line[\'debtor\'] and \'13cm\' or \'11cm\' ;" tal:content="python:line[\'account_name\']"/>\n
<td colwidth="2cm" tal:content="python:line[\'debtor\'] and line[\'amount\'] or \' \' "/>\n
<td colwidth="2cm" tal:content="python:line[\'debtor\'] and \' \' or line[\'amount\'] "/>\n
tal:attributes="colwidth python: line[\'debtor\'] and \'12cm\' or \'10cm\' ;" tal:content="python:line[\'account_name\']"/>\n
<td colwidth="2.5cm" tal:content="python:line[\'debtor\'] and here.ERP5Accounting_FormatMonetaryValue(line[\'amount\']) or \' \' "/>\n
<td colwidth="2.5cm" tal:content="python:line[\'debtor\'] and \' \' or here.ERP5Accounting_FormatMonetaryValue(line[\'amount\']) "/>\n
</tr>\n
</table>\n
</tal:block>\n
......@@ -101,9 +130,35 @@
<td colwidth="1.5cm"/>\n
<td colwidth="1.5cm"/>\n
<td colwidth="0.5cm"/>\n
<td colwidth="12.5cm" tal:content="transaction/description"/>\n
<td colwidth="2cm"/>\n
<td colwidth="11.5cm" tal:content="transaction/description"/>\n
<td colwidth="2.5cm"/>\n
<td colwidth="2.5cm"/>\n
</tr>\n
</table>\n
</tal:block>\n
\n
<tal:block tal:replace="nothing"> Summary.\n
</tal:block>\n
<tal:block>\n
<table style="transaction_header" splitbyrow="1" repeatrows="0" repeatcols="0">\n
<tr rowheight="0.5cm">\n
<td colwidth="1.5cm"/>\n
<td colwidth="1.5cm"/>\n
<td colwidth="4.5cm"/>\n
<td colwidth="3cm"/>\n
<td colwidth="4.5cm"/>\n
<td colwidth="2.5cm"/>\n
<td colwidth="2.5cm"/>\n
</tr>\n
</table>\n
<table style="transaction_body" splitbyrow="1" repeatrows="0" repeatcols="0">\n
<tr rowheight="1.5cm">\n
<td colwidth="1.5cm"/>\n
<td colwidth="1.5cm"/>\n
<td colwidth="2cm"/>\n
<td colwidth="10cm" > Total </td>\n
<td colwidth="2.5cm" tal:content="python: here.ERP5Accounting_FormatMonetaryValue(transaction_list[-1][\'journal_total_debit\']) "/>\n
<td colwidth="2.5cm" tal:content="python: here.ERP5Accounting_FormatMonetaryValue(transaction_list[-1][\'journal_total_credit\']) "/>\n
</tr>\n
</table>\n
</tal:block>\n
......
......@@ -81,7 +81,9 @@
</item>
<item>
<key> <string>items</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>required</string> </key>
......@@ -120,7 +122,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -152,9 +156,7 @@
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
......@@ -262,7 +264,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>6</int> </value>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -287,6 +289,25 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.MethodField</string>
<string>Method</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>AccountingTransactionModule_getTranslatedPortalTypeItemList</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
......@@ -300,7 +321,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:[(here.translation_service.translate(\'ui\', pt).encode(\'utf8\'), pt) for pt in (\'Accounting Transaction\', \'Sale Invoice Transaction\', \'Purchase Invoice Transaction\', \'Pay Sheet Transaction\', \'Payment Transaction\', \'Balance Transaction\')]</string> </value>
<value> <string>python: [ x[1] for x in here.AccountingTransactionModule_getTranslatedPortalTypeItemList()]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -321,7 +321,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.Base_getTranslatedWorkflowStateItemList(\'accounting_workflow\')</string> </value>
<value> <string>python:here.Base_getTranslatedWorkflowStateItemList()</string> </value>
</item>
</dictionary>
</pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment