Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
erp5
Commits
72dfb2c4
Commit
72dfb2c4
authored
Jan 08, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting: apply the same change than GL on account statement
parent
8c313674
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
630 additions
and
476 deletions
+630
-476
bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Module/account_statement_export.xml
...nting%20Transaction%20Module/account_statement_export.xml
+4
-2
bt5/erp5_accounting/ActionTemplateItem/portal_types/Organisation/account_statement_export.xml
...em/portal_types/Organisation/account_statement_export.xml
+1
-1
bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/account_statement_export.xml
...lateItem/portal_types/Person/account_statement_export.xml
+1
-1
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml
...ng/AccountModule_getAccountStatementReportSectionList.xml
+17
-9
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountStatementReportDialog.xml
...unting/AccountModule_viewAccountStatementReportDialog.xml
+1
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountStatementReportDialog/your_export.xml
...ntModule_viewAccountStatementReportDialog/your_export.xml
+110
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.xml
...unting/Account_getNotGroupedAccountingTransactionList.xml
+58
-78
product/ERP5/tests/testAccountingReports.py
product/ERP5/tests/testAccountingReports.py
+438
-385
No files found.
bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Module/account_statement_export.xml
View file @
72dfb2c4
...
@@ -30,7 +30,9 @@
...
@@ -30,7 +30,9 @@
</item>
</item>
<item>
<item>
<key>
<string>
description
</string>
</key>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
icon
</string>
</key>
<key>
<string>
icon
</string>
</key>
...
@@ -73,7 +75,7 @@
...
@@ -73,7 +75,7 @@
<key>
<string>
text
</string>
</key>
<key>
<string>
text
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string
encoding=
"cdata"
>
<![CDATA[
string:${object_url}/AccountModule_viewAccountStatementReportDialog?your_portal_skin=ODS&your_format=
string:${object_url}/AccountModule_viewAccountStatementReportDialog?your_portal_skin=ODS&your_format=
&field_your_export:int=1
]]>
</string>
</value>
]]>
</string>
</value>
</item>
</item>
...
...
bt5/erp5_accounting/ActionTemplateItem/portal_types/Organisation/account_statement_export.xml
View file @
72dfb2c4
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
<key>
<string>
text
</string>
</key>
<key>
<string>
text
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string
encoding=
"cdata"
>
<![CDATA[
string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=
string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=
&field_your_export:int=1
]]>
</string>
</value>
]]>
</string>
</value>
</item>
</item>
...
...
bt5/erp5_accounting/ActionTemplateItem/portal_types/Person/account_statement_export.xml
View file @
72dfb2c4
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
<key>
<string>
text
</string>
</key>
<key>
<string>
text
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string
encoding=
"cdata"
>
<![CDATA[
string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=
string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=
&field_your_export:int=1
]]>
</string>
</value>
]]>
</string>
</value>
</item>
</item>
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml
View file @
72dfb2c4
...
@@ -90,6 +90,8 @@ period_start_date = context\\\n
...
@@ -90,6 +90,8 @@ period_start_date = context\\\n
section_category=request[\'section_category\'],\n
section_category=request[\'section_category\'],\n
date=from_date or at_date)\n
date=from_date or at_date)\n
\n
\n
export = request[\'export\']\n
\n
# Also get the currency, to know the precision\n
# Also get the currency, to know the precision\n
currency = context.Base_getCurrencyForSection(request[\'section_category\'])\n
currency = context.Base_getCurrencyForSection(request[\'section_category\'])\n
precision = context.account_module.getQuantityPrecisionFromResource(currency)\n
precision = context.account_module.getQuantityPrecisionFromResource(currency)\n
...
@@ -144,21 +146,27 @@ if hide_analytic:\n
...
@@ -144,21 +146,27 @@ if hide_analytic:\n
else:\n
else:\n
analytic_column_list = context.AccountModule_getAnalyticColumnList()\n
analytic_column_list = context.AccountModule_getAnalyticColumnList()\n
params[\'analytic_column_list\'] = analytic_column_list\n
params[\'analytic_column_list\'] = analytic_column_list\n
request.set(\'analytic_column_list\', analytic_column_list) # for Movement_getExplanationTitleAndAnalytics\n
\n
\n
selection_columns = (\n
selection_columns = (\n
(\'date\', \'Operation Date\'),\n
(\'Movement_getSpecificReference\', \'Transaction Reference\'),\n
(\'Movement_getSpecificReference\', \'Transaction Reference\'),\n
(\'
date\', \'Dat
e\'),\n
(\'
Movement_getExplanationTitleAndAnalytics\', \'Title\\nReference and Analytics\' if analytic_column_list else \'Title\\nReferenc
e\'),\n
(\'Movement_getExplanationTitle\', \'Accounting Transaction Title\'),
)\n
)\n
if len(section_uid) >
1:\n
if len(section_uid) >
1:\n
selection_columns += ( (\'section_title\', \'Section\'), )\n
selection_columns += ((\'section_title\', \'Section\'),)\n
selection_columns += analytic_column_list\n
if not mirror_section:\n
selection_columns += ( (\'Movement_getMirrorSectionTitle\', \'Third Party\'), )\n
selection_columns += (\n
selection_columns += (\n
(\'Movement_getExplanationReference\', \'Document Reference\'),\n
(\'debit_price\', \'Debit\'),\n
(\'debit_price\', \'Debit\'),\n
(\'credit_price\', \'Credit\'),\n
(\'credit_price\', \'Credit\'),\n
(\'running_total_price\', \'Net\'),)\n
(\'running_total_price\', \'Running Balance\'),\n
(\'grouping_reference\', \'Grouping Reference\'),\n
(\'grouping_date\', \'Grouping Date\'),\n
(\'modification_date\', \'Modification Date\'),\n
(\'getTranslatedSimulationStateTitle\', \'State\'),\n
)\n
\n
if export:\n
selection_columns = context.AccountModule_getGeneralLedgerColumnItemList()\n
\n
\n
report_section_list = []\n
report_section_list = []\n
if from_date and detailed_from_date_summary:\n
if from_date and detailed_from_date_summary:\n
...
@@ -185,7 +193,7 @@ if from_date and detailed_from_date_summary:\n
...
@@ -185,7 +193,7 @@ if from_date and detailed_from_date_summary:\n
report_section_list.append(\n
report_section_list.append(\n
ReportSection(\n
ReportSection(\n
path=node,\n
path=node,\n
form_id=\'Account_viewAccountingTransactionList\',\n
form_id=\'Account_viewAccountingTransactionList
Export\' if export else \'Account_viewAccountingTransactionList
\',\n
selection_name=\'account_preference_selection\',\n
selection_name=\'account_preference_selection\',\n
selection_params=params,\n
selection_params=params,\n
selection_columns=selection_columns,\n
selection_columns=selection_columns,\n
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountStatementReportDialog.xml
View file @
72dfb2c4
...
@@ -112,6 +112,7 @@
...
@@ -112,6 +112,7 @@
<list>
<list>
<string>
your_simulation_state
</string>
<string>
your_simulation_state
</string>
<string>
your_portal_type
</string>
<string>
your_portal_type
</string>
<string>
your_export
</string>
</list>
</list>
</value>
</value>
</item>
</item>
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewAccountStatementReportDialog/your_export.xml
0 → 100644
View file @
72dfb2c4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
css_class
</string>
<string>
hidden
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_export
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string>
hidden_label
</string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_checkbox
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Export Mode
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.xml
View file @
72dfb2c4
...
@@ -51,12 +51,9 @@
...
@@ -51,12 +51,9 @@
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.PythonScripts.standard import Object\n
<value>
<string>
from Products.PythonScripts.standard import Object\n
from Products.ERP5Type.Document import newTempBase\n
from Products.ERP5Type.Message import Message\n
portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
getObject = portal.portal_catalog.getObject\n
getObject = portal.portal_catalog.getObject\n
params = portal.ERP5Accounting_getParams(selection_name)\n
params = portal.ERP5Accounting_getParams(selection_name)\n
N_ = lambda msg: Message(\'erp5_ui\', msg)\n
\n
\n
# this also prevents to be called directly\n
# this also prevents to be called directly\n
assert \'node_uid\' in kw\n
assert \'node_uid\' in kw\n
...
@@ -86,87 +83,70 @@ for brain in portal.Base_zGetNotGroupedMovementList(\n
...
@@ -86,87 +83,70 @@ for brain in portal.Base_zGetNotGroupedMovementList(\n
portal_type=portal.getPortalAccountingMovementTypeList(),\n
portal_type=portal.getPortalAccountingMovementTypeList(),\n
section_uid=params[\'section_uid\']):\n
section_uid=params[\'section_uid\']):\n
\n
\n
# manually filter out not interesting lines\n
# manually filter out not interesting lines\n
# XXX this is because Base_zGetNotGroupedMovementList is really\n
# XXX this is because Base_zGetNotGroupedMovementList is really\n
# minimalistic\n
# minimalistic\n
if mirror_section_relative_url and \\\n
if mirror_section_relative_url and \\\n
brain.mirror_section_relative_url != mirror_section_relative_url:\n
brain.mirror_section_relative_url != mirror_section_relative_url:\n
continue\n
continue\n
\n
mvt = brain.getObject()\n
transaction = mvt.getParentValue()\n
\n
if portal_type_filter and \\\n
transaction.getPortalType() not in portal_type_list:\n
continue\n
\n
\n
is_source = (brain.mirror_section_relative_url == mvt.getDestinationSection())\n
mvt = brain.getObject()\n
if is_source:\n
transaction = mvt.getParentValue()\n
if payment_uid and mvt.getSourcePaymentUid() != payment_uid:\n
\n
continue\n
if portal_type_filter and \\\n
if project_uid and mvt.getSourceProjectUid() != project_uid:\n
transaction.getPortalType() not in portal_type_list:\n
continue\n
continue\n
if function and not (mvt.getSourceFunction() or \'\').startswith(function):\n
continue\n
specific_reference = transaction.getSourceReference()\n
mirror_section_title = mvt.getDestinationSectionTitle()\n
section_title = mvt.getSourceSectionTitle()\n
else:\n
if payment_uid and mvt.getDestinationPaymentUid() != payment_uid:\n
continue\n
if project_uid and mvt.getDestinationProjectUid() != project_uid:\n
continue\n
if function and not (mvt.getDestinationFunction() or \'\').startswith(function):\n
continue\n
specific_reference = transaction.getDestinationReference()\n
mirror_section_title = mvt.getSourceSectionTitle()\n
section_title = mvt.getDestinationSectionTitle()\n
\n
\n
\n
debit = max(brain.total_quantity, 0)\n
is_source = (brain.mirror_section_relative_url == mvt.getDestinationSection())\n
total_debit += debit\n
if is_source:\n
credit = max(-brain.total_quantity, 0)\n
if payment_uid and mvt.getSourcePaymentUid() != payment_uid:\n
total_credit += credit\n
continue\n
if project_uid and mvt.getSourceProjectUid() != project_uid:\n
continue\n
if function and not (mvt.getSourceFunction() or \'\').startswith(function):\n
continue\n
specific_reference = transaction.getSourceReference()\n
mirror_section_title = mvt.getDestinationSectionTitle()\n
section_title = mvt.getSourceSectionTitle()\n
else:\n
if payment_uid and mvt.getDestinationPaymentUid() != payment_uid:\n
continue\n
if project_uid and mvt.getDestinationProjectUid() != project_uid:\n
continue\n
if function and not (mvt.getDestinationFunction() or \'\').startswith(function):\n
continue\n
specific_reference = transaction.getDestinationReference()\n
mirror_section_title = mvt.getSourceSectionTitle()\n
section_title = mvt.getDestinationSectionTitle()\n
\n
\n
\n
debit_price = max(brain.total_price
, 0)\n
debit = max(brain.total_quantity
, 0)\n
total_debit_price += debit_price
\n
total_debit += debit
\n
credit_price = max(-brain.total_price
, 0)\n
credit = max(-brain.total_quantity
, 0)\n
total_credit_price += credit_price
\n
total_credit += credit
\n
\n
\n
brain_date = brain.date\n
debit_price = max(brain.total_price, 0)\n
if mvt.getStartDate():\n
total_debit_price += debit_price\n
brain_date = brain_date.toZone(mvt.getStartDate().timezone())\n
credit_price = max(-brain.total_price, 0)\n
\n
total_credit_price += credit_price\n
line = Object(uid=\'new_000\',\n
total_price=brain.total_price,\n
date=brain.date,\n
Movement_getSpecificReference=specific_reference,\n
Movement_getMirrorSectionTitle=mirror_section_title,\n
section_title=section_title,\n
debit=debit,\n
credit=credit,\n
debit_price=debit_price,\n
credit_price=credit_price,\n
Movement_getExplanationTitle=\n
mvt.hasTitle() and mvt.getTitle() or transaction.getTitle())\n
\n
\n
analytic_info = {}\n
brain_date = brain.date\n
for analytic_column, analytic_column_title in analytic_column_list:\n
if mvt.getStartDate():\n
if analytic_column == \'project\':\n
brain_date = brain_date.toZone(mvt.getStartDate().timezone())\n
if is_source:\n
\n
analytic_info[\'project\'] = mvt.asContext(project_uid=mvt.getSourceProjectUid()).Movement_getProjectTitle()\n
line = Object(uid=\'new_000\',\n
else:\n
total_price=brain.total_price,\n
analytic_info[\'project\'] = mvt.asContext(project_uid=mvt.getDestinationProjectUid()).Movement_getProjectTitle()\n
date=brain.date,\n
elif analytic_column == \'function\':\n
Movement_getSpecificReference=specific_reference,\n
if is_source:\n
mirror_section_title=mirror_section_title,\n
analytic_info[\'function\'] = mvt.asContext(function_uid=mvt.getDestinationFunctionUid()).Movement_getFunctionTitle()\n
section_title=section_title,\n
else:\n
debit=debit,\n
analytic_info[\'function\'] = mvt.asContext(function_uid=mvt.getDestinationFunctionUid()).Movement_getFunctionTitle()\n
credit=credit,\n
else:\n
debit_price=debit_price,\n
analytic_info[analytic_column] = mvt.getProperty(analytic_column)\n
credit_price=credit_price,\n
Movement_getExplanationTitleAndAnalytics=brain.Movement_getExplanationTitleAndAnalytics(brain))\n
\n
\n
line.update(analytic_info)\n
line_list.append(line)\n
line_list.append(line)\n
\n
\n
\n
\n
context.REQUEST.set(\n
context.REQUEST.set(\n
...
...
product/ERP5/tests/testAccountingReports.py
View file @
72dfb2c4
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment