civicrm_financial_trxn.fee_amount reversals mixed up
Overview
When doing reversal bookkeeping entry as part of changing a financial type, the fee_amount field does not have its sign reversed. This results in an incorrect net_amount field. See bug 1 in https://gist.github.com/JoeMurray/6db6a82ff6c9e593ca5301b5f8708f52
Current behaviour
civicrm_financial_trxn.fee_amount has same value as original record in the reversal record. This results in net_amount not being a correct reversal of the original record's net_amount.
Expected behaviour
civicrm_financial_trxn.fee_amount has negative of value in original record in the reversal record. This results in net_amount being the negative in the reversal record of that field in the original record.
Comments
We should check for this issue wherever the code creates reversal transactions.
Make unit tests for all of the areas in the code where this occurs.