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

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



Revision: 6870
          http://sourceforge.net/p/ledger-smb/code/6870
Author:   einhverfr
Date:     2014-02-17 13:35:53 +0000 (Mon, 17 Feb 2014)
Log Message:
-----------
Fixed date handling with GL report.  Arg what a mess of things I made with my first round of code.  As sometimes is the case the answer was simply to remove code I previously had written.

Modified Paths:
--------------
    trunk/LedgerSMB/Report/GL.pm
    trunk/LedgerSMB/Report.pm
    trunk/LedgerSMB/Scripts/journal.pm

Modified: trunk/LedgerSMB/Report/GL.pm
===================================================================
--- trunk/LedgerSMB/Report/GL.pm	2014-02-17 11:43:16 UTC (rev 6869)
+++ trunk/LedgerSMB/Report/GL.pm	2014-02-17 13:35:53 UTC (rev 6870)
@@ -26,6 +26,7 @@
 package LedgerSMB::Report::GL;
 use Moose;
 extends 'LedgerSMB::Report';
+with 'LedgerSMB::Report::Dates';
 
 use LedgerSMB::Business_Unit_Class;
 use LedgerSMB::Business_Unit;
@@ -280,22 +281,6 @@
 
 has 'description' => (is => 'rw', isa => 'Maybe[Str]');
 
-=item from_date
-
-Earliest date which matches the search
-
-=cut
-
-has 'from_date' => (is => 'rw', coerce => 1, isa => 'LedgerSMB::Moose::Date');
-
-=item to_date
-
-Last date that matches the search
-
-=cut
-
-has 'to_date' => (is => 'rw', coerce => 1, isa => 'LedgerSMB::Moose::Date');
-
 =item approved
 
 Unless false, only matches approved transactions.  When false, matches all 

Modified: trunk/LedgerSMB/Report.pm
===================================================================
--- trunk/LedgerSMB/Report.pm	2014-02-17 11:43:16 UTC (rev 6869)
+++ trunk/LedgerSMB/Report.pm	2014-02-17 13:35:53 UTC (rev 6870)
@@ -351,22 +351,10 @@
 
 sub prepare_input {
     my ($self, $request) = @_;
-    if ($request->{from_month}){# and $request->{year}){tshvr4 year should be from_year!?
-        my $interval = $self->get_interval_dates(
-                                                  $request->{from_year}, 
-                                                  $request->{from_month}, 
-                                                  $request->{interval}
-        );
-        $request->{from_date} = $interval->{start};
-        $request->{to_date} = $interval->{end};
-    } else {
-        $request->{from_date} = LedgerSMB::PGDate->from_input(
-                                   $request->{from_date}
-        );
-        $request->{to_date} = LedgerSMB::PGDate->from_input(
-                                   $request->{to_date}#date_to
-        );
-    }
+    # Removing date handling since this is done by
+    # LedgerSMB::Report::Dates
+    # Question:  Should we move from_amount and to_amount to a role like this
+    # instead? --CT
     $request->{from_amount} = LedgerSMB::PGNumber->from_input(
                                $request->{from_amount}
     );

Modified: trunk/LedgerSMB/Scripts/journal.pm
===================================================================
--- trunk/LedgerSMB/Scripts/journal.pm	2014-02-17 11:43:16 UTC (rev 6869)
+++ trunk/LedgerSMB/Scripts/journal.pm	2014-02-17 13:35:53 UTC (rev 6870)
@@ -131,11 +131,7 @@
                if $request->{"business_unit_$count"};
     }
     #tshvr4 trying to mix in period from_month from_year interval
-    my $tshvr4_report = LedgerSMB::Report->new(%$request);#tshvr4,seems i have to do this , to be able to call prepare_input
-    $tshvr4_report->prepare_input($request);
-    my $report = LedgerSMB::Report::GL->new(%$request);
-    $report->run_report;
-    $report->render($request);
+    LedgerSMB::Report::GL->new(%$request)->render($request);
 }
 
 =item search_purchases

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