patch for split accumulation in invoice/bill posting

Derek Atkins warlord at MIT.EDU
Tue Sep 21 09:58:20 EDT 2004


[ moved to gnucash-devel ]

Daniel Lindenaar <d.j.w.lindenaar at student.tue.nl> writes:

> Really? I just assumend that the xml parser would simply ignore any
> 'extra' flags...

Nope.  The XML parser is extremely fragile and will barf on any
unknown tags.  It's quite unfortunate and one of the (many) reasons I
dislike the existing XML File Backend.

>>Question: Is there some reason you need to store this flag?  Why can't
>>it just be an argument during the post process, perhaps using a "file
>>property (preference)" as the default value?
>>
>>
>>
> The reason would be that there could be some invoices that need
> splitting and others who don't. Anyway, first i thought about putting
> this in the post dialog, but that seemed to be a 'standard' dialog,
> accessed through a function i.e. gnc_dialog_dates_acct_parented (...);
> so it would need to be rewritten to allow for any extra checkboxes. I
> could do this, but that would mean that the stadardisation is lost
> there.

I guess I don't understand why you'd want to split some and not others.
But eh.  Whatever.

As for the "standard" dialog, it's only used by the various invoice
frontends.  Just add another (optional) parameter to the dialog.  If
the caller supplies this parameter, the show the toggle; if the caller
does NOT supply this parameter, hide the toggle.

Just because a function is used by multiple places doesn't mean you
can't (or shouldn't) change the API.  Indeed, you should also change
the gncInvoicePostToAccount() API to add the boolean flag of whether
to accumulate splits.

This really doesn't belong as a flag stored in the invoice, IMHO.

> No i didn't. I included two patches; one for the older 1.8.9 tree, in
> which the book is owned by the invoice directly and one for the 1.9.0
> tree, where the book is accessed via the QOFInstance.

Sorry, didn't look closely enough.  The patches looked pretty close,
but since I didn't like the file change I mostly ignored the rest of
it. ;)

> About the bug I reported in the end of the email, is that known or not?

I honestly have no clue; I haven't tested with CVS to see what
happens.  If CVS HEAD doesn't post correctly that's definitely a bug,
but unless Linas broke something during his massive changes I don't
know what it could be.  Granted, this wouldn't be the first time he
accidentally broke something in the business code.

I'll try to take a look at it later today to verify the code.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list