Skip to content

Commit

Permalink
Merge pull request #377 from Troter2/Final_Changes_on_Dev
Browse files Browse the repository at this point in the history
Final changes on dev
  • Loading branch information
Juanca192001 authored Jun 13, 2024
2 parents 8e9dab2 + c3176d5 commit 7adae3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Billing/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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})
Expand Down Expand Up @@ -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})
2 changes: 1 addition & 1 deletion hotelManagementProject/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/<int:reservation_id>/', 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'),
Expand Down

0 comments on commit 7adae3b

Please sign in to comment.