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

SF.net SVN: ledger-smb:[4051] branches/1.3



Revision: 4051
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4051&view=rev
Author:   einhverfr
Date:     2011-11-24 14:20:30 +0000 (Thu, 24 Nov 2011)
Log Message:
-----------
Correcting recurring issue regarding dateformats

Modified Paths:
--------------
    branches/1.3/LedgerSMB/Form.pm
    branches/1.3/bin/am.pl

Modified: branches/1.3/LedgerSMB/Form.pm
===================================================================
--- branches/1.3/LedgerSMB/Form.pm	2011-11-24 13:14:56 UTC (rev 4050)
+++ branches/1.3/LedgerSMB/Form.pm	2011-11-24 14:20:30 UTC (rev 4051)
@@ -777,8 +777,14 @@
     my $second = $3;
     my $third  = $4;
 
-    $newdate = "${$first}?${$second}?${$third}";
-    $newdate =~ s/\?/$sep/;
+    my @elems;
+    for my $pos ($first, $second, $third){
+        push @elems, $YYYY if uc($pos) eq 'YYYY';
+        push @elems, $MM if uc($pos) eq 'MM';
+        push @elems, $DD if uc($pos) eq 'DD';
+    }
+    $newdate = "$elems[0]$sep$elems[1]$sep$elems[2]";
+
     return $newdate;
 }
 

Modified: branches/1.3/bin/am.pl
===================================================================
--- branches/1.3/bin/am.pl	2011-11-24 13:14:56 UTC (rev 4050)
+++ branches/1.3/bin/am.pl	2011-11-24 14:20:30 UTC (rev 4051)
@@ -2522,12 +2522,13 @@
                     }
 
                     $form->{invnumber} = $pt->{reference};
-                    $form->{transdate} = $pt->{nextdate};
 
                     # tax accounts
                     $form->all_taxaccounts( \%myconfig, undef,
                         $form->{transdate} );
-
+                    $form->{transdate} = $form->convert_date(
+                             $pt->{nextdate}, \%myconfig
+                    );
                     # calculate duedate
                     $form->{duedate} =
                       $form->add_date( \%myconfig, $form->{transdate},

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