summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-07 19:42:32 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-07 19:42:32 +0000
commit814644f32d2fb16b4de8b56b25474aeb2dd41dcb (patch)
treeaaf5adc13f1ccf918a3acd68f3a2e041eceba5b6
parent79aa66560d5b01fdae598fd9ac1de67317b69ebb (diff)
Fixing behaviour of 'months' and 'years' units in add_date
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1157 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/Form.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index b36f838f..8ba7eaed 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -1423,12 +1423,13 @@ sub add_date {
my $whole = int( $diff / 12 );
$yy += $whole;
- $mm = ( $diff % 12 ) + 1;
+ $mm = ( $diff % 12 );
+ $mm = '12' if $mm == 0;
$diff = 0;
}
if ( $unit eq 'years' ) {
- $yy++;
+ $yy += $repeat;
}
$mm--;