diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewBalanceSheetReport.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewBalanceSheetReport.xml index 0f906b2e0cf164ffbf3bef2dc1a11e1149b0d8fa..922d2519bd80b3899e52698021453ba6bcd1c0f3 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewBalanceSheetReport.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewBalanceSheetReport.xml @@ -83,11 +83,13 @@ dQEAAAAA</string> </value> at_date_previous_period python:modules["DateTime"].DateTime(at_date.year() - 1, at_date.month(), at_date.day()).latestTime();\n date_formatter nocall:here/Base_viewFieldLibrary/my_date/render_pdf;\n from_date python:context.Base_getAccountingPeriodStartDateForSectionCategory(section_category=request["section_category"], date=at_date);\n + from_date_previous_period python:context.Base_getAccountingPeriodStartDateForSectionCategory(section_category=request["section_category"], date=at_date_previous_period);\n portal_type here/getPortalAccountingMovementTypeList;\n section_uid python: context.Base_getSectionUidListForSectionCategory(request["section_category"]);\n financial_section python:context.getPortalObject().portal_categories.financial_section;\n getInventory python: lambda **kw: context.portal_simulation.getInventoryAssetPrice(section_uid=section_uid, simulation_state=request["simulation_state"], function=request.get("function") or None, project=request.get("project") or None, at_date=at_date, portal_type=portal_type, **kw);\n getInventoryIncomeAccount python: lambda **kw:context.portal_simulation.getInventoryAssetPrice(section_uid=section_uid, simulation_state=request["simulation_state"], function=request.get("function") or None, project=request.get("project") or None, at_date=at_date, from_date=from_date, portal_type=portal_type, **kw);\n + getInventoryIncomeAccountPreviousPeriod python: lambda **kw:context.portal_simulation.getInventoryAssetPrice(section_uid=section_uid, simulation_state=request["simulation_state"], function=request.get("function") or None, project=request.get("project") or None, at_date=at_date_previous_period, from_date=from_date_previous_period, portal_type=portal_type, **kw);\n getInventoryPreviousPeriod python: lambda **kw:context.portal_simulation.getInventoryAssetPrice(section_uid=section_uid, simulation_state=request["simulation_state"], function=request.get("function") or None, project=request.get("project") or None, at_date=at_date_previous_period, portal_type=portal_type, **kw);\'\n office:version=\'1.0\'>\n <office:scripts/>\n @@ -620,7 +622,27 @@ dQEAAAAA</string> </value> table:style-name=\'report-content-currency2\'>\n <text:p></text:p>\n </table:table-cell>\n - </tal:block></tal:block>\n + </tal:block>\n +\n + <!-- previous period -->\n + <tal:block\n + tal:define=\'value python: -getInventoryPreviousPeriod(node_category=node_category) - getInventoryIncomeAccountPreviousPeriod(node_category=["financial_section/income", "financial_section/expense"]);\n + global total_prev_period python: total_prev_period + value;\'>\n + <table:table-cell\n + tal:condition=\'value\'\n + tal:attributes=\'office:value value\'\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 + </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 <tal:block tal:condition=\'python: cat_level_1.getId() != "net_profit"\'>\n <tal:block \n @@ -640,7 +662,6 @@ dQEAAAAA</string> </value> <text:p></text:p>\n </table:table-cell>\n </tal:block>\n - </tal:block>\n \n <!-- previous period -->\n <tal:block\n @@ -660,6 +681,9 @@ dQEAAAAA</string> </value> <text:p></text:p>\n </table:table-cell>\n </tal:block>\n +\n + </tal:block>\n +\n </tal:block>\n </table:table-row>\n <!-- }}} -->\n @@ -721,7 +745,27 @@ dQEAAAAA</string> </value> table:style-name=\'report-content-currency2\'>\n <text:p></text:p>\n </table:table-cell>\n - </tal:block></tal:block>\n + </tal:block>\n + \n + <!-- previous period -->\n + <tal:block\n + tal:define=\'value python: -getInventoryPreviousPeriod(node_category=[node_category]) - getInventoryIncomeAccountPreviousPeriod(node_category=["financial_section/income", "financial_section/expense"]);\n + global total_prev_period python: total_prev_period + value;\'>\n + <table:table-cell\n + tal:condition=\'value\'\n + tal:attributes=\'office:value value\'\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 + </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 <tal:block tal:condition=\'python: cat_level_2.getId() != "net_profit"\'>\n <tal:block \n @@ -741,7 +785,6 @@ dQEAAAAA</string> </value> <text:p></text:p>\n </table:table-cell>\n </tal:block>\n - </tal:block>\n \n <!-- previous period -->\n <tal:block\n @@ -761,6 +804,8 @@ dQEAAAAA</string> </value> <text:p></text:p>\n </table:table-cell>\n </tal:block>\n + </tal:block>\n +\n </table:table-row>\n \n <!-- }}} -->\n @@ -797,7 +842,28 @@ dQEAAAAA</string> </value> <text:p></text:p>\n </table:table-cell>\n </tal:block>\n +\n + <!-- previous period -->\n + <tal:block\n + tal:define=\'value python: -getInventoryPreviousPeriod(node_category=[node_category]) - getInventoryIncomeAccountPreviousPeriod(node_category=["financial_section/income", "financial_section/expense"]);\n + global total_prev_period python: total_prev_period + value;\'>\n + <table:table-cell\n + tal:condition=\'value\'\n + tal:attributes=\'office:value value\'\n + table:style-name=\'report-content-currency3\'\n + office:value=\'123456.56\'\n + office:value-type=\'float\'>\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 </tal:block>\n +\n + </tal:block>\n +\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 @@ -835,6 +901,7 @@ dQEAAAAA</string> </value> <text:p></text:p>\n </table:table-cell>\n </tal:block>\n +\n </tal:block>\n </tal:block>\n </table:table-row>\n diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewProfitAndLossReport.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewProfitAndLossReport.xml index f8cd67ca0ca832efc3e3c59a824821801481727f..44192908f3780c785350157319424d33ef0c9dfd 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewProfitAndLossReport.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewProfitAndLossReport.xml @@ -80,7 +80,7 @@ dQEAAAAA</string> </value> xmlns:metal=\'http://xml.zope.org/namespaces/metal\'\n tal:attributes=\'dummy python:request.RESPONSE.setHeader("Content-Type", "text/html;; charset=utf-8")\'\n tal:define=\'at_date request/at_date/latestTime;\n - at_date_previous_period python:modules["DateTime"].DateTime(at_date.year() - 1, at_date.month(), at_date.day().latestTime());\n + at_date_previous_period python:modules["DateTime"].DateTime(at_date.year() - 1, at_date.month(), at_date.day()).latestTime();\n from_date python:context.Base_getAccountingPeriodStartDateForSectionCategory(section_category=request["section_category"], date=at_date);\n from_date_previous_period python:context.Base_getAccountingPeriodStartDateForSectionCategory(section_category=request["section_category"], date=at_date_previous_period);\n portal_type here/getPortalAccountingMovementTypeList;\n @@ -90,7 +90,7 @@ dQEAAAAA</string> </value> getInventory python: lambda **kw:context.portal_simulation.getInventoryAssetPrice(section_uid=section_uid, simulation_state=request["simulation_state"], function=request.get("function") or None, project=request.get("project") or None, at_date=at_date, from_date=from_date, portal_type=portal_type, **kw);\n getInventoryPreviousPeriod python: lambda **kw:context.portal_simulation.getInventoryAssetPrice(section_uid=section_uid, simulation_state=request["simulation_state"], function=request.get("function") or None, project=request.get("project") or None, at_date=at_date_previous_period, from_date=from_date_previous_period, portal_type=portal_type, **kw);\n net_income python:getInventory(node_category=["financial_section/income", "financial_section/expense"]);\n - net_income_previous_period python:getInventoryPreviousPeriod(node_category=["financial_section/income", "financial_section/expense"])\'\n + net_income_previous_period python:getInventoryPreviousPeriod(node_category=["financial_section/income", "financial_section/expense"]);\'\n office:version=\'1.0\'>\n <office:scripts/>\n <office:font-face-decls>\n @@ -486,7 +486,7 @@ dQEAAAAA</string> </value> <!-- }}} -->\n \n <!-- NET PROFIT {{{ -->\n - <table:table-row tal:condition="python: net_income < 0">\n + <table:table-row tal:condition="python: net_income < 0 or net_income_previous_period < 0">\n <table:table-cell table:style-name=\'report-stat2\'\n office:value-type=\'string\'\n table:number-rows-spanned=\'1\'\n @@ -499,8 +499,8 @@ dQEAAAAA</string> </value> tal:define="global grand_total_current_period python: grand_total_current_period - net_income"\n office:value-type=\'float\' office:value=\'123456.56\'><text:p>123 456,56</text:p></table:table-cell>\n <table:table-cell table:style-name=\'report-stat-currency2\'\n - tal:attributes="office:value python: net_income_previous_period"\n - tal:define="global grand_total_previous_period python: grand_total_previous_period + net_income_previous_period"\n + tal:attributes="office:value python: - net_income_previous_period"\n + tal:define="global grand_total_previous_period python: grand_total_previous_period - net_income_previous_period"\n office:value=\'\' office:value-type=\'float\'><text:p></text:p></table:table-cell>\n </table:table-row>\n \n @@ -837,7 +837,7 @@ dQEAAAAA</string> </value> <!-- }}} --> \n \n <!-- NET LOSS {{{ -->\n - <table:table-row tal:condition="python: net_income > 0">\n + <table:table-row tal:condition="python: net_income > 0 or net_income_previous_period > 0">\n <table:table-cell table:style-name=\'report-stat2\'\n office:value-type=\'string\'\n table:number-rows-spanned=\'1\'\n diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision index b29e8d2b2be279ea7c2e24283d29ecb956f7a1bd..306d91c91f0ed2141746a8b6f0d1906fbb7aeb2b 100644 --- a/bt5/erp5_accounting/bt/revision +++ b/bt5/erp5_accounting/bt/revision @@ -1 +1 @@ -1090 \ No newline at end of file +1091 \ No newline at end of file