Skip to content

Commit

Permalink
Merge pull request #2482 from internetee/2480-fix-monthly-invoices
Browse files Browse the repository at this point in the history
Fixed dates for yearly domains in monthly invoices
  • Loading branch information
vohmar authored Nov 18, 2022
2 parents 6e66eb0 + 7e80221 commit 30fd6d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/concerns/invoice/book_keeping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 30fd6d2

Please sign in to comment.