1. Edit the product(s) where auto credit should be allowed and enable this setting, i.e. in demo env for .COM domains
we set it like:
2. On "Settings" / "Scheduled task settings", make sure AutoCreditScheduledEventHandler runs, see https://demo-admin.atomia.com/ScheduledTaskSettings
3. Find an open invoice with one of the products supporting autocredit, e.g. go to subscription and find a .COM domain subscription in status "Prepared"
In the demo env example invoice used is https://demo-admin.atomia.com/Invoices/6f5b393c-b9ee-4724-800c-afed520e8260/Preview
4. Go to the BCP subscriptions page for the customer in question, in the demo is used is:
Press "Delete" to remove the domain.
5. Now an "auto credit request" is created and after a configurable time the, AutoCreditScheduledEventHandler will credit the open invoice that the subscription was
on and create a new one with only the lines left in an OK state.
The default time for this is 5 minutes, and it is configured through the autocreditDelay="5" option of the <atomiaBilling> web.config element.
In the database, the auto credit request is visible as an AtomiaBilling..autocredit_request row.
6. Wait this number of minutes + until the next time the AutoCreditScheduledEventHandler executes
7. Check that the invoice was credited and a new one was created successfully (also you can note that the AtomiaBilling..autocredit_request row now has status FINISHED)
(in the demo example since the domain was the only row of the invoice no new invoice was created, the entire invoice was credited)