[REF] Separate and move line-item specific portion of checkTaxAmount to LineItem
authoreileen <emcnaughton@wikimedia.org>
Mon, 31 Aug 2020 02:14:32 +0000 (14:14 +1200)
committereileen <emcnaughton@wikimedia.org>
Mon, 31 Aug 2020 02:14:36 +0000 (14:14 +1200)
commita5bf8a53ba596071e21d1069504edd22e055445a
tree6a8ee2e2c28f63c933b61a1ca979bb58c17482ef
parent060f4f65044c7cb305b9abda7af101d59c72850a
[REF] Separate and move line-item specific portion of checkTaxAmount to LineItem

This is not intended to be the final place but making sense of checkTaxAmount is hard so I wanted to keep this simple and
iterate.

checkTaxAmount is called from 2 places - once from v3 LineItem.create with isLineItem = TRUE
and once from Contribution.create with isLineItem = FALSE

Most of the function is accessible dependent on isLineItem - meaning it's 2 separate functions.
However, the first chuck is called 'whenever id is set'. BUT it makes no sense for line items. It
uses the 'id' - regardless of whether it is a line item id or a contribution id - to get the previous
contribution. It then sets tax amount based on a comparison - but
that really makes zero sense. I'm pretty sure it was never intended to be used for LineItems
CRM/Contribute/BAO/Contribution.php
api/v3/LineItem.php