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

SF.net SVN: ledger-smb:[2730] trunk



Revision: 2730
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2730&view=rev
Author:   einhverfr
Date:     2009-07-15 18:08:36 +0000 (Wed, 15 Jul 2009)

Log Message:
-----------
Minor bug fix for GL report balance handling

Modified Paths:
--------------
    trunk/LedgerSMB/GL.pm
    trunk/sql/Pg-database.sql

Modified: trunk/LedgerSMB/GL.pm
===================================================================
--- trunk/LedgerSMB/GL.pm	2009-07-15 17:39:34 UTC (rev 2729)
+++ trunk/LedgerSMB/GL.pm	2009-07-15 18:08:36 UTC (rev 2730)
@@ -357,8 +357,8 @@
         $apwhere .= " AND c.category = $var";
     }
 
-    if ( $form->{accno} ) {
-        my $accno = $dbh->quote( $form->{accno} );
+    if ( $form->{chart_accno} ) {
+        my $accno = $dbh->quote( $form->{chart_accno} );
 
         # get category for account
         $query = qq|SELECT category, link, contra, description
@@ -375,7 +375,7 @@
 			SELECT account__obtain_balance(?, id) from chart
 			WHERE accno = ? |;
             my $sth = $dbh->prepare($query);
-            $sth->execute($form->{datefrom}, $accno);
+            $sth->execute($form->{datefrom}, $form->{chart_accno});
 
             ( $form->{balance} ) = $sth->fetchrow_array;
             $sth->finish;

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2009-07-15 17:39:34 UTC (rev 2729)
+++ trunk/sql/Pg-database.sql	2009-07-15 18:08:36 UTC (rev 2730)
@@ -531,14 +531,15 @@
 CREATE TABLE batch (
   id serial primary key,
   batch_class_id integer references batch_class(id) not null,
-  control_code text,
+  control_code text NOT NULL,
   description text,
   default_date date not null,
   approved_on date default null,
   approved_by int references entity_employee(entity_id),
   created_by int references entity_employee(entity_id),
   locked_by int references session(session_id),
-  created_on date default now()
+  created_on date default now(),
+  CHECK length(control_code) > 0
 );
 
 COMMENT ON COLUMN batch.batch_class_id IS


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