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

SF.net SVN: ledger-smb:[3070] addons/1.3/import_trans/trunk



Revision: 3070
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3070&view=rev
Author:   einhverfr
Date:     2010-09-24 17:07:51 +0000 (Fri, 24 Sep 2010)

Log Message:
-----------
Fix for CSV exports regarding excel for the Mac

Modified Paths:
--------------
    addons/1.3/import_trans/trunk/scripts/import_trans.pl

Added Paths:
-----------
    addons/1.3/import_trans/trunk/import_trans.pl

Copied: addons/1.3/import_trans/trunk/import_trans.pl (from rev 3063, addons/1.3/import_trans/import_trans.pl)
===================================================================
--- addons/1.3/import_trans/trunk/import_trans.pl	                        (rev 0)
+++ addons/1.3/import_trans/trunk/import_trans.pl	2010-09-24 17:07:51 UTC (rev 3070)
@@ -0,0 +1,3 @@
+#!/usr/bin/perl
+
+require 'lsmb-request.pl';

Modified: addons/1.3/import_trans/trunk/scripts/import_trans.pl
===================================================================
--- addons/1.3/import_trans/trunk/scripts/import_trans.pl	2010-09-23 17:41:50 UTC (rev 3069)
+++ addons/1.3/import_trans/trunk/scripts/import_trans.pl	2010-09-24 17:07:51 UTC (rev 3070)
@@ -33,6 +33,21 @@
                    $form->{rowcount} = 0;
                    $form->{dbh} = $request->{_dbh};
                    for my $ref (@$entries){
+                       if ($ref->{debits} !~ /\d/){
+                          delete $ref->{debits};
+                       } else {
+                          $ref->{debits} = $form->parse_amount(
+                                         $request->{_user}, $ref->{debits}
+                          );
+                       }
+                       if ($ref->{credits} !~ /\d/){
+                          delete $ref->{credits};
+                       } else {
+                          $ref->{credits} = $form->parse_amount(
+                                         $request->{_user}, $ref->{credits}
+                          );
+                       }
+                       next if !$ref->{debits} and !$ref->{credits};
                        ++$form->{rowcount} = 0;
                        for my $col (@{$col->{$request->{type}}}){
                            $form->{"${col}_$form->{rowcount}"} = shift @$ref;


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