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

SF.net SVN: ledger-smb:[6492] trunk/LedgerSMB/Report/Trial_Balance.pm



Revision: 6492
          http://sourceforge.net/p/ledger-smb/code/6492
Author:   einhverfr
Date:     2014-01-17 05:14:53 +0000 (Fri, 17 Jan 2014)
Log Message:
-----------
trial balance now excludes, in Perl, all accounts with no opening balance or activity

Modified Paths:
--------------
    trunk/LedgerSMB/Report/Trial_Balance.pm

Modified: trunk/LedgerSMB/Report/Trial_Balance.pm
===================================================================
--- trunk/LedgerSMB/Report/Trial_Balance.pm	2014-01-17 05:05:06 UTC (rev 6491)
+++ trunk/LedgerSMB/Report/Trial_Balance.pm	2014-01-17 05:14:53 UTC (rev 6492)
@@ -214,10 +214,13 @@
 
 sub run_report {
     my ($self) = @_;
-    my @rows = $self->exec_method({funcname => 'trial_balance__generate'});
+    my @rawrows = $self->exec_method({funcname => 'trial_balance__generate'});
     my $total_debits;
     my $total_credits;
-    for my $ref(@rows){
+    my @rows = ();
+    for my $ref(@rawrows){
+        next if (($ref->{starting_balance} == 0)
+                        and ($ref->{credits} == 0) and ($ref->{debits} == 0));
         my $href_suffix = "from_date=" . $self->from_date . 
                           "&to_date=" . $self->to_date .
                           "&accno=" . $ref->{account_number};
@@ -226,12 +229,11 @@
         $ref->{account_number_href_suffix} = $href_suffix;
         $ref->{account_desc_href_suffix} = $href_suffix;
         $ref->{gifi_accno_href_suffix} = $href_suffix;
-        
+        push @rows, $ref;
     }
     push @rows, {class => 'total', 
                debits => $total_debits,
               credits => $total_credits, };
-
     $self->rows(\@rows);
 }
 

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


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits