Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Use correct parser for the monetary value

Klaus Zandersdd98ad6056f8
diff --git a/modules/budgets/app/models/budget.rb b/modules/budgets/app/models/budget.rb
index 2ccfd2e834f..12ca58d3c09 100644
--- a/modules/budgets/app/models/budget.rb
+++ b/modules/budgets/app/models/budget.rb
@@ -47,6 +47,7 @@ class Budget < ApplicationRecord
has_many :time_entries, through: :work_packages
include ActiveModel::ForbiddenAttributesProtection
+ include Costs::NumberHelper
acts_as_attachable
acts_as_journalized
@@ -130,6 +131,10 @@ class Budget < ApplicationRecord
subject
end
+ def base_amount=(value)
+ super(parse_number_string(value))
+ end
+
def material_budget
@material_budget ||= material_budget_items.visible_costs.inject(BigDecimal("0.0000")) { |sum, i| sum += i.costs }
end