[GNC-dev] Fetching invoice tax list and general business information in python

2022-10-12 Thread Tim van Osch
Hey everyone,

I would like to render my invoice using the python bindings but I am having
two issues.

The main issue I am having is getting the tax values of an invoice per tax
table. Something like this:
*VAT 21%  *€152.00
*VAT 6%*€23.00
I found the method: Invoice.GetTotalTaxList() which is expected to return
an AccountValueList. Unfortunately in the python bindings it returns a list
of _gnc_monetary, which I think is a wrong/incomplete typing.
Does anyone know how I can fetch the tax values per table for an invoice in
Python?

The second issue is retrieving the "general" information about my business
(name, address, tax number, etc). I think the term for this data is slots.
So the question is, how/can I read slots through the python bindings?

Thank you.

Sincerely,
Tim van Osch.
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Fetching invoice tax list and general business information in python

2022-10-12 Thread Michael or Penny Novack

On 10/12/2022 6:41 AM, Tim van Osch wrote:

Hey everyone,

I would like to render my invoice using the python bindings but I am having
two issues.

The main issue I am having is getting the tax values of an invoice per tax
table. Something like this:
*VAT 21%  *€152.00
*VAT 6%*€23.00
I found the method: Invoice.GetTotalTaxList() which is expected to return
an AccountValueList. Unfortunately in the python bindings it returns a list
of _gnc_monetary, which I think is a wrong/incomplete typing.
Does anyone know how I can fetch the tax values per table for an invoice in
Python?


Just a reminder.

Those that want/ask for something like this are almost always in a 
jurisdiction where it is a relatively simple problem. In other words, 
they do not recognize they are a "special case" of a "figure the tax" 
problem where the general case is FAR more complicated, Where it would 
require a "system"/function to compute the applicable sales tax (VAT is 
a form of "sales tax".


In the general case, the "compute the tax" process has to deal with 
multiple tax tables (one for each jurisdiction claiming sales tax) and 
that also needing to take into account what is or is not "taxable" in 
that jurisdiction. Over here we have 50 states plus some local 
jurisdiction also wanting sales tax and which applies is not necessarily 
based on where the business is located. If the sale is remote, that will 
depend on the customer location.


USUALLY these calculations are done by a POS system which feeds the 
accounting package, not as part of the accounting package. Why "point of 
sales" should be obvious when you recognize that sales AT a "brick and 
mortar" store will depend on where (the "point of"). Thus a small 
business with three buildings, one in Greenfield MA, one in Brattleboro 
VT, and one in Keene NH (these would all fit in a 40 mile circle) could 
be the same POS software with the program in one place "follow MA 
rules", one "follow VT rules", one "follow NH rules" << the program is 
told where its "point" is >> but if say one of those stores is also 
handling remote sales that "point" changes with each sale << according 
to where the customer/delivery is >>


NOTE: POS systems usually also feed the inventory system so the sale 
results in reduction of physical inventory


Gnucash is JUST an accounting package, the "general ledger" part of a 
complete business system, which might include POS, inventory, payroll, 
billable hours, etc.


Michael D Novack

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Flatpak GnuCash and Finance::Quote

2022-10-12 Thread Bruce Schuck

Geert,

One additional note. In the README for gnucash-on-flatpak, you or some 
one else notes about the flatpak-cpan-generator.pl script:


"Note I have found the script to be not very version control friendly: 
generated-sources.json will change a lot between runs. It will have the 
exact same sources and dependencies, but they are shuffled around. 
Experiments indicate this is already due to the way cpanminus handles 
dependency resolution. The order in which same-level dependencies are 
processed is not stable. A minor annoyance I can live with for now."


May I suggest using the 'jq' tool.

The command "cat generated-sources.json | jq -S 'sort_by(.dest)'" will 
sort both the keys in each section (you will notice that the raw file 
may contain one module's data listed as url, dest, type, sha256; then 
the next as dest, type, sha256, url) and order the modules 
alphabetically in the output (I have not yet figured an easy way to 
ignore case).


When building a test flatpak on Ubuntu 22.04 I had to change the 
build-command in modules/perl.json to "perl-libs/install.sh" from 
"install.sh".


- Bruce S.
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel