Skip to content

Commit

Permalink
Fix bad creation of label in taxes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionosphere committed Sep 12, 2017
1 parent b8cfacd commit d8e0aee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/models/tax.rb
Expand Up @@ -137,10 +137,11 @@ def import_from_nomenclature(reference_name, active = nil)
next unless name = nature.send("#{account}_account")
tax_radical = Account.find_or_import_from_nomenclature(name)
# find if already account tax by number was created
tax_account = Account.find_or_create_by_number("#{tax_radical.number}#{nature.suffix}") do |a|
a.name = "#{tax_radical.name} - #{item.human_name}"
a.usages = tax_radical.usages
end
tax_account = Account.find_or_create_by_number("#{tax_radical.number}#{nature.suffix}")
tax_account.name = item.human_name
tax_account.usages = tax_radical.usages
tax_account.save!

attributes["#{account}_account_id"] = tax_account.id
end
Tax.create!(attributes)
Expand Down

0 comments on commit d8e0aee

Please sign in to comment.