mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-23 08:22:15 +00:00
Add a button for creating and instantly voiding invoices
Handy dandy for when you have loads of cancelled events, like say, a pandemic
This commit is contained in:
@@ -201,6 +201,11 @@ class InvoiceEvent(generic.View):
|
||||
invoice.invoice_date = datetime.date.today()
|
||||
messages.success(self.request, 'Invoice created successfully')
|
||||
|
||||
if kwargs.get('void'):
|
||||
invoice.void = not invoice.void
|
||||
invoice.save()
|
||||
messages.warning(self.request, 'Invoice voided')
|
||||
|
||||
return HttpResponseRedirect(reverse_lazy('invoice_detail', kwargs={'pk': invoice.pk}))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user