Commit f73b058c authored by Jérome Perrin's avatar Jérome Perrin

Generates valid ODF for Balance Sheet

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16760 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a52fece9
...@@ -303,7 +303,7 @@ dQEAAAAA</string> </value> ...@@ -303,7 +303,7 @@ dQEAAAAA</string> </value>
net python: getInventory(node_category=node_category);\n net python: getInventory(node_category=node_category);\n
amort python: "amort" in cat_level_2.objectIds() and -getInventory(node_category="%s/amort" % node_category) or 0;\n amort python: "amort" in cat_level_2.objectIds() and -getInventory(node_category="%s/amort" % node_category) or 0;\n
gross python: net + amort;\'>\n gross python: net + amort;\'>\n
<table:table-cell text:style-name=\'T1\' table:style-name=\'report-content-heading2\'\n <table:table-cell table:style-name=\'report-content-heading2\'\n
office:value-type=\'string\'>\n office:value-type=\'string\'>\n
<text:p tal:define="global level2_title cat_level_2/getTranslatedTitle"\n <text:p tal:define="global level2_title cat_level_2/getTranslatedTitle"\n
tal:content="level2_title"\n tal:content="level2_title"\n
...@@ -312,47 +312,71 @@ dQEAAAAA</string> </value> ...@@ -312,47 +312,71 @@ dQEAAAAA</string> </value>
\n \n
<!-- gross -->\n <!-- gross -->\n
<table:table-cell\n <table:table-cell\n
tal:condition="gross"\n
table:style-name=\'report-content-currency2\'\n table:style-name=\'report-content-currency2\'\n
tal:define=\'global total_gross python: total_gross + gross;\'\n tal:define=\'global total_gross python: total_gross + gross;\'\n
tal:attributes=\'office:value python: gross;\n tal:attributes=\'office:value gross\'\n
office:value-type python:gross and "float" or "text"\'\n office:value-type="float"\n
office:value-type=\'float\' office:value=\'123456.56\'>\n office:value=\'123456.56\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n </table:table-cell>\n
<table:table-cell\n
tal:condition="not:gross"\n
table:style-name=\'report-content-currency2\'>\n
<text:p></text:p>\n
</table:table-cell>\n
\n
\n \n
<!-- amort -->\n <!-- amort -->\n
<table:table-cell\n <table:table-cell\n
tal:condition=\'amort\'\n
table:style-name=\'report-content-currency2\'\n table:style-name=\'report-content-currency2\'\n
tal:define=\'global total_amort python: total_amort + amort;\'\n tal:define=\'global total_amort python: total_amort + amort;\'\n
tal:attributes=\'office:value python: amort;\n tal:attributes=\'office:value amort\'\n
office:value-type python:amort and "float" or "text"\'\n office:value-type=\'float\'>\n
office:value=\'123456.56\'\n
office:value-type=\'float\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n </table:table-cell>\n
<table:table-cell\n
tal:condition=\'not:amort\'\n
table:style-name=\'report-content-currency2\'>\n
<text:p></text:p>\n
</table:table-cell>\n
\n
\n \n
<!-- net -->\n <!-- net -->\n
<table:table-cell\n <table:table-cell\n
tal:condition=\'net\'\n
table:style-name=\'report-content-currency2\'\n table:style-name=\'report-content-currency2\'\n
tal:define=\'global total_net python: total_net + net;\'\n tal:define=\'global total_net python: total_net + net;\'\n
tal:attributes=\'office:value python: net;\n tal:attributes=\'office:value net\'\n
office:value-type python: net and "float" or "text"\'\n
office:value=\'123456.56\'\n office:value=\'123456.56\'\n
office:value-type=\'float\'>\n office:value-type=\'float\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n </table:table-cell>\n
<table:table-cell\n
tal:condition=\'not:net\'\n
table:style-name=\'report-content-currency2\'>\n
<text:p></text:p>\n
</table:table-cell>\n
\n \n
<!-- previous year -->\n <!-- previous year -->\n
<table:table-cell\n <tal:block \n
table:style-name=\'report-content-currency2\'\n
tal:define=\'value python: getInventoryPreviousPeriod(node_category=node_category);\n tal:define=\'value python: getInventoryPreviousPeriod(node_category=node_category);\n
global total_net_prev_period python: total_net_prev_period + value;\'\n global total_net_prev_period python: total_net_prev_period + value;\'>\n
tal:attributes=\'office:value python: value;\n <table:table-cell\n
office:value-type python:value and "float" or "text"\'\n tal:condition=\'value\' \n
table:style-name=\'report-content-currency2\'\n
tal:attributes=\'office:value value\'\n
office:value=\'123456.56\'\n office:value=\'123456.56\'\n
office:value-type=\'float\'>\n office:value-type=\'float\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n </table:table-cell>\n
<table:table-cell\n
tal:condition=\'not: value\' \n
table:style-name=\'report-content-currency2\'>\n
<text:p></text:p>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n </tal:block>\n
</table:table-row>\n </table:table-row>\n
</tal:block>\n </tal:block>\n
...@@ -372,48 +396,70 @@ dQEAAAAA</string> </value> ...@@ -372,48 +396,70 @@ dQEAAAAA</string> </value>
\n \n
<!-- gross -->\n <!-- gross -->\n
<table:table-cell\n <table:table-cell\n
tal:condition="gross"\n
table:style-name=\'report-content-currency3\'\n table:style-name=\'report-content-currency3\'\n
tal:define=\'global total_gross python: total_gross + gross;\'\n tal:define=\'global total_gross python: total_gross + gross;\'\n
tal:attributes=\'office:value python: gross;\n tal:attributes=\'office:value gross\'\n
office:value-type python:gross and "float" or "text"\'\n office:value-type=\'float\' office:value=\'123456.56\'>\n
office:value-type=\'float\' office:value=\'123456.56\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n </table:table-cell>\n
<table:table-cell\n
tal:condition="not:gross"\n
table:style-name=\'report-content-currency3\'>\n
<text:p></text:p>\n
</table:table-cell>\n
\n \n
<!-- amort -->\n <!-- amort -->\n
<table:table-cell\n <table:table-cell\n
table:style-name=\'report-content-currency3\'\n tal:condition=\'amort\'\n
tal:define=\'global total_amort python: total_amort + amort;\'\n table:style-name=\'report-content-currency3\'\n
tal:attributes=\'office:value python: amort;\n tal:define=\'global total_amort python: total_amort + amort;\'\n
office:value-type python:amort and "float" or "text"\'\n tal:attributes=\'office:value amort\'\n
office:value=\'123456.56\'\n office:value=\'123456.56\'\n
office:value-type=\'float\'>\n office:value-type=\'float\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n </table:table-cell>\n
<table:table-cell\n
tal:condition=\'not:amort\'\n
table:style-name=\'report-content-currency3\'>\n
<text:p></text:p>\n
</table:table-cell>\n
\n \n
<!-- net -->\n <!-- net -->\n
<table:table-cell\n <table:table-cell\n
tal:condition=\'net\'\n
table:style-name=\'report-content-currency3\'\n table:style-name=\'report-content-currency3\'\n
tal:define=\'global total_net python: total_net + net;\'\n tal:define=\'global total_net python: total_net + net;\'\n
tal:attributes=\'office:value python: net;\n tal:attributes=\'office:value net\'\n
office:value-type python: net and "float" or "text"\'\n
office:value=\'123456.56\'\n office:value=\'123456.56\'\n
office:value-type=\'float\'>\n office:value-type=\'float\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n </table:table-cell>\n
<table:table-cell\n
tal:condition=\'not:net\'\n
table:style-name=\'report-content-currency3\'>\n
<text:p></text:p>\n
</table:table-cell>\n
\n \n
<!-- previous year -->\n <!-- previous year -->\n
<table:table-cell\n <tal:block \n
table:style-name=\'report-content-currency3\'\n
tal:define=\'value python: getInventoryPreviousPeriod(node_category=node_category);\n tal:define=\'value python: getInventoryPreviousPeriod(node_category=node_category);\n
global total_net_prev_period python: total_net_prev_period + value;\'\n global total_net_prev_period python: total_net_prev_period + value;\'>\n
tal:attributes=\'office:value python: value;\n <table:table-cell\n
office:value-type python:value and "float" or "text"\'\n tal:condition=\'value\'\n
table:style-name=\'report-content-currency3\'\n
tal:attributes=\'office:value value\'\n
office:value=\'123456.56\'\n office:value=\'123456.56\'\n
office:value-type=\'float\'>\n office:value-type=\'float\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n
<table:table-cell\n
tal:condition=\'not:value\'\n
table:style-name=\'report-content-currency3\'>\n
<text:p></text:p>\n
</table:table-cell>\n </table:table-cell>\n
</tal:block>\n </tal:block>\n
</tal:block>\n
</table:table-row>\n </table:table-row>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
...@@ -497,7 +543,9 @@ dQEAAAAA</string> </value> ...@@ -497,7 +543,9 @@ dQEAAAAA</string> </value>
\n \n
</tal:block> <!-- loop level 1 -->\n </tal:block> <!-- loop level 1 -->\n
\n \n
<table:table-row table:style-name=\'page-break\'/>\n <table:table-row table:style-name=\'page-break\'>\n
<table:table-cell/>\n
</table:table-row>\n
\n \n
\n \n
</table:table> <!-- new table -->\n </table:table> <!-- new table -->\n
...@@ -603,39 +651,62 @@ dQEAAAAA</string> </value> ...@@ -603,39 +651,62 @@ dQEAAAAA</string> </value>
If the category have the special ID \'net_profit\', it will also contain the content of income & expense for this period\n If the category have the special ID \'net_profit\', it will also contain the content of income & expense for this period\n
-->\n -->\n
<tal:block tal:condition=\'python: cat_level_2.getId() == "net_profit"\'>\n <tal:block tal:condition=\'python: cat_level_2.getId() == "net_profit"\'>\n
<table:table-cell\n <tal:block \n
tal:define=\'value python: -getInventory(node_category=[node_category]) - getInventoryIncomeAccount(node_category=["financial_section/income", "financial_section/expense"]);\n tal:define=\'value python: -getInventory(node_category=[node_category]) - getInventoryIncomeAccount(node_category=["financial_section/income", "financial_section/expense"]);\n
global total_current_period python: total_current_period + value;\'\n global total_current_period python: total_current_period + value;\'>\n
tal:attributes=\'office:value value;\n <table:table-cell\n
office:value-type python:value and "float" or "text";\'\n tal:condition=\'value\'\n
table:style-name=\'report-content-currency2\'\n tal:attributes=\'office:value value\'\n
office:value-type=\'float\'\n table:style-name=\'report-content-currency2\'\n
office:value=\'123456.56\'>\n office:value-type=\'float\'\n
<text:p>123 456,56</text:p>\n office:value=\'123456.56\'>\n
</table:table-cell></tal:block>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n
<table:table-cell\n
tal:condition=\'not:value\'\n
table:style-name=\'report-content-currency2\'>\n
<text:p></text:p>\n
</table:table-cell>\n
</tal:block></tal:block>\n
\n
<tal:block tal:condition=\'python: cat_level_2.getId() != "net_profit"\'>\n <tal:block tal:condition=\'python: cat_level_2.getId() != "net_profit"\'>\n
<table:table-cell\n <tal:block \n
tal:define=\'value python: -getInventory(node_category=node_category);\n tal:define=\'value python: -getInventory(node_category=node_category);\n
global total_current_period python: total_current_period + value;\'\n global total_current_period python: total_current_period + value;\'>\n
tal:attributes=\'office:value value;\n <table:table-cell\n
office:value-type python:value and "float" or "text"\'\n tal:condition=\'value\'\n
table:style-name=\'report-content-currency2\'\n tal:attributes=\'office:value value\'\n
office:value-type=\'float\'\n table:style-name=\'report-content-currency2\'\n
office:value=\'123456.56\'>\n office:value-type=\'float\'\n
<text:p>123 456,56</text:p>\n office:value=\'123456.56\'>\n
</table:table-cell></tal:block>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n
<table:table-cell\n
tal:condition=\'not:value\'\n
table:style-name=\'report-content-currency2\'>\n
<text:p></text:p>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n
\n \n
<!-- previous period -->\n <!-- previous period -->\n
<table:table-cell\n <tal:block\n
tal:define=\'value python: -getInventoryPreviousPeriod(node_category=node_category);\n tal:define=\'value python: -getInventoryPreviousPeriod(node_category=node_category);\n
global total_prev_period python: total_prev_period + value;\'\n global total_prev_period python: total_prev_period + value;\'>\n
tal:attributes=\'office:value python: value;\n <table:table-cell\n
office:value-type python:value and "float" or "text"\'\n tal:condition=\'value\'\n
tal:attributes=\'office:value value\'\n
table:style-name=\'report-content-currency2\'\n table:style-name=\'report-content-currency2\'\n
office:value=\'123456.56\'\n office:value=\'123456.56\'\n
office:value-type=\'float\'>\n office:value-type=\'float\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n </table:table-cell>\n
<table:table-cell\n
tal:condition=\'not:value\'\n
table:style-name=\'report-content-currency2\'>\n
<text:p></text:p>\n
</table:table-cell>\n
</tal:block>\n
</table:table-row>\n </table:table-row>\n
\n \n
<!-- }}} -->\n <!-- }}} -->\n
...@@ -655,41 +726,63 @@ dQEAAAAA</string> </value> ...@@ -655,41 +726,63 @@ dQEAAAAA</string> </value>
If the category have the special ID \'net_profit\', it will also contain the content of income & expense for this period\n If the category have the special ID \'net_profit\', it will also contain the content of income & expense for this period\n
-->\n -->\n
<tal:block tal:condition=\'python: cat_level_3.getId() == "net_profit"\'>\n <tal:block tal:condition=\'python: cat_level_3.getId() == "net_profit"\'>\n
<table:table-cell\n <tal:block\n
tal:define=\'value python: -getInventory(node_category=[node_category]) - getInventoryIncomeAccount(node_category=["financial_section/income", "financial_section/expense"]);\n tal:define=\'value python: -getInventory(node_category=[node_category]) - getInventoryIncomeAccount(node_category=["financial_section/income", "financial_section/expense"]);\n
global total_current_period python: total_current_period + value;\'\n global total_current_period python: total_current_period + value;\'>\n
tal:attributes=\'office:value value;\n <table:table-cell\n
office:value-type python:value and "float" or "text";\'\n tal:condition=\'value\'\n
tal:attributes=\'office:value value\'\n
table:style-name=\'report-content-currency3\'\n table:style-name=\'report-content-currency3\'\n
office:value-type=\'float\'\n office:value-type=\'float\'\n
office:value=\'123456.56\'>\n office:value=\'123456.56\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell></tal:block>\n </table:table-cell>\n
<tal:block tal:condition=\'python: cat_level_3.getId() != "net_profit"\'>\n
<table:table-cell\n <table:table-cell\n
tal:condition=\'not:value\'\n
table:style-name=\'report-content-currency3\'>\n
<text:p></text:p>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n
<tal:block tal:condition=\'python: cat_level_3.getId() != "net_profit"\'>\n
<tal:block\n
tal:define=\'value python: -getInventory(node_category=node_category);\n tal:define=\'value python: -getInventory(node_category=node_category);\n
global total_current_period python: total_current_period + value;\'\n global total_current_period python: total_current_period + value;\'>\n
tal:attributes=\'office:value value;\n <table:table-cell\n
office:value-type python:value and "float" or "text"\'\n tal:condition=\'value\'\n
tal:attributes=\'office:value value\'\n
table:style-name=\'report-content-currency3\'\n table:style-name=\'report-content-currency3\'\n
office:value-type=\'float\'\n office:value-type=\'float\'\n
office:value=\'123456.56\'>\n office:value=\'123456.56\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell></tal:block>\n </table:table-cell>\n
<table:table-cell\n
tal:condition=\'not:value\'\n
table:style-name=\'report-content-currency3\'>\n
<text:p></text:p>\n
</table:table-cell>\n
</tal:block>\n
\n \n
<!-- previous period -->\n <!-- previous period -->\n
<table:table-cell\n <tal:block\n
tal:define=\'value python: -getInventoryPreviousPeriod(node_category=node_category);\n tal:define=\'value python: -getInventoryPreviousPeriod(node_category=node_category);\n
global total_prev_period python: total_prev_period + value;\'\n global total_prev_period python: total_prev_period + value;\'>\n
tal:attributes=\'office:value python: value;\n <table:table-cell\n
office:value-type python:value and "float" or "text"\'\n tal:condition=\'value\'\n
tal:attributes=\'office:value value\'\n
table:style-name=\'report-content-currency3\'\n table:style-name=\'report-content-currency3\'\n
office:value=\'123456.56\'\n office:value=\'123456.56\'\n
office:value-type=\'float\'>\n office:value-type=\'float\'>\n
<text:p>123 456,56</text:p>\n <text:p>123 456,56</text:p>\n
</table:table-cell>\n </table:table-cell>\n
\n <table:table-cell\n
tal:condition=\'not:value\'\n
table:style-name=\'report-content-currency3\'>\n
<text:p></text:p>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n
</table:table-row>\n </table:table-row>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
......
424 427
\ No newline at end of file \ No newline at end of file
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