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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
amrani
erp5
Commits
b46c3772
Commit
b46c3772
authored
Jun 08, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_accounting: adds filtering on ledger for Third Parties Report
parent
2df92e7f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
278 additions
and
3 deletions
+278
-3
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.py
...ounting/AccountModule_getOtherPartiesReportSectionList.py
+11
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewOtherPartiesReport.xml
.../erp5_accounting/AccountModule_viewOtherPartiesReport.xml
+1
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewOtherPartiesReport/your_ledger.xml
...ting/AccountModule_viewOtherPartiesReport/your_ledger.xml
+84
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewOtherPartiesReportDialog.xml
...accounting/AccountModule_viewOtherPartiesReportDialog.xml
+1
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewOtherPartiesReportDialog/your_ledger.xml
...ccountModule_viewOtherPartiesReportDialog/your_ledger.xml
+84
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.py
...kins/erp5_accounting/Node_getAccountingTransactionList.py
+2
-2
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_statAccountingBalance.py
...ortal_skins/erp5_accounting/Node_statAccountingBalance.py
+1
-1
product/ERP5/tests/testAccountingReports.py
product/ERP5/tests/testAccountingReports.py
+94
-0
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.py
View file @
b46c3772
...
...
@@ -12,6 +12,7 @@ role_filter_list = request.get('mirror_section_category_list', None)
omit_balanced_accounts
=
request
[
'omit_balanced_accounts'
]
from_date
=
request
.
get
(
'from_date'
,
None
)
project
=
request
.
get
(
'project'
,
None
)
ledger
=
request
.
get
(
'ledger'
,
None
)
currency
=
portal
.
Base_getCurrencyForSection
(
request
[
'section_category'
])
precision
=
portal
.
account_module
.
getQuantityPrecisionFromResource
(
currency
)
...
...
@@ -46,6 +47,16 @@ if project:
else
:
params
[
'project_uid'
]
=
portal
.
restrictedTraverse
(
project
).
getUid
()
if
ledger
:
if
not
isinstance
(
ledger
,
list
):
# Allows the generation of reports on different ledgers as the same time
ledger
=
[
ledger
]
portal_categories
=
portal
.
portal_categories
ledger_value_list
=
[
portal_categories
.
restrictedTraverse
(
ledger_category
,
None
)
for
ledger_category
in
ledger
]
for
ledger_value
in
ledger_value_list
:
params
.
setdefault
(
'ledger_uid'
,
[]).
append
(
ledger_value
.
getUid
())
simulation_tool
=
portal
.
portal_simulation
entity_columns
=
[
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewOtherPartiesReport.xml
View file @
b46c3772
...
...
@@ -97,6 +97,7 @@
<string>
your_omit_grouping_reference
</string>
<string>
your_mirror_section_category_list
</string>
<string>
your_gap_root
</string>
<string>
your_ledger
</string>
<string>
your_simulation_state
</string>
<string>
your_report_date
</string>
</list>
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewOtherPartiesReport/your_ledger.xml
0 → 100644
View file @
b46c3772
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_ledger
</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>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
your_ledger
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
AccountModule_viewReportFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewOtherPartiesReportDialog.xml
View file @
b46c3772
...
...
@@ -99,6 +99,7 @@
<list>
<string>
your_simulation_state
</string>
<string>
your_mirror_section_category_list
</string>
<string>
your_ledger
</string>
</list>
</value>
</item>
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewOtherPartiesReportDialog/your_ledger.xml
0 → 100644
View file @
b46c3772
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_ledger
</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>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
your_ledger
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
AccountModule_viewDialogFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.py
View file @
b46c3772
...
...
@@ -25,8 +25,8 @@ if kw.get('mirror_section_uid'):
if
kw
.
get
(
'ledger'
,
None
):
params
[
'ledger'
]
=
kw
[
'ledger'
]
category_uid_list
=
(
'payment_uid'
,
'project_uid'
,
'funding_uid'
,
'
function
_uid'
,
'payment_request_uid'
,
'default_aggregate_uid'
)
category_uid_list
=
(
'payment_uid'
,
'project_uid'
,
'funding_uid'
,
'function_uid'
,
'
ledger
_uid'
,
'payment_request_uid'
,
'default_aggregate_uid'
)
for
category_uid
in
category_uid_list
:
category_uid_value
=
kw
.
get
(
category_uid
)
if
category_uid_value
:
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_statAccountingBalance.py
View file @
b46c3772
...
...
@@ -16,7 +16,7 @@ if kw.get('mirror_section_uid'):
params
[
'mirror_section_uid'
]
=
kw
[
'mirror_section_uid'
]
category_uid_list
=
(
'payment_uid'
,
'project_uid'
,
'funding_uid'
,
'function_uid'
,
'payment_request_uid'
)
'
ledger_uid'
,
'
function_uid'
,
'payment_request_uid'
)
for
category_uid
in
category_uid_list
:
category_uid_value
=
kw
.
get
(
category_uid
)
if
category_uid_value
:
...
...
product/ERP5/tests/testAccountingReports.py
View file @
b46c3772
...
...
@@ -4377,6 +4377,100 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
credit_price
=
0
,
debit_price
=
300
,)
def
testOtherPartiesReportLedger
(
self
):
# Other parties report with a filter on ledger
# This tests works because /for the moment/ any transaction between 2
# entities belong to the same ledger
self
.
createLedgerCategory
()
account_module
=
self
.
portal
.
account_module
t1
=
self
.
_makeOne
(
portal_type
=
'Accounting Transaction'
,
title
=
'Transaction 1'
,
source_reference
=
'1'
,
simulation_state
=
'delivered'
,
ledger
=
'accounting/general'
,
destination_section_value
=
self
.
organisation_module
.
client_1
,
start_date
=
DateTime
(
2006
,
2
,
1
),
lines
=
(
dict
(
source_value
=
account_module
.
receivable
,
source_debit
=
100.0
),
dict
(
source_value
=
account_module
.
goods_sales
,
source_credit
=
100.0
)))
t2
=
self
.
_makeOne
(
portal_type
=
'Accounting Transaction'
,
title
=
'Transaction 2'
,
source_reference
=
'2'
,
simulation_state
=
'delivered'
,
ledger
=
'accounting/general'
,
destination_section_value
=
self
.
organisation_module
.
client_1
,
start_date
=
DateTime
(
2006
,
2
,
1
,
0
,
1
),
lines
=
(
dict
(
source_value
=
account_module
.
payable
,
source_debit
=
200.0
),
dict
(
source_value
=
account_module
.
goods_sales
,
source_credit
=
200.0
)))
t3
=
self
.
_makeOne
(
portal_type
=
'Accounting Transaction'
,
title
=
'Transaction 3'
,
source_reference
=
'3'
,
simulation_state
=
'delivered'
,
ledger
=
'accounting/detailed'
,
destination_section_value
=
self
.
organisation_module
.
client_1
,
start_date
=
DateTime
(
2006
,
2
,
1
,
0
,
2
),
lines
=
(
dict
(
source_value
=
account_module
.
payable
,
source_debit
=
400.0
),
dict
(
source_value
=
account_module
.
goods_sales
,
source_credit
=
400.0
)))
request_form
=
self
.
portal
.
REQUEST
.
form
request_form
[
'at_date'
]
=
DateTime
(
2006
,
2
,
1
)
request_form
[
'section_category'
]
=
'group/demo_group'
request_form
[
'section_category_strict'
]
=
False
request_form
[
'simulation_state'
]
=
[
'delivered'
]
request_form
[
'ledger'
]
=
'ledger/accounting/general'
request_form
[
'omit_balanced_accounts'
]
=
False
request_form
[
'omit_grouping_reference'
]
=
True
report_section_list
=
self
.
getReportSectionList
(
self
.
portal
.
accounting_module
,
'AccountModule_viewOtherPartiesReport'
)
self
.
assertEqual
(
1
,
len
(
report_section_list
))
# the role is displayed in parenthesis
self
.
assertEqual
(
report_section_list
[
0
].
getTitle
(),
'Client 1 (Client)'
)
# currency is present in the report
self
.
assertEqual
(
'currency_module/euro'
,
self
.
portal
.
AccountModule_viewOtherPartiesReport
.
your_currency
.
get_value
(
'default'
))
line_list
=
self
.
getListBoxLineList
(
report_section_list
[
0
])
data_line_list
=
[
l
for
l
in
line_list
if
l
.
isDataLine
()]
self
.
assertEqual
(
2
,
len
(
data_line_list
))
self
.
checkLineProperties
(
data_line_list
[
0
],
Movement_getExplanationTitle
=
'Transaction 1'
,
Movement_getExplanationTranslatedPortalType
=
'Accounting Transaction'
,
Movement_getNodeGapId
=
'41'
,
credit_price
=
0
,
debit_price
=
100
,
date
=
DateTime
(
'2006/02/01'
),
getTranslatedSimulationStateTitle
=
'Closed'
,
running_total_price
=
100.0
)
self
.
checkLineProperties
(
data_line_list
[
1
],
Movement_getExplanationTitle
=
'Transaction 2'
,
Movement_getExplanationTranslatedPortalType
=
'Accounting Transaction'
,
Movement_getNodeGapId
=
'40'
,
credit_price
=
0
,
debit_price
=
200
,
date
=
DateTime
(
2006
,
2
,
1
,
0
,
1
),
getTranslatedSimulationStateTitle
=
'Closed'
,
running_total_price
=
300.0
)
self
.
assertTrue
(
line_list
[
-
1
].
isStatLine
())
self
.
checkLineProperties
(
line_list
[
-
1
],
credit_price
=
0
,
debit_price
=
300
,)
def
createAgedBalanceDataSet
(
self
):
"""Create data set for aged balance:
2013/07/30: Purchase invoice 1 (500)
...
...
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