[UPD] Arround plan amount with coeff
If 100 <= amount_with_coef < 125, result = 100 If 125 <= amount_with_coef < 175, result = 150 If 175 <= amount_with_coef <= 200, result = 200
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "account_budget_forecast",
|
||||
"version": "13.0.1.2.0",
|
||||
"version": "13.0.1.3.0",
|
||||
"author": "Elabore",
|
||||
"maintainer": "False",
|
||||
"website": "False",
|
||||
|
@@ -290,6 +290,21 @@ class BudgetForecast(models.Model):
|
||||
record.plan_amount_with_coeff = record.plan_amount_without_coeff * (
|
||||
1 + record.analytic_id.global_coeff
|
||||
)
|
||||
modulo = record.plan_amount_with_coeff % 100
|
||||
if (modulo > 0) and (modulo < 25):
|
||||
record.plan_amount_with_coeff = record.plan_amount_with_coeff - modulo
|
||||
elif (modulo >= 25) and (modulo < 50):
|
||||
record.plan_amount_with_coeff = record.plan_amount_with_coeff + (
|
||||
50 - modulo
|
||||
)
|
||||
elif (modulo > 50) and (modulo < 75):
|
||||
record.plan_amount_with_coeff = record.plan_amount_with_coeff - (
|
||||
modulo - 50
|
||||
)
|
||||
elif (modulo >= 75) and (modulo < 100):
|
||||
record.plan_amount_with_coeff = record.plan_amount_with_coeff + (
|
||||
100 - modulo
|
||||
)
|
||||
|
||||
@api.depends("child_ids")
|
||||
def _calc_plan_qty(self):
|
||||
|
Reference in New Issue
Block a user