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
1
Merge Requests
1
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
Cédric Le Ninivin
erp5
Commits
09e12061
Commit
09e12061
authored
May 07, 2020
by
Cédric Le Ninivin
Committed by
Titouan Soulard
Mar 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BuilderMixin: Introduce batch Order Quantity
parent
af1587fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.BuilderMixin.py
...TemplateItem/portal_components/mixin.erp5.BuilderMixin.py
+4
-0
No files found.
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.BuilderMixin.py
View file @
09e12061
...
...
@@ -384,10 +384,12 @@ class BuilderMixin(XMLObject, Amount, Predicate):
local_min_delay_second
,
local_max_delay_second
,
local_min_order_delay_second
,
local_max_order_delay_second
=
getMinMaxDelayAndOrderDelay
(
selected_supply
,
default_supply
)
local_order_quantity_unit_default_quantity_unit_conversion_ratio
=
getOrderQuantityUnitDefaultQuantityUnitConversionRatio
(
selected_supply
,
default_supply
)
local_order_quantity_unit_value
=
getCorrectSupplyParameter
(
selected_supply
,
default_supply
,
'getOrderQuantityUnitValue'
)
local_batch_order_quantity
=
getCorrectSupplyParameter
(
selected_supply
,
default_supply
,
'getBatchOrderQuantity'
)
else
:
local_min_delay_second
,
local_max_delay_second
,
local_min_order_delay_second
,
local_max_order_delay_second
=
min_delay_second
,
max_delay_second
,
min_order_delay_second
,
max_order_delay_second
local_order_quantity_unit_default_quantity_unit_conversion_ratio
=
order_quantity_unit_default_quantity_unit_conversion_ratio
local_order_quantity_unit_value
=
original_order_quantity_unit_value
local_batch_order_quantity
=
original_batch_order_quantity
delay_second
=
local_max_delay_second
or
local_min_delay_second
or
0
limit_date
=
getPreviousValidDate
(
date
)
start_date
=
getPreviousValidDate
(
...
...
@@ -398,6 +400,7 @@ class BuilderMixin(XMLObject, Amount, Predicate):
order_delay_second
=
local_max_order_delay_second
or
local_min_order_delay_second
or
0
effective_date
=
addToDate
(
start_date
,
second
=-
order_delay_second
)
order_quantity
=
ceil
(
quantity
/
local_order_quantity_unit_default_quantity_unit_conversion_ratio
)
order_quantity
=
ceil
(
order_quantity
/
local_batch_order_quantity
)
*
local_batch_order_quantity
quantity
=
order_quantity
*
local_order_quantity_unit_default_quantity_unit_conversion_ratio
return
order_quantity
,
local_order_quantity_unit_value
,
effective_date
,
start_date
,
stop_date
,
quantity
...
...
@@ -524,6 +527,7 @@ class BuilderMixin(XMLObject, Amount, Predicate):
original_min_stock_value
=
0
#supply.getMinOrderQuantity() / default_quantity_unit_flow_quantity_unit_conversion_ratio
original_factor
=
0
#supply.getMinFlow()
original_order_quantity_unit_value
=
supply
.
getOrderQuantityUnitValue
()
original_batch_order_quantity
=
supply
.
getBatchOrderQuantity
()
# Create a movement per period
for
period_start_date
in
limit_date_list
:
# Prepare history list of the current period
...
...
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