* src/gnome/druid-loan.c: Apply patch to fix a number of

off-by-one bugs in the loan druid.  Fixes #119001.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8988 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/cashutil
Derek Atkins 23 years ago
parent 92797dd5e0
commit c482d618c4

@ -1,3 +1,8 @@
2003-08-03 Derek Atkins <derek@ihtfp.com>
* src/gnome/druid-loan.c: Apply patch to fix a number of
off-by-one bugs in the loan druid. Fixes #119001.
2003-07-30 Derek Atkins <derek@ihtfp.com>
* src/gnome-utils/gnc-account-tree.c: add "(Report)" strings

@ -2195,16 +2195,17 @@ ld_create_sxes( LoanDruidData *ldd )
paymentSX->name = g_strdup(ldd->ld.repMemo);
paymentSX->start = *ldd->ld.startDate;
paymentSX->last = *ldd->ld.repStartDate;
g_date_subtract_months( &paymentSX->last, 1 );
{
paymentSX->end = *ldd->ld.repStartDate;
g_date_add_months( &paymentSX->end, ldd->ld.numMonRemain );
g_date_add_months( &paymentSX->end, ldd->ld.numMonRemain - 1);
}
paymentSX->freq = ldd->ld.repFreq;
/* Figure out the correct current instance-count for the txns in the
* SX. */
paymentSX->instNum =
(ldd->ld.numPer * ( ldd->ld.perSize == YEARS ? 12 : 1 ))
- ldd->ld.numMonRemain;
- ldd->ld.numMonRemain + 1;
paymentSX->mainTxn = gnc_ttinfo_malloc();
gnc_ttinfo_set_currency( paymentSX->mainTxn,
@ -2486,7 +2487,7 @@ ld_get_loan_range( LoanDruidData *ldd, GDate *start, GDate *end )
*start = *ldd->ld.startDate;
*end = *start;
g_date_add_months( end,
ldd->ld.numPer
ldd->ld.numPer - 1
* ( ldd->ld.perSize == MONTHS ? 1 : 12 ) );
}
@ -2590,7 +2591,7 @@ ld_rev_recalc_schedule( LoanDruidData *ldd )
g_date_subtract_days( &curDate, 1 );
xaccFreqSpecGetNextInstance( ldd->ld.repFreq,
&curDate, &curDate );
for ( i=0;
for ( i=1;
g_date_valid( &curDate )
&& g_date_compare( &curDate, &end ) <= 0 ;
i++,

Loading…
Cancel
Save