The Edit screen handles Tax Amount and Total Amount differently depending on how whether Contributions are data entered with or without priceset.
A. What's happening? The Edit screen handles Tax Amount and Total Amount differently depending on how whether Contributions are data entered with or without priceset. This results in an error on when trying to (empty Edit ->) Save a Contribution that has Sales Tax associated with it and is generated without a priceset. The error prompts users to manually adjust the Total Amount (and/or the Fee Amount and/or the Net Amount themselves and that results in bad data;
B. Can one use JMA's lineItem editor extension fix this? No - the civicrm_line_item data themselves are correct. Everything is properly recorded in both civicrm_line_item as well as in civicrm_contribution [screenshots at the bottom]. The issue is the math/data handling that is being done when the Edit screen is invoked.
C. Is this a specific Client issue for you? No it's not - it's a stripped down real issue example to point out that we need to standardize and define/review Tax Amount, Fee Amount, Net Amount, Total Amount, Contribution Total, Subtotal, Line Total, Total Price and use the calculations/definitions across all CiviCRM pathways or we'll continue to play whack-a-mole on Sales Taxes.
D. What would be a solution? We need to decide on what the Edit screen and math should look like - and make that independent of whether the contribution and it's associated line items were originally created with a priceset or not.
Setup:
- CiviCRM 5.3.0;
- Tax and Invoicing Enabled;
- 5% Sale Tax associated with Financial Type 'Taxable Item";
- lineItem editor extension installed;
Contribution 4392 - Contribution w/ Sales Tax and NO priceset Steps to reproduce: Contributions -> New Contribution: Save Edit -> Save -> Error:
Contribution 4394 - Contributions w/ Sales Tax and priceset Steps to reproduce: Contributions -> New Contribution: Save Edit (and Saves without Errors)
Summary - two Contributions are identical except for how they were generated - 4394 can be edited and 4392 can not;