From 3cb9614c7fed98415108d64243e4d3f8758feca4 Mon Sep 17 00:00:00 2001 From: Juanca192001 Date: Thu, 13 Jun 2024 17:19:44 +0200 Subject: [PATCH 1/2] Sprint 3 done --- Billing/views.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Billing/views.py b/Billing/views.py index bab9811..132e0a5 100644 --- a/Billing/views.py +++ b/Billing/views.py @@ -14,6 +14,7 @@ def list_offers(request): return render(request, 'billing/list_offers.html', {'ofertas': promotions, 'cupones': coupons}) return redirect('home') + def list_coupons(request): if request.user.has_perm('accountant'): coupons = Coupon.objects.all() @@ -53,6 +54,7 @@ def edit_coupon(request): return redirect('list_coupons') return redirect('home') + def create_offer(request): if request.user.has_perm('accountant') and request.method == 'POST': form = PromotionForm(request.POST, request.FILES) @@ -61,7 +63,8 @@ def create_offer(request): return redirect('list_offers') return redirect('home') - def list_restaurant_and_room(request): + +def list_restaurant_and_room(request): if request.user.has_perm('accountant'): reservations = RoomReservation.objects.filter(guest_leaved=True) return render(request, 'billing/list_reservations.html', {'reservas': reservations}) @@ -89,7 +92,9 @@ def delete_offer(request, offer_id): return redirect('list_offers') return redirect('home') + def details_reservation(request, reservation_id): room_reservation = get_object_or_404(RoomReservation, pk=reservation_id) restaurant_reservations = RestaurantReservation.objects.filter(room_reservation=room_reservation) - return render(request, 'billing/details_reservation.html', {'room_reservation': room_reservation, 'restaurant_reservations': restaurant_reservations}) + return render(request, 'billing/details_reservation.html', + {'room_reservation': room_reservation, 'restaurant_reservations': restaurant_reservations}) From c3176d5caa865fa47547ab3a4deb4913257dc2c7 Mon Sep 17 00:00:00 2001 From: Juanca192001 Date: Thu, 13 Jun 2024 18:30:50 +0200 Subject: [PATCH 2/2] final_change --- hotelManagementProject/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotelManagementProject/urls.py b/hotelManagementProject/urls.py index 919b2d4..44d73e4 100644 --- a/hotelManagementProject/urls.py +++ b/hotelManagementProject/urls.py @@ -113,7 +113,7 @@ path('coupon/', list_coupons, name='list_coupons'), path('coupon/create_coupon', create_coupon, name='create_coupon'), path('coupon/edit_status_coupon/', edit_status_coupon, name='edit_status_coupon'), - path('coupon/edit_coupon/',edit_coupon, name='edit_coupon' ) + path('coupon/edit_coupon/',edit_coupon, name='edit_coupon' ), path('details_reservation//', details_reservation, name='details_reservation'), path('pay_reservation_with_invoices', pay_reservation_with_invoices, name='pay_reservation_with_invoices'), path('generate_room_invoice', generate_room_invoice, name='generate_room_invoice'),