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

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



Revision: 6839
          http://sourceforge.net/p/ledger-smb/code/6839
Author:   einhverfr
Date:     2014-02-11 08:13:25 +0000 (Tue, 11 Feb 2014)
Log Message:
-----------
fixing trial balance and PNL bugs:
1.  Balances confusing in trial balance (bug 1040)
2.  PNL dropdowns not linking to correct data (bug 1055)

Modified Paths:
--------------
    trunk/LedgerSMB/Report/Dates.pm
    trunk/LedgerSMB/Report/Trial_Balance.pm
    trunk/UI/Reports/filters/trial_balance.html

Modified: trunk/LedgerSMB/Report/Dates.pm
===================================================================
--- trunk/LedgerSMB/Report/Dates.pm	2014-02-11 02:07:10 UTC (rev 6838)
+++ trunk/LedgerSMB/Report/Dates.pm	2014-02-11 08:13:25 UTC (rev 6839)
@@ -61,9 +61,9 @@
 
 =cut
 
-has date_from => (lazy => '1', builder => 'from_date');
+has date_from => (is => 'ro', lazy => '1', builder => 'from_date');
 
-has date_to => (lazy => '1', builder => 'to_date');
+has date_to => (is => 'ro', lazy => '1', builder => 'to_date');
 
 sub _get_from_date {
     my ($self) = @_;
@@ -105,11 +105,25 @@
     return $date;
 }
 
-before 'render' => sub { 
+sub _set_lazy_dates {
               my ($self) = @_;
+              # Set lazy attributes
               $self->from_date;
               $self->to_date;
+              $self->date_from;
+              $self->date_to;
+}
+
+before 'render' => sub { 
+              my ($self) = @_;
+              # Set lazy attributes
+              $self->_set_lazy_dates;
 };
+before 'run_report' => sub { 
+              my ($self) = @_;
+              # Set lazy attributes
+              $self->_set_lazy_dates;
+};
 
 
 =head1 COPYRIGHT

Modified: trunk/LedgerSMB/Report/Trial_Balance.pm
===================================================================
--- trunk/LedgerSMB/Report/Trial_Balance.pm	2014-02-11 02:07:10 UTC (rev 6838)
+++ trunk/LedgerSMB/Report/Trial_Balance.pm	2014-02-11 08:13:25 UTC (rev 6839)
@@ -83,7 +83,16 @@
 
 has ignore_yearend => (is => 'rw', isa => 'Str');
 
+=item balance_sign
 
+Either 1, 0, or -1.  1 for credit, -1 for debit, 0 for normal balances (i.e 
+credit balances except for asset and expense accounts).
+
+=cut
+
+has balance_sign => (is => 'rw', isa => 'Int');
+
+
 =item heading
 
 If set, only select accounts under this heading

Modified: trunk/UI/Reports/filters/trial_balance.html
===================================================================
--- trunk/UI/Reports/filters/trial_balance.html	2014-02-11 02:07:10 UTC (rev 6838)
+++ trunk/UI/Reports/filters/trial_balance.html	2014-02-11 08:13:25 UTC (rev 6839)
@@ -1,7 +1,12 @@
 <?lsmb include_stylesheet = ['css/trial_balance/search.css']?>
 <?lsmb INCLUDE 'ui-header.html' ?> 
 <?lsmb PROCESS elements.html;
-       PROCESS report_base.html ?>
+       PROCESS report_base.html;
+BALANCE_TYPES = [
+   {text = text('Debit'), id = -1}
+   {text = text('Credit'), id = 1}
+   {text = text('Normal'), id = 0}
+] ?>
 
 <body class="<?lsmb dojo_theme ?>">
     <form method="get" action="trial_balance.pl">
@@ -19,29 +24,8 @@
             <td>
               <table>
                 <?lsmb PROCESS business_classes ?>
+                <?lsmb PROCESS date_row ?>
                 <tr>
-                    <th align="right"><?lsmb text('From') ?></th>
-                    <td>
-                        <?lsmb PROCESS input element_data={
-                        class => 'date',
-                        name => 'date_from',
-                        size => '11',
-                        title => user.dateformat,
-                        value => report.date_from,
-                        } ?>
-                    </td>
-                    <th align="right"><?lsmb text('To') ?></th>
-                    <td>
-                        <?lsmb PROCESS input element_data={
-                        class => 'date',
-                        name => 'date_to',
-                        size => '11',
-                        title => user.dateformat,
-                        value => report.date_to,
-                        } ?>
-                    </td>
-                </tr>
-                <tr>
             </table>
           </td>
         </tr>
@@ -72,6 +56,13 @@
                              } ?>
                     </td>
                 </tr>
+                <tr><th><?lsmb text('Balances as') ?></th>
+                    <td><?lsmb PROCESS select element_data = {
+                               name = 'balance_sign'
+                            options = BALANCE_TYPES 
+                     default_values = ['0']
+                          value_attr = 'id'
+                        } ?></td>
               </table>
             </td>
           </tr>
@@ -116,7 +107,7 @@
         <br />
         
         <?lsmb PROCESS button element_data={
-            text = 'Run',
+            text = text('Continue'),
             attributes = {
                 name= 'action',
                 value= 'run'

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


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits