gnucash stable: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Mon Jun 12 18:05:57 EDT 2023
Updated via https://github.com/Gnucash/gnucash/commit/2e20b37d (commit)
via https://github.com/Gnucash/gnucash/commit/0d1ba1eb (commit)
via https://github.com/Gnucash/gnucash/commit/fb7c0328 (commit)
via https://github.com/Gnucash/gnucash/commit/7d26b8c0 (commit)
via https://github.com/Gnucash/gnucash/commit/d63248da (commit)
via https://github.com/Gnucash/gnucash/commit/7b1ad4ec (commit)
via https://github.com/Gnucash/gnucash/commit/6e5c525f (commit)
via https://github.com/Gnucash/gnucash/commit/df6c7756 (commit)
from https://github.com/Gnucash/gnucash/commit/770b5a4b (commit)
commit 2e20b37d0429e79a5346405956cbc5f82dbd0fd8
Merge: 0d1ba1ebe7 df6c775617
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jun 12 14:45:19 2023 -0700
Merge Paolo Maero's 'money-out' into stable.
commit 0d1ba1ebe7464cf4842aa92cf6c589bfb4d1e53d
Merge: fb7c0328bc 7d26b8c05f
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jun 12 14:44:11 2023 -0700
Merge Richard Cohen's 'y2038-fixes' into stable.
commit fb7c0328bce2eb3f067b355970a5cbca582c38e4
Merge: 770b5a4be9 7b1ad4ec19
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jun 12 14:43:09 2023 -0700
Merge Richard Cohen's 'remove-unused-osx_accel_map' into stable.
commit 7d26b8c05f63a8a8a62484979a3dd7ffab9e16b6
Author: Richard Cohen <richard at daijobu.co.uk>
Date: Tue Jun 6 15:42:28 2023 +0100
Fail the test if still using 32bit time_t in 2038
gtest-gnc-option.cpp and gtest-gnc-optiondb.cpp need to call
time() for g_date_set_time_t()
diff --git a/libgnucash/engine/test/gtest-gnc-option.cpp b/libgnucash/engine/test/gtest-gnc-option.cpp
index 29d6fee316..813820fb1e 100644
--- a/libgnucash/engine/test/gtest-gnc-option.cpp
+++ b/libgnucash/engine/test/gtest-gnc-option.cpp
@@ -941,6 +941,13 @@ TEST(GncOptionDate, test_gnc_relative_date_from_storage_string)
EXPECT_EQ(RelativeDatePeriod::END_ACCOUNTING_PERIOD, gnc_relative_date_from_storage_string("end-prev-fin-year"));
}
+TEST(GncOptionDate, test_not_using_32bit_time_t_in_2038)
+{
+ // tests below call time() to initialize GDate.
+ // make sure the tests fail if that could cause a problem
+ EXPECT_FALSE(sizeof (time_t) == 4 && time(nullptr) <= 0) << "Time to upgrade 32bit time_t!";
+}
+
TEST(GncOptionDate, test_gnc_relative_date_to_time64)
{
GDate date;
commit d63248dad2c3762ab67b1f0fc737660abb7c9098
Author: Richard Cohen <richard at daijobu.co.uk>
Date: Tue Jun 6 15:40:55 2023 +0100
Update Y2038 comments
diff --git a/libgnucash/engine/gnc-date.h b/libgnucash/engine/gnc-date.h
index 0b06af4a88..2193d0de10 100644
--- a/libgnucash/engine/gnc-date.h
+++ b/libgnucash/engine/gnc-date.h
@@ -29,10 +29,7 @@
Utility functions to handle date and time (adjusting, getting
the current date, printing the date and time, etc.)
- Overall, this file is quite a mess. Note, however, that other
- applications, besides just GnuCash, use this file. In particular,
- GnoTime (gttr.sourcefore.net) uses this file, and this file is
- formally a part of QOF (qof.sourceforge.net).
+ Overall, this file is quite a mess.
An important note about time-keeping: The general goal of any
program that works with numeric time values SHOULD BE to always
@@ -80,9 +77,12 @@ extern "C"
/**
- * Many systems, including Microsoft Windows and BSD-derived Unixes
- * like Darwin, are retaining the int-32 typedef for time_t. Since
- * this stops working in 2038, we define our own:
+ * Most systems that are currently maintained, including Microsoft Windows,
+ * BSD-derived Unixes and Linux, support 64-bit time_t even on 32-bit
+ * architectures. See https://en.wikipedia.org/wiki/Year_2038_problem
+ *
+ * For practical reasons -- as not all have made the transition to 64-bit --
+ * we define our own 64-bit time type.
*/
typedef gint64 time64;
/* A bit of a hack to create a type separate from the alias of int64_t so that
@@ -165,7 +165,7 @@ typedef enum
* These functions use boost::date_time internally.
*/
/** \brief fill out a time struct from a 64-bit time value.
- * \param secs: Seconds since 00:00:01 UTC 01 January 1970 (negative values
+ * \param secs: Seconds since 00:00:00 UTC 01 January 1970 (negative values
* are seconds before that moment).
* \return A struct tm*, allocated on the heap. Must be freed with gnc_tm_free().
* The time is adjusted for the current local time zone.
@@ -173,7 +173,7 @@ typedef enum
struct tm* gnc_localtime (const time64 *secs);
/** \brief fill out a time struct from a 64-bit time value adjusted for the current time zone.
- * \param secs: Seconds since 00:00:01 UTC 01 January 1970 (negative values
+ * \param secs: Seconds since 00:00:00 UTC 01 January 1970 (negative values
* are seconds before that moment)
* \param time: A struct tm* for the function to fill.
* The time is adjusted for the current local time zone.
@@ -181,7 +181,7 @@ struct tm* gnc_localtime (const time64 *secs);
struct tm* gnc_localtime_r (const time64 *secs, struct tm* time);
/** \brief fill out a time struct from a 64-bit time value
- * \param secs: Seconds since 00:00:01 UTC 01 January 1970 (negative values
+ * \param secs: Seconds since 00:00:00 UTC 01 January 1970 (negative values
* are seconds before that moment)
* \return A struct tm*, allocated on the heap. Must be freed with gnc_tm_free()
* The time is UTC.
@@ -196,7 +196,7 @@ gint gnc_start_of_week (void);
/** \brief calculate seconds from the epoch given a time struct
* \param time: A struct tm* containing the date-time information.
* The time is understood to be in the current local time zone.
- * \return Seconds since 00:00:01 UTC 01 January 1970 (negative values
+ * \return Seconds since 00:00:00 UTC 01 January 1970 (negative values
* are seconds before that moment).
*/
time64 gnc_mktime (struct tm* time);
@@ -204,13 +204,13 @@ time64 gnc_mktime (struct tm* time);
/** \brief calculate seconds from the epoch given a time struct
* \param time: A struct tm* containing the date-time information
* The time is understood to be utc.
- * \return Seconds since 00:00:01 UTC 01 January 1970 (negative values
+ * \return Seconds since 00:00:00 UTC 01 January 1970 (negative values
* are seconds before that moment).
*/
time64 gnc_timegm (struct tm* time);
/** \brief Return a string representation of a date from a 64-bit time value
- * \param secs: Seconds since 00:00:01 UTC 01 January 1970 (negative values
+ * \param secs: Seconds since 00:00:00 UTC 01 January 1970 (negative values
* are seconds before that moment)
* \return A string, which must be freed with g_free(), representing the date
* in the following format:
@@ -219,19 +219,19 @@ time64 gnc_timegm (struct tm* time);
*/
gchar* gnc_ctime (const time64 *secs);
-/** \brief get the current local time
+/** \brief get the current time
* \param A time64* which, if not NULL, will be filled in with the same
* value as is returned.
- * \return Seconds since 00:00:01 UTC 01 January 1970 (negative values
+ * \return Seconds since 00:00:00 UTC 01 January 1970 (negative values
* are seconds before that moment)
*/
time64 gnc_time (time64 *tbuf);
/** \brief Find the difference in seconds between two time values
* \param secs1: The first time value, in Seconds since
- * 00:00:01 UTC 01 January 1970 (negative values are seconds before that moment)
+ * 00:00:00 UTC 01 January 1970 (negative values are seconds before that moment)
* \param secs2: The second time value, in Seconds since
- * 00:00:01 UTC 01 January 1970 (negative values are seconds before that moment)
+ * 00:00:00 UTC 01 January 1970 (negative values are seconds before that moment)
* \return The difference in seconds between secs1 and secs2. If secs2 is
* later than secs1 the value will be negative.
*/
commit 7b1ad4ec19a00c2250d07f094fefc61ffcbb5c35
Author: Richard Cohen <richard at daijobu.co.uk>
Date: Thu Jun 8 14:05:11 2023 +0100
Remove unused osx_accel_map
Since a143f8b5edd3118aedff975d3a1b5b47867e2027 on 2023-03-11,
accelerator-map-osx is the file that is used
diff --git a/gnucash/ui/CMakeLists.txt b/gnucash/ui/CMakeLists.txt
index 143d5f6b07..b049a864b5 100644
--- a/gnucash/ui/CMakeLists.txt
+++ b/gnucash/ui/CMakeLists.txt
@@ -1,5 +1,4 @@
set (ui_SOURCES
- osx_accel_map
accelerator-map
accelerator-map-osx)
diff --git a/gnucash/ui/osx_accel_map b/gnucash/ui/osx_accel_map
deleted file mode 100644
index b450c8f6de..0000000000
--- a/gnucash/ui/osx_accel_map
+++ /dev/null
@@ -1,228 +0,0 @@
-; gnucash GtkAccelMap rc-file -*- scheme -*-
-; this file is an automated accelerator map dump
-;
-; (gtk_accel_path "<Actions>/MenuAdditions/BudgetReportAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/UnvoidTransactionAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/IncomevsDayofWeekAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/BudgetBalanceSheetAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/AverageBalanceAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-aqbanking-actions/DtausImportAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-file-history-actions/RecentFile8Action" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-budget-actions/OpenBudgetAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/ViewSummaryAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/EmployeeProcessPaymentAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/FileOpenMenuAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/BusinessAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/BalanceSheetAction" "")
-(gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/FileOpenAction" "<Meta>o")
-(gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/FileSaveAction" "<Meta>s")
-; (gtk_accel_path "<Actions>/MainWindowActions/ActionsRenamePageAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/InvestmentPortfolioAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/FileExportAccountsAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/BusinessTestReloadInvoiceAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/ExpensesvsDayofWeekAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-csv-actions/CsvImportAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/FilePropertiesAction" "<Alt>Return")
-; (gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/EditTaxOptionsAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/FileNewMenuAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/CustomerProcessPaymentAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/TrialBalanceAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/ActionsAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/AccountSummaryAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/HelpAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/BusinessTestReloadReceivableAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/SampleCustomAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/EmployeeNewEmployeeOpenAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/ScrubAllAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ScheduleTransactionAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-aqbanking-actions/ABIssueIntTransAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/ProfitLossAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-log-replay-actions/LogReplayAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/CustomerNewJobOpenAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/PayableAgingAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/GeneralJournalAction" "")
-(gtk_accel_path "<Actions>/MainWindowActions/HelpTutorialAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/ActionsSinceLastRunAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/BusinessTestReloadOwnerAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/ReceivableAgingAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/ToolsPriceEditorAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/VendorFindJobOpenAction" "")
-(gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/FileNewAction" "<Meta>n")
-; (gtk_accel_path "<Actions>/gnc-plugin-aqbanking-actions/ABSetupAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/BalanceSheetusingeguilegncAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/ScrubMenuAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/CancelTransactionAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ReverseTransactionAction" "")
- (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/CutTransactionAction" "<Control><Meta>x")
-; (gtk_accel_path "<Actions>/MenuAdditions/JobReportAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/VendorNewJobOpenAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-file-history-actions/RecentFile5Action" "")
-(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/EditFindTransactionsAction" "<Meta>f")
-(gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/EditEditAccountAction" "<Meta>e")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/EditExchangeRateAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-budget-actions/NewBudgetAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/BudgetIncomeStatementAction" "")
-(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ActionsTransferAction" "<Meta>t")
-; (gtk_accel_path "<Actions>/MenuAdditions/IncomeExpenseChartAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/LiabilityPiechartAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/EmployeeMenuAction" "")
-(gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/ActionsTransferAction" "<Meta>t")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/BillsDueReminderOpenAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/ActionsForgetWarningsAction" "")
-(gtk_accel_path "<Actions>/MainWindowActions/FilePrintAction" "<Meta>p")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/BillingTermsOpenAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/BusinessAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/FileAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/VendorNewVendorOpenAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ActionsLotsAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/CustomerReportAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/ActionsReconcileAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/CustomReportsAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-aqbanking-actions/ABIssueTransAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/IncomeExpenseAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/IncomePiechartAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/ReportsAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/TransactionAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ViewStyleAutoSplitAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ActionsStockSplitAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/VendorFindVendorOpenAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/ScrubAction" "")
-(gtk_accel_path "<Actions>/MainWindowActions/EditCutAction" "<Meta>x")
-; (gtk_accel_path "<Actions>/gnc-plugin-aqbanking-actions/OnlineActionsAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ActionsReconcileAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/ToolsFinancialCalculatorAction" "")
-(gtk_accel_path "<Actions>/MainWindowActions/FilePageSetupAction" "<Shift><Meta>p")
-(gtk_accel_path "<Actions>/MainWindowActions/FileCloseAction" "<Meta>w")
-; (gtk_accel_path "<Actions>/MenuAdditions/TransactionReportAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/BudgetProfitLossAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ScrubAllAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/ActionsMortgageLoanAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-register-actions/ToolsGeneralJournalAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/EditDeleteAccountAction" "Delete")
-; (gtk_accel_path "<Actions>/MenuAdditions/VendorReportAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/CustomerFindCustomerOpenAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-file-history-actions/RecentFile2Action" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-qif-import-actions/QIFImportAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/RecordTransactionAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-file-history-actions/RecentFile4Action" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/BudgetFlowAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/VendorFindBillOpenAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ViewStyleJournalAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/ActionsScheduledTransactionsAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/EmployeeFindEmployeeOpenAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/JumpTransactionAction" "")
-(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/PasteTransactionAction" "<Control><Meta>v")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/BusinessTestInitDataAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/WindowMovePageAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-aqbanking-actions/ABGetTransAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/EmployeeFindExpenseVoucherOpenAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/HelpContentsAction" "F1")
-; (gtk_accel_path "<Actions>/MenuAdditions/CustomMulticolumnReportAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/WelcomeSampleReportAction" "")
-(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/EditCutAction" "<Meta>x")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ViewStyleDoubleLineAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ScrubCurrentAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/ViewAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/AdvancedPortfolioAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/HelpTipsOfTheDayAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/BudgetAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/CustomerFindInvoiceOpenAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/CustomerFindJobOpenAction" "")
-(gtk_accel_path "<Actions>/MainWindowActions/EditCopyAction" "<Meta>c")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/BusinessTestSearchAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-aqbanking-actions/Mt940ImportAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/IncomeBarchartAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/ActionsLotsAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ViewFilterByAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/EditRenumberSubaccountsAction" "")
-(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/CopyTransactionAction" "<Control><Meta>c")
-; (gtk_accel_path "<Actions>/MainWindowActions/ToolsAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/ExpensePiechartAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/FileOpenSubaccountsAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/WindowsAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-ofx-actions/OfxImportAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/BusinessTestAction" "")
-(gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/EditFindTransactionsAction" "<Meta>f")
-; (gtk_accel_path "<Actions>/MenuAdditions/ExpenseBarchartAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/BudgetBarchartAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/DeleteTransactionAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/IncomeStatementAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-aqbanking-actions/Mt942ImportAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/ActionsScheduledTransactionEditorAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/RemoveTransactionSplitsAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/ScrubSubAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-file-history-actions/RecentFile1Action" "")
-(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/FilePrintAction" "<Meta>p")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/FileNewAccountAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-file-history-actions/RecentFile3Action" "")
-(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/EditEditAccountAction" "<Meta>e")
-;(gtk_accel_path "<Actions>/MainWindowActions/EditPreferencesAction" "<alt>,")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/ActionsStockSplitAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/HelpAboutAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/ViewFilterByAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ReportsAccountReportAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/ViewToolbarAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-file-history-actions/RecentFile7Action" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-aqbanking-actions/ABGetBalanceAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/FileAddAccountHierarchyAssistantAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/WindowNewAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-file-history-actions/RecentFile9Action" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/ViewSortByAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/EditAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/CustomerNewInvoiceOpenAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/DuplicateTransactionAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/SplitTransactionAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/LiabilityBarchartAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/BlankTransactionAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ViewSortByAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/EmployeeNewExpenseVoucherOpenAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/ViewFilterByAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/EmployeeReportAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/FancyInvoiceAction" "")
-(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/EditPasteAction" "<Meta>v")
-; (gtk_accel_path "<Actions>/gnc-plugin-aqbanking-actions/ABIssueDirectDebitAction" "")
-(gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/FileSaveAsAction" "<Shift><Meta>s")
-; (gtk_accel_path "<Actions>/MenuAdditions/AssetsLiabilitiesAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/PrintableInvoiceAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/EasyInvoiceAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/TaxInvoiceAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ViewStyleBasicAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/EquityStatementAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/VendorNewBillOpenAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/PriceScatterplotAction" "")
-(gtk_accel_path "<Actions>/MainWindowActions/ViewRefreshAction" "<Meta>r")
-; (gtk_accel_path "<Actions>/gnc-plugin-aqbanking-actions/DtausImportSendAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/VoidTransactionAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/VendorProcessPaymentAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/ActionsAutoClearAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/NetWorthBarchartAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/ReportsAcctTransReportAction" "")
-; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/FileOpenAccountAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/CustomerMenuAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/ToolsBookCloseAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/TaxScheduleReportTXFExportAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/ViewStatusbarAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-basic-commands-actions/ToolsCommodityEditorAction" "")
-(gtk_accel_path "<Actions>/MainWindowActions/EditPasteAction" "<Meta>v")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/VendorMenuAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/ExtensionsAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-file-history-actions/RecentFile0Action" "")
-(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/EditCopyAction" "<Meta>c")
-; (gtk_accel_path "<Actions>/MenuAdditions/CashFlowAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/FileImportAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/CustomerNewCustomerOpenAction" "")
- (gtk_accel_path "<Actions>/MainWindowActions/FileQuitAction" "<Meta>q")
-; (gtk_accel_path "<Actions>/gnc-plugin-business-actions/TaxTablesOpenAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/AssetPiechartAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/SampleReportwithExamplesAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/GeneralJournalAction" "")
-; (gtk_accel_path "<Actions>/MenuAdditions/AssetBarchartAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-report-system-actions/EditStyleSheetsAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-account-tree-actions/ViewAccountTreeAction" "")
-; (gtk_accel_path "<Actions>/MainWindowActions/FileExportAction" "")
-; (gtk_accel_path "<Actions>/gnc-plugin-file-history-actions/RecentFile6Action" "")
- (gtk_accel_path "<Actions>/GncPluginPageReportActions/FilePrintAction" "<Meta>p")
- (gtk_accel_path "<Actions>/GncPluginPageReportActions/EditCutAction" "<Meta>x")
- (gtk_accel_path "<Actions>/GncPluginPageReportActions/EditPasteAction" "<Meta>v")
- (gtk_accel_path "<Actions>/GncPluginPageReportActions/ViewRefreshAction" "<Meta>r")
- (gtk_accel_path "<Actions>/GncPluginPageReportActions/EditCopyAction" "<Meta>c")
commit 6e5c525f7756c1cd3997691daee9c40eecfa6c01
Author: Richard Cohen <richard at daijobu.co.uk>
Date: Thu Jun 1 16:10:36 2023 +0100
Use gnc_time() instead of time()
diff --git a/libgnucash/engine/gnc-date.cpp b/libgnucash/engine/gnc-date.cpp
index 56383edcf3..d7ae1a3dca 100644
--- a/libgnucash/engine/gnc-date.cpp
+++ b/libgnucash/engine/gnc-date.cpp
@@ -1329,19 +1329,19 @@ gnc_time64_get_day_end (time64 time_val)
void
gnc_tm_get_today_start (struct tm *tm)
{
- gnc_tm_get_day_start(tm, time(NULL));
+ gnc_tm_get_day_start(tm, gnc_time(nullptr));
}
void
gnc_tm_get_today_neutral (struct tm *tm)
{
- gnc_tm_get_day_neutral(tm, time(NULL));
+ gnc_tm_get_day_neutral(tm, gnc_time(nullptr));
}
void
gnc_tm_get_today_end (struct tm *tm)
{
- gnc_tm_get_day_end(tm, time(NULL));
+ gnc_tm_get_day_end(tm, gnc_time(nullptr));
}
time64
@@ -1349,7 +1349,7 @@ gnc_time64_get_today_start (void)
{
struct tm tm;
- gnc_tm_get_day_start(&tm, time(NULL));
+ gnc_tm_get_day_start(&tm, gnc_time(nullptr));
return gnc_mktime(&tm);
}
@@ -1358,7 +1358,7 @@ gnc_time64_get_today_end (void)
{
struct tm tm;
- gnc_tm_get_day_end(&tm, time(NULL));
+ gnc_tm_get_day_end(&tm, gnc_time(nullptr));
return gnc_mktime(&tm);
}
diff --git a/libgnucash/engine/test/gtest-gnc-datetime.cpp b/libgnucash/engine/test/gtest-gnc-datetime.cpp
index 7a5128d6b3..70b8b1a614 100644
--- a/libgnucash/engine/test/gtest-gnc-datetime.cpp
+++ b/libgnucash/engine/test/gtest-gnc-datetime.cpp
@@ -23,6 +23,7 @@
\********************************************************************/
#include "../gnc-datetime.hpp"
+#include "../gnc-date.h"
#include <gtest/gtest.h>
/* Backdoor to enable unittests to temporarily override the timezone: */
@@ -253,7 +254,7 @@ TEST(gnc_date_operators, test_move_assignment)
TEST(gnc_datetime_constructors, test_default_constructor)
{
GncDateTime atime;
- long time_now = time(nullptr);
+ time64 time_now = gnc_time(nullptr);
EXPECT_EQ(static_cast<time64>(atime), static_cast<time64>(time_now));
}
diff --git a/libgnucash/engine/test/test-gnc-date.c b/libgnucash/engine/test/test-gnc-date.c
index 93c379e0ce..558217196a 100644
--- a/libgnucash/engine/test/test-gnc-date.c
+++ b/libgnucash/engine/test/test-gnc-date.c
@@ -344,7 +344,7 @@ test_gnc_time (void)
time64 secs1, secs2;
secs1 = gnc_time (&secs2);
g_assert_cmpint (secs1, ==, secs2);
- g_assert_cmpint (secs1, ==, time(0));
+ g_assert_cmpint (secs1, ==, gnc_time(NULL));
}
/* gnc_difftime and gnc_tm_free are just too simple to bother testing. */
commit df6c775617feb133bbbbd060e23ae8ab30a5a4df
Author: fabrica64 <paolo at maero.com>
Date: Sun Jun 4 22:28:00 2023 -0300
Including brokerage fees in Money Out calculation (if not ignoring them) in advanced-portfolio.scm report and updating the "advanced" tests to reflect selling fees being included into the money out value
diff --git a/gnucash/report/reports/standard/advanced-portfolio.scm b/gnucash/report/reports/standard/advanced-portfolio.scm
index 935d560c9a..4e259d12f0 100644
--- a/gnucash/report/reports/standard/advanced-portfolio.scm
+++ b/gnucash/report/reports/standard/advanced-portfolio.scm
@@ -514,6 +514,7 @@ by preventing negative stock balances.<br/>")
(trans-brokerage (gnc-numeric-zero))
(trans-shares (gnc-numeric-zero))
(shares-bought (gnc-numeric-zero))
+ (shares-sold (gnc-numeric-zero))
(trans-sold (gnc-numeric-zero))
(trans-bought (gnc-numeric-zero))
(trans-spinoff (gnc-numeric-zero))
@@ -570,8 +571,11 @@ by preventing negative stock balances.<br/>")
(gnc-numeric-add trans-bought split-value commod-currency-frac GNC-RND-ROUND))
(set! shares-bought
(gnc-numeric-add shares-bought split-units units-denom GNC-RND-ROUND)))
- (set! trans-sold
- (gnc-numeric-sub trans-sold split-value commod-currency-frac GNC-RND-ROUND)))))
+ (begin
+ (set! trans-sold
+ (gnc-numeric-sub trans-sold split-value commod-currency-frac GNC-RND-ROUND))
+ (set! shares-sold
+ (gnc-numeric-add shares-sold split-units units-denom GNC-RND-ROUND))))))
((split-account-type? s ACCT-TYPE-ASSET)
;; If all the asset accounts mentioned in the transaction are siblings of each other
@@ -594,7 +598,8 @@ by preventing negative stock balances.<br/>")
(gnc:debug "Income: " (gnc-numeric-to-string trans-income)
" Brokerage: " (gnc-numeric-to-string trans-brokerage)
" Shares traded: " (gnc-numeric-to-string trans-shares)
- " Shares bought: " (gnc-numeric-to-string shares-bought))
+ " Shares bought: " (gnc-numeric-to-string shares-bought)
+ " Shares sold " (gnc-numeric-to-string shares-sold))
(gnc:debug " Value sold: " (gnc-numeric-to-string trans-sold)
" Value purchased: " (gnc-numeric-to-string trans-bought)
" Spinoff value " (gnc-numeric-to-string trans-spinoff)
@@ -626,6 +631,14 @@ by preventing negative stock balances.<br/>")
(fees (gnc-numeric-mul trans-brokerage fee-frac commod-currency-frac GNC-RND-ROUND)))
(set! trans-bought (gnc-numeric-add trans-bought fees commod-currency-frac GNC-RND-ROUND))))
+ ;; Add brokerage fees to trans-sold if not ignoring them and there are any
+ (if (and (not (eq? handle-brokerage-fees 'ignore-brokerage))
+ (gnc-numeric-positive-p trans-brokerage)
+ (gnc-numeric-positive-p trans-shares))
+ (let* ((fee-frac (gnc-numeric-div shares-sold trans-shares GNC-DENOM-AUTO GNC-DENOM-REDUCE))
+ (fees (gnc-numeric-mul trans-brokerage fee-frac commod-currency-frac GNC-RND-ROUND)))
+ (set! trans-sold (gnc-numeric-add trans-sold fees commod-currency-frac GNC-RND-ROUND))))
+
;; Update the running total of the money in the DRP residual account. This is relevant
;; if this is a reinvestment transaction (both income and purchase) and there seems to
;; asset accounts used to hold excess income.
diff --git a/gnucash/report/reports/standard/test/test-portfolios.scm b/gnucash/report/reports/standard/test/test-portfolios.scm
index a939e01ece..f753545030 100644
--- a/gnucash/report/reports/standard/test/test-portfolios.scm
+++ b/gnucash/report/reports/standard/test/test-portfolios.scm
@@ -103,7 +103,7 @@
(let ((sxml (options->sxml advanced-uuid options "basic average")))
(test-equal "advanced: average basis"
'("AAPL" "AAPL" "NASDAQ" "42.00" "$6.0000" "$484.88" "$252.00" "$800.00"
- "$553.00" "$227.88" "-$232.88" "-$5.00" "-0.63%" "$4.00"
+ "$543.00" "$227.88" "-$232.88" "-$5.00" "-0.63%" "$4.00"
"$10.00" "-$1.00" "-0.13%")
(sxml->table-row-col sxml 1 1 #f)))
@@ -111,7 +111,7 @@
(let ((sxml (options->sxml advanced-uuid options "basic fifo")))
(test-equal "advanced: fifo basis"
'("AAPL" "AAPL" "NASDAQ" "42.00" "$6.0000" "$543.94" "$252.00" "$800.00"
- "$553.00" "$286.94" "-$291.94" "-$5.00" "-0.63%" "$4.00" "$10.00"
+ "$543.00" "$286.94" "-$291.94" "-$5.00" "-0.63%" "$4.00" "$10.00"
"-$1.00" "-0.13%")
(sxml->table-row-col sxml 1 1 #f)))
@@ -119,7 +119,7 @@
(let ((sxml (options->sxml advanced-uuid options "basic filo")))
(test-equal "advanced: filo basis"
'("AAPL" "AAPL" "NASDAQ" "42.00" "$6.0000" "$400.00" "$252.00" "$800.00"
- "$553.00" "$143.00" "-$148.00" "-$5.00" "-0.63%" "$4.00" "$10.00"
+ "$543.00" "$143.00" "-$148.00" "-$5.00" "-0.63%" "$4.00" "$10.00"
"-$1.00" "-0.13%")
(sxml->table-row-col sxml 1 1 #f))))
(teardown)))
Summary of changes:
.../report/reports/standard/advanced-portfolio.scm | 19 +-
.../reports/standard/test/test-portfolios.scm | 6 +-
gnucash/ui/CMakeLists.txt | 1 -
gnucash/ui/osx_accel_map | 228 ---------------------
libgnucash/engine/gnc-date.cpp | 10 +-
libgnucash/engine/gnc-date.h | 34 +--
libgnucash/engine/test/gtest-gnc-datetime.cpp | 3 +-
libgnucash/engine/test/gtest-gnc-option.cpp | 7 +
libgnucash/engine/test/test-gnc-date.c | 2 +-
9 files changed, 51 insertions(+), 259 deletions(-)
delete mode 100644 gnucash/ui/osx_accel_map
More information about the gnucash-changes
mailing list