Adding VAT information for all payment fields

I don’t think this is specific to Finland, but at least we are hit with this.
I need to have VAT configurable for events and for all registration form items.
AND the VAT value depends on the type of event and extra billable items.

I’m adding local payment options with finally using paytrail: Paytrail Payment API
The VAT code is per item line requirement. And the calculated price / receipt for user needs to be rendered with tax information.

Here’s my questions which of these options are feasible:

  1. if I make the changes and PR for VAT column / settings would that be appreciated upstream.
    * blank/null values keeping current processing model to not break existing users.
  2. Hook it in using a plugin?
  3. keeping a patch for local version (I really don’t want to do this).

I found signals for these reg form steps:
plugin.connect(signals.event.registration_form_edited, _display_changes) plugin.connect(signals.event.registration_form_field_deleted, _display_changes)
plugin.connect(signals.event.registration_form_created, _display_changes)

But edit is not triggeres on form field editing and I could not find any triggers (except for delete) when editing form fields.

As a temporary measure is there a way to access event and regforms for payment plugin settings form:
class EventSettingsForm(PaymentEventSettingsFormBase):

I’d like to get list of form fields (price type) and regform settings.
This would allow setting VAT overrides per field.

There’s no signal for this. Check RHRegistrationFormModifyField - as you can see, only _process_DELETE triggers a signal but _process_PATCH doesn’t.

Feel free to send a PR adding a new signal for this.

Quick question of the direction you prefer.

  1. Trigger “signals.event.registration_form_edited” when forms are edited
    *would mirror “signals.event.registration_form_created” because this one return form fields.
  2. Trigger “signals.event.registration_form_field_changed” (or similar) when ever form field is edited.
  3. Both?

And any chance of getting this in to 3.3.9 if I put all my effort to this for couple of days?

My end goal is to be able to mark events and items with prices in events to set VAT for each entry.
In Finland (and for university) Event can be 0% or 25.5% and items in events like:
Optional Dinner (25.5%)
Optional bus ride (now 14%, 13.5% next year)

would mirror “signals.event.registration_form_created” because this one return form fields

Not sure what you mean. This signal is only triggered during form creation and has nothing to do with fields.

Trigger “signals.event.registration_form_field_changed” (or similar) when ever form field is edited.

I think this is the right way to go here. It matches the other signals so it’s consistent with what already exists.

And any chance of getting this in to 3.3.9 if I put all my effort to this for couple of days?

Just the signal? Sure, send a PR. That’s close to no review effort and thus a quick candidate to merge.

In Finland (and for university) Event can be 0% or 25.5% and items in events like:
Optional Dinner (25.5%)
Optional bus ride (now 14%, 13.5% next year)

TBH I don’t understand why you need this on the fields. Can’t you just provide values with VAT included (in which case the different VAT rates would just affect how much money you get to keep in the end)? Or is there a requirement that you also display the value without VAT and how much VAT there is no each item? Because in most online shops the most you typically see for VAT is a mention at the end of your invoice of how much VAT is included in the price…

Legally I need to display the VAT values and even the credit card payment processors will not accept payments unless the VAT values are there.
Basically I cannot use any of the current payment processor implementations because of this.

The problem is that different items have different VAT classes.
So I need to somehow get this information from either when activating Payment type (e.g. filling in the itam VAT codes) or on the forms themselves when those are modified.

The create signal return initial form fields with inside the created object.
Form edited signal does not return these fields.

I’ll try to get PR and examples done today.

Json fromat of ‘registration_form_created’ signal, form_items key is what I was talking about

"currency": "EUR",

"form_items": \[

“<RegistrationFormPersonalDataSection(1, registration_form_id=1): \“Personal Data\”>”,

“<RegistrationFormPersonalDataField(2, registration_form_id=1): \“First Name\”>”,

“<RegistrationFormPersonalDataField(3, registration_form_id=1): \“Last Name\”>”,

“<RegistrationFormPersonalDataField(4, registration_form_id=1): \“Email Address\”>”,

“<RegistrationFormPersonalDataField(5, registration_form_id=1): \“Affiliation\”>”,

“<RegistrationFormPersonalDataField(6, registration_form_id=1, is_enabled=False): \“Address\”>”,

“<RegistrationFormPersonalDataField(7, registration_form_id=1, is_enabled=False): \“Country\”>”,

“<RegistrationFormPersonalDataField(8, registration_form_id=1, is_enabled=False): \“Phone Number\”>”,

“<RegistrationFormPersonalDataField(9, registration_form_id=1, is_enabled=False): \“Position\”>”,

“<RegistrationFormPersonalDataField(10, registration_form_id=1, is_enabled=False): \“Title\”>”,

“<RegistrationFormPersonalDataField(11, registration_form_id=1, is_enabled=False): \“Picture\”>”

\],

“title”: “UUsi”,

I just sent PR for the signals #7165
I’d appreciated checking moving and adding new fields. The position and content of the signal.
In my local minimal tests, they work as they should.

Quick example of “Item Code” field for billable fields.
Idea of having a field to store “Item Code” or VAT number or some other reference.
Default class could be set to hidden.

Intended purpose is to give payment plugins some way to use item codes or vat codes without restricting the current flow.

Basically I need the Item Code information at payment provider time and when generating receipt.
Current implementation of the Indico does not allow me to do that.
Added item_code to
class BillableFieldDataSchema(FieldSetupSchemaBase):
price = fields.Float(load_default=0)
item_code = fields.String(load_default="")

Here is the settins panel:


Registration form editor:


Registration step (when not hidden):

And quick example of the generated html.

image

I’m proposing this as part of a new feature in Indico core: Add support for tax compliant invoices · Issue #7196 · indico/indico · GitHub