diff --git a/app/models/concerns/invoice/book_keeping.rb b/app/models/concerns/invoice/book_keeping.rb index 895b763cf8..2c9b8a5ca2 100644 --- a/app/models/concerns/invoice/book_keeping.rb +++ b/app/models/concerns/invoice/book_keeping.rb @@ -59,8 +59,9 @@ def divide_by_quantity_and_years(quantity, duration, item, lines) duration.times do |dur| single_item_dup = single_item.dup - single_item_dup['start_date'] = (issue_date + dur.year).end_of_month.strftime('%Y-%m-%d') - single_item_dup['end_date'] = (issue_date + (dur + 1).year).end_of_month.strftime('%Y-%m-%d') + date = (issue_date + dur.year).end_of_month.strftime('%Y-%m-%d') + single_item_dup['start_date'] = date + single_item_dup['end_date'] = date single_item_dup['price'] = (item['price'].to_f / duration).round(2) lines << single_item_dup end