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

Time records marked as exported even when invoice is not saved due to duplicate invoice numbers #2917

Closed
jonaswinkler opened this issue Nov 7, 2021 · 2 comments · Fixed by #2932
Milestone

Comments

@jonaswinkler
Copy link

Describe the bug
Premise: When manually entering invoice numbers without using the invoice number generator placeholders, it could happen that you enter a number which already exists.

When creating an invoice and selecting "Mark as exported" in the "Filter invoice data" settings, everything works as expected, even the preview. If you then choose to save the invoice, the error message

"Changes could not be saved: Invoice "xyz" already exists"

but the time records are marked as exported. Now you have to figure out which time records were on that invoice and manually mark them as open / not exported.

=> I'd expect the time records to not be marked as exported when errors occur.

To Reproduce

  1. Go to 'Invoices'
  2. Manually set invoice number
  3. Save an invoice with that number (this should succeed)
  4. Enable "Mark as exported"
  5. Save another invoice
  6. See error message "invoice already exists"
  7. Note that time records are marked as exported

Logfile
This is on Kimai cloud, no logs available.

Additional context

  • Kimai version: 1.15.6
  • PHP version: ?.?
  • Device: Kimai Cloud
  • Browser Chrome
@kevinpapst
Copy link
Member

Thanks for the report!
Yes, that should be an atomic operation and I'll look into it.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants