[GNC] Have code run when a new invoice is posted.

Jediator jediator at artemisspace.com
Sun Sep 24 17:29:10 EDT 2023


I am facing the same problem.  My solution is to leverage the Import 
Invoices/Bills function in GC (using version 5.3 now) and transfer the 
invoices and bills in CSV to GC.  It may require some manual steps, but 
it should be easy to create a python script to generate your invoices 
and bills in CSV automatically.

GC's Python binding is nowhere documented except looking at the source 
code on github, as far as I knew.  The bindings are not too complicated 
to comprehend, but you still need invest sometime to dig through and try 
them out.  Not really an option for average users. Hope this helps.

Cheers!  -- JC

On 9/24/23 10:55 AM, flynth at gmail.com wrote:
> Hi,
>
> I started using gnucash 2 months ago and I'm currently using it in
> parallel with another accounting software. In general gnucash does what I
> want (VAT accounting, accrual accounting of other taxes). However,
> currently when I post an invoice I also have to post a bill for some
> percentage of its net value as my income tax (I'm in a scheme where
> income tax is just a percentage of income, no expenses are taken into
> account etc). I'm looking for some method to automate this.
>
> Ideally I'd love to be able to run some code (guile/python) when a new
> invoice is posted. That code could then create and post a bill to be paid
> before the 20th of next month for the taxman.
>
> Another option is, to create a bill every month on the 1st, to be paid next
> month on the 20th and the amount to be a percentage of net value of sales
> invoiced this month.
>
> I don't know if any of this is possible in gnucash. I know about the
> offline python and scheme APIs (offline as it can manipulate the accounts
> when gnucash is not). I could write a python script that runs with some
> regularity and creates/updates the income bills based on the invoices
> present, but this doesn't seem such a "nice" solution as to have some code
> run at the moment an invoice is posted, or have some formula in the bill
> value that takes into account this month's sales.
>
>   If anyone has an idea how to do the above, please let me know,
> Luk
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.



More information about the gnucash-user mailing list