Better determine the province/state from the billing address
by @shaneonabike, copied from our internal Gitlab:
The code before to determine the billing address wasn't working properly. Adds a helper function to better determine this information based on various scenarios.
- See if we have a billing address
- If not, check to see if we have an address that is checked off as billing
Steps to reproduce:
- Set the taxcalculator to use
Billing address
- Create a Contact
- Create a new primary address, and check off that it is the ```Billing address``
- Create an address that is
Billing
from another province - Process a payment
- Payment taxes will reflect the province of the
Billing
address - In another test you could modify that address during the contribution and change the state to something else
- Ensure that the address is changed in the contact for the
Billing addresss
- Ensure that the total taxes are correct