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
Xueyun Qian
erp5
Commits
bad19050
Commit
bad19050
authored
Mar 10, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting: display mirror section title in GL initial balance line
parent
aa66b679
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
0 deletions
+114
-0
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.py
...kins/erp5_accounting/Node_getAccountingTransactionList.py
+6
-0
product/ERP5/tests/testAccountingReports.py
product/ERP5/tests/testAccountingReports.py
+108
-0
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.py
View file @
bad19050
...
...
@@ -177,6 +177,7 @@ if from_date or is_pl_account:
Movement_getExplanationTranslatedPortalType
=
''
,
Movement_getExplanationReference
=
''
,
Movement_getMirrorSectionTitle
=
''
,
mirror_section_title
=
''
,
Movement_getNodeGapId
=
''
,
getListItemUrl
=
lambda
*
args
,
**
kw
:
None
,
Movement_getExplanationUrl
=
lambda
**
kw
:
None
,
...
...
@@ -195,6 +196,11 @@ if from_date or is_pl_account:
Movement_getNodeGapId
=
node
.
Account_getGapId
(),
node_translated_title
=
node
.
getTranslatedTitle
()
)
if
params
.
get
(
'mirror_section_uid'
):
mirror_section
=
portal
.
portal_catalog
.
getObject
(
params
[
'mirror_section_uid'
])
previous_balance
.
edit
(
mirror_section_title
=
mirror_section
.
getTitle
()
)
section
=
portal
.
portal_catalog
.
getObject
(
section_uid
)
previous_balance
.
edit
(
Movement_getSectionPriceCurrency
=
section
.
getPriceCurrencyReference
(),
...
...
product/ERP5/tests/testAccountingReports.py
View file @
bad19050
...
...
@@ -4020,6 +4020,114 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
self
.
assertEqual
(
1
,
len
(
data_line_list
))
self
.
checkLineProperties
(
data_line_list
[
0
],
debit_price
=
2900
,
credit_price
=
2900
)
def
testGeneralLedgerInitialBalance
(
self
):
# Initial balance line on GL
# we will use the same data set as account statement
self
.
createAccountStatementDataSetOnTwoPeriods
()
# set request variables and render
request_form
=
self
.
portal
.
REQUEST
.
form
request_form
[
'from_date'
]
=
DateTime
(
2006
,
2
,
1
)
request_form
[
'at_date'
]
=
DateTime
(
2006
,
12
,
31
)
request_form
[
'gap_list'
]
=
[
'my_country/my_accounting_standards/4/41'
]
request_form
[
'section_category'
]
=
'group/demo_group'
request_form
[
'section_category_strict'
]
=
False
request_form
[
'simulation_state'
]
=
[
'delivered'
]
request_form
[
'hide_analytic'
]
=
False
request_form
[
'export'
]
=
False
report_section_list
=
self
.
getReportSectionList
(
self
.
portal
.
accounting_module
,
'AccountModule_viewGeneralLedgerReport'
)
self
.
assertEqual
(
2
,
len
(
report_section_list
))
self
.
assertEqual
(
'41 - Receivable (Client 1)'
,
report_section_list
[
0
].
getTitle
())
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_getSpecificReference
=
'Previous Balance'
,
mirror_section_title
=
'Client 1'
,
date
=
DateTime
(
2006
,
2
,
1
),
debit_price
=
300
,
credit_price
=
0
,
running_total_price
=
300
,
)
self
.
checkLineProperties
(
data_line_list
[
1
],
Movement_getSpecificReference
=
'3'
,
Movement_getExplanationTitleAndAnalytics
=
'Transaction 3
\
n
ref3'
,
date
=
DateTime
(
2006
,
2
,
2
),
debit_price
=
300
,
credit_price
=
0
,
running_total_price
=
600
,
)
self
.
assertTrue
(
line_list
[
-
1
].
isStatLine
())
self
.
checkLineProperties
(
line_list
[
-
1
],
Movement_getSpecificReference
=
None
,
Movement_getExplanationTitleAndAnalytics
=
None
,
date
=
None
,
debit_price
=
600
,
credit_price
=
0
,
)
self
.
assertEqual
(
'Total'
,
report_section_list
[
1
].
getTitle
())
line_list
=
self
.
getListBoxLineList
(
report_section_list
[
1
])
data_line_list
=
[
l
for
l
in
line_list
if
l
.
isDataLine
()]
self
.
assertEqual
(
1
,
len
(
data_line_list
))
self
.
checkLineProperties
(
data_line_list
[
0
],
debit_price
=
600
,
credit_price
=
0
)
def
testGeneralLedgerExportInitialBalance
(
self
):
# Initial balance on GL export
# we will use the same data set as account statement
self
.
createAccountStatementDataSetOnTwoPeriods
()
# set request variables and render
request_form
=
self
.
portal
.
REQUEST
.
form
request_form
[
'from_date'
]
=
DateTime
(
2006
,
2
,
1
)
request_form
[
'at_date'
]
=
DateTime
(
2006
,
12
,
31
)
request_form
[
'gap_list'
]
=
[
'my_country/my_accounting_standards/4/41'
]
request_form
[
'section_category'
]
=
'group/demo_group'
request_form
[
'section_category_strict'
]
=
False
request_form
[
'simulation_state'
]
=
[
'delivered'
]
request_form
[
'hide_analytic'
]
=
False
request_form
[
'export'
]
=
True
report_section_list
=
self
.
getReportSectionList
(
self
.
portal
.
accounting_module
,
'AccountModule_viewGeneralLedgerReport'
)
self
.
assertEqual
(
1
,
len
(
report_section_list
))
# export mode has no section headers
self
.
assertEqual
(
None
,
report_section_list
[
0
].
getTitle
())
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_getSpecificReference
=
'Previous Balance'
,
mirror_section_title
=
'Client 1'
,
date
=
DateTime
(
2006
,
2
,
1
),
debit_price
=
300
,
credit_price
=
0
,
)
self
.
checkLineProperties
(
data_line_list
[
1
],
Movement_getSpecificReference
=
'3'
,
mirror_section_title
=
'Client 1'
,
date
=
DateTime
(
2006
,
2
,
2
),
debit_price
=
300
,
credit_price
=
0
,
)
self
.
assertFalse
(
line_list
[
-
1
].
isStatLine
())
def
testGeneralLedgerGAPFilter
(
self
):
# General Ledger filtered by GAP category
...
...
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