[REF] Cleanup code to determine financial_type_id
authoreileen <emcnaughton@wikimedia.org>
Mon, 8 Mar 2021 11:03:34 +0000 (00:03 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 8 Mar 2021 11:10:46 +0000 (00:10 +1300)
commitbe2e79c858d13a8fc84e66e316580304c571cb93
tree6320f3ced8d2df3bc168d2265fbfd5d3c5bd5561
parent2fa1dfcbb1ecef4bc182895d8c34d64bd6f3740a
[REF] Cleanup code to determine financial_type_id

Financial type id is really simple on this form - it's either required or
it can be determined form the price set.

However, the code passes the financial_type_id from array to array, calculating
it in more than one place which rather hides the underlying simplicity of it.

This retrieves it using a function that does the same from anywhere in the code.

Note that if someone tried to add it before this->order is built it would
hard fail & kill a bunch of tests. this->order is built at the start of the
submit routine
CRM/Financial/BAO/Order.php
CRM/Member/Form/Membership.php
tests/phpunit/CRM/Member/Form/MembershipTest.php