Details

    • Type: Epic
    • Status: Done/Fixed
    • Priority: Important
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7
    • Fix Version/s: 4.7.17
    • Component/s: None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Sprint:
      4.7.14 Financial
    • Funding Source:
      Contributed Code

      Description

      Below is an overview of bugs. However, the intention is to create individual issues for any verified issues & move the description to there. As this bug is now an epic it should only be a container for the other bugs, details should not be discussed here & the PRs should be against the other, verified, issues.

      1: When there is a change in Contribution line item like Payment instrument, Financial Type etc there is an entry created in civicrm_financial_item table for the change with -ve (using previous financial item) +ve (new financial item). If there is a tax associated with contribution the entries in financial item are incorrect like description, financial account id etc and even in civicrm_entity_financial_txn.entity_id for entity_table = 'civicrm_financial_item'.

      2. When we create new contribution using New Contribution Form without priceset with Financial Type Donation (having tax defined for Donation Financial type), civicrm_contribution.tax_amount stores incorrect value.

      3. When you try to updated the contribution amount having tax using New Contribution Form, it throws a validation error 'The sum of fee amount and net amount must be equal to total amount' even though the sum of net amount and fee amount is equal to total amount.

      4. When there is a change in contribution Financial Type, the entries in financial trxn are created incorrectly which results in unbalance in Balance report.(CRM-19273 fix in QA might resolve this - retest this after applying & testing that)

      5. When there is a change in Contribution Financial type and Total Amount in one shot, the entries in financial trxn are created incorrectly which results in unbalance in Balance report. (CRM-19273 fix in QA might resolve this - retest this after applying & testing that)

      NB: As of Feb 2, 2017
      PR 9340, 9588 closed
      PR 9590 merged
      PR 9682 open

      As of Mar 10, 2017
      https://github.com/civicrm/civicrm-core/pull/9590/files and which are addressed by
      https://github.com/civicrm/civicrm-core/pull/9589 - has been approved by a reviewer
      https://github.com/civicrm/civicrm-core/pull/9682
      https://github.com/civicrm/civicrm-core/pull/9683
      https://github.com/civicrm/civicrm-core/pull/9684
      https://github.com/civicrm/civicrm-core/pull/9685 WIP

        Attachments

          Issue Links

            Activity

            [CRM-19585] Sales tax issues
            Joe Murray added a comment -

            Pradeep Nayak Please provide description with description of each error addressed by PR.

            Pradeep Nayak added a comment -

            I have fixed #1 to #4.
            For #5 i waiting for Joe's reply to email

            Joe Murray added a comment -

            Email sent Dec 16.

            Jitendra Purohit added a comment -

            Found additional issue related to tax. Steps to reproduce:

            • Create a priceset with taxable financial type eg 10% tax.
            • create a price fields with options say $100 and $200.
            • Record an offline contribution and select $200. tax will be recorded as $20.
            • Click Save. Check the total_amount - $220 (Correct).
            • Click on edit link and save the contribution without modifying any fields.
            • Check the total_amount - $242 (Incorrect). Seems like the tax_amount gets additionally added to the updated total_amount($220 + $22).
            • Now, everytime you edit and save this contribution, the total_amount will be incremented. 242(220+22), 266(240+24), 292(266+26) and so on.

            This is a regression as I see this to be working fine in 4.6. Not sure but this seems related https://github.com/civicrm/civicrm-core/pull/8835.

            Joe Murray added a comment -

            Pradeep, could you fix new issue reported by Jitendra. We saw this very early on iirc, and I thought we had long ago fixed it. Please check if the unmerged PR at https://github.com/civicrm/civicrm-core/pull/9588 is the fix for it and deal with failing test.

            Joe Murray added a comment -

            Edsel Lopez Pradeep Nayak Could you review the comments on 9340 and see which apply still to 9682 and respond, probably best in comments on 9682, replicating original comment and adding your response? Thx.

            Eileen McNaughton added a comment - - edited

            I think to get some progress here we need to treat this as an epic or close it & create specific issues.

            I looked at the first PR against this issue - but the test failed very early on - with or without the fix

            ```
            {{ /**

            • Test for change in FT
              */
              public function testChangePaymentInstrumentTax() { $contactId = $this->individualCreate(); $this->enableTaxAndInvoicing(); $financialType = $this->createFinancialType(); $financialAccount = $this->relationForFinancialTypeWithFinancialAccount($financialType['id']); $params = array( 'contact_id' => $contactId, 'currency' => 'USD', 'financial_type_id' => 1, 'contribution_status_id' => 1, 'payment_instrument_id' => 1, 'total_amount' => 200.00, 'fee_amount' => 0, 'non_deductible_amount' => 0, ); $id = $this->contributionCreate($params); $financialTrxn = $this->callAPISuccess('financial_trxn', 'get', array( 'trxn_id' => 12345, )); $this->assertEquals($financialTrxn['count'], 1, 'Counts do not match.'); $this->assertEquals($financialTrxn['values'][1]['payment_instrument_id'], 1, 'Payment Instrument is not the same.'); $this->assertEquals($financialTrxn['values'][1]['total_amount'], 220.00, 'Amount does not match.'); }

              }}
              ```

            So assuming that should work - perhaps the first issue is to get that test added & passing (it might be a test problem not a core problem) - I suspect it is but it feels like the first blocker in https://github.com/civicrm/civicrm-core/pull/9682.

            The second blocker being lack of a separate & specific issue

            Agileware added a comment -

            There are still tax issues which have not been solved and grouping these together to raise visibility via an epic (or whatever) would greatly help.

            Joe Murray added a comment - - edited

            I've converted issue to Epic type.

            add test and get passing

            passing tests:
            https://github.com/civicrm/civicrm-core/pull/9589 - has been approved by a reviewer
            https://github.com/civicrm/civicrm-core/pull/9682
            https://github.com/civicrm/civicrm-core/pull/9683
            https://github.com/civicrm/civicrm-core/pull/9684
            https://github.com/civicrm/civicrm-core/pull/9685

            Pradeep, could you create separate issues under this epic for each of the PRs, and provide a description of what each PR is doing in the related issue.

            Joe Murray added a comment -

            Linking another existing tax issue to this epic

            Eileen McNaughton added a comment -

            Good find on that other issue - looks like it probably needs about 40 minutes more work to get it QA'd & merged & as we have learnt, often merging in this area fixes other issues

            Eileen McNaughton added a comment -

            I've added a link in to this as it seems likely this fix will impact on & possibly fix other issues. Since it is in QA & passed code-quality review I would priotise it to the top

            Agileware added a comment -

            Just a FYI. Have created CRM-20423 which should be part of this EPIC.

            Eileen McNaughton added a comment -

            I've closed this because I believe most if not all the issues against it are not closed & we should open new specific tickets where that is not the case

              People

              • Assignee:
                Pradeep Nayak
                Reporter:
                Pradeep Nayak

                Dates

                • Created:
                  Updated:
                  Resolved: