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

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



Revision: 4950
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4950&view=rev
Author:   einhverfr
Date:     2012-06-29 06:24:45 +0000 (Fri, 29 Jun 2012)
Log Message:
-----------
correcting localization of date formats for taxform reports

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/LedgerSMB/User.pm
    branches/1.3/scripts/taxform.pl

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2012-06-28 12:06:42 UTC (rev 4949)
+++ branches/1.3/Changelog	2012-06-29 06:24:45 UTC (rev 4950)
@@ -10,6 +10,7 @@
 * Fixed invalid syntax for integer on saving employee (Chris T)
 * Cleaned up dates lines on employee screen (Chris T)
 * Added access to parts.image for ar invoice, order, quote templates (Chris T)
+* Fixed error on redirect from attaching file to part (Chris T h/t Brian W)
 
 Changelog for 1.3.19
 * New link for customer/vendor when not a dropdown (Chris T)

Modified: branches/1.3/LedgerSMB/User.pm
===================================================================
--- branches/1.3/LedgerSMB/User.pm	2012-06-28 12:06:42 UTC (rev 4949)
+++ branches/1.3/LedgerSMB/User.pm	2012-06-29 06:24:45 UTC (rev 4950)
@@ -189,6 +189,15 @@
     $sth = $dbh->prepare("SELECT value FROM defaults WHERE setting_key = 'templates'");
     $sth->execute();
     ($templates) = $sth->fetchrow_array() || 'demo';
+    my %date_query = (
+        'mm/dd/yy' => 'set DateStyle to \'SQL, US\'',
+        'mm-dd-yy' => 'set DateStyle to \'POSTGRES, US\'',
+        'dd/mm/yy' => 'set DateStyle to \'SQL, EUROPEAN\'',
+        'dd-mm-yy' => 'set DateStyle to \'POSTGRES, EUROPEAN\'',
+        'dd.mm.yy' => 'set DateStyle to \'GERMAN\''
+    );
+    $dbh->do( $date_query{ $myconfig{dateformat} } );
+
     $myconfig->{templates} = "$LedgerSMB::Sysconfig::templates/$templates";
     return $myconfig;
 }

Modified: branches/1.3/scripts/taxform.pl
===================================================================
--- branches/1.3/scripts/taxform.pl	2012-06-28 12:06:42 UTC (rev 4949)
+++ branches/1.3/scripts/taxform.pl	2012-06-29 06:24:45 UTC (rev 4950)
@@ -142,7 +142,7 @@
     # TODO:  Eliminate duplicate code!
     if ($request->{meta_number}) {
       my @call_args = ($request->{'tax_form_id'},
-                       $request->{begin_month}.' '.$request->{begin_day}.' '.$request->{begin_year}, $request->{end_month}.' '.$request->{end_day}.' '.$request->{end_year}, 
+                       $request->{begin_year}.'-'.$request->{begin_month}.'-'.$request->{begin_day}, $request->{end_year}.'-'.$request->{end_month}.'-'.$request->{end_day}, 
                        $request->{meta_number});
                        
       my @results = $request->call_procedure(procname => 'tax_form_details_report', args => ..hidden..);
@@ -184,7 +184,7 @@
     } 
     else {
         
-        my @call_args = ($request->{'tax_form_id'}, $request->{begin_month}.' '.$request->{begin_day}.' '.$request->{begin_year}, $request->{end_month}.' '.$request->{end_day}.' '.$request->{end_year});
+        my @call_args = ($request->{'tax_form_id'}, $request->{begin_year}.'-'.$request->{begin_month}.'-'.$request->{begin_day}, $request->{end_year}.'-'.$request->{end_month}.'-'.$request->{end_day});
         my @results = $request->call_procedure(procname => 'tax_form_summary_report', args => ..hidden..);
         for my $r (@results){
             my $company = LedgerSMB::DBObject::Vendor->new(base => $request);

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