Move calls to CRM_Core_BAO_FinancialTrxn::createDeferredTrxn back to the calling...
authoreileen <emcnaughton@wikimedia.org>
Mon, 28 Oct 2019 11:48:26 +0000 (00:48 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 28 Oct 2019 11:53:30 +0000 (00:53 +1300)
commit901094ebcdaf355f254159721f30cc71f2cf418e
tree4d13bad0b8eea1cd3f1c21d36e15a8089494650b
parent6f2246e5edb9ae980693e89d1aea4d9a76dae3cb
Move calls to CRM_Core_BAO_FinancialTrxn::createDeferredTrxn back to the calling functions.

Although this seems like we are increasing duplication - by having more calls to one line of code I feel like
we are better off moving it back to the calling functions as there is 'preparatory wrangling' that also belongs
in the calling functions - notably in changeFinancialType.

I believe we should be able to get to the point where the updateFinancialAccounts funcgtion does not
need to receive context as a parameter because all the context specific stuff will be done in the calling functions
and it will have a clear objective - which I have finally realised is creating the financial transaction
and the financial items - however in some cases it is called twice to do a reversal followed by a line item
and I believe the calling functions could be cleaned up a lot more by 'returning' code to them as
passing  by reference leaves us very unclear as to what is happening to them at each point in the process.
CRM/Contribute/BAO/Contribution.php