From 7d5663899ca62b4e52a854372a7c777a6ee6e730 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Fri, 26 May 2023 20:41:13 -0400 Subject: [PATCH] Bug 798930 - invoices wont sequence to the next number Because KVP can't magically cast between int64_t and double. --- libgnucash/engine/gnc-optiondb.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libgnucash/engine/gnc-optiondb.cpp b/libgnucash/engine/gnc-optiondb.cpp index a7498805c1..117848fdd2 100644 --- a/libgnucash/engine/gnc-optiondb.cpp +++ b/libgnucash/engine/gnc-optiondb.cpp @@ -457,9 +457,11 @@ GncOptionDB::save_to_kvp(QofBook* book, bool clear_options) const noexcept else if (is_qofinstance_ui_type(type)) kvp = kvp_value_from_qof_instance_option(option); else if (type == GncOptionUIType::NUMBER_RANGE) - /* The Gtk control uses a double so that's what we - * have to store. */ - kvp = new KvpValue(option.template get_value()); + { + auto d_value{option.template get_value()}; + auto value{static_cast(d_value)}; + kvp = new KvpValue(value); + } else { auto str{option.template get_value()};