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
Labels
Merge Requests
147
Merge Requests
147
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
0dc53d07
Commit
0dc53d07
authored
Jul 03, 2019
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_pdm: update property names in Resource_getPriceCalculationOperandDict
parent
604ef310
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_getPriceCalculationOperandDict.py
...skins/erp5_pdm/Resource_getPriceCalculationOperandDict.py
+6
-4
No files found.
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_getPriceCalculationOperandDict.py
View file @
0dc53d07
from
math
import
log
result
=
context
.
getPriceParameterDict
(
context
=
movement
,
**
kw
)
# XXX: Add "stepped_price" in calculation
# sliced_base_price = {'price': 10.0, 'sliced_range': (1, None)}
# Calculate
# If slice_base_price:
# base_price = SUM(number_of_items_in_slice * slice_base_price) for each slice
# Then
# ((base_price + SUM(additional_price) +
# variable_value * SUM(variable_additional_price)) *
# (1 - MIN(1, MAX(SUM(discount_ratio) , exclusive_discount_ratio ))) +
...
...
@@ -20,10 +21,11 @@ result = context.getPriceParameterDict(context=movement, **kw)
# It can be seen as a way to define a pricing model that not only
# depends on discrete variations, but also on a continuous property
# of the object
if
result
[
"sliced_base_price"
]:
if
result
[
"slice_base_price"
]:
total_price
=
0.
quantity
=
movement
.
getQuantity
()
sliced_base_price_list
=
zip
(
result
[
"slice
d_base_price"
],
result
[
"sliced
_range"
])
sliced_base_price_list
=
zip
(
result
[
"slice
_base_price"
],
result
[
"slice_quantity
_range"
])
for
slice_price
,
slice_range
in
sliced_base_price_list
:
slice_min
,
slice_max
=
slice_range
if
slice_max
is
None
:
...
...
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