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 357696 - Billable items appear in more than one invoice
Billable items appear in more than one invoice
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Business
2.0.x
Other All
: Normal normal
: ---
Assigned To: Derek Atkins
Derek Atkins
Depends on:
Blocks:
 
 
Reported: 2006-09-25 22:13 UTC by digger vermont
Modified: 2018-06-29 21:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
account file with bilable items occurring in more than one invoice (6.06 KB, application/x-bzip)
2006-09-25 22:15 UTC, digger vermont
Details

Description digger vermont 2006-09-25 22:13:13 UTC
Please describe the problem:
I have billable items showing up in more than one customer invoice.  

Steps to reproduce:
 
1. Create a vendor and customer.
2. Create "invoice #1" for the customer.
3. Create "bill #1" for the Vendor charged back to the customer.
4. Post the Vendor "bill #1".
5. The billable items show up in the Customer "invoice #1".
6. click on the "invoiced?" column which puts an x in it.
7. Select an "Income Account" for the billable item.
8. Post "invoice #1"
9. Create customer "invoice #2"
10. The items from "bill #1" reappear in "invoice #2"

Actual results:
The billable items that are billed in the posted invoice show up again in a newly 
created invoice.

Expected results:
Itemes that are billed in a posted invoice should not appear in another invoice.

Does this happen every time?
I would say frequently enough that I've stopped using gnucash in my business for the moment.

Other information:
I brought up the problem to the GnuCash user mailing list in this thread
http://article.gmane.org/gmane.comp.gnome.apps.gnucash.user/18243
Comment 1 digger vermont 2006-09-25 22:15:37 UTC
Created attachment 73400 [details]
account file with bilable items occurring in more than one invoice
Comment 2 Alexander Vorobiev 2008-02-05 21:38:01 UTC
I have the same problem with items coming from Employee Voucher e.g. when I have expenses I want to charge back to my customer. Every time I create new invoice for this customer I see the list of those items from an old (posted) invoice. They are editable and the changes propagate to the old invoice. When I post the new invoice the old items disappear. This happens every time.

I use GnuCash 2.2.1
Comment 3 Derek Atkins 2008-02-06 04:09:28 UTC
The logic is supposed to be:

  /* Match:   (where I-TYPE == Invoice or Bill)
   *
   * 1. book AND
   * 2.   ( Entry->I-TYPE == ledger->invoice
   * #if I-TYPE == Invoice (entry only)
   *        OR
   * 3.     ( Entry->Invoice == NULL AND
   *          ( Entry->Billable == TRUE AND
   *            Entry->Bill->Is-Posted? == TRUE AND
   *            ( Entry->BillTo == Invoice->parent OR
   *              Entry->Bill->BillTo == Invoice->parent ) )
   *           OR
   *           ( Entry->Order->real-parent == Invoice->parent ) )
   * #endif
   *      )
   *
   * Note that term 3 is only for Editable invoices.
   */

Is this logic wrong?
Comment 4 Derek Atkins 2008-02-06 04:13:09 UTC
I'll note that I CAN reproduce this in trunk using the supplied data file.  At first I thought the problem might've been in the qof query core due to a change where sometimes (now) a GUID isn't NULL, but is guid_null().  But changing the test there didn't fix the bug so there's something else going on here.
Comment 5 Simon Booth 2009-01-05 20:03:41 UTC
FYI, This bug appears to be present in 2.2.6 (Ubuntu) as well.  I too have a series of previously invoiced billable items which show up when entering a new invoice, but disappear when posted...
Comment 6 Geert Janssens 2010-05-07 10:40:10 UTC
I managed to track this one down.

The logic mentioned in comment#3 is not exactly how the query is implemented. The implementation is slightly stricter even (which is correct as far as I can see).

The issue arises from an logic error deep inside the query builder code. Due to that bug, the "test for a NULL guid" condition is effectively never added correctly, which results in a different query that returns entries when it should not.

Anyway, I have fixed this in r19132. The first release that will have this fix will be 2.3.13.
Comment 7 John Ralls 2018-06-29 21:13:09 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=357696. Please update any external references or bookmarks.