[GNC] Have code run when a new invoice is posted.
Adrien Monteleone
adrien.monteleone at lusfiber.net
Mon Sep 25 16:19:11 EDT 2023
Scheduled transactions can likely do most of that work, but they can't
automatically fire based on some other event outside of the schedule.
If I'm not mistaken, there is an app listed on 'Using GnuCash' on the
wiki that can record and execute GUI clicks (along with other scripts)
like a really fancy Macro. That might be worth investigating.
Optionally, you'd have to set some type of watcher to detect when a new
invoice/bill appears in the data file which would then trigger your
script/macro.
Regards,
Adrien
On 9/24/23 9: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,
More information about the gnucash-user
mailing list