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

SF.net SVN: ledger-smb: [1472] branches/1.2



Revision: 1472
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1472&view=rev
Author:   tetragon
Date:     2007-08-28 11:03:40 -0700 (Tue, 28 Aug 2007)

Log Message:
-----------
Improve handling of the number format 1.000,00 by timecards

Modified Paths:
--------------
    branches/1.2/LedgerSMB/JC.pm
    branches/1.2/bin/jc.pl

Modified: branches/1.2/LedgerSMB/JC.pm
===================================================================
--- branches/1.2/LedgerSMB/JC.pm	2007-08-27 05:51:12 UTC (rev 1471)
+++ branches/1.2/LedgerSMB/JC.pm	2007-08-28 18:03:40 UTC (rev 1472)
@@ -76,6 +76,7 @@
           || $form->dberror($query);
 
         $ref = $sth->fetchrow_hashref(NAME_lc);
+        $form->db_parse_numeric(sth=>$sth, hashref=>$ref);
 
         for ( keys %$ref ) { $form->{$_} = $ref->{$_} }
         $sth->finish;
@@ -488,6 +489,7 @@
     $sth->execute($dateformat) || $form->dberror($query);
 
     while ( $ref = $sth->fetchrow_hashref(NAME_lc) ) {
+        $form->db_parse_numeric(sth=>$sth, hashref=>$ref);
         $ref->{project} = ( $ref->{parts_id} ) ? "job" : "project";
         $ref->{transdate} = $ref->{transdatea};
         delete $ref->{transdatea};

Modified: branches/1.2/bin/jc.pl
===================================================================
--- branches/1.2/bin/jc.pl	2007-08-27 05:51:12 UTC (rev 1471)
+++ branches/1.2/bin/jc.pl	2007-08-28 18:03:40 UTC (rev 1472)
@@ -40,6 +40,7 @@
 #======================================================================
 
 use LedgerSMB::JC;
+use Math::BigFloat;
 
 1;
 
@@ -413,7 +414,7 @@
         $form->{checkedin} = 0;
     }
 
-    $form->{clocked} = ( $form->{checkedout} - $form->{checkedin} ) / 3600;
+    $form->{clocked} = Math::BigFloat->new(( $form->{checkedout} - $form->{checkedin} ) / 3600);
     if ( $form->{clocked} ) {
         $form->{oldnoncharge} = $form->{clocked} - $form->{qty};
     }
@@ -1045,7 +1046,7 @@
             $form->{checkedin} = 0;
         }
 
-        $form->{clocked} = ( $form->{checkedout} - $form->{checkedin} ) / 3600;
+        $form->{clocked} = Math::BigFloat->new(( $form->{checkedout} - $form->{checkedin} ) / 3600);
 
         for (qw(sellprice qty noncharge allocated)) {
             $form->{$_} = $form->parse_amount( \%myconfig, $form->{$_} );


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