GNOME Bugzilla – Bug 759294
New the billing term are not saved during invoice editing.
Last modified: 2018-06-29 23:44:50 UTC
When changing an invoice's billing term to a new one, say from 1 month to 2 months and then proceed to posting the invoice. The invoice billing term is still set to 1 month. Current work around is to edit the xml <invoices:terms> directly. Thank you.
If you are changing the terms using the dropdown in the invoice view I can confirm this behavior. If you use the edit invoice button (usually fifth one along) or from the menu Edit->Edit Invoice and edit it in the Invoice Information dialog it should work. Can you confirm this please?
Yes,I'm using the drop down menu on the invoice view page. Sorry for not being clear enough. Thank you.
Thanks, but does it work when you use the alternate method I suggested.?
(In reply to Mike E from comment #3) > Thanks, but does it work when you use the alternate method I suggested.? Yes, It does. with a caveat though. After changing the billing term on the Information dialog, the billing term drop down resets itself to blank on the view invoice page. Shouldn't this copy billing term selection from the information dialog? However, when I set it to the desired billing term it saved fine. I got to admit I did not know that the edit->Edit Invoice thing exists. After all from user prespective, the one right smack in front is the obvious tool to use (the drop down). Anyway, thank you for the quicker work around without needing to delve into xml. Thank you.
Glad to have helped. I agree with your caveat, that is a bug. In dialog-invoice.c, the method gnc_invoice_terms_changed_cb() is supposed to do the update. I don't think the terms should be changeable from the invoice screen anyway. I note that the code to make it read only after posting has been commented out (near line 1874) for some reason. I don't think that's correct either. Maybe some other developer will provide more information/ideas.
Git blame tells us that Derek commented out those lines as part of https://github.com/Gnucash/gnucash/commit/06a94557b37c9d54ebab884f37b23e4e4536da75 in 2002. The commit message was: " Change the format of Invoices slightly, in preparation for Lots. "In partciular, remove the due-date and paid-date from the invoice itself (let A/R and A/P handle that with Lots). Change the Invoice Window from a Dialog to a GnomeApp -- provide a toolbar. Also remove Orders from the UI." He'd added that read-only bit only a few months before, in https://github.com/Gnucash/gnucash/commit/88aac579bce5b755a73f5b5d0d00ad7e1de5dfb4, so presumably decided that it was a bad idea.
Let's see if I can dredge up that 13-year-old memory why I commented it out.. IIRC the reason I turned off the read-only on that was that there was a bug with displaying the contents when it was read-only.. Like part of the widget was there, but another part wasn't. IMHO, all the items in the invoice window should be read-only (except the notes). Everything should only be editable via the Edit Invoice window. Most likely the comment-out was an oversight.
I agree, it shouldn't be editable, even before posting, from the invoice window. That should be a relatively easy fix. Which just leaves why it's not updated on return from the edit dialog.
Warlord: Un-commenting means that if the invoice is posted, then un-posted again those items never become active again, unless the invoice is closed then re-opened. Substituting !is_posted instead of FALSE in gtk_widget_set_sensitive () fixes that though. Also why not lock the comments on posting? I often use that field to provide more information about the invoice. I often repair stuff and I like to provide more information about what I did to fix it, partly for customer feedback and a note to self if I ever get that item back for repair. Should the terms even be a dropdown in that view anyway? Shouldn't it just be a textual display of the terms?
(In reply to Mike E from comment #8) > I agree, it shouldn't be editable, even before posting, from the invoice > window. For the record, I disagree with that. But that's not important for the current bug at hand. (In reply to Mike E from comment #9) > Should the terms even be a dropdown in that view anyway? Shouldn't it just > be a textual display of the terms? Yes, given these fields are currently intended as read only, I agree a textual display would be less confusing.
Created attachment 317177 [details] [review] Prevent editing the terms from the invoice view Prevent editing the terms from the invoice view. This has to be edited via the edit invoice button or menu Edit->Edit Invoice. The dropdown in the invoice view has been replaced with an edit text box set to non-editable in the glade file. Files edited are: src/business/business-gnome/dialog-invoice.c src/business/business-gnome/gtkbuilder/dialog-invoice.glade Glade file edited using glade-3 3.8.3 which shouldn't have introduced too many artifacts. I've not changed any other behavior. I'll test some more and commit it later, but an quick check would be appreciated,
Commited to maint commit 35b5d944840e4439e
Review of attachment 317177 [details] [review]: Committed to maint.
*** Bug 724973 has been marked as a duplicate of this bug. ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=759294. Please update any external references or bookmarks.