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

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



Revision: 5957
          http://sourceforge.net/p/ledger-smb/code/5957
Author:   einhverfr
Date:     2013-08-22 10:00:18 +0000 (Thu, 22 Aug 2013)
Log Message:
-----------
Fixing bug, no orders show up unless closed option is set

Modified Paths:
--------------
    trunk/LedgerSMB/PGDate.pm
    trunk/LedgerSMB/Report/Dates.pm
    trunk/sql/modules/OrderEntry.sql

Modified: trunk/LedgerSMB/PGDate.pm
===================================================================
--- trunk/LedgerSMB/PGDate.pm	2013-08-22 09:40:40 UTC (rev 5956)
+++ trunk/LedgerSMB/PGDate.pm	2013-08-22 10:00:18 UTC (rev 5957)
@@ -19,12 +19,21 @@
 =over
 
 =item date
+
 A DateTime object for internal storage and processing.
 
 =cut
 
 has date => (isa => 'DateTime', is=> 'ro', required => '0');
 
+=item dummy
+
+If set to 1, this is a dummy value for an unknown value
+
+=cut
+
+has dummy => (isa => 'Bool', is=> 'ro', required => '0');
+
 =back
 
 =head1 SUPPORTED FORMATS
@@ -150,7 +159,7 @@
     my $format = $LedgerSMB::App_State::User->{dateformat};
     $format ||= 'yyyy-mm-dd';
     my $dt =  _parse_string($self, $input, uc($format), $has_time);
-    return $self->new({date => $dt});
+    return $self->new(date => $dt, dummy => !defined $dt);
 }
 
 
@@ -200,7 +209,7 @@
        confess 'LedgerSMB::PGDate Invalid DB Type';
     }
     my $dt =  _parse_string($self, $input, $format, $has_time);
-    return $self->new({date => $dt});
+    return $self->new(date => $dt, dummy => !defined $dt);
 }
 
 =item to_db

Modified: trunk/LedgerSMB/Report/Dates.pm
===================================================================
--- trunk/LedgerSMB/Report/Dates.pm	2013-08-22 09:40:40 UTC (rev 5956)
+++ trunk/LedgerSMB/Report/Dates.pm	2013-08-22 10:00:18 UTC (rev 5957)
@@ -71,7 +71,7 @@
         if ($ref->{lsmb__min_date}){
             return LedgerSMB::PGDate->from_db($ref->{lsmb__min_date}, 'date');
         } else {
-            return LedgerSMB::PGDate->from_db('1900-01-01', 'date');
+            return LedgerSMB::PGDate->new();
         }
                
     }
@@ -82,10 +82,11 @@
     if (!$self->from_month or !$self->from_year or $self->interval eq 'none'){
         my ($ref) = $self->exec_method({funcname => 'lsmb__max_date'});
         if ($ref->{lsmb__max_date}){
-            return LedgerSMB::PGDate->from_db($ref->{lsmb__max_date}, 'date');
+             return LedgerSMB::PGDate->from_db($ref->{lsmb__max_date}, 'date');
         } else {
-            return LedgerSMB::PGDate->from_db('2300-01-01', 'date');
+            return LedgerSMB::PGDate->new();
         }
+            
     }
     my $dateobj = $self->from_date;
     my $date = $dateobj->from_db($dateobj->to_db, 'date'); # copy, round trip

Modified: trunk/sql/modules/OrderEntry.sql
===================================================================
--- trunk/sql/modules/OrderEntry.sql	2013-08-22 09:40:40 UTC (rev 5956)
+++ trunk/sql/modules/OrderEntry.sql	2013-08-22 10:00:18 UTC (rev 5957)
@@ -70,8 +70,8 @@
              AND (in_ponumber IS NULL OR o.ponumber ILIKE in_ponumber || '%')
             AND (in_ordnumber IS NULL 
                      OR o.ordnumber ILIKE in_ordnumber || '%')
-             AND (in_open is true or o.closed is false)
-             AND (in_closed is true or o.closed is true)
+             AND ((in_open is true and o.closed is false)
+                 OR (in_closed is true and o.closed is true))
              AND (in_shipvia IS NULL 
                       OR o.shipvia @@ plainto_tsquery(in_shipvia))
              AND (in_description IS NULL AND in_shippable IS NULL OR

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


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits