Commit Graph

28279 Commits

Author SHA1 Message Date
Jeremy White
7f420b53c0 Spelling fix: catagory -> category 2023-09-10 21:02:17 -05:00
Zdenko Podobný
c5a71f2464
Translation update by Zdenko Podobný <zdenop@gmail.com> using Weblate
po/sk.po: 57.8% (3195 of 5524 strings; 1103 fuzzy)
350 failing checks (6.3%)
Translation: GnuCash/Program (Slovak)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/sk/

Co-authored-by: Zdenko Podobný <zdenop@gmail.com>
2023-09-11 00:09:15 +02:00
John Ralls
e3d682c0e5 Merge Richard Cohen's 'fix-gnc-mktime' into stable. 2023-09-10 15:08:32 -07:00
John Ralls
8a91fa8deb Remove defective and fortunately unused typemap. 2023-09-10 15:06:46 -07:00
Richard Cohen
75f49aaec5 Valgrind: fix "definitely lost" memory in (gnc-mktime) - test-invoice-report-builtin-default
==158291== 6 bytes in 1 blocks are definitely lost in loss record 18 of 824
==158291==    at 0x4848C63: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==158291==    by 0x4A91473: scm_realloc (in /usr/lib/x86_64-linux-gnu/libguile-3.0.so.1.5.0)
==158291==    by 0x4AFF26B: scm_to_stringn (in /usr/lib/x86_64-linux-gnu/libguile-3.0.so.1.5.0)
==158291==    by 0x4CB473D: _wrap_gnc_mktime(scm_unused_struct*) (swig-engine.cpp:38703)
...
2023-09-10 14:54:30 -07:00
Richard Cohen
9fe19d6cf9 Move potentially unused "SCM zone" variable into the #ifdef 2023-09-10 14:54:30 -07:00
John Ralls
6c9d0dca2c Update github action package versions. 2023-09-10 14:48:51 -07:00
John Ralls
ab63595cc1 Merge James White's 'prices1' into stable. 2023-09-10 14:39:24 -07:00
Jeremy White
737e732e1c Fixup qif-imp price unit tests.
The expected results changed with commit 80f7e60f49.
At the same time, improve readability of test results by
assigning a tag and ordering expected vs actual correctly.
2023-09-10 14:13:04 -07:00
Jeremy White
34946c7461 Remove exceptions and use patterns in parse-price-line.
Also use a more standard numberic parser instead of an ad-hoc
string parser.

Code written by Christopher Lam.
2023-09-10 14:13:04 -07:00
Jeremy White
6bf062c738 Add a qif file with !Type:Prices transactions.
Including a few deliberate errors.
2023-09-10 14:13:04 -07:00
Jeremy White
dd429aaa0c Present warnings from the file load step.
The price import will now throw warnings if there are
invalid prices.  The previous logic would 'auto-next' in this
case, only holding if the parse-file phase threw warnings.

This change insures that these warnings are seen.
2023-09-10 14:13:04 -07:00
Jeremy White
06b6d60f5b Screen out price records with blank values.
Found a live Quicken record with an empty price.
2023-09-10 14:13:04 -07:00
Jeremy White
9cacaa72e8 Build the pruned list with cons, not append.
It is 10x faster against a large dataset.

Insight from Christopher Lam.
2023-09-10 14:13:04 -07:00
Jeremy White
af11a549e3 Implement support for !Type:Prices QIF records. 2023-09-10 14:12:55 -07:00
John Ralls
a8c20604ab Merge Bob Fewel's 'bug798990' into stable. 2023-09-10 12:22:38 -07:00
John Ralls
fcd054a257 Merge Bob Fewell's 'bug798995' into stable. 2023-09-10 11:59:02 -07:00
John Ralls
4dec95e642 Merge John Ralls's 'more-stock-assistant' into stable 2023-09-10 10:44:26 -07:00
John Ralls
a09228a83e [stock-txn-asst] Remove superflouos FieldMask::DISABLED tags
From the stock entry of stock split and reverse split templates. Since
there are other flags on the line the DISABLED flag isn't useful.
2023-09-10 10:40:54 -07:00
John Ralls
637522fed1 [stock-txn-asst] Don't report account missing if it's not required. 2023-09-10 10:40:54 -07:00
John Ralls
215a16a5e8 [stock-txn-asst] Add multicurrency note to introduction.
Warning the user that they're not supported.
2023-09-10 10:40:54 -07:00
John Ralls
e17345d4b6 [stock-txn-asst] Include a marker split in the stock account for divs. 2023-09-10 10:40:54 -07:00
John Ralls
94db524c60 [stokc-txn-asst] Add default currency to GncAccountSelector
Set the default currency to the transaction currency for creating
new accounts.
2023-09-10 10:40:12 -07:00
John Ralls
83ecabebce [stock-txn-asst] Remove unused method. 2023-09-10 10:32:49 -07:00
John Ralls
c03b57b8fb [stock-txn-asst] Doxygen documentation of classes.
And non-trivial functions.
2023-09-10 10:32:49 -07:00
John Ralls
fbf5ab8b47 [stock-txn-asst] Ensure correct memory management flow.
For the StockTransferController and GncGuiManager events.
2023-09-10 10:32:49 -07:00
John Ralls
4ff0ac383a [stock-txn-asst] Change structs to classes.
With private data members, replacing direct member access with
accessor functions and refactoring functionality away from the
Model, View, and Controller container classes to the classes
that own the members.

This removes the need for RTTI inspection as regular virtual
function dispatch accounts for differences in Entry classes.
2023-09-10 10:32:49 -07:00
John Ralls
58c4d5f0ca [stock-txn-asst] Variable-specific callbacks take an entry pointer.
Prerequisite for making class member variables private.
2023-09-10 10:32:49 -07:00
John Ralls
8a60a3cf0f [stock-txn-asst] model::calculate_price becomes entry::print_price
Replace multiple-responsibility function in the wrong class with a
single-responsibility function in the right class.

Changes the signature of a couple of PageStockValue functions.
2023-09-10 10:32:49 -07:00
John Ralls
2e1a8bc8a7 [stock-txn-asst] Separate setting the amount/value and validating it.
Setting happens via callbacks and they were handed direct access
to the member variables so the validation wasn't happening.
Validation also requires a logger and passing that to the callbacks
would be hard.
2023-09-10 10:32:49 -07:00
John Ralls
a31eefd673 [stock-txn-asst] Fix setting the initial focussed widget.
One can't grab the widget in prepare, the page runs its own focus so
one must handle the page's focus event.
2023-09-10 10:32:49 -07:00
John Ralls
c3f56e89e5 [stock-txn-asst] Handle correctly capitalizing fees. 2023-09-10 10:32:49 -07:00
John Ralls
acff356fec [stock-txn-asst] Set all the needed parameters for StockCGEntry.
So that it will create the split and do so with the right memo.
2023-09-10 10:32:49 -07:00
John Ralls
fe728708ce [stock-txn-asst] Move stock amount calculation to StockEntry.
It's StockEntry's responsibility not Model's. This lets us remove
the model parameter from PageStockAmount::prepare. It also requires
that we use StockEntry's set_amount method instead of just setting
m_amount it StockAssistantTest::instantiate_model.
2023-09-10 10:32:49 -07:00
John Ralls
176ff44128 [stock-txn-asst] Remove StockTransactionSplitInfo
With action a StockTransactionEntry member it's no longer useful.
2023-09-10 10:32:49 -07:00
John Ralls
35946c8e1c [stock-txn-asst] Make action a StockTransactionEntry member.
Instead of a function paramter that's set and translated
inconsistently.
2023-09-10 10:32:48 -07:00
John Ralls
eebf505548 [stock-txn-asst] Reformat explanation messages to remove long lines. 2023-09-10 10:32:39 -07:00
Luna Jernberg
ccd6d5ccf4
Translation update by Luna Jernberg <droidbittin@gmail.com> using Weblate
po/sv.po: 100.0% (5524 of 5524 strings; 0 fuzzy)
2 failing checks (0.1%)
Translation: GnuCash/Program (Swedish)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/sv/

Co-authored-by: Luna Jernberg <droidbittin@gmail.com>
2023-09-09 08:39:34 +02:00
Zdenko Podobný
d5f3cf5734
Translation update by Zdenko Podobný <zdenop@gmail.com> using Weblate
po/sk.po: 56.3% (3114 of 5524 strings; 1161 fuzzy)
374 failing checks (6.7%)
Translation: GnuCash/Program (Slovak)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/sk/

Translation update  by Zdenko Podobný <zdenop@gmail.com> using Weblate

po/sk.po: 55.6% (3075 of 5524 strings; 1200 fuzzy)
413 failing checks (7.4%)
Translation: GnuCash/Program (Slovak)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/sk/

Translation update  by Zdenko Podobný <zdenop@gmail.com> using Weblate

po/glossary/sk.po: 83.3% (180 of 216 strings; 17 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Slovak)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/sk/

Translation update  by Zdenko Podobný <zdenop@gmail.com> using Weblate

po/sk.po: 54.4% (3009 of 5524 strings; 1265 fuzzy)
487 failing checks (8.8%)
Translation: GnuCash/Program (Slovak)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/sk/

Translation update  by Zdenko Podobný <zdenop@gmail.com> using Weblate

po/glossary/sk.po: 82.8% (179 of 216 strings; 17 fuzzy)
6 failing checks (2.7%)
Translation: GnuCash/Glossary (Slovak)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/sk/

Co-authored-by: Zdenko Podobný <zdenop@gmail.com>
2023-09-09 08:39:34 +02:00
Christopher Lam
7aa283fbab [gnc-account-sel.c] shortcut checks for account visibility 2023-09-09 14:38:42 +08:00
John Ralls
b5e5a0ed2f [stock-txn-asst] Add notes about cash-in-lieu and capgains.
Cash in lieu must be reported as a separate transaction. There was
already a note about that in reverse splits, apply it to regular
splits.

Add suggestion to enter a placeholder number when one can't
immediately calculate the capital gain on a sale or cover buy.
2023-09-08 16:05:03 -07:00
John Ralls
a2bd020b13 [stock-txn-asst] Call gettext on the transaction type explanation. 2023-09-08 16:05:03 -07:00
John Ralls
814754891f [stock-txn-asst] Don't generate stock splitinfo if no stock split. 2023-09-08 16:05:03 -07:00
John Ralls
fc4f4ae6d7 Bug 799054 - Stock Assist not functioning
* Get the sign right when calculating new shares
* Fix displaying values and units on the summary page
* Don't display "missing" for values when the user skips
  entering a 0 value.
* Create the Stock-account's fees split (when capitalizing)
  and cap-gains split.
2023-09-08 16:05:03 -07:00
John Ralls
c284f96286 [asst-stock-txn] Fix typo. 2023-09-08 16:05:03 -07:00
John Ralls
917b4b247c [stock-txn-asst] Fix sell-side stock amounts.
It was setting a negative amount in one too many places.
2023-09-08 16:05:03 -07:00
John Ralls
502dcc03ce [stock-txn-asst] Extract Logger class 2023-09-08 16:05:03 -07:00
John Ralls
e46195cba7 [stock-txn-asst] Move prepare details into Assistant Page member funcs.
Substantially simplifies the code by reducing the needed indirection.
In most cases the StockTransactionEntry has everything the page needs
and can be passed as a parameter, further simplifying the code.
2023-09-08 16:05:03 -07:00
John Ralls
4c916ada22 Make connect_signals and prepare StockAssistantController members. 2023-09-08 16:05:03 -07:00
John Ralls
30b41544ce Make StockAssistantController's view member in-place instead of a unique_ptr.
Requires moving some parameters around so we can initialize it
correctly:
All of the view's pages need to take an Account* and get its commodity
or currency in their ctors, and creation of the builder has to move to
gnc_stock_transaction_assistant and get passed in.
2023-09-08 16:05:03 -07:00