Fix Directo monthly invoice generation

#475
This commit is contained in:
Artur Beljajev 2017-05-08 01:11:20 +03:00
parent 885f28e34e
commit fd1f475925
2 changed files with 48 additions and 54 deletions

View file

@ -52,24 +52,16 @@ module Billing
"#{operation_category} #{zone_name}"
end
def years_amount
duration.to_i
end
def price_decimal
price_cents / BigDecimal.new('100')
end
def zone_name
zone.origin
end
private
def to_partial_path
'price'
end
private
def init_values
return unless new_record?
self.valid_from = Time.zone.now.beginning_of_year unless valid_from