Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-21276

Incorrect financial transactions when overriding taxes a backend membership form with buildAmount

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.7.25
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      In short, here is the context:

      • A Canadian association has to charge taxes on memberships, therefore the tax % depends on the billing address of the member (HST in some participating provinces, 5% GST-only for some others).
      • We setup a Financial Type "membership" with a tax amount of 99%, because it gets altered later on, and because we want errors to be obvious.
      • We use `cdntaxcalculator` to calculate the correct tax % based on the member's billing address. More specific, we are using SymbioTIC's fork: https://github.com/coopsymbiotic/biz.jmaconsulting.cdntaxcalculator/tree/symbiotic

      Now go to the CiviCRM backend:

      • Assuming there is a membership type, and its Financial Type is associated to a 99% tax account. Let's say that the membership amount is 300$.
      • Create a contact record, with a billing address in, for example, Quebec
      • Create a membership, using the "simple" priceset (the build-in one)
      • The amount of the membership should be "315$" and indicate "includes 15$ tax".
      • Click save. All looks good.
      • Go to the 'contribution' tab of the contact, click to view the contribution: it will indicate "tax: 297$". That's because in the membership submit function, it reloads the pricesets but does not call the buildAmount hook, so it used a 99% tax rate. The total amount is still good, but the core tax code seems to reverse-recalculate taxes based on the total amount (cringe).

        Attachments

          Activity

            People

            • Assignee:
              mlutfy Mathieu Lutfy
              Reporter:
              mlutfy Mathieu Lutfy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: