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

SF.net SVN: ledger-smb:[5216] trunk/sql/modules/PNL.sql



Revision: 5216
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5216&view=rev
Author:   einhverfr
Date:     2012-11-20 06:49:15 +0000 (Tue, 20 Nov 2012)
Log Message:
-----------
final fixes to PNL procedures

Modified Paths:
--------------
    trunk/sql/modules/PNL.sql

Modified: trunk/sql/modules/PNL.sql
===================================================================
--- trunk/sql/modules/PNL.sql	2012-11-20 06:43:14 UTC (rev 5215)
+++ trunk/sql/modules/PNL.sql	2012-11-20 06:49:15 UTC (rev 5216)
@@ -180,7 +180,10 @@
   JOIN account_heading ah on a.heading = ah.id
   JOIN acc_trans ac ON a.id = ac.chart_id
   JOIN gl ON ac.trans_id = gl.id
- WHERE ac.approved is true AND ac.transdate BETWEEN $2 AND $3
+ WHERE ac.approved is true 
+          AND ($2 IS NULL OR ac.transdate >= $2) 
+          AND ($3 IS NULL OR ac.transdate <= $3)
+          AND a.category IN ('I', 'E')
  GROUP BY a.id, a.accno, a.description, a.category, 
           ah.id, ah.accno, ah.description
  ORDER BY a.category DESC, a.accno ASC;

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