Merging books

Blair Lowe gnucash at zedemail.ca
Wed May 4 23:06:21 EDT 2005


On Wed, 2005-05-04 at 14:55, Neil Williams wrote:
> On Wednesday 04 May 2005 8:36 pm, Blair Lowe wrote:
> > Hi,
> >
> > Our accountant had our books for quite some time, and now we have two
> > versions and would like to put all the new customers and invoices into
> > the new file.
> 
> If you can wait for the next release (late this year), this will be solved.
> 
> > Is there an easy way of doing this from the xml file,
> 
> No - it is a lot more complex than that. If you try to do this, you are likely 
> to end up with badly corrupted data. Of course, you may be lucky.
> :-(
> 
> > or should we just 
> > re-enter the hundred or so bills again?
> 
> This functionality is already in the CVS code but it is not setup for this 
> kind of merge, yet.
> 
> I'm currently working on getting the invoices to be exportable in the first 
> place.
> 
> In the Gnome2 version, the procedure would be:
> 
> 1. Make a backup of each file.
> 2. Open the old file in GnuCash (the one from the accountant).
> 3. Export the customers and invoices as XML files (using the QSF format).
> 4. Close that file and open the new file in GnuCash (the latest data).
> 5. Import the QSF data and merge it into the data in the new file.
> 6. Check your data and save!
> 
> The code will show you any collisions or any instance where there is an 
> ambiguous match between the new data and the existing data.
> 
> Currently, I need to flesh out the exported invoices a little more (a lot more 
> difficult than it sounds!) and there is a bug in the merge handler in GnuCash 
> - it works as a test routine but something in the Gnome2 interface is 
> stalling.
> 
> The finished code will do a lot more than what you need right now - it's the 
> mechanism for importing data from various other sources, like a Palm PDA and 
> probably applications like GnoTime etc. It needs to meet the needs of a wide 
> range of users so I can't just make a shortsighted leap to a cut-down 
> version.
> 
> It'll also support merging two complete books (without exporting anything) 
> although merging two books from different users is likely to generate quite a 
> lot of collisions. Where possible, export just the changed data, it'll save 
> time overall.

Thanks!

Not for the faint of heart I tried the following: note that we have been
only doing invoices on our side:

get old file that was sent to accountant on feb 23rd.
create a patch file against the one that we did invoices in (<newfile>):
diff -Naur <oldfile> <newfile>    >  anotherFile.patch

Then patch the new file from the accountant:

patch -p0 <newfileFromAccountant>  < anotherFile.patch

We will be checking this, and only about 10% of the "hunks" failed.
There appear to be newer invoices in the patched file.

Anything to reduce the amount of data entry!

This is surely not recommended, and all files were backed up first.

TTYL,
Blair.

-- 
.ca DOMAINS:    https://www.domainsunder.ca     Computer Engineering Inc.
Tel 780 450 8494 or TOLL FREE 1 877 968 7626 (9-5 Mountain Time)



More information about the gnucash-user mailing list