From e9e0749bdbb49fbb5a8f940c1e4b400dad7df81a Mon Sep 17 00:00:00 2001 From: Du Peng Date: Wed, 20 Sep 2023 18:13:30 +0200 Subject: [PATCH] (bug) unbale to update card bank of payment schedule --- CHANGELOG.md | 1 + app/services/cart_service.rb | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1f794d83..269c2ee48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Fix a bug: unable to update card for payment schedule - Fix a bug: user is_allow_contact is actived by default - Fix a bug: unbale to export projects +- Fix a bug: unbale to update card bank of payment schedule ## v6.0.14 2023 September 6 diff --git a/app/services/cart_service.rb b/app/services/cart_service.rb index c89d20533..7f878753e 100644 --- a/app/services/cart_service.rb +++ b/app/services/cart_service.rb @@ -190,33 +190,36 @@ class CartService def reservable_from_payment_schedule_object(object, plan) reservable = object.reservation.reservable + cart_item_reservation_slots = object.reservation.slots_reservations.map do |s| + { slot_id: s.slot_id, slots_reservation_id: s.id, offered: s.offered } + end case reservable when Machine CartItem::MachineReservation.new(customer_profile: @customer.invoicing_profile, operator_profile: @operator.invoicing_profile, reservable: reservable, - cart_item_reservation_slots_attributes: object.reservation.slots_reservations, + cart_item_reservation_slots_attributes: cart_item_reservation_slots, plan: plan, new_subscription: true) when Training CartItem::TrainingReservation.new(customer_profile: @customer.invoicing_profile, operator_profile: @operator.invoicing_profile, reservable: reservable, - cart_item_reservation_slots_attributes: object.reservation.slots_reservations, + cart_item_reservation_slots_attributes: cart_item_reservation_slots, plan: plan, new_subscription: true) when Event CartItem::EventReservation.new(customer_profile: @customer.invoicing_profile, operator_profile: @operator.invoicing_profile, event: reservable, - cart_item_reservation_slots_attributes: object.reservation.slots_reservation, + cart_item_reservation_slots_attributes: cart_item_reservation_slots, normal_tickets: object.reservation.nb_reserve_places, cart_item_event_reservation_tickets_attributes: object.reservation.tickets) when Space CartItem::SpaceReservation.new(customer_profile: @customer.invoicing_profile, operator_profile: @operator.invoicing_profile, reservable: reservable, - cart_item_reservation_slots_attributes: object.reservation.slots_reservations, + cart_item_reservation_slots_attributes: cart_item_reservation_slots, plan: plan, new_subscription: true) else