Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoice not of valid status for modification This document cannot be edited as it has a payment or credit note allocated to it. #73

Open
jitendrapurohit opened this issue Jun 19, 2020 · 1 comment

Comments

@jitendrapurohit
Copy link
Contributor

We've seen several reports of these errors in invoice logs. The case to get this error is slightly complicated. I think the below steps should be able to replicate -

  1. Create a contribution in civicrm with status = Pending. This inserts a row in account_invoice table with needs_update = 1 and account_status_id` = 2

  2. Push this contribution to xero. needs_update is set to 0.

  3. Update the invoice on xero account. Mark them as Paid.

  4. In civi, when the "Pull" job is executed, it updates the value of account_status_id to 1. All correct till now.

  5. Next, when CiviAccountSync Complete Contributions job is executed, it updates the status of the contribution to 1 (completed). This also modifies the needs_update flag in civicrm_account_invoice table.

  6. Again, when the push job is executed with an intention to update the status of invoice on xero, it notices that the status is already updated (in step 3) and records the below error in error_log field.

Invoice not of valid status for modification This document cannot be edited as it has a payment or credit note allocated to it.

We had ~480 rows displayed with the same error message. Workaround is to avoid updating the status of the invoice in "Xero" and instead use civicrm to update the contribution which correctly updates the invoice when "Push" job is executed.

@eileenmcnaughton Thoughts? Probably, we should not set "needs_update" in step 5, but hard to identify if account_status_id was set to 1 from the pull job or via some ipn notification? OR

While push job, simply bypass this error if status on xero matches with existing status in civicrm?

@petednz
Copy link
Contributor

petednz commented Jul 10, 2020

Hi @eileenmcnaughton might you be able to give us any of your wisdom on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants