GNOME Bugzilla – Bug 728103
Invoice opened does not contain the Job under circumstances
Last modified: 2018-06-29 23:29:32 UTC
Steps to reproduce: Open Gnucash Open an Invoice (which has a Job) for View/Edit Notice the Job is there Close GnuCash Open GnuCash again The Invoice is still open. Job field is empty. Tested on 2.6.3 (Windows and Linux), and 2.6.2 (Linux).
Confirmed for git master in Fedora18. To restore the job, it's not enough to edit the invoice and re-select the job. I have to first select a different job, then re-edit and select the correct job. It's gone again after another save, close, open cycle though. It looks as if the job is still applied to the invoice but the text box isn't being updated. Adding a new entry to the invoice causes the job to reappear, as does deleting an entry.
The problem is in saving the page as a state for Gnucash. The function did not check for job, so it always saved the customer or the vendor as the owner, instead of the job. The patch resolves the problem (tested in linux - master, with vendor bills with and without jobs, and invoices).
Created attachment 275845 [details] [review] Modify function gnc_invoice_save_page
Tested in maint and master branch on Linux FC18. Old invoices on opening still don't show the job name, but on re-saving then re-opening the job is displayed correctly. This is as I'd expect with this patch, so looks good to me..
If I understand the state saving code correctly it wasn't even necessary to re-save. Just closing and opening the book would be sufficient. I have applied the patch to the stable branch. Thank you very much !
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=728103. Please update any external references or bookmarks.