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 637004 - "Export Customers" option needed
"Export Customers" option needed
Status: RESOLVED OBSOLETE
Product: GnuCash
Classification: Other
Component: Business
2.3.x
Other All
: Normal enhancement
: ---
Assigned To: Derek Atkins
Derek Atkins
: 139431 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-12-11 06:21 UTC by IronSmith
Modified: 2018-06-29 22:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description IronSmith 2010-12-11 06:21:24 UTC
There desperately needs to be an option to export customers information. I understand that there once was this option but it doesn't exist anymore?
Comment 1 Derek Atkins 2010-12-11 14:58:47 UTC
What data do you want/need exported?
In what format?
And for what purpose (who/what would be using the exported data)

The old export method was removed because there was nothing that existed that could read or use the exported data.  (It used QSF, which pretty much is a dead tech).
Comment 2 IronSmith 2010-12-11 18:54:59 UTC
I keep all of my customer data in gnu-cash, I would like to be able to export everything in the "edit customer" window under the "customer" & "shipping address" tabs - all to csv for use in spreadsheets (vCard format would be nice too but not as useful).

company name, customer name, address, phone, fax, email, shipping address, shipping phone, shipping fax, shipping email
Comment 3 IronSmith 2010-12-11 19:02:36 UTC
The purpose for exporting the customer data would be for mailing promotions, adding customers to my contacts on my email; also so I can have my customers data with me on my smart phone for driving directions, phone numbers and email address for contact while I'm on the road.
I suppose there are other situations where exporting this data would be useful in the future but I have found myself needing a customer list several times for those purposes I listed above.
Comment 4 IronSmith 2010-12-11 19:04:49 UTC
oh, I forgot about the "notes" field, that would be useful too, but not essential.
Comment 5 Christian Stimming 2010-12-27 21:42:14 UTC
Thank you for taking the time to explain your enhancement request.

The described enhancement is a good proposal and would be an advantage for the software. However, as a volunteer-driven project with limited resources, the GnuCash developers have to set priorities on which features are most likely being worked on in the near future. In that sense, the current GnuCash developers decided not to work on your proposed feature in the next 4-6 months. In case you would like to have this feature implemented in any case, you have the following option: 1. Start to program in gnucash yourself - see http://wiki.gnucash.org/wiki/Development . 2. Convince someone who is not yet part of the GnuCash team to join the team and implement your feature. 3. Pay some of the GnuCash developers to implement your feature - ask on the mailing list gnucash-devel@gnucash.org in that case. Thank you very much.

Feel free to file other bugs or enhancement requests that you find, though.
Comment 6 Christian Stimming 2011-01-03 08:48:51 UTC
http://lists.gnucash.org/pipermail/gnucash-devel/2010-December/030616.html

This might be possible very quickly by writing a python script that opens the gnucash file, queries for all customers, and writes out some text-based format. Example for working with a Customer object in python is in src/optional/python-bindings/example_scripts/simple_business_create.py
Comment 7 Christian Stimming 2011-01-03 08:56:16 UTC
@Mark: Is the function gncBusinessGetOwnerList() of r19625 available in python as well? How would I call it in python?
Comment 8 Mark Jenkins 2011-01-03 19:08:23 UTC
No, src/engine/gncBusiness.h is not included in
gnucash/trunk/src/optional/python-bindings/gnucash_core.i

But it probably could be included safely. Even a non programmer can test this out by adding that, re-compile, set the PYTHONPATH to the location of the bindings (if not in a standard place), and test the function works..
>>> from gnucash.gnucash_core_c import gncBusinessGetOwnerList, GNC_ID_CUSTOMER
>>> from gnucash import Session
>>> s = Session(..... # see other example scripts)

>>> cust_list = gncBusinessGetOwnerList( book.get_instance(), 
GNC_ID_CUSTOMER, False )
>>> print cust_list

There is already gnucash.gnucash_core.Book.CustomerLookup which works if you know the customer GUID, but if not, getting a list of GUID's is possible by accessing the database/file-format, but by that point you're already in a position to just scrape everything.

gncBusinessGetOwnerList sounds like the best approach -- something I'd probably get around to adding with an example script eventually...

If you were to seek paid bids on gnucash-devel (or privately to me) as suggested by Christian, I woudl resond and base my quote on my estimate adding this to the python bindings and adding an example script that does a csv export of all customer and all customer info, and submitting a patch could be done in 1-2 hours.
Comment 9 Christian Stimming 2011-01-03 19:38:47 UTC
(In reply to comment #8)
> If you were to seek paid bids on gnucash-devel (or privately to me) as
> suggested by Christian, I woudl resond and base my quote on my estimate adding
> this to the python bindings and adding an example script that does a csv export
> of all customer and all customer info, and submitting a patch could be done in
> 1-2 hours.

... exactly this was my question here. I sent a bid to "IronSmith" as well, but because I don't know the wrappers as well as you do, I would need significantly more time and your bid for sure is the best he could get. I can strongly support your ideas here.
Comment 10 Christian Stimming 2011-01-16 19:58:43 UTC
*** Bug 139431 has been marked as a duplicate of this bug. ***
Comment 11 Chris Good 2016-06-18 08:06:04 UTC
I've modified Receivable Aging and Payable Aging reports so you can optionally display customer and vendor address info at the end of each line showing the company aged balances.
The reports can then be copied and pasted (or exported as html) into a spreadsheet for use in mail merge.

The following columns have been added: 
customer/vendor active status, contact name, address, phone, fax, email, shipping contact name, shipping address, shipping phone, shipping fax, shipping email. Shipping details are only available for customers as these details are not held in GnuCash for vendors.

I haven't added the Notes as I only found this bug when I went looking for a bug to link my mods to after I had completed the mod. I can try to do later if this is still required? I think maybe some of the other billing fields could also be useful, say Currency, Terms, Credit Limit etc. I suppose if all the fields are available, this would be useful for creating a CSV for importing into a new book, which seems to be already available.

I've created a pull request (maint):
https://github.com/goodvibes2/gnucash/commit/718cf03bcef02ed75fba42d9032530df29fa1630

This is my first modification in scheme, so please feel free to tell me if I should have done something some other way.

One thing I'm not really happy with is I pass a Boolean 'receivable' from receivables.scm/payables.scm to aging.scm so I can tell if the Address Source option (Billing or Shipping) needs to be added. I'm thinking maybe there is a better way for aging.scm to tell if it is dealing with customers or vendors.
I couldn't use the selected account as the Address Source option needs to be added before the Account is available.

Also, because these reports include customers/vendors by finding all the transactions for the selected accounts receivable or payable account, companies will not be listed if they have no posted transactions (invoice etc). It would be better to report all customers/vendors but this was too hard for me for this first attempt. Presumably a cust/vendor would not be added in most GnuCash books until there is an actual need to invoice them, so probably this is OK.
Comment 12 Chris Good 2016-06-24 08:00:53 UTC
I have documented the payable/receivable aging reports including the new options for displaying address details and created maint pull request
https://github.com/Gnucash/gnucash-docs/pull/54
Comment 13 John Ralls 2018-06-29 22:49:14 UTC
GnuCash bug tracking has moved to a new Bugzilla host. The new URL for this bug is https://bugs.gnucash.org/show_bug.cgi?id=637004. Please continue processing the bug there and please update any external references or bookmarks.