After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759294 - New the billing term are not saved during invoice editing.
New the billing term are not saved during invoice editing.
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Business
git-maint
Other All
: Normal normal
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
: 724973 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-12-10 11:34 UTC by budi
Modified: 2018-06-29 23:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Prevent editing the terms from the invoice view (19.04 KB, patch)
2015-12-10 23:10 UTC, Mike Evans
committed Details | Review

Description budi 2015-12-10 11:34:44 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.
Comment 1 Mike Evans 2015-12-10 13:16:59 UTC
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?
Comment 2 budi 2015-12-10 14:18:55 UTC
Yes,I'm using the drop down menu on the invoice view page.
Sorry for not being clear enough.

Thank you.
Comment 3 Mike Evans 2015-12-10 14:36:53 UTC
Thanks, but does it work when you use the alternate method I suggested.?
Comment 4 budi 2015-12-10 14:54:47 UTC
(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.
Comment 5 Mike Evans 2015-12-10 15:26:28 UTC
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.
Comment 6 John Ralls 2015-12-10 16:00:05 UTC
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.
Comment 7 Derek Atkins 2015-12-10 16:10:28 UTC
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.
Comment 8 Mike Evans 2015-12-10 16:21:29 UTC
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.
Comment 9 Mike Evans 2015-12-10 17:43:33 UTC
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?
Comment 10 Geert Janssens 2015-12-10 18:10:18 UTC
(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.
Comment 11 Mike Evans 2015-12-10 23:10:48 UTC
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,
Comment 12 Mike Evans 2015-12-11 10:29:23 UTC
Commited to maint commit 35b5d944840e4439e
Comment 13 Mike Evans 2015-12-11 10:33:13 UTC
Review of attachment 317177 [details] [review]:

Committed to maint.
Comment 14 Mike Evans 2016-06-28 11:15:29 UTC
*** Bug 724973 has been marked as a duplicate of this bug. ***
Comment 15 John Ralls 2018-06-29 23:44:50 UTC
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.