Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
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
Eteri
erp5_fork
Commits
728df139
Commit
728df139
authored
Nov 25, 2014
by
Gabriel Monnerat
Committed by
Jérome Perrin
Dec 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testInvoice: add test to reproduce rounding issue when Accounting Transactions are created
parent
13a8ed1c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
product/ERP5/tests/testInvoice.py
product/ERP5/tests/testInvoice.py
+57
-0
No files found.
product/ERP5/tests/testInvoice.py
View file @
728df139
...
@@ -2607,6 +2607,63 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
...
@@ -2607,6 +2607,63 @@ class TestSaleInvoice(TestSaleInvoiceMixin, TestInvoice, ERP5TypeTestCase):
"""
)
"""
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
def
stepCreateCurrency
(
self
,
sequence
):
currency
=
self
.
portal
.
currency_module
.
newContent
(
portal_type
=
"Currency"
,
title
=
"Currency"
,
base_unit_quantity
=
0.01
)
sequence
.
edit
(
currency
=
currency
)
def
stepCreateInvoiceWithBadPrecision
(
self
,
sequence
):
portal
=
self
.
portal
vendor
=
sequence
.
get
(
'vendor'
)
invoice
=
portal
.
accounting_module
.
newContent
(
portal_type
=
"Sale Invoice Transaction"
,
specialise
=
self
.
business_process
,
source_section_value
=
vendor
,
start_date
=
self
.
datetime
,
price_currency_value
=
sequence
.
get
(
'currency'
),
destination_section_value
=
sequence
.
get
(
'client1'
),
source_value
=
vendor
)
resource
=
self
.
portal
.
getDefaultModule
(
self
.
resource_portal_type
).
newContent
(
portal_type
=
self
.
resource_portal_type
,
title
=
'Resource'
,
sale_supply_line_source_account
=
"account_module/sale"
,
product_line
=
'apparel'
)
product_line
=
invoice
.
newContent
(
portal_type
=
"Invoice Line"
,
resource_value
=
resource
,
quantity
=
1
,
price
=
0.014
)
product_line
=
invoice
.
newContent
(
portal_type
=
"Invoice Line"
,
resource_value
=
resource
,
quantity
=
1
,
price
=
0.014
)
self
.
tic
()
invoice
.
plan
()
invoice
.
confirm
()
self
.
tic
()
invoice
.
start
()
self
.
tic
()
movement_list
=
invoice
.
getMovementList
(
portal_type
=
invoice
.
getPortalAccountingMovementTypeList
())
receivable_line
=
[
m
for
m
in
movement_list
\
if
m
.
getSourceValue
().
getAccountType
()
==
\
"asset/receivable"
][
0
]
self
.
assertEquals
(
0.03
,
receivable_line
.
getSourceDebit
())
vat_line
=
[
m
for
m
in
movement_list
\
if
m
.
getSourceValue
().
getAccountType
()
==
\
"liability/payable/collected_vat"
][
0
]
self
.
assertEquals
(
0.0
,
vat_line
.
getSourceDebit
())
income_line
=
[
m
for
m
in
movement_list
\
if
m
.
getSourceValue
().
getAccountType
()
==
\
"income"
][
0
]
self
.
assertEquals
(
0.03
,
income_line
.
getSourceCredit
())
def
test_rounding_issue
(
self
):
sequence_list
=
SequenceList
()
sequence_list
.
addSequenceString
(
"""
stepCreateCurrency
stepCreateEntities
stepCreateInvoiceWithBadPrecision
"""
)
sequence_list
.
play
(
self
)
def
test_02_TwoInvoicesFromTwoPackingList
(
self
,
quiet
=
quiet
):
def
test_02_TwoInvoicesFromTwoPackingList
(
self
,
quiet
=
quiet
):
"""
"""
This test was created for the following bug:
This test was created for the following bug:
...
...
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