Financial issueshttps://lab.civicrm.org/dev/financial/-/issues2023-11-15T18:37:43Zhttps://lab.civicrm.org/dev/financial/-/issues/220With tax enabled Total Amount is confusing in online receipt and tax amount l...2023-11-15T18:37:43ZDaveDWith tax enabled Total Amount is confusing in online receipt and tax amount line is wrongIt used to show the amount before tax and the tax amount. But now it looks like this. There was $2 tax.
![untitled3](/uploads/2d19419c080ae6f6f009d1e6f7eff44d/untitled3.png)
This is the same as https://lab.civicrm.org/dev/financial/-/i...It used to show the amount before tax and the tax amount. But now it looks like this. There was $2 tax.
![untitled3](/uploads/2d19419c080ae6f6f009d1e6f7eff44d/untitled3.png)
This is the same as https://lab.civicrm.org/dev/financial/-/issues/206 just in the interim changes have caused the problem to shift.
Also the confirm and thankyou pages make no mention of the tax and there's now a php warning about a missing tax var on those pages.
![untitled7](/uploads/8fcb99238d074a7dd4a53ec000bf51b1/untitled7.png)
![untitled8](/uploads/ebb164e557d99a76bb0f90381b0525c9/untitled8.png)
One way to reproduce:
1. Turn on tax and invoicing. https://docs.civicrm.org/user/en/latest/contributions/sales-tax-and-vat/
* In my case I set up a non-deductible financial type called t-shirts and a corresponding sales tax account that has 5% tax.
2. Create a price set for it.
* There's one price field. I used type text/quantity. Field is required although that's not relevant just makes sense here. Financial type t-shirts.
3. Set up the dummy payment processor.
4. Create a contribution page with that processor and financial type t-shirts and use the price set. Set it to send a receipt.
5. Buy a t-shirt.5.68.0https://lab.civicrm.org/dev/financial/-/issues/216Financial Batches: remove the creation of activities for New/Edit2023-08-09T18:28:27ZbgmFinancial Batches: remove the creation of activities for New/EditI fell down a rabbit hole while testing the New Financial Batch form, and noticed that it creates an activity whenever a batch is created or edited. It also creates an activity when the batch is exported, but not when closed or deleted.
...I fell down a rabbit hole while testing the New Financial Batch form, and noticed that it creates an activity whenever a batch is created or edited. It also creates an activity when the batch is exported, but not when closed or deleted.
The "Create Batch" and "Edit Batch" activities do not seem useful to me. I would leave the "Export Accounting Batch" activity for now.
Any objections to removing?
(I'm creating this issue for visibility, but will send a PR that might be more clear)
cc @JoeMurray5.66.0https://lab.civicrm.org/dev/financial/-/issues/215Incorrect membership status on payment failure2023-09-06T14:38:37ZMonish DebIncorrect membership status on payment failureOverview
----------------------------------------
If there is an active membership A and the user selects & renews for a different membership B, then on payment failure membership B retain the old membership status (current/new) instead ...Overview
----------------------------------------
If there is an active membership A and the user selects & renews for a different membership B, then on payment failure membership B retain the old membership status (current/new) instead of pending.
Reproduction steps
----------------------------------------
1. A user has active membership A
1. User made a live donation for membership B (that belongs to the same membership org)
1. Payment fails due to some reason.
Current behaviour
----------------------------------------
The user has an active membership B linked with a Pending (Incomplete transaction) contribution.
Expected behaviour
----------------------------------------
The membership status should be set to Pending
Environment information
----------------------------------------
* __Browser:__ _Firefox 59.0.1/Chrome 78.0.3904/Safari 13_
* __CiviCRM:__ _Master_
* __PHP:__ __8.0_
* __CMS:__ _Drupal 8_
* __Database:__ _MariaDB 10.4_
* __Web Server:__ _Apache 2.4_Monish DebMonish Debhttps://lab.civicrm.org/dev/financial/-/issues/214Link to record payment from within participant change selections links it to ...2023-05-27T14:08:26ZDaveDLink to record payment from within participant change selections links it to wrong contribution, or crashes if that doesn't exist1. Register an event participant for a paid event.
2. In the record payment section of the registration, change the amount to less than the total so it's just a partial payment.
3. Save.
4. View/edit the participant record. Note the id i...1. Register an event participant for a paid event.
2. In the record payment section of the registration, change the amount to less than the total so it's just a partial payment.
3. Save.
4. View/edit the participant record. Note the id in the url.
5. Click Change Selections.
6. Click View Payments.
7. Click Record Payment. Note the id in the url. It's the participant id not the contribution id. If a contribution with that id doesn't exist then at this point it crashes.
8. If it does exist, note now at this point the balance owed displayed may be incorrect because it's from an unrelated contribution.
9. Fill it out and save.
10. Note it takes you to a different contact and has applied the payment to the unrelated contribution.
This is only from the Change Selections section. The other Record Payment link found at the bottom of the participant record when you expand the triangle is correct.
Can reproduce on dmaster. I doubt this is recent.5.63.0https://lab.civicrm.org/dev/financial/-/issues/213Imported has completed successfully, but that's not true2023-01-15T21:04:15ZKarinGImported has completed successfully, but that's not trueCiviCRM 5.56.2
Contributions -> Import via UI ->
Client also noted (and I confirmed) that Contact Type appears to be no longer relevant/required.
Previous behaviour: CiviCRM generates an import_error file noting the contributions which...CiviCRM 5.56.2
Contributions -> Import via UI ->
Client also noted (and I confirmed) that Contact Type appears to be no longer relevant/required.
Previous behaviour: CiviCRM generates an import_error file noting the contributions which could not be imported and the reason - in this case Contact ID does not exist.
Screenshots (really awesome client report):
![image](/uploads/e569fd7fac5fb380e64318731aab5925/image.png)
![image](/uploads/713ee8a4cb0112b052a82fac53fe98e7/image.png)
![image](/uploads/736818ab47519bee7944120f5d577097/image.png)
![image](/uploads/1162ab9a29299db21546bf2e295a3d22/image.png)
![image](/uploads/9e3a4cf72ead03397d48542c24baa751/image.png)
![image](/uploads/60a57e3362cadf8710e9a194331a4159/image.png)5.57.0https://lab.civicrm.org/dev/financial/-/issues/212Why does lineitem.financial_type_id have a db constraint ON DELETE SET NULL2022-11-11T08:00:35ZDaveDWhy does lineitem.financial_type_id have a db constraint ON DELETE SET NULLThe UI won't let you delete financial types that have records that use them. And I can't see a reason why if somebody were to go into the database and try to delete a financial type that you would want to allow this if it has records tha...The UI won't let you delete financial types that have records that use them. And I can't see a reason why if somebody were to go into the database and try to delete a financial type that you would want to allow this if it has records that use it.
The default action for foreign key constraints is to allow deletion if not in use, prevent it if it is in use, which seems exactly right for this field. To make it explicit can use ON DELETE RESTRICT.https://lab.civicrm.org/dev/financial/-/issues/211Sending receipt auto when editing a payment (editing financial trx payment)2023-01-18T20:26:40Zlevi.kSending receipt auto when editing a payment (editing financial trx payment)@JoeMurray
Steps to reproduce
1. Add a contribution
2. Edit the payment (the edit needs to be of the sort that will create a minus and plus transaction) like changing a payment method
(This does not happen when editing the financial...@JoeMurray
Steps to reproduce
1. Add a contribution
2. Edit the payment (the edit needs to be of the sort that will create a minus and plus transaction) like changing a payment method
(This does not happen when editing the financial type on the contribution eventhough it effects a plus and minus transaction (when the account is different))
3. The system will then send a unwanted email receipt (think its using the payment receipt (not contribution receipt)
Drupal 7
civicrm 5.53.0Monish DebMonish Debhttps://lab.civicrm.org/dev/financial/-/issues/210Changing contribution financial type from non-deductible to deductible does n...2023-07-05T23:48:38ZlarsssandergreenChanging contribution financial type from non-deductible to deductible does not change non-deductible amount, resulting in inability to issue tax receiptsSuppose someone enters a donation with an event fee financial type by mistake. The non-deductible amount is set to the full amount of the contribution. If they then change the financial type to a donation type, the non-deductible amount ...Suppose someone enters a donation with an event fee financial type by mistake. The non-deductible amount is set to the full amount of the contribution. If they then change the financial type to a donation type, the non-deductible amount remains the full amount of the contribution, so no tax receipt can be issued for the donation. Since most people probably don't use non-deductible amount regularly, if at all, they aren't likely to check this. Not a big deal if you then try to issue a tax receipt for the single contribution as it will be obvious that something is wrong (though perhaps frustrating because it isn't clear what), but if you are issuing them in bulk, you may not notice this at all, resulting in a donor not getting their tax receipt — a pretty bad outcome from a donor stewardship perspective.
We probably don't want to change non-deductible amounts in the background for existing contributions, but how about a warning that pops up when the financial type is changed from non-deductible to deductible, advising the user to check the non-deductible amount? Perhaps this wouldn't matter to some users, who don't care at all about deductible versus non-deductible, but this does seem worth warning about because it can produce unexpected results in the background.
Something like:
```You've changed the financial type for this $NNN contribution from non-tax deductible to tax deductible, but the non-deductible amount of $NNN has not been changed. This could prevent a tax receipt from being issued. You may want to edit the non-deductible amount.```https://lab.civicrm.org/dev/financial/-/issues/209Disabled Financial Types are listed when creating a Price Field2022-11-02T00:34:40ZpetednzDisabled Financial Types are listed when creating a Price FieldReplicated on dmaster.
1/ create a new Financial Type - set it as disabled.
2/ create new price set / field and note that the disabled Type is showing
3/ try to save - spinny spin spin if using pop ups - if not using pop-up get
4/ Finan...Replicated on dmaster.
1/ create a new Financial Type - set it as disabled.
2/ create new price set / field and note that the disabled Type is showing
3/ try to save - spinny spin spin if using pop ups - if not using pop-up get
4/ Financial Type for Price Field Option is either disabled or does not exist
is there a logic for showing disabled fields in this interface - can't personally think of one esp the pain of users sitting for 10 mins waiting for things to save.
Possibly related to https://lab.civicrm.org/dev/financial/-/issues/198 though that seems the other end of the problem, ie a Price Field is using a Fin Type that has since been set to be disabled5.56.0colemanwcolemanwhttps://lab.civicrm.org/dev/financial/-/issues/207Currency codes for São Tome and Principe Dobra, Zambian Kwacha and Zimbabwe D...2022-09-09T10:17:04ZBradley TaylorCurrency codes for São Tome and Principe Dobra, Zambian Kwacha and Zimbabwe Dollar incorrectEsentially the same issue as dev/financial#184.
- São Tome and Principe Dobra: STN since 1 January 2018
- Zambian Kwacha: ZMW since December 31, 2012
- Zimbabwe Dollar: ZWL since June 2009
I think we need to copy what we did for https:...Esentially the same issue as dev/financial#184.
- São Tome and Principe Dobra: STN since 1 January 2018
- Zambian Kwacha: ZMW since December 31, 2012
- Zimbabwe Dollar: ZWL since June 2009
I think we need to copy what we did for https://github.com/civicrm/civicrm-core/pull/21751/files, but for these 3 additional currencies:
- Update the SQL files for new installs
- Add a migration to update any historical payments.
These is possibly an argument for not migrating the data for old transactions (as in all cases the ISO code changed to reflect some change to the currency, for example a redenomination). Doing the migration fits with what happened last time, and probably saves headaches with needing to support old currency codes, which will no longer exist in libraries like Brick\Money. However, as the data _was_ migrated for Ghana and Belarus I think it probably makes sense to continue with that pattern this time around.https://lab.civicrm.org/dev/financial/-/issues/204Editing a line item on a membership extends the term of the membership2022-10-11T12:27:28ZkcristianoEditing a line item on a membership extends the term of the membershipCiviCRM 5.50+
Tested on WP Master
Required Line item editor extension and membership created from a price set.
wpcvmaster - 5.53
Steps to reproduce:
- Add a recurring membership
![image](/uploads/6bcad85c842288f49b37d665d4cf02a3...CiviCRM 5.50+
Tested on WP Master
Required Line item editor extension and membership created from a price set.
wpcvmaster - 5.53
Steps to reproduce:
- Add a recurring membership
![image](/uploads/6bcad85c842288f49b37d665d4cf02a3/image.png)
![image](/uploads/79381fa3d7cc4976f3df819fdb79c54e/image.png)
* Need to update rate for the next recurring membership payment
- click more on the recurring transaction that is in progress
![image](/uploads/3b1e39119d0eeb3ccd63ff6da8a72e67/image.png)
* view template
* then edit at bottom of screen
![image](/uploads/0c67dab579f9fd714b9fe3c7517e9750/image.png)
* edit line item
![image](/uploads/9eb56bec0334d8f389db8f5b68f0c33b/image.png)
* change amount
![image](/uploads/512f88dde2200e18efb8771bb3b73b7c/image.png)
- recurring is now updated:
![image](/uploads/4ffaae2bf8207c6b14f3f02d11e8f9aa/image.png)
Unintended consequence: Membership extended:
![image](/uploads/da6e71e2d4d2fbc7f9de4c2709691931/image.png)
cc @seamuslee @JoeMurray This _may_ be related to the 2.5 releaseMonish DebMonish Debhttps://lab.civicrm.org/dev/financial/-/issues/203False-positive duplicate detection caused by webform not passing correct par...2024-01-16T19:36:50ZAllenShawFalse-positive duplicate detection caused by webform not passing correct parameters to Authorize.net - it needs to pass contributionID(Joinery internal reference: "Trello#142: Membership Application and Payment Process Not Working")
From what I understand so far, it seems there's a well-thought effort to use propertybag to standardize parameter names in payment proces...(Joinery internal reference: "Trello#142: Membership Application and Payment Process Not Working")
From what I understand so far, it seems there's a well-thought effort to use propertybag to standardize parameter names in payment processors. Here's one area where this effort seems incomplete and easily improved:
There are a few places in `CRM_Core_Payment_AuthorizeNet::doPayment()` where directly accessing `$params` could (and does) cause problems; it seems right to switch these to `$propertybag`. (BTW I think that usage of `propertybag` in the context of alterPaymentProcessorParams hook is still not appropriate, so I'm not suggesting changes to that usage within this method.)
**Specific observable problem:**
(I can create a more detailed and stripped-down recipe if needed, but hoping to avoid the effort.)
- On a site with: D7, civicrm 5.49.5, webform_civicrm.module, and contributiontransactlegacy extension
- We have a webform which accepts membership signups, payable through the core Authorize.net payment processor.
- Payments made through this webform are actually transacted in Authorize.net, but the user is given the error, 'It appears that this transaction is a duplicate. Have you already submitted the form once? If so there may have been a connection problem. Check your email for a receipt from Authorize.net. If you do not receive a receipt within 2 hours you can try your transaction again. If you continue to have problems please contact the site administrator.'
- FWIW I have observed that the below corrective measure fixes this problem for this site.
**Why this error happens:**
- `CRM_Core_Payment_AuthorizeNet::doPayment()` calls `$this->checkDupe($authorizeNetFields['x_invoice_num'], $params['contributionID'] ?? NULL)` (see [line 171](https://github.com/civicrm/civicrm-core/blob/a1278f71bd804c8013600793916a692b4345e4a2/CRM/Core/Payment/AuthorizeNet.php#L171)) to detect a duplicate transaction.
- However, `$params['contributionID']` is undefined. (On the other hand, `$params['contribution_id']` is defined, as is `$propertyBag->getContributionID( )`).
- Since `checkDup()` gets a NULL value for `$contributionId`, it always thinks the contribution is a duplicate, so we get the above error message.
**Corrective measueres**
1. Seems like the intent of `propertybag` is to clear up exctly this kind of naming inconsistency. I suggest changing Line 171 to use `$propertyBag->getContributionID( )` instaed of `$params['contributionID']`.
2. [Line 146](https://github.com/civicrm/civicrm-core/blob/a1278f71bd804c8013600793916a692b4345e4a2/CRM/Core/Payment/AuthorizeNet.php#L146), which tries to read `$params['is_recur']` and `$params['contributionRecurID']`, is probably also a good candidate for similar cleanup?
Should I go head with a PR or is more discussion needed?https://lab.civicrm.org/dev/financial/-/issues/202Unable to update recurring amount when using Sales Tax2022-08-03T15:19:05ZKarinGUnable to update recurring amount when using Sales TaxHitting Edit on the template contribution (with or without line item editor extension - June 2022 version) -> saving it [multiple times] -> does not update the amount in the recurring series -> note the mismatches of amounts:
![image](/...Hitting Edit on the template contribution (with or without line item editor extension - June 2022 version) -> saving it [multiple times] -> does not update the amount in the recurring series -> note the mismatches of amounts:
![image](/uploads/8280ff94ddb4e66ba1368e64c1d4b72a/image.png)https://lab.civicrm.org/dev/financial/-/issues/201Stop adding 'In Progress' and 'Overdue' statuses to civicrm_contribution.cont...2022-09-15T21:47:08ZeileenStop adding 'In Progress' and 'Overdue' statuses to civicrm_contribution.contribution_status_id option groupThis has been around as a back burner project for a while but didn't have it's own gitlab ... tada
A long long time ago contribution, contribution recur, payments, pledges and pledge payments shared the same option group for their statu...This has been around as a back burner project for a while but didn't have it's own gitlab ... tada
A long long time ago contribution, contribution recur, payments, pledges and pledge payments shared the same option group for their status & some nasty magic massaged values in and out. Overdue and In progress 'leaked' from these other entities onto the contribution in a long-ago regression but was never intended as a contribution status option value in core.
The plan is to stop adding those statuses on NEW installs. (We might add a message on non-new installs that have them but we don't really want to remove them).
Unfortunately this has been a slow-burner as the tests found code places referencing the wrong option group list in many cases - I've slowly been whittling these down & as of writing three tests are failing
https://github.com/civicrm/civicrm-core/pull/23074
Note that this was notified in a long-ago dev-digest and steps have been taken in the Sepa extension (the only one identified as using these statuses) to ensure they are presenthttps://lab.civicrm.org/dev/financial/-/issues/200Contribution status’s are ambiguous (WIP)2022-09-10T05:42:18ZJamie Novick - CompucoContribution status’s are ambiguous (WIP)**Background:**
Contribution status’s are ambiguous in CiviCRM and can lead to confusion over the current state of an invoice or contribution and whether there are amounts owed or owing to the contributor. This leads to a wealth of prob...**Background:**
Contribution status’s are ambiguous in CiviCRM and can lead to confusion over the current state of an invoice or contribution and whether there are amounts owed or owing to the contributor. This leads to a wealth of problems about what the intention of the user really is in a number of scenarios when they change the contribution status.
Examples:
| Example | Narrative | Video |
| ------ | ------ | ------ |
| Example 1a: Overpayment / pending refund | A contribution which is created for $100 donation, but pending. We then record an overpayment of $120. Hypothetically the contribution is overpaid by $20 and should be pending refund. This is not shown in CiviCRM. There is nothing showing the user that there is an overpayment of $20.| ![1-Overpayment](/uploads/74eca492a8d044aa17033dd681922c4a/1-Overpayment.webm)
| Example 1b: Change contribution status to refunded | We can further demonstrate this by taking the same contribution and then changing the status of the contribution to refunded. This raises the question of what this means? Does this reflect the users intention to: Cancel the original debt of $100 (i.e. to credit note the original amounts owed and clear the balance Or reflect the fact a refund was made for the payment of $120, but that they are still owed the original $100 Or both? CiviCRM has refunded the original value of the invoice, i.e. $100, even though the payment of $120 was received. As such we still owe $20 but this is not shown in CiviCRM.|![2-Change_status_to_refunded](/uploads/bf9eae010687771d440b4baa0d528d1e/2-Change_status_to_refunded.webm)
| Example 2: A typo entered in the wrong contribution amount | Add a contribution for $100 and set as completed. Realised that actually the contribution was $120. System will automatically add the additional $20 payment. Note: If this was a change in the line items of an invoice, it would not be safe to assume we received the additional payment. The aim of the user might be to state the obligation to pay was $120. Also it probably wasn’t 2 separate payments and hence we should reverse out the first payment (-100) and then make a second payment for the full amount (+120) | ![Updating_a_contribution_amount_error](/uploads/bda0cc37c9c5911b54bb429367bdffbf/Updating_a_contribution_amount_error.webm)
Much of this stems from the contribution status field being both be the driver of changes to the contribution (i.e. by changing the status to completed or refunded) or changed itself (i.e. the result of changes to the position of the contribution) by recording payments or refunds.
As such this is a proposal to simplify this workflow so that the the contribution status is only the result of the status of the contribution, and can no longer be used to change the status of the contribution.
We would retain the ability to make changes to the contribution status via the API for backwards compatibility until extensions can adopt the new model.
**Further ramblings (feel free to skip this part if you are not too interested in accounting principles)**
Accounting has simple and sounds principles for dealing with all of this.
“Obligations” are managed by 2 documents: Invoices and Credit notes. An invoice would stipulate what is obligated. This can be reduced by creating a credit note, which would then reduce the obligated amount.
It’s worth noting that for sales tax (for example VAT) purposes invoices should be sequentially numbered and should not be edited once they are generated. Hence usually you would not just simply delete an invoice to reduce the obligated amount, you would create a credit note for some or all of the amount, apply it to the invoice and send that to the customer to show the reduce in their balance owed to you.
As such I think in CiviCRM we need to fully enforce the split of concepts of the “obligation” and the actual payments (or refunded) amounts. Currently we have started on the journey towards that where Contributions (and line items on them) represent the obligations in most cases, and payments (or financial transactions of type payment) are the payments.
The contribution status should be a reflection of the net of that position. Does the customer owe us money (= pending or partially paid*) or is the balance settled (= completed) or do we owe them money (= pending refund)?
</details>
**Proposed changes:**
1. Recalculate the contribution status whenever a contribution is created or updated
We should recalculate the contribution status whenever a contribution is created or updated based on the following rules:
| Ref | Calculation | Status |
| ------ | ------ | ------ |
| 1 | If there are no payments or refunds | Pending (arguably there would be a better label for this but in order to avoid making actual changes to the contribution status options this would seem to be the best fit) |
| 2 | If the sum of the line items (including any tax line items) > (sum of payments received - sum of refunds paid out) | Partially paid |
| 3 | If the sum of the line items (including any tax line items) < (sum of payments received - sum of refunds paid out) | Pending refund |
| 4 | If the sum of the line items (including any tax line items) = (sum of payments received - sum of refunds paid out) | Completed |
2. Changes to the User interface:
| Screen | How it looks currently | How it will work | Changes required |
| ------ | ------ | ------ |------ |
| New contribution screen | ![image](/uploads/568a11ebd7cc0b44edc36077d06f62d8/image.png) | ![Create_new_contribution](/uploads/cb028a89f3c3cc2c3798128efaa4e0d6/Create_new_contribution.png) | We split the "obligation" with the "payment". As such we remove the contribution status field from this screen and instead allow people to decide whether they want to record the "payment" at the same time as recording the "obligation" by checking the "Record payment" checkbox. The contribution status would then be calculated using the logic above. i. |
| View contribution screen (one line item) | ![Screenshot_2022-08-29_at_11.26.55](/uploads/02854f20d41d8ffec5159fa1977627e0/Screenshot_2022-08-29_at_11.26.55.png) | | No Changes |
| View contribution screen (multiple line items) || | |
| Edit contribution screen (one line item) | ![Screenshot_2022-08-29_at_11.30.42](/uploads/6faaed62b313698c1a4346956f48e719/Screenshot_2022-08-29_at_11.30.42.png)| ![Screenshot_2022-08-29_at_11.37.56](/uploads/68293bdc8d48c548606793c6a64d159d/Screenshot_2022-08-29_at_11.37.56.png)| Status field becomes read only and we introduce a button to cancel the contribution. See below for new screen for cancelling a contribution|
| Edit contribution screen (multiple line items) || | |
| New membership screen | ![image](/uploads/568a11ebd7cc0b44edc36077d06f62d8/image.png) | cell | ------ |
| View membership screen (one line item) | | ||
| View membership screen (multiple line items) | | ||
| Edit membership screen (one line item) | | ||
| Edit membership screen (multiple line items) | | ||
| New event participant screen | ![image](/uploads/568a11ebd7cc0b44edc36077d06f62d8/image.png) | ![New_participant](/uploads/7837cf2271b10bb5824d11483221037a/New_participant.png) | Change the checkbox "Record Payment" to "Record Contribution" OR have a toggle to allow the admin to decide whether they are recording a "Paid" or "Free ticket". We only need the financial type and contribution date if we are only recording the contribution (note in https://lab.civicrm.org/dev/core/-/issues/1403 we have agreed to change label of contribution received date to contribution date). The amounts / lines should come from above. |
| View event participant screen (one line item) | | ||
| View event participant screen (multiple line items) | | ||
| Edit event participant screen (one line item) | | ||
| Edit event participant screen (multiple line items) | | ||
- Removehttps://lab.civicrm.org/dev/financial/-/issues/196Proposal: Account for new Mastercard regulations for recurring contributions2022-09-20T17:19:38ZJonGoldProposal: Account for new Mastercard regulations for recurring contributionsThere's an article here:
https://www.allaboutadvertisinglaw.com/2021/11/new-mastercard-requirements-for-subscription-and-negative-option-billing-models.html
But here are the highlights:
* Must send a confirmation email at the time of en...There's an article here:
https://www.allaboutadvertisinglaw.com/2021/11/new-mastercard-requirements-for-subscription-and-negative-option-billing-models.html
But here are the highlights:
* Must send a confirmation email at the time of enrollment that includes the terms of the subscription and instructions on how to cancel the subscription
* Send a receipt after every successful billing attempt that includes instructions for how to cancel this subscription (this can be instructions to call customer service)
* Provide an online cancellation method (similar to unsubscribing from emails) – that can be instructions to call customer service
* For any subscription/recurring payment plan that bills a cardholder less frequently than every six months, the merchant must send a notification at least seven days prior to the billing date that includes the terms of the subscription and instructions on how to cancel the subscription
* Merchants have until Sept 21, 2022, to meet this requirement.
It seems like `civicrm_contribution_recur.is_email_receipt` should be ignored if the card type is Mastercard. It also seems like a new Scheduled Job is necessary for folks who have recurring contributions that are less frequent than six months.https://lab.civicrm.org/dev/financial/-/issues/195Using the line item editor on a contribution template does not update the mat...2022-07-07T07:51:33ZAlanDixonUsing the line item editor on a contribution template does not update the matching recurring contribution total amountThis is a follow up issue to https://lab.civicrm.org/dev/financial/-/issues/194
as per: https://lab.civicrm.org/dev/financial/-/issues/194#note_75215
It's a similar issue to this one: https://github.com/civicrm/civicrm-core/pull/21473
...This is a follow up issue to https://lab.civicrm.org/dev/financial/-/issues/194
as per: https://lab.civicrm.org/dev/financial/-/issues/194#note_75215
It's a similar issue to this one: https://github.com/civicrm/civicrm-core/pull/21473
Note that if you go back and just save the contribution template, then the issue can be worked around as an administrator!
i.e. part of the problem is that the line item editor is assuming it's living in an isolated world that it knows everything instead of behaving like a responsible citizen.https://lab.civicrm.org/dev/financial/-/issues/193After import of contribution: User deprecated function: Deprecated function C...2022-06-10T09:05:04ZTobias KrauseAfter import of contribution: User deprecated function: Deprecated function CRM_Core_OptionGroup::getValueWe get the above warning after the import of contributions on CiviCRM 5.48.2 with Drupal 9. The full message is:
`User deprecated function: Deprecated function CRM_Core_OptionGroup::getValue, use CRM_Core_PseudoConstant::getKey. in CRM_...We get the above warning after the import of contributions on CiviCRM 5.48.2 with Drupal 9. The full message is:
`User deprecated function: Deprecated function CRM_Core_OptionGroup::getValue, use CRM_Core_PseudoConstant::getKey. in CRM_Core_Error::deprecatedFunctionWarning() (line 1043 of /vendor/civicrm/civicrm-core/CRM/Core/Error.php).`5.51.0https://lab.civicrm.org/dev/financial/-/issues/192CiviCRM crashes when I select ZMK as default currency2022-09-09T13:10:06ZmitoworksCiviCRM crashes when I select ZMK as default currencyA clean install of CiviCRM on Wordpress crashes whenever I select ZMK as default currency. My installation details are:
> WordPress version 5.9.2
> Current theme: Twenty Twenty-Two (version 1.1)
> Current plugin: CiviCRM (version 5.4...A clean install of CiviCRM on Wordpress crashes whenever I select ZMK as default currency. My installation details are:
> WordPress version 5.9.2
> Current theme: Twenty Twenty-Two (version 1.1)
> Current plugin: CiviCRM (version 5.47.2)
> PHP version 8.0.16
```
Error Details
=============
An error of type E_ERROR was caused in line 19 of the file /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/brick/money/src/Exception/UnknownCurrencyException.php. Error message: Uncaught Brick\Money\Exception\UnknownCurrencyException: Unknown currency code: ZMK in /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/brick/money/src/Exception/UnknownCurrencyException.php:19
Stack trace:
#0 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/brick/money/src/ISOCurrencyProvider.php(120): Brick\Money\Exception\UnknownCurrencyException::unknownCurrency()
#1 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/brick/money/src/Currency.php(91): Brick\Money\ISOCurrencyProvider->getCurrency()
#2 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/brick/money/src/Money.php(189): Brick\Money\Currency::of()
#3 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Utils/Money.php(209): Brick\Money\Money::of()
#4 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Utils/Money.php(88): CRM_Utils_Money::formatUSLocaleNumericRounded()
#5 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Core/Resources/Common.php(219): CRM_Utils_Money::format()
#6 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Core/Resources/Common.php(128): CRM_Core_Resources_Common::coreResourceList()
#7 /home/monkey/public_html/civic/wp-content/uploads/civicrm/templates_c/CachedCiviContainer.a02b080bd0d8fdf7053d123f1aecc5d2.php(807): CRM_Core_Resources_Common::createFullBundle()
#8 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/vendor/symfony/dependency-injection/Container.php(306): CachedCiviContainer->getBundle_CoreResourcesService()
#9 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/Civi.php(174): Symfony\Component\DependencyInjection\Container->get()
#10 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Core/Resources.php(214): Civi::service()
#11 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm/CRM/Core/Resources.php(382): CRM_Core_Resources->addBundle()
#12 /home/monkey/public_html/civic/wp-content/plugins/civicrm/civicrm.php(1087): CRM_Core_Resources->addCoreResources()
#13 /home/monkey/public_html/civic/wp-content/plugins/civicrm/includes/civicrm.admin.php(761): CiviCRM_For_WordPress->add_core_resources()
#14 /home/monkey/public_html/civic/wp-includes/class-wp-hook.php(307): CiviCRM_For_WordPress_Admin->admin_page_load()
#15 /home/monkey/public_html/civic/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
#16 /home/monkey/public_html/civic/wp-includes/plugin.php(474): WP_Hook->do_action()
#17 /home/monkey/public_html/civic/wp-admin/admin.php(237): do_action()
#18 {main}
thrown
```
After this, I can't do anything else under the CiviCRM menu
It looks like a change in currency to ZMW in 2013 is causing the issue.5.54.0https://lab.civicrm.org/dev/financial/-/issues/189Creating an Order fails with `Line item total doesn't match total amount` due...2023-06-19T09:18:26ZhaystackCreating an Order fails with `Line item total doesn't match total amount` due to the mismatch of 2 vs 6 decimal placesOpening this instead of conflating two issues in #188 - specifically referring to [this thread](https://lab.civicrm.org/dev/financial/-/issues/188#note_66286). As the subject says, creating an Order can fail with the error `Line item tot...Opening this instead of conflating two issues in #188 - specifically referring to [this thread](https://lab.civicrm.org/dev/financial/-/issues/188#note_66286). As the subject says, creating an Order can fail with the error `Line item total doesn't match total amount` because of the mismatch of 2 vs 6 decimal places when calculating the Order total from the amounts and tax amounts in the Line Items.
Say, for example, I have two Taxable Line Items in an Order both of which have had their Tax Amount pre-calculated - in this case by WooCommerce but I assume this could equally be the result from any external Payment Processor. All the amounts in the following params are correct as far as WooCommerce is concerned. Both CiviCRM and WooCommerce have `19.37910000` configured as the relevant Tax Rate.
```
[params] => Array
(
[contact_id] => 210
[financial_type_id] => 5
[payment_instrument_id] => 4
[trxn_id] => WooCommerce Order - 2250
[invoice_id] => 2250_woocommerce
[receive_date] => 2021-10-13 19:34:30
[contribution_status_id] => Pending
[is_pay_later] => 1
[total_amount] => 77.59 <-- The pre-calculated Total Amount
[tax_amount] => 12.59 <-- The pre-calculated Total Tax Amount
[source] => Shop
[campaign_id] => 3
[note] => Solstice Ticket (Bass) x 1, Solstice Ticket (Tenor) x 1
[line_items] => Array
(
[17] => Array
(
[params] => Array
(
[event_id] => 2
[contact_id] => 210
[role_id] => 1
[price_set_id] => 8
[fee_level] => Bass
[fee_amount] => 29.84
[source] => Shop: Solstice Ticket (Bass)
[status_id] => Pending from pay later
)
[line_item] => Array
(
[0] => Array
(
[price_field_id] => 9
[unit_price] => 25.00
[qty] => 1
[line_total] => 25.00 <-- The Line Total
[tax_amount] => 4.84 <-- The pre-calculated Tax Amount
[label] => Bass
[entity_table] => civicrm_participant
[financial_type_id] => 5
[price_field_value_id] => 19
)
)
)
[18] => Array
(
[params] => Array
(
[event_id] => 2
[contact_id] => 210
[role_id] => 1
[price_set_id] => 8
[fee_level] => Tenor
[fee_amount] => 47.75
[source] => Shop: Solstice Ticket (Tenor)
[status_id] => Pending from pay later
)
[line_item] => Array
(
[0] => Array
(
[price_field_id] => 9
[unit_price] => 40.00
[qty] => 1
[line_total] => 40.00 <-- The Line Total
[tax_amount] => 7.75 <-- The pre-calculated Tax Amount
[label] => Tenor
[entity_table] => civicrm_participant
[financial_type_id] => 5
[price_field_value_id] => 20
)
)
)
)
)
```
The Order API recalculates `$order->getTotalAmount()` and [then compares it with what's passed in via the API](https://github.com/civicrm/civicrm-core/blob/f73d3ac9a9979d8a616b0e2df53a459f7e6a84d7/api/v3/Order.php#L113). However, the rounding to 6 decimal places (rather than 2) triggers `CRM_Contribute_Exception_CheckLineItemsException` because `$params['total_amount'] = 77.59` does not equal `$order->getTotalAmount() = 77.596415`.
WooCommerce appears to _round_ the Line Items before _summing_ them, so:
* Line Item 1: `1.193791 * 25 = 29.844775 => 29.84`
* Line Item 2: `1.193791 * 40 = 47.75164 => 47.75`
* Total of rounded Line Items: `77.59`
CiviCRM, appears to _sum_ the Line Items before _rounding_ them, so:
* Line Item 1: `1.193791 * 25 = 29.844775`
* Line Item 2: `1.193791 * 40 = 47.75164`
* Total of summed Line Items: `77.596415`
`CRM_Utils_Money::equals()` then rounds _up_ not _down_ because of the extra precision and :boom: the above params cannot successfully create an Order.
My suggestion is that CiviCRM should:
* Verify the amount in each Line Item to the number of decimal places for the given currency.
* Keep a running total of those amounts.
* Compare the final running total with the `total_amount`.