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

SF.net SVN: ledger-smb: [1493] trunk/LedgerSMB



Revision: 1493
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1493&view=rev
Author:   einhverfr
Date:     2007-09-01 15:49:54 -0700 (Sat, 01 Sep 2007)

Log Message:
-----------
Fixing bind errors when transdate is omitted in Form::all_vc and also ensuring that invoices show up in transaction report.

Modified Paths:
--------------
    trunk/LedgerSMB/AA.pm
    trunk/LedgerSMB/Form.pm

Modified: trunk/LedgerSMB/AA.pm
===================================================================
--- trunk/LedgerSMB/AA.pm	2007-09-01 22:22:31 UTC (rev 1492)
+++ trunk/LedgerSMB/AA.pm	2007-09-01 22:49:54 UTC (rev 1493)
@@ -784,11 +784,11 @@
 		          d.description AS department, 
 		          a.ponumber $acc_trans_flds
 		     FROM $table a
-		     JOIN $form->{vc} vc USING (entity_id)
+		     JOIN entity_credit_account vc USING (entity_id)
 		LEFT JOIN employee e ON (a.person_id = e.entity_id)
 		LEFT JOIN employee m ON (e.managerid = m.entity_id)
 		     JOIN entity ee ON (e.entity_id = ee.id)
-             JOIN entity me ON (m.entity_id = me.id)
+                LEFT JOIN entity me ON (m.entity_id = me.id)
 		     JOIN entity vce ON (vc.entity_id = vce.id)
 		LEFT JOIN exchangerate ex ON (ex.curr = a.curr
 		          AND ex.transdate = a.transdate)

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2007-09-01 22:22:31 UTC (rev 1492)
+++ trunk/LedgerSMB/Form.pm	2007-09-01 22:49:54 UTC (rev 1493)
@@ -1702,7 +1702,9 @@
         $where = qq| (startdate IS NULL OR startdate <= ?)
 					AND (enddate IS NULL OR enddate >= ?) 
 					AND entity_class = ?|;
-        push (@queryargs, $transdate, $transdate );
+        push (@queryargs, $transdate, $transdate, $self->{vc_class});
+    } else {
+        $where = " true";
     }
 
     $sth = $dbh->prepare($query);
@@ -1734,7 +1736,7 @@
 				  ORDER BY name|;
 
         shift @queryargs;
-        push( @queryargs, $self->{vc_class}, $self->{"${vc}_id"} );
+        push( @queryargs, $self->{"${vc}_id"} );
 
         $sth = $dbh->prepare($query);
         $sth->execute(@queryargs) || $self->dberror($query);


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