Commit Graph

26749 Commits

Author SHA1 Message Date
John Ralls
31d45fc586 Merge branch 'maint' 2023-02-05 09:18:00 -08:00
Christopher Lam
9c87585d4e Bug 798747 - Crash in Investment Portfolio report
add support for pricedb-before in portfolio reports
2023-02-05 22:19:36 +08:00
Robert Fewell
6946d2197b Change default invoice report dialog
If selected default invoice report is missing, hide the timeout and
wait for user selection.
2023-02-05 10:56:50 +00:00
Robert Fewell
45a07463fb Change max timeout to 20 seconds for default invoice report 2023-02-05 10:21:56 +00:00
Christopher Lam
68cd8cfa2c [portfolio] remove unused the_price 2023-02-05 17:24:49 +08:00
Christopher Lam
85c2491664 Merge branch 'maint' 2023-02-05 12:09:38 +08:00
John Ralls
928f4f6232 Fix test error from replacing guile * form. 2023-02-04 14:12:35 -08:00
Geert Janssens
60209a766f Merge branch 'csv_import' 2023-02-04 19:13:16 +01:00
Geert Janssens
89944ba054 Bug 796955 - Import CSV - Single-line two-currency transactions can't be imported - follow up
This second commit implements the suggestion from
that bug to add a 'Transfer Amount' column type to
the importer to avoid rounding errors that could
happen with exchange rates.
2023-02-04 19:11:54 +01:00
Geert Janssens
2d8bb6f62f Bug 796955 - Import CSV - Single-line two-currency transactions can't be imported
Behaviour is as follows:
If
  single line provides a price
And
  at some point in the import process we get into a
  situation where the base account and transfer
  account have a different commodity
Then
  transfer_acct amount = base_acct amount * price

If on the other hand base_acct and transfer_acct turn
out to have the same commodity, price is ignored.
2023-02-04 18:56:02 +01:00
John Ralls
1c09adec87 Use gnc_numeric_multiply instead of Guile's * form for computing prices.
Partly fixes bug 798550 (https://bugs.gnucash.org/show_bug.cgi?id=798550)

Guile's * form when applied to rationals doesn't reduce and since
guile uses gmp for unlimited precision arithmetic produces numbers
that can't be passed back to C functions because they're too big for
any normal C integer types.
2023-02-04 09:43:56 -08:00
Geert Janssens
56d16f4f0f Some cleanups in import-acount-matcher.c
- Remove unused member variables from AccountPickerDialog struct
- Rename boolean function parameter to better describe what it represents
- Simplify a few constructs and condidionals
- remove unused constructor

Kept separate from actual logic changes
2023-02-04 16:53:20 +01:00
Geert Janssens
99506d331a Reduce GncImportMatchMap to just the account
There is no added value in storing the book and account together
The book is easily retrieved from the account (as was
illustrated in the gnc_account_imap_new function).

I looked through the commit history to understand why this struct
was originally created and a long time ago it also had
a reference to a kvp frame.
2023-02-04 16:53:20 +01:00
Geert Janssens
376f0bfae9 Convert import-backend.c to cpp
Allows even more concise code.
2023-02-04 16:53:20 +01:00
Geert Janssens
2e573d9ccd Some cleanups in the import backend code
Improve readability
Simplify a few constructs
2023-02-04 16:52:53 +01:00
Geert Janssens
61817fdc44 Import matcher - filter open transactions early
Open transactions in the context of the importer represent
freshly downloaded transactions. They can't possibly be
valid matches. Filtering them out early is a minor performance
optimization. For large imports it avoids having to traverse
a long list of splits multiple times.
2023-02-04 16:52:53 +01:00
Geert Janssens
3f51775570 Enable import of tranfser split reconcile state and date 2023-02-04 16:52:53 +01:00
Geert Janssens
1c2c184e2e CsvTxImp - rename 'Deposit' and 'Withdrawal' columns
Multiple reasons:
- they only have meaning in bank or cash contexts, but the importer is meant
  to be more generic.
- 'Withdrawal' is misleading in that the code behind it caters very
  generically for cases where values should be negated before being
  used. A 'Withdrawal' is only a single use case of this behaviour.

New names are 'Amount' (iso 'Deposit')
and 'Amount (Negated)' (iso 'Withdrawal')
2023-02-04 16:52:53 +01:00
Geert Janssens
4e6637e67e Bug 798292 - csv Import Transactions Ignores Multi-Splits
This requires GncPreTrans objects to be aware of the multi_split
preference to be able to estimate whether empty date or
description fields should be flagged as error or not.
2023-02-04 16:43:47 +01:00
Geert Janssens
7670068778 CSV Import - rewrite update_pre_trans/split_props
These two functions are always called together and the
flow is more efficient and easier to understand if
they are merged into one function.
2023-02-04 16:43:47 +01:00
Geert Janssens
7fa4966e57 Bug 797756 - Currency format setting is ignored 2023-02-04 16:43:47 +01:00
Geert Janssens
1ce5ace25f Bug 794028 - CSV import, default to matching full account name
If the account map doesn't yield a result, try to map
the import string against existing accounts' full names
2023-02-04 16:43:46 +01:00
Geert Janssens
51706f289c Minor corrections in comments 2023-02-04 16:43:46 +01:00
John Ralls
f54927d9cf [c++options] Parent account types must be included in the types list
Or the selection routine can't show the descendants you want.
2023-02-03 16:42:12 -08:00
John Ralls
730d8bd730 [c++ options] Don't crash if the option doesn't have a UI item.
Return quietly if it's an internal option and noisily if not.
2023-02-03 16:42:12 -08:00
John Ralls
a5d503071b Bug 798739 - Advanced Portfolio report fails
If the retrieved type is too big it over-runs the avi.include_type
array and corrupts the next node's next pointer.
2023-02-03 16:41:23 -08:00
John Ralls
7bb14b9caa Merge Richard Cohen's 'use-reference-for-loop' into master 2023-02-02 14:32:14 -08:00
John Ralls
d4d5f26970 Merge Richard Cohen's 'build-cleanup' into master 2023-02-02 14:21:27 -08:00
John Ralls
f8fe461cdf Merge Richard Cohen's 'replace-deprecated-gtk' into master 2023-02-02 14:19:37 -08:00
John Ralls
12db8eaaf2 Merge Bob Fewell's 'bug753307master' into master. 2023-02-02 13:58:26 -08:00
Robert Fewell
cbf39074c2 Remove the old preference setting for default invoice report
Remove preference setting and set the schema to be depreciated in
version 5000 and removed in version 6000.
2023-02-02 14:05:53 +00:00
Robert Fewell
07f3f536cc Allow to select saved report on print invoice button
This change was inspired by mildred's #PR1247 and uses the new
GncReportCombo to allow selection of 'Saved Invoice reports' when the
invoice print button is used or when printing multiple invoices.

This change presents a dialog with the default for the report combo set
to the properties setting. This dialog has a timeout which is
adjustable under properties and will stop if a key is pressed or combo
popped so that a different report template can be selected and used.
There is also an 'OK' button that stops the time out and prints and a
'Cancel' button which cancels the print.
2023-02-02 14:05:53 +00:00
Robert Fewell
b41e491ec5 Modify proposed code to use new GncReportCombo widget. 2023-02-02 14:05:46 +00:00
Robert Fewell
b49b5c86bb Create a new widget GncReportCombo to list reports
This widget will provide a combo and populate a model with guids, names
and a warning value that controls the visibility of a warning image.
2023-02-02 14:04:50 +00:00
Robert Fewell
019214f1c2 Bug753307 - Custom Report be selectable as default Report for Printing
This commit changes the preference in Business->'Report for Printing'
to be saved as a book property and allow the selection of any Invoice
Report to be used as the default.
2023-02-01 16:29:11 +00:00
Richard Cohen
d91d270a76 Replace deprecated (since 2.38) g_simple_action_group_lookup
with g_action_map_lookup_action
2023-01-31 17:53:11 +00:00
Richard Cohen
e3515185d3 Make the cmake command lowercase 2023-01-31 16:25:12 +00:00
Richard Cohen
351990cf47 Remove unused GNOME cmake flags
There are no longer any Gnome dependencies
2023-01-31 16:25:03 +00:00
Richard Cohen
dbdb5cb9d1 Remove unused GNUCASH_LATEST_STABLE_SERIES 2023-01-31 16:16:48 +00:00
Richard Cohen
d8f45f2443 Use const references for for-loops to avoid unnecessary copies
Found by clazy - clazy-range-loop-reference
2023-01-31 14:44:57 +00:00
Robert Fewell
63f8e73142 Fix sensitivity of invoice toolbar buttons
In gnc_plugin_page_invoice_update_menus change the location of saving
the is_posted and can_post values and remove saving of is_readonly.
2023-01-31 13:37:20 +00:00
Robert Fewell
30d2b97252 Fix toolbar Print action for invoices 2023-01-31 13:24:00 +00:00
John Ralls
ce3447e6ea Bug 798740 - Build fails with gcc 13
Protect against passing an lseek failure rv to read().
2023-01-30 16:48:16 -08:00
Robert Fewell
2fc63d6244 Fix horizontal alignment of options labels to be GTK_ALIGN_END 2023-01-30 15:05:43 +00:00
Geert Janssens
ea95580b42 Merge branch 'maint' 2023-01-30 14:26:05 +01:00
Geert Janssens
8a167d186b Payment dialog - always list all possible post accounts
Before only the post account in the currency of the selected
vendor or customer was available.

This was reported in bug 797487n comment 17.
2023-01-30 13:48:19 +01:00
Geert Janssens
849aea31ef Bug 797477 - Manual foreign transaction from APAR to another doesn't trigger price input 2023-01-30 12:07:39 +01:00
Christopher Lam
119356752f Merge branch 'maint' 2023-01-30 09:56:13 +08:00
Geert Janssens
5bbfb8efd4 Add proper indent to scheme changes from previous commit
Committed seperately to make it easier to look at the actual changes.
This commit only adds a 2 space indent to one function body.
2023-01-29 23:11:49 +01:00
Geert Janssens
34ed91eac9 Bug 798734 - Aging Reports don't handle mixed currency payments and invoices without Trading Accounts
Revisit the fix. It still made assumptions about the way
payment transactions were created. It can now handle
payment transaction either in the payment account
currency or in the post account currency.
2023-01-29 23:09:06 +01:00