Commit Graph

28154 Commits

Author SHA1 Message Date
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
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
John Ralls
89360252fb Bug 798983 - Empty Orphan account appears after entering transactions in 5.3
Caused by trying to set the account on the blank split. The blank split
was present because the method used to clear the split list for the
receiving transaction in gnc_float_txn_to_txn_swap_accounts only removed
splits that belong to the transaction, and the blank split doesn't.

Adds new function xaccTransClearSplits to do a more thorough job.
Also improve the documentation for xaccSplitDestroy to better explain when
a transaction will be destroyed if it empties the split list.

 # Please enter the commit message for your
changes. Lines starting
2023-09-08 15:08:44 -07:00
Christopher Lam
76ac345edb Merge branch 'GNCAccountSel-default-commodity' into stable #1762 2023-09-08 17:24:44 +08:00
Andrea Andre
9d12874cec
Translation update by Andrea Andre <andrea.tsg19@slmail.me> using Weblate
po/ro.po: 48.6% (2689 of 5524 strings; 1752 fuzzy)
662 failing checks (11.9%)
Translation: GnuCash/Program (Romanian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ro/

Co-authored-by: Andrea Andre <andrea.tsg19@slmail.me>
2023-09-07 21:55:29 +02:00
Christopher Lam
492f8c927c [dialog-account] remove gnc_ui_new_accounts_from_name_window_with_types 2023-09-07 23:41:47 +08:00
Christopher Lam
c1bc9e17c6 [gncEntryLedger] don't use gnc_ui_new_accounts_from_name_window_with_types
use gnc_ui_new_accounts_from_name_with_defaults instead
2023-09-07 23:41:47 +08:00
Christopher Lam
58d5d4bc73 [gnc-account-sel] can specify any new account's default commodity 2023-09-07 23:41:47 +08:00
Christopher Lam
af371af172 [dialog-account] new: gnc_ui_new_account_with_types_and_commodity
same as gnc_ui_new_account_with_types but can specify new account's
default commodity
2023-09-07 23:41:42 +08:00
John Ralls
4206300dce Bug 799075 - Saving display tab changes in Report Options does not work.
When altering a library report option change the default value, not
the value so that the option system recognizes user changes correctly.
2023-09-05 16:42:48 -07:00
Zdenko Podobný
4ffe1082c1
Translation update by Zdenko Podobný <zdenop@gmail.com> using Weblate
po/sk.po: 51.0% (2818 of 5524 strings; 1404 fuzzy)
530 failing checks (9.5%)
Translation: GnuCash/Program (Slovak)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/sk/

Co-authored-by: Zdenko Podobný <zdenop@gmail.com>
2023-09-04 20:52:25 +02:00
Szia Tomi
09664063c4
Translation update by Szia Tomi <sziatomi01@gmail.com> using Weblate
po/glossary/hu.po: 100.0% (216 of 216 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/hu/

Translation update  by Szia Tomi <sziatomi01@gmail.com> using Weblate

po/hu.po: 69.4% (3837 of 5524 strings; 635 fuzzy)
1 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Co-authored-by: Szia Tomi <sziatomi01@gmail.com>
2023-09-04 20:52:24 +02:00
Andrea Andre
47589c43e1
Translation update by Andrea Andre <andrea.tsg19@slmail.me> using Weblate
po/ro.po: 48.6% (2688 of 5524 strings; 1779 fuzzy)
681 failing checks (12.3%)
Translation: GnuCash/Program (Romanian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ro/

Translation update  by Andrea Andre <andrea.tsg19@slmail.me> using Weblate

po/ro.po: 48.6% (2685 of 5524 strings; 1804 fuzzy)
701 failing checks (12.6%)
Translation: GnuCash/Program (Romanian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ro/

Translation update  by Andrea Andre <andrea.tsg19@slmail.me> using Weblate

po/ro.po: 48.5% (2681 of 5524 strings; 1837 fuzzy)
714 failing checks (12.9%)
Translation: GnuCash/Program (Romanian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ro/

Co-authored-by: Andrea Andre <andrea.tsg19@slmail.me>
2023-09-04 20:52:24 +02:00
Andrea Andre
73d9bf73dc
Translation update by Andrea Andre <andrea.tsg19@slmail.me> using Weblate
po/ro.po: 48.5% (2683 of 5524 strings; 1897 fuzzy)
726 failing checks (13.1%)
Translation: GnuCash/Program (Romanian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ro/

Co-authored-by: Andrea Andre <andrea.tsg19@slmail.me>
2023-09-02 20:56:03 +02:00
Jeremy White
f10948d21d Remove reference to unused assistant subfield.
This did not cause trouble because the only use of this
was in a call to gnc_warning_dialog, which protects against
a NULL pointer.
2023-08-29 16:49:35 -05:00
Christopher Lam
7ce4198c20 rename string_to_gnc_numeric to gnc_numeric_from_string 2023-08-29 08:45:20 +08:00
Christopher Lam
75f6ee1817 [test-scm-engine] tests gnc-numeric-from-string 2023-08-29 08:30:52 +08:00
Christopher Lam
c45b9736ab [gnc-numeric.cpp] parse integer + fraction; e.g."10 1/4" == 10.25 2023-08-29 08:30:30 +08:00
Christopher Lam
9802c80996 Bug 799069 - Multicurrency Invoice Payment
Don't use TransGetCurrency/SplitValue to show payment details. They
may convert to the user's home currency. Use SplitAccount's and
SplitAmount to show the payment details in the APAR currency.
2023-08-28 13:00:11 +08:00
Christopher Lam
eb2dd3ef0e [csv-transaction-export.cpp] Refactor export into export_query_splits
account_splits handles XML_EXPORT_TRANS.
2023-08-26 20:29:18 +08:00
Christopher Lam
8fe9dc9845 Bug 799068 - csv export active register not working
XML_EXPORT_TRANS uses info->csva.account_list. XML_EXPORT_REGISTER
doesn't use an account list, and uses the register QofQuery
instead. Call account_splits once with a nullptr account.
2023-08-25 00:16:07 +08:00
Dimitris Mandalidis
3d1e11545a
Translation update by Dimitris Mandalidis <dimitris.mandalidis@gmail.com> using Weblate
po/el.po: 52.4% (2897 of 5524 strings; 1563 fuzzy)
546 failing checks (9.8%)
Translation: GnuCash/Program (Greek)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/el/

Translation update  by Dimitris Mandalidis <dimitris.mandalidis@gmail.com> using Weblate

po/el.po: 52.2% (2887 of 5524 strings; 1563 fuzzy)
546 failing checks (9.8%)
Translation: GnuCash/Program (Greek)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/el/

Co-authored-by: Dimitris Mandalidis <dimitris.mandalidis@gmail.com>
2023-08-23 18:54:23 +02:00
Christopher Lam
bd2d3182d1 Revert "[gnc-tree-container.hpp] define GncTreeContainer" 2023-08-23 18:08:52 +08:00
Christopher Lam
737efe4c49 Revert "[assistant-csv-trans-import.cpp] uses GtkTreeModelContainer"
This reverts commit bea6b52d3f.
2023-08-23 18:05:35 +08:00
Christopher Lam
bd7e4cbf9f Revert "[assistant-csv-price-import.cpp] uses GtkTreeModelContainer"
This reverts commit f10d7a7c8e.
2023-08-23 18:05:35 +08:00