Importing Revisited

Neil Williams linux at codehelp.co.uk
Sat Jul 31 17:02:49 EDT 2004


blfs wrote:
Sorry, this should have gone to the list first time.

> This can be implemented in a gazillion different ways, but in the end
> there should be data in the program that resembles
> 
> struct check{ char *number; char *payee; char *amount; char *memo; 
> char *etc; };

What on earth are you doing with the amount as a char*? It would have to 
immediately become more complex to account for numeric values. That then 
has to be extended to multiple currencies (GnuCash knows that the real 
world knows more than dollars). Then, again in the real world, few 
people write a single cheque for single items that can be assigned to 
one category. You don't even describe categories, let alone double-entry 
accounting. So you need a Split as well - one cheque used to settle one 
bill that includes multiple items that need to be categorised into 
different accounts - maybe household, car fuel, groceries.

Do you think that GnuCash wouldn't use simple data types if that was 
workable? Do you think GnuCash was *deliberately* made complex, just for 
the fun of it??

> Now what I am not understanding is why is it not trivial to import
> flat text data into this program.

Because your example is too trivial to be useful. It uses pointless data 
types that simply create work (and therefore errors).

Real structures are FAR more complex and it is this complexity that 
makes the import non-trivial.

> There are two possible explanations.  The first being that there is
> no such animal as a check in the program.  At least not one that
> resembles the structure above.

The real reason is that you are being naiive in your planned structures.

Please read the REAL WORLD developer reference:
http://cvs.gnucash.org/docs/HEAD/modules.html


> The second is the concern that just importing a bunch of checks would
> throw the ledger out of balance.  Usually programs handle this by
> having a post function in the program.  The checks dont go to the GL
> until they are posted.

Which needs further code.


> 
> Can someone please enlighten me here.

Read the source documentation.


-- 

Neil Williams
=============
http://www.codehelp.co.uk/
http://www.dclug.org.uk/
http://www.isbn.org.uk/
http://sourceforge.net/projects/isbnsearch/

http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3




-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
Url : http://lists.gnucash.org/pipermail/gnucash-user/attachments/20040731/15cf2694/attachment.bin


More information about the gnucash-user mailing list