Bug 799395 - relative date offset quarters occasionally wrong

If the accounting period start month and the present month are the
same the present month would be offset by 3. Don't do that.
This commit is contained in:
John Ralls 2024-09-22 16:12:54 -07:00
parent 63714e5e93
commit c584337c3a

View File

@ -528,7 +528,7 @@ gnc_relative_date_to_time64(RelativeDatePeriod period)
break;
case RelativeDateOffset::QUARTER:
{
auto delta = (now.tm_mon > acct_per.tm_mon ?
auto delta = (now.tm_mon >= acct_per.tm_mon ?
( now.tm_mon - acct_per.tm_mon) % 3 :
3 - ((acct_per.tm_mon - now.tm_mon) % 3));
now.tm_mon = now.tm_mon - delta;