From 0e661c1a0c42bd0de5accfcae5d0e02b0d2c4630 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 29 Oct 2008 13:57:27 +0000
Subject: [PATCH] pass portal type to select only accounting movements

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24387 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../AccountModule_viewBalanceSheetReport.xml               | 7 ++++---
 .../AccountModule_viewProfitAndLossReport.xml              | 5 +++--
 bt5/erp5_accounting/bt/revision                            | 2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

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 a15d15bb22..0a92b0e47a 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,12 @@ dQEAAAAA</string> </value>
               at_date_previous_period python:modules["DateTime"].DateTime(at_date.year() - 1, at_date.month(), at_date.day());\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
+              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"], at_date=at_date, **kw);\n
-              getInventoryIncomeAccount python: lambda **kw:context.portal_simulation.getInventoryAssetPrice(section_uid=section_uid, simulation_state=request["simulation_state"], at_date=at_date, from_date=from_date, **kw);\n
-              getInventoryPreviousPeriod python: lambda **kw:context.portal_simulation.getInventoryAssetPrice(section_uid=section_uid, simulation_state=["simulation_state"], at_date=at_date_previous_period, **kw);\'\n
+              getInventory python: lambda **kw: context.portal_simulation.getInventoryAssetPrice(section_uid=section_uid, simulation_state=request["simulation_state"], 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"], 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=["simulation_state"], at_date=at_date_previous_period, portal_type=portal_type, **kw);\'\n
   office:version=\'1.0\'>\n
   <office:scripts/>\n
   <office:font-face-decls>\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 97bf8f1b83..fd7227b33d 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
@@ -83,11 +83,12 @@ dQEAAAAA</string> </value>
               at_date_previous_period python:modules["DateTime"].DateTime(at_date.year() - 1, at_date.month(), at_date.day());\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
               date_formatter nocall:here/Base_viewFieldLibrary/my_date/render_pdf;\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"], at_date=at_date, from_date=from_date, **kw);\n
-              getInventoryPreviousPeriod python: lambda **kw:context.portal_simulation.getInventoryAssetPrice(section_uid=section_uid, simulation_state=["simulation_state"], at_date=at_date_previous_period, from_date=from_date_previous_period, **kw);\n
+              getInventory python: lambda **kw:context.portal_simulation.getInventoryAssetPrice(section_uid=section_uid, simulation_state=request["simulation_state"], 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=["simulation_state"], 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
   office:version=\'1.0\'>\n
diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision
index 089447802b..a5a504bd0e 100644
--- a/bt5/erp5_accounting/bt/revision
+++ b/bt5/erp5_accounting/bt/revision
@@ -1 +1 @@
-798
\ No newline at end of file
+799
\ No newline at end of file
-- 
2.30.9