Skip to content
Permalink
Browse files

Merge pull request #2431 from ekylibre/debug-fixed-assets

[Exception] fixed_assets#create (NoMethodError) undefined method >> f…
  • Loading branch information...
Aquaj committed Mar 14, 2019
2 parents c903577 + 163976e commit dc8a974ea8aab408ce77ce5bad6467dc2d3c31ff
Showing with 5 additions and 2 deletions.
  1. +5 −2 app/models/fixed_asset.rb
@@ -148,8 +148,11 @@ class FixedAsset < Ekylibre::Record::Base
elsif depreciation_method_simplified_linear?
self.depreciation_percentage = 20 if depreciation_percentage.blank? || depreciation_percentage <= 0
months = 12 * (100.0 / depreciation_percentage.to_f)
self.stopped_on = started_on >> months.floor
self.stopped_on += (months - months.floor) * 30.0 - 1
if self.started_on
# TODO: use proper duration operations here
self.stopped_on = started_on >> months.floor
self.stopped_on += (months - months.floor) * 30.0 - 1
end
end
# self.currency = self.journal.currency
true

0 comments on commit dc8a974

Please sign in to comment.
You can’t perform that action at this time.