Commit Graph

34 Commits

Author SHA1 Message Date
Robert Fewell
59d95a4ce6 Bug 798545 - Crash when updating document link on vendor bill
There were two issues here, the first one was that the copied doclink
was pointing to the original doclink which lead to a double-free. The
second is the setting of the doclink on the copied invoice needs to be
done with gncInvoiceSetDocLink otherwise on closure the doclink value
will disappear.
2022-11-24 11:16:01 +00:00
John Ralls
ce2b89fd8c [business]Add diagnostic messages to GncEntry and GncInvoice. 2022-03-05 18:18:13 -08:00
Christopher Lam
ac2afc7e13 [gncInvoice.c] GValue string must be unset 2021-08-29 15:38:16 +08:00
Simon Arlott
320df7e409
Use const return values for string cache
This is a prerequisite for being able to return "" (which is const) and
none of the returned values should ever be modified.
2021-07-11 18:54:49 +01:00
Christopher Lam
1824a30bd0 [gncinvoice] g_value_unset 2021-06-05 00:21:52 +08:00
Christopher Lam
c5585ebe2c [gncInvoice] free GList* 2021-06-02 22:04:52 +08:00
luz paz
16b4976381 Fix typos in libgnucash/
Found via `codespell -q 3 -L ans,ba,parm,parms,numer`
2021-03-02 01:15:32 +01:00
Robert Fewell
7c1026783b Change the document link KVP symbol to original name
To maintain compatibility with any existing document link entries the
old 'assoc-head' and 'asooc_uri' entries will be used for the gsetting
and KVP entries.
2020-09-13 11:01:37 +01:00
John Ralls
db626de68a Rename all Transaction and Invoice Association identifiers to DocLink.
To better reflect the purpose and for consistency with other software
(e.g. Libre Office).
2020-09-11 11:34:32 -07:00
Robert Fewell
2f9be87549 Replace tabs with spaces in gncInvoice.c/h
Replace tabs with spaces, trim ending spaces and add spaces to function
calls where appropriate.
2020-05-28 17:25:41 +01:00
Robert Fewell
69aeacb621 Add KVP Association property to GncInvoice 2020-05-28 17:25:41 +01:00
Christopher Lam
09a8bee5c0 Merge branch 'speedup-aging' #638 2020-05-14 20:30:08 +08:00
John Ralls
b4177bc60a Fix transaction post_date being set to midnight local.
Reported for Invoices on gnucash-user. Checked all other uses of
xaccTransSetPostDateSecs(), fixed the ones that weren't passing an
already normalized time64. For Invoices change the post_date to also be
normalized so that it stays the same as the transaction post_date. That
also protects it from the displayed date changing depending on timezone.

The python binding invoice post_time test had to be changed to match.
2020-04-30 12:09:22 -07:00
Christopher Lam
a3dae3bd4d [gnc-lot.c] speed up gncInvoiceGetInvoiceFromLot by caching invoice 2020-04-30 23:56:26 +08:00
John Ralls
bf55c30aeb Fix most of the unused assignment errors from static analysis.
There are a very few left that need deeper study, but this gets
rid of most of the noise. For the most part it's just getting rid of
extra variables or removing an assignment that is always
replaced later but before any reads of the variable. A few are
discarded result variables.
2018-11-30 15:08:41 +09:00
Geert Janssens
3991ccb9c2 Cache current owner balances
These are queried continuously by the owner tree view (on Customer/Vendor/Employee
Overview pages) and recalculating them is an expensive operation.
The cache will be invalidated each time a lot reated to the owner
changes (modify or delete). The net effect is a huge responsiveness
improvement of said overviews in case of a large book.
2018-09-23 16:00:41 +02:00
Geert Janssens
3634e8f59d Fix memory leak using qof_instance_get on a GncGUID
The underlying boxed type will return a copy so we should free this
when no longer needed.
2018-09-09 22:50:05 +02:00
John Ralls
92a8cf330a Timespec->time64 in business code. 2018-08-13 11:52:42 -07:00
John Ralls
6f89bd62b3 Remove timespec from gnucash/gnome.
With a little API bleed into engine.
2018-08-12 16:12:19 -07:00
Geert Janssens
d87fa3a5be Bug 796766 - Credit note creating 'imbalance' with wrong entries
Add fix and regression test.
2018-08-06 13:29:12 +02:00
John Ralls
756f444ac3 Update bug tracker URL
Change all instances of bugzilla.gnome.org to bugs.gnucash.org, reflecting
our migration to a self-hosted bug tracker.

Inform the Translation Project Coordinator at release that this affects
translatable strings and that all message catalogs have been updated.
2018-07-13 09:49:33 -07:00
Geert Janssens
fcabf6bb96 A more detailed revision of gncEntry and gncInvoice related rounding
First change is to ensure gncEntry rounding is consistent. Internally
calculated values in the entry are never rounded. Consumers of
gncEntry's calculated values can request them either rounded or not.

Next use a pragmatical approach for calculating values on invoices based on
the entry values: do the rounding such that we never
create an unbalanced transaction while posting
That means
- round each entry's net value before summing them in net total
- accumulate all tax totals on invoice level per tax account before rounding
  and round before before summing them in a global tax total

Hopefully this will catch a few more rounding issues in this area.

A complete solution can only offered if we allow users to manually correct
tax entries. This requires changes to user interface and data format
so that's not going to happen in gnucash 3.x.
2018-05-24 18:53:15 +02:00
Geert Janssens
4aadfbe636 Bug 795040 - GnuCash crashes when searching for a newly created bill 2018-04-26 23:06:35 +02:00
Geert Janssens
dcfc1280bd Base invoice posted status on the presence of a posted transaction rather than a posted account
Bills and invoices that are posted and subsequently unposted again still store their
posted account internally as a convenience to the user (upon reposting the old
account will be offered by default) so it's not a reliable test for the posted state.
The posted transaction on the other hand is guaranteed to only exist when the invoice is
posted. This should fix a slew of small and perhaps larger side effects, such as
a posted bill still appearing as editable, critical warnings when creating new bills/invoices
and so on.
2018-04-14 18:46:26 +02:00
Christopher Lam
f910d931f7 gncInvoice: complete removal gncInvoiceDateExists 2018-03-31 05:35:49 +08:00
Christopher Lam
b99dee1736 Replace gncInvoiceDateExists to gncInvoiceIsPosted
This commit partially reverts commit 862956a760 which exported
gncInvoiceDateExists. Remove this API and use gncInvoiceIsPosted
instead.
2018-03-31 05:35:49 +08:00
John Ralls
a23f103ebb Bug 794730 - SIGSEGV when entering an exchange rate, Part 2
91f4b19 changed the test for gncInvoiceDateExists from date != 0
to date != INT64_MAX, which isn't backwards compatible, so test
for both. But the submitted file had a posted date of -1 so
gncInvoiceIsPosted returned true anyway. That's not consistent with
the logic in dialog-invoice.c, which checked gncInvoicePostedAcc != NULL,
a better test. The result was that the "Post" button lit up but
gncInvoicePost returned immediately, doing nothing, so change
gncInvoiceIsPosted to use gncInvoicePostedAcc instead.
2018-03-30 11:19:51 -07:00
Christopher Lam
862956a760 BUGFIX: invoice posted-date is no longer 0 for unposted invoices
This commit fixes business reports caused by 91f4b19039
whereby the posted-date for unposted invoice was changed
from 0 to MAXINT. Now we need to use (gncInvoiceIsPosted)
or (gncInvoiceDateExists) instead.
2018-01-30 19:29:04 +08:00
John Ralls
91f4b19039 Convert python bindings from timespec to time64. 2018-01-20 12:35:04 -08:00
lmat
9a86dd222b gncInvoice uses time64 2018-01-08 13:01:29 +11:00
lmat
dbd1473730 Adding time64 alternatives 2018-01-08 13:01:29 +11:00
lmat
805549ba24 Rename qofinstance function
This function was supposed to be renamed a while back. I had named it
this way for debugging purposes.
2017-12-21 07:39:33 -05:00
lmat
9d7ec35ce5 Removed qof_instance_set_kvp, qof_instance_get_kvp
And replaced them with versions that take lists of key path elements.
This is in an effort to eliminate the parsing of kvp keys.
2017-12-21 07:39:32 -05:00
Geert Janssens
83d14e1c1c Restructure the src directory
It is split into
- /libgnucash (for the non-gui bits)
- /gnucash (for the gui)
- /common (misc source files used by both)
- /bindings (currently only holds python bindings)

This is the first step in restructuring the code. It will need much
more fine tuning later on.
2017-08-10 18:45:00 +02:00