From d104403af03a2e2c3631c31dce10d23461438235 Mon Sep 17 00:00:00 2001 From: Nicolas Florentin Date: Fri, 8 Apr 2016 11:17:52 +0200 Subject: [PATCH] little fix Reservation#generate_invoice_items take into account that plan can be purchased at the same time when reserving machine --- app/models/reservation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/reservation.rb b/app/models/reservation.rb index ea31b7158..4cbf36c03 100644 --- a/app/models/reservation.rb +++ b/app/models/reservation.rb @@ -45,7 +45,7 @@ class Reservation < ActiveRecord::Base # === Machine reservation === when Machine base_amount = reservable.prices.find_by(group_id: user.group_id, plan_id: plan.try(:id)).amount - users_credits_manager = UsersCredits::Manager.new(reservation: self) + users_credits_manager = UsersCredits::Manager.new(reservation: self, plan: plan) slots.each_with_index do |slot, index| description = reservable.name + " #{I18n.l slot.start_at, format: :long} - #{I18n.l slot.end_at, format: :hour_minute}"