Skip to content

Commit

Permalink
Support specifying an autocancel time for reg transfer invoices
Browse files Browse the repository at this point in the history
And default it to the autocancel for the conference, but allow the admin
creating the invoice to override if needed.
  • Loading branch information
mhagander committed Oct 17, 2024
1 parent a1be298 commit 0c8d1d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions postgresqleu/confreg/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,11 +914,14 @@ class TransferRegForm(forms.Form):
invoice_name = forms.CharField(required=False, label="Invoice recipient name", help_text="Name of the recipient of the invoice")
invoice_email = forms.EmailField(required=False, label="Invoice recipient email", help_text="E-mail to send the invoice to")
invoice_address = forms.CharField(widget=MonospaceTextarea, required=False)
invoice_autocancel = forms.IntegerField(required=False, label="Invoice autocancel hours", help_text="Automatically cancel invoice after this many hours",
validators=[django.core.validators.MinValueValidator(0)])
confirm = forms.BooleanField(help_text="Confirm that you want to transfer the registration with the given steps!", required=False)

def __init__(self, conference, *args, **kwargs):
self.conference = conference
super(TransferRegForm, self).__init__(*args, **kwargs)
self.initial['invoice_autocancel'] = conference.invoice_autocancel_hours
self.fields['transfer_from'].queryset = ConferenceRegistration.objects.select_related('conference').filter(conference=conference, payconfirmedat__isnull=False, canceledat__isnull=True, transfer_from_reg__isnull=True)
self.fields['transfer_to'].queryset = ConferenceRegistration.objects.select_related('conference').filter(conference=conference, payconfirmedat__isnull=True, canceledat__isnull=True, bulkpayment__isnull=True)
if not ('transfer_from' in self.data and 'transfer_to' in self.data):
Expand Down
1 change: 1 addition & 0 deletions postgresqleu/confreg/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4560,6 +4560,7 @@ def transfer_reg(request, urlname):
processorid=rtp.pk,
accounting_account=settings.ACCOUNTING_CONFREG_ACCOUNT,
accounting_object=conference.accounting_object,
canceltime=get_invoice_autocancel(form.cleaned_data['invoice_autocancel']),
paymentmethods=conference.paymentmethods.all(),
)
rtp.invoice.save()
Expand Down

0 comments on commit 0c8d1d1

Please sign in to comment.