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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Papa Tamsir Kane
erp5
Commits
2df92e7f
Commit
2df92e7f
authored
Jun 08, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_accounting: adds filtering on ledger for Journal Report
parent
959ed281
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
220 additions
and
1 deletion
+220
-1
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalReportSectionList.py
...ccountingTransactionModule_getJournalReportSectionList.py
+13
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.py
.../AccountingTransactionModule_getJournalSectionLineList.py
+3
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.xml
...AccountingTransactionModule_getJournalSectionLineList.xml
+1
-1
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalDialog.xml
...ounting/AccountingTransactionModule_viewJournalDialog.xml
+1
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalDialog/your_ledger.xml
...untingTransactionModule_viewJournalDialog/your_ledger.xml
+84
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalReport.xml
...ounting/AccountingTransactionModule_viewJournalReport.xml
+1
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalReport/your_ledger.xml
...untingTransactionModule_viewJournalReport/your_ledger.xml
+84
-0
product/ERP5/tests/testAccountingReports.py
product/ERP5/tests/testAccountingReports.py
+33
-0
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalReportSectionList.py
View file @
2df92e7f
...
@@ -2,10 +2,13 @@ from Products.ERP5Form.Report import ReportSection
...
@@ -2,10 +2,13 @@ from Products.ERP5Form.Report import ReportSection
request
=
container
.
REQUEST
request
=
container
.
REQUEST
Base_translateString
=
container
.
Base_translateString
Base_translateString
=
container
.
Base_translateString
portal
=
context
.
getPortalObject
()
portal_type
=
request
[
'portal_type'
]
portal_type
=
request
[
'portal_type'
]
simulation_state
=
request
[
'simulation_state'
]
simulation_state
=
request
[
'simulation_state'
]
hide_analytic
=
request
[
'hide_analytic'
]
hide_analytic
=
request
[
'hide_analytic'
]
project
=
request
.
get
(
'project'
,
None
)
project
=
request
.
get
(
'project'
,
None
)
ledger
=
request
.
get
(
'ledger'
,
None
)
at_date
=
request
[
'at_date'
].
latestTime
()
at_date
=
request
[
'at_date'
].
latestTime
()
from_date
=
request
.
get
(
'from_date'
)
or
at_date
.
earliestTime
()
from_date
=
request
.
get
(
'from_date'
)
or
at_date
.
earliestTime
()
section_uid
=
context
.
Base_getSectionUidListForSectionCategory
(
section_uid
=
context
.
Base_getSectionUidListForSectionCategory
(
...
@@ -38,6 +41,16 @@ if project:
...
@@ -38,6 +41,16 @@ if project:
selection_params
[
'project_uid'
]
=
\
selection_params
[
'project_uid'
]
=
\
context
.
getPortalObject
().
restrictedTraverse
(
project
).
getUid
()
context
.
getPortalObject
().
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
:
selection_params
.
setdefault
(
'ledger_uid'
,
[]).
append
(
ledger_value
.
getUid
())
analytic_column_list
=
()
analytic_column_list
=
()
if
hide_analytic
:
if
hide_analytic
:
selection_params
[
'group_by'
]
=
(
'explanation_uid'
,
selection_params
[
'group_by'
]
=
(
'explanation_uid'
,
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.py
View file @
2df92e7f
...
@@ -19,6 +19,9 @@ if project_uid:
...
@@ -19,6 +19,9 @@ if project_uid:
else
:
else
:
extra_kw
[
'project_uid'
]
=
project_uid
extra_kw
[
'project_uid'
]
=
project_uid
if
ledger_uid
:
extra_kw
[
'ledger_uid'
]
=
ledger_uid
account_title_cache
=
{}
account_title_cache
=
{}
def
getAccountId
(
node_relative_url
):
def
getAccountId
(
node_relative_url
):
if
node_relative_url
not
in
account_title_cache
:
if
node_relative_url
not
in
account_title_cache
:
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.xml
View file @
2df92e7f
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
selection, at_date, from_date, portal_type, simulation_state, section_uid, payment_mode=None, payment=None, gap_root=None, group_by=None, analytic_column_list=[], project_uid=None, **kw
</string>
</value>
<value>
<string>
selection, at_date, from_date, portal_type, simulation_state, section_uid, payment_mode=None, payment=None, gap_root=None, group_by=None, analytic_column_list=[], project_uid=None,
ledger_uid=None,
**kw
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalDialog.xml
View file @
2df92e7f
...
@@ -91,6 +91,7 @@
...
@@ -91,6 +91,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_ledger
</string>
</list>
</list>
</value>
</value>
</item>
</item>
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalDialog/your_ledger.xml
0 → 100644
View file @
2df92e7f
<?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/AccountingTransactionModule_viewJournalReport.xml
View file @
2df92e7f
...
@@ -98,6 +98,7 @@
...
@@ -98,6 +98,7 @@
<string>
your_at_date
</string>
<string>
your_at_date
</string>
<string>
your_gap_root
</string>
<string>
your_gap_root
</string>
<string>
your_portal_type
</string>
<string>
your_portal_type
</string>
<string>
your_ledger
</string>
<string>
your_simulation_state
</string>
<string>
your_simulation_state
</string>
</list>
</list>
</value>
</value>
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewJournalReport/your_ledger.xml
0 → 100644
View file @
2df92e7f
<?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>
product/ERP5/tests/testAccountingReports.py
View file @
2df92e7f
...
@@ -527,6 +527,39 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
...
@@ -527,6 +527,39 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
self
.
assertTrue
(
line_list
[
-
1
].
isStatLine
())
self
.
assertTrue
(
line_list
[
-
1
].
isStatLine
())
self
.
checkLineProperties
(
line_list
[
-
1
],
debit
=
500
,
credit
=
500
)
self
.
checkLineProperties
(
line_list
[
-
1
],
debit
=
500
,
credit
=
500
)
def
testJournalLedger
(
self
):
self
.
createLedgerDataSet
()
request_form
=
self
.
portal
.
REQUEST
.
form
request_form
[
'at_date'
]
=
DateTime
(
2006
,
2
,
2
)
request_form
[
'section_category'
]
=
'group/demo_group'
request_form
[
'section_category_strict'
]
=
False
request_form
[
'portal_type'
]
=
[
'Sale Invoice Transaction'
]
request_form
[
'simulation_state'
]
=
[
'delivered'
]
request_form
[
'ledger'
]
=
'ledger/accounting/general'
request_form
[
'hide_analytic'
]
=
True
report_section_list
=
self
.
getReportSectionList
(
self
.
portal
.
accounting_module
,
'AccountingTransactionModule_viewJournalReport'
)
self
.
assertEqual
(
1
,
len
(
report_section_list
))
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
],
node_title
=
'41'
,
mirror_section_title
=
'Client 1'
,
debit
=
500
,
credit
=
0
)
self
.
checkLineProperties
(
data_line_list
[
1
],
node_title
=
'7'
,
debit
=
0
,
credit
=
500
)
stat_line
=
line_list
[
-
1
]
self
.
assertTrue
(
line_list
[
-
1
].
isStatLine
())
self
.
checkLineProperties
(
line_list
[
-
1
],
debit
=
500
,
credit
=
500
)
def
createAccountStatementDataSet
(
self
,
use_two_bank_accounts
=
1
):
def
createAccountStatementDataSet
(
self
,
use_two_bank_accounts
=
1
):
"""Create transactions for Account statement report.
"""Create transactions for Account statement report.
...
...
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