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
Kasra Jamshidi
erp5
Commits
70a5a681
Commit
70a5a681
authored
Sep 11, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting: fix account statement begin balance showing non grouped lines for 0 quantity
fixes #20170911-1AD62FB
parent
921fb233
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
2 deletions
+60
-2
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.py
...ounting/Account_getNotGroupedAccountingTransactionList.py
+2
-2
product/ERP5/tests/testAccountingReports.py
product/ERP5/tests/testAccountingReports.py
+58
-0
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.py
View file @
70a5a681
...
...
@@ -67,9 +67,9 @@ for brain in portal.portal_simulation.getMovementHistoryList(**inventory_query):
credit
=
max
(
-
brain
.
total_quantity
,
0
)
total_credit
+=
credit
debit_price
=
max
(
brain
.
total_price
,
0
)
debit_price
=
max
(
(
brain
.
total_price
or
0
)
,
0
)
total_debit_price
+=
debit_price
credit_price
=
max
(
-
brain
.
total_price
,
0
)
credit_price
=
max
(
-
(
brain
.
total_price
or
0
)
,
0
)
total_credit_price
+=
credit_price
line
=
Object
(
uid
=
'new_000'
,
...
...
product/ERP5/tests/testAccountingReports.py
View file @
70a5a681
...
...
@@ -1611,6 +1611,64 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
self
.
assertTrue
(
line_list
[
-
1
].
isStatLine
())
self
.
checkLineProperties
(
line_list
[
-
1
],
debit_price
=
700
,
credit_price
=
200
)
def
testAccountStatementFromDateDetailedSummaryZeroTransaction
(
self
):
# Edge case regression #20170911-1AD62FB
t0
=
self
.
_makeOne
(
portal_type
=
'Accounting Transaction'
,
title
=
'Transaction 0'
,
reference
=
'ref0'
,
source_reference
=
'0'
,
simulation_state
=
'planned'
,
destination_section_value
=
self
.
organisation_module
.
client_1
,
start_date
=
DateTime
(
2006
,
1
,
31
),
lines
=
(
dict
(
source_value
=
self
.
portal
.
account_module
.
receivable
,
id
=
'receivable_line'
,
source_debit
=
0
),
dict
(
source_value
=
self
.
portal
.
account_module
.
payable
,
source_credit
=
0
)))
self
.
assertFalse
(
t0
.
receivable_line
.
hasGroupingReference
())
self
.
_createAccountStatementGroupedAtFromDateDataSet
()
# set request variables and render
request_form
=
self
.
portal
.
REQUEST
.
form
request_form
[
'node'
]
=
\
self
.
portal
.
account_module
.
receivable
.
getRelativeUrl
()
request_form
[
'from_date'
]
=
DateTime
(
2006
,
2
,
26
)
request_form
[
'at_date'
]
=
DateTime
(
2006
,
6
,
1
)
request_form
[
'section_category'
]
=
'group/demo_group'
request_form
[
'section_category_strict'
]
=
False
request_form
[
'simulation_state'
]
=
[
'delivered'
,
'planned'
]
request_form
[
'detailed_from_date_summary'
]
=
1
request_form
[
'hide_analytic'
]
=
False
request_form
[
'export'
]
=
False
report_section_list
=
self
.
getReportSectionList
(
self
.
portal
.
accounting_module
,
'AccountModule_viewAccountStatementReport'
)
self
.
assertEqual
(
4
,
len
(
report_section_list
))
report_section_list
=
[
r
for
r
in
report_section_list
if
r
.
form_id
]
self
.
assertEqual
(
2
,
len
(
report_section_list
))
# the first section contains explanation of non grouped lines before the
# period
line_list
=
self
.
getListBoxLineList
(
report_section_list
[
0
])
data_line_list
=
[
l
for
l
in
line_list
if
l
.
isDataLine
()]
# We have lines for transaction 0 and 1 which are not grouped
self
.
assertEqual
(
2
,
len
(
data_line_list
))
self
.
checkLineProperties
(
data_line_list
[
0
],
Movement_getSpecificReference
=
'0'
,
date
=
DateTime
(
2006
,
1
,
31
),
Movement_getExplanationTitleAndAnalytics
=
'Transaction 0
\
n
ref0'
,
debit_price
=
0
,
credit_price
=
0
,)
self
.
checkLineProperties
(
data_line_list
[
1
],
Movement_getSpecificReference
=
'1'
,
date
=
DateTime
(
2006
,
2
,
1
),
Movement_getExplanationTitleAndAnalytics
=
'Transaction 1
\
n
ref1'
,
debit_price
=
100
,
credit_price
=
0
,)
self
.
assertTrue
(
line_list
[
-
1
].
isStatLine
())
self
.
checkLineProperties
(
line_list
[
-
1
],
debit_price
=
100
,
credit_price
=
0
)
def
testAccountStatementPeriodDateForExpenseAccounts
(
self
):
# Account statement for expense or income account will not show
...
...
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