mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Correct bug introduced in commit 63deaad
. affecting Edit->Tax Report Options and the US Income Tax Report
This commit is contained in:
parent
b5c1937702
commit
d0ad95fe92
@ -4006,13 +4006,17 @@ gint64
|
||||
xaccAccountGetTaxUSCopyNumber (const Account *acc)
|
||||
{
|
||||
auto copy_number = get_kvp_int64_path (acc, {"tax-US", "copy-number"});
|
||||
return copy_number ? *copy_number : 1;
|
||||
return (copy_number && (*copy_number != 0)) ? *copy_number : 1;
|
||||
}
|
||||
|
||||
void
|
||||
xaccAccountSetTaxUSCopyNumber (Account *acc, gint64 copy_number)
|
||||
{
|
||||
set_kvp_int64_path (acc, {"tax-US", "copy-number"}, copy_number);
|
||||
if (copy_number != 0)
|
||||
set_kvp_int64_path (acc, {"tax-US", "copy-number"}, copy_number);
|
||||
else
|
||||
/* deletes KVP if it exists */
|
||||
set_kvp_int64_path (acc, {"tax-US", "copy-number"}, std::nullopt);
|
||||
}
|
||||
|
||||
/*********************************************************************\
|
||||
|
@ -1406,9 +1406,9 @@ typedef enum
|
||||
const char * xaccAccountGetTaxUSPayerNameSource (const Account *account);
|
||||
/** DOCUMENT ME! */
|
||||
void xaccAccountSetTaxUSPayerNameSource (Account *account, const char *source);
|
||||
/** DOCUMENT ME! */
|
||||
/** Returns copy_number stored in KVP; if KVP doesn't exist or copy_number is zero, returns 1 */
|
||||
gint64 xaccAccountGetTaxUSCopyNumber (const Account *account);
|
||||
/** DOCUMENT ME! */
|
||||
/** Saves copy_number in KVP if it is greater than 1; if copy_number is zero, deletes KVP */
|
||||
void xaccAccountSetTaxUSCopyNumber (Account *account, gint64 copy_number);
|
||||
/** @} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user