[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1157] branches/1.2/LedgerSMB/Form.pm



Revision: 1157
          http://svn.sourceforge.net/ledger-smb/?rev=1157&view=rev
Author:   tetragon
Date:     2007-05-07 12:42:32 -0700 (Mon, 07 May 2007)

Log Message:
-----------
Fixing behaviour of 'months' and 'years' units in add_date

Modified Paths:
--------------
    branches/1.2/LedgerSMB/Form.pm

Modified: branches/1.2/LedgerSMB/Form.pm
===================================================================
--- branches/1.2/LedgerSMB/Form.pm	2007-05-07 19:40:00 UTC (rev 1156)
+++ branches/1.2/LedgerSMB/Form.pm	2007-05-07 19:42:32 UTC (rev 1157)
@@ -1423,12 +1423,13 @@
             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--;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.