mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Merge pull request #560 from internetee/registry-475
Fix Directo localization
This commit is contained in:
commit
c616b21e5e
1 changed files with 5 additions and 1 deletions
|
@ -89,12 +89,16 @@ class Directo < ActiveRecord::Base
|
|||
price = load_price(activity)
|
||||
|
||||
if price.duration.include?('year')
|
||||
localized_duration = price.duration
|
||||
localized_duration.sub!(/years/, 'aastat')
|
||||
localized_duration.sub!(/year/, 'aasta')
|
||||
|
||||
price.duration.to_i.times do |i|
|
||||
year = i+1
|
||||
hash = {
|
||||
"ProductID" => DOMAIN_TO_PRODUCT[price.zone_name],
|
||||
"Unit" => "tk",
|
||||
"ProductName" => ".#{price.zone_name} registreerimine: #{price.duration.to_i} aasta",
|
||||
"ProductName" => ".#{price.zone_name} registreerimine: #{price.duration.to_i} #{localized_duration}",
|
||||
"UnitPriceWoVAT" => price.price.amount / price.duration.to_i
|
||||
}
|
||||
hash["StartDate"] = (activity.created_at + (year-1).year).end_of_month.strftime(date_format) if year > 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue