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

introduce some styles in that report

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30306 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 874e32cf
......@@ -13,6 +13,12 @@
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......@@ -99,7 +105,7 @@ def isVisibleCell(cell):\n
\n
\n
for budget in budget_list:\n
for budget_line in budget.contentValues():\n
for budget_line in budget.contentValues(sort_on=((\'int_index\', \'asc\'),)):\n
total_level_1_initial_budget = 0\n
total_level_1_current_budget = 0\n
total_level_1_engaged_budget = 0\n
......@@ -133,11 +139,22 @@ for budget in budget_list:\n
\n
# we use BudgetLine_asCellRange to get cell names, and have a default value\n
# for "virtual level 2"\n
title = budget_line.getTitle().decode(\'utf8\')\n
cell_name_dict = {budget_line.getResource(base=1):\n
budget_line.getTitle().decode(\'utf8\')}\n
cell_style_dict = {budget_line.getResource(base=1): \'Level2\'}\n
for cell_range_list in budget_line.BudgetLine_asCellRange(matrixbox=1):\n
for category, title in cell_range_list:\n
cell_name_dict[category] = title.decode(\'utf8\')\n
cell_name_dict[category] = title.decode(\'utf8\').replace(u\'\\xA0\', \'\')\n
depth = (title.count(\'\\xA0\') / 4.) or title.count(\'/\')\n
if depth == 1:\n
cell_style_dict[category] = \'Level2.1\'\n
elif depth == 2:\n
cell_style_dict[category] = \'Level2.2\'\n
elif depth == 3:\n
cell_style_dict[category] = \'Level2.3\'\n
else:\n
cell_style_dict[category] = \'Level2\'\n
\n
for level_2_category in level_2_variation_category_list:\n
\n
......@@ -147,7 +164,8 @@ for budget in budget_list:\n
total_level_2_consumed_budget = 0\n
total_level_2_available_budget = 0\n
level_2_line_list = [dict(is_level_2=1,\n
title=cell_name_dict[level_2_category])]\n
title=cell_name_dict[level_2_category],\n
style=cell_style_dict[level_2_category])]\n
\n
for level_3_category in level_3_variation_category_list:\n
sign = budget_line.BudgetLine_getConsumptionSign()\n
......@@ -214,8 +232,7 @@ for budget in budget_list:\n
consumed_budget=total_level_1_consumed_budget,\n
available_budget=total_level_1_available_budget,\n
consumed_ratio=consumed_ratio))\n
\n
\n
\n
\n
if line_list:\n
line_list[-1][\'is_last_line\'] = 1\n
......@@ -305,10 +322,12 @@ return pformat(line_list)\n
<string>$append0</string>
<string>x</string>
<string>level_3_variation_category_list</string>
<string>title</string>
<string>cell_name_dict</string>
<string>cell_style_dict</string>
<string>cell_range_list</string>
<string>title</string>
<string>_write_</string>
<string>depth</string>
<string>level_2_category</string>
<string>total_level_2_initial_budget</string>
<string>total_level_2_current_budget</string>
......
......@@ -21,6 +21,12 @@ NbKwiYHTI4/yd/un5MbirJKu1FTjfzbmbczIPHyXl9a8kn9+y/UXUEsBAhQAFAAAAAgAu3RqOkTV
gP9KAQAAaAcAABUAAAAAAAAAAAAAAAAAAAAAAE1FVEEtSU5GL21hbmlmZXN0LnhtbFBLBQYAAAAA
AQABAEMAAAB9AQAAAAA=</string> </value>
</item>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......@@ -311,48 +317,49 @@ AQABAEMAAAB9AQAAAAA=</string> </value>
\n
<tal:block tal:repeat="line line_list">\n
\n
<table:table-row table:style-name="ro4" tal:condition="line/is_level_1 | nothing">\n
<table:table-cell table:style-name="ce4" office:value-type="string">\n
<table:table-row table:style-name="Level1" tal:condition="line/is_level_1 | nothing">\n
<table:table-cell table:style-name="Level1Cell1" office:value-type="string">\n
<text:p tal:content="line/title">$level1</text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name="ce9"/>\n
<table:table-cell table:style-name="ce15" table:number-columns-repeated="5"/>\n
<table:table-cell table:style-name="ce20"/>\n
<table:table-cell table:style-name="ce26" table:number-columns-repeated="248"/>\n
<table:table-cell table:style-name="Level1" table:number-columns-repeated="7"/>\n
<table:table-cell table:number-columns-repeated="768"/>\n
</table:table-row>\n
\n
<table:table-row table:style-name="ro5" tal:condition="line/is_level_2 | nothing">\n
<table:table-cell table:style-name="ce5"/>\n
<table:table-cell table:style-name="ce10" office:value-type="string">\n
<table:table-row table:style-name="Level2" \n
tal:condition="line/is_level_2 | nothing"\n
tal:define="style python:line.get(\'style\', \'Level2\')">\n
<table:table-cell table:style-name="Level2Cell1"\n
tal:attributes="table:style-name string:${style}Cell1"/>\n
<table:table-cell table:style-name="Level2" office:value-type="string"\n
tal:attributes="table:style-name style">\n
<text:p tal:content="line/title">$level 2</text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name="ce15" table:number-columns-repeated="5"/>\n
<table:table-cell table:style-name="ce20"/>\n
<table:table-cell table:number-columns-repeated="1016"/>\n
<table:table-cell table:style-name="Level2" table:number-columns-repeated="6"\n
tal:attributes="table:style-name style"/>\n
<table:table-cell table:number-columns-repeated="768"/>\n
</table:table-row>\n
\n
<table:table-row table:style-name="ro5" tal:condition="line/is_level_3 | nothing">\n
<table:table-cell table:style-name="ce5"/>\n
<table:table-cell table:style-name="ce11" office:value-type="string">\n
<table:table-row table:style-name="Level3" tal:condition="line/is_level_3 | nothing">\n
<table:table-cell table:style-name="Level3Cell1"/>\n
<table:table-cell table:style-name="Level3" office:value-type="string">\n
<text:p><text:s text:c="3"/><tal:block tal:replace="line/title"/></text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name="ce17" office:value-type="float" office:value="1" tal:attributes="office:value line/initial_budget">\n
<table:table-cell table:style-name="Level3" office:value-type="float" office:value="1" tal:attributes="office:value line/initial_budget">\n
<text:p>1</text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name="ce17" office:value-type="float" office:value="2" tal:attributes="office:value line/current_budget">\n
<table:table-cell table:style-name="Level3" office:value-type="float" office:value="2" tal:attributes="office:value line/current_budget">\n
<text:p>2</text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name="ce17" office:value-type="float" office:value="3" tal:attributes="office:value line/engaged_budget">\n
<table:table-cell table:style-name="Level3" office:value-type="float" office:value="3" tal:attributes="office:value line/engaged_budget">\n
<text:p>3</text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name="ce17" office:value-type="float" office:value="4" tal:attributes="office:value line/consumed_budget">\n
<table:table-cell table:style-name="Level3" office:value-type="float" office:value="4" tal:attributes="office:value line/consumed_budget">\n
<text:p>4</text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name="ce17" office:value-type="float" office:value="5" tal:attributes="office:value line/available_budget">\n
<table:table-cell table:style-name="Level3" office:value-type="float" office:value="5" tal:attributes="office:value line/available_budget">\n
<text:p>5</text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name="ce22" office:value-type="percentage" office:value="0.06" tal:attributes="office:value line/consumed_ratio">\n
<table:table-cell table:style-name="Level3" office:value-type="percentage" office:value="0.06" tal:attributes="office:value line/consumed_ratio">\n
<text:p>6,00%</text:p>\n
</table:table-cell>\n
<table:table-cell table:number-columns-repeated="1016"/>\n
......
248
\ No newline at end of file
249
\ 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