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
Klaus Wölfel
erp5
Commits
7193b12d
Commit
7193b12d
authored
Jun 04, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trade: Consider movement dates to select trade condition for price
using movement date rather than order date is more correct
parent
5d929056
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeCondition.py
...ateItem/portal_components/test.erp5.testTradeCondition.py
+38
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.py
...kins/erp5_core/Movement_getPriceCalculationOperandDict.py
+4
-1
No files found.
bt5/erp5_simplified_invoicing/TestTemplateItem/portal_components/test.erp5.testTradeCondition.py
View file @
7193b12d
...
...
@@ -604,6 +604,44 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
resource_value
=
self
.
resource
,
quantity
=
1
).
getPrice
(),
3
)
def
test_supply_line_from_effective_trade_condition_apply_based_on_movement_date
(
self
):
self
.
trade_condition
.
setReference
(
self
.
id
())
self
.
trade_condition
.
setExpirationDate
(
DateTime
(
1999
,
12
,
31
))
self
.
trade_condition
.
newContent
(
portal_type
=
self
.
supply_line_type
,
resource_value
=
self
.
resource
,
base_price
=
2
,
)
another_trade_condition
=
self
.
trade_condition_module
.
newContent
(
portal_type
=
self
.
trade_condition_type
,
effective_date
=
DateTime
(
2000
,
1
,
1
),
reference
=
self
.
id
(),
)
another_trade_condition
.
newContent
(
portal_type
=
self
.
supply_line_type
,
resource_value
=
self
.
resource
,
base_price
=
3
,
)
another_trade_condition
.
validate
()
self
.
tic
()
self
.
order
.
setSpecialiseValue
(
self
.
trade_condition
)
self
.
assertEqual
(
self
.
order
.
newContent
(
portal_type
=
self
.
order_line_type
,
start_date
=
DateTime
(
1999
,
1
,
1
),
resource_value
=
self
.
resource
,
quantity
=
1
).
getPrice
(),
2
)
self
.
assertEqual
(
self
.
order
.
newContent
(
portal_type
=
self
.
order_line_type
,
start_date
=
DateTime
(
2001
,
1
,
1
),
resource_value
=
self
.
resource
,
quantity
=
1
).
getPrice
(),
3
)
# TODO: move to testSupplyLine ! (which does not exist yet)
def
test_supply_line_section
(
self
):
# if a supply lines defines a section, it has priority over supply lines
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.py
View file @
7193b12d
...
...
@@ -103,7 +103,10 @@ if explanation is not None:
# if there are trade conditions containing supply lines related to that
# order/invoice, we give high priority to those supply lines
try
:
composed_document
=
explanation
.
asComposedDocument
()
composed_document
=
explanation
.
asContext
(
start_date
=
context
.
getStartDate
(),
stop_date
=
context
.
getStopDate
(),
).
asComposedDocument
()
except
KeyError
:
pass
else
:
...
...
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