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

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



Revision: 5858
          http://sourceforge.net/p/ledger-smb/code/5858
Author:   einhverfr
Date:     2013-05-22 15:13:55 +0000 (Wed, 22 May 2013)
Log Message:
-----------
Balance sheet clickthrough works, added account numbers

Modified Paths:
--------------
    trunk/UI/Reports/balance_sheet.html
    trunk/sql/modules/Report.sql

Modified: trunk/UI/Reports/balance_sheet.html
===================================================================
--- trunk/UI/Reports/balance_sheet.html	2013-05-21 15:58:09 UTC (rev 5857)
+++ trunk/UI/Reports/balance_sheet.html	2013-05-22 15:13:55 UTC (rev 5858)
@@ -8,9 +8,9 @@
    <th colspan="2"><?lsmb text('Assets') ?></th>
 </tr>
 <?lsmb FOREACH line IN report.balance_sheet.A.lines ?> 
-<tr><th><a href="journal.pl?action=search&to_date=<?lsmb to_date 
-       ?>&accno=account_number"
-       ><?lsmb line.account_number _ ': ' _ line.account_description ?></a></th>
+<tr><th><a href="journal.pl?action=search&to_date=<?lsmb report.to_date 
+       ?>&accno=<?lsmb line.account_number ?>"
+       ><?lsmb line.account_number _ ' - ' _ line.account_desc ?></a></th>
     <td class="amount"><?lsmb line.balance ?> </td>
 </tr>
 <?lsmb END ?>
@@ -21,9 +21,9 @@
    <th colspan="2"><?lsmb text('Liabilities') ?></th>
 </tr>
 <?lsmb FOREACH line IN report.balance_sheet.L.lines ?> 
-<tr><th><a href="journal.pl?action=search&to_date=<?lsmb to_date 
+<tr><th><a href="journal.pl?action=search&to_date=<?lsmb report.to_date 
        ?>&accno=<?lsmb line.account_number ?>"
-       ><?lsmb line.account_number _ ': ' _ line.account_description ?></a></th>
+       ><?lsmb line.account_number _ ' - ' _ line.account_desc ?></a></th>
     <td class="amount"><?lsmb line.balance ?> </td>
 </tr>
 <?lsmb END ?>
@@ -34,9 +34,9 @@
    <th colspan="2"><?lsmb text('Equity') ?></th>
 </tr>
 <?lsmb FOREACH line IN report.balance_sheet.Q.lines ?> 
-<tr><th><a href="journal.pl?action=search&to_date=<?lsmb to_date 
-       ?>&accno=account_number"
-       ><?lsmb line.account_number _ ': ' _ line.account_description ?></a></th>
+<tr><th><a href="journal.pl?action=search&to_date=<?lsmb report.to_date 
+       ?>&accno=<?lsmb account_number ?>"
+       ><?lsmb IF line.account_number; line.account_number _ ' - '; END; line.account_desc ?></a></th>
     <td class="amount"><?lsmb line.balance ?> </td>
 </tr>
 <?lsmb END ?>

Modified: trunk/sql/modules/Report.sql
===================================================================
--- trunk/sql/modules/Report.sql	2013-05-21 15:58:09 UTC (rev 5857)
+++ trunk/sql/modules/Report.sql	2013-05-22 15:13:55 UTC (rev 5858)
@@ -585,7 +585,7 @@
           AS heading
      FROM account a
 )
-   SELECT a2.id, a.description, a.accno, a.category, 
+   SELECT a2.id, a2.accno, a.description, a.category, 
           sum(ac.amount * CASE WHEN  a.category = 'A' THEN -1 ELSE 1 END), 
           at.path
      FROM a_bs a
@@ -594,13 +594,13 @@
      JOIN tx_report t ON t.approved AND t.id = ac.trans_id
 LEFT JOIN account a2 ON a.id = a2.id AND a2.category NOT IN ('I', 'E')
     WHERE ac.transdate <= coalesce($1, (select max(transdate) from acc_trans))
- GROUP BY a2.id, a.accno, a.description, a.category, at.path
+ GROUP BY a2.id, a2.accno, a.description, a.category, at.path
  ORDER BY CASE WHEN a.category = 'A' THEN 1
                WHEN a.category = 'L' THEN 2
                ELSE 3
           END,
           at.path,
-          a.accno NULLS LAST;
+          a2.accno NULLS LAST;
 $$;
 
 COMMENT ON function report__balance_sheet(date) IS

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