1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(bug) unbale to update card bank of payment schedule

This commit is contained in:
Du Peng 2023-09-20 18:13:30 +02:00
parent eb4c89cd68
commit e9e0749bdb
2 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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