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

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



Revision: 6789
          http://sourceforge.net/p/ledger-smb/code/6789
Author:   einhverfr
Date:     2014-02-07 05:41:44 +0000 (Fri, 07 Feb 2014)
Log Message:
-----------
Stored procedures for timecard searches now work, but there is no open/closed options for the search screen.

Modified Paths:
--------------
    trunk/LedgerSMB/Report/Timecards.pm
    trunk/sql/modules/Timecards.sql

Modified: trunk/LedgerSMB/Report/Timecards.pm
===================================================================
--- trunk/LedgerSMB/Report/Timecards.pm	2014-02-07 05:24:21 UTC (rev 6788)
+++ trunk/LedgerSMB/Report/Timecards.pm	2014-02-07 05:41:44 UTC (rev 6789)
@@ -184,7 +184,7 @@
     for my $row (@rows){
         $row->{"day$row->{dow}"} = $row->{qty};
     }
-    $self->rows(@rows);
+    $self->rows(\@rows);
 }
 
 =back

Modified: trunk/sql/modules/Timecards.sql
===================================================================
--- trunk/sql/modules/Timecards.sql	2014-02-07 05:24:21 UTC (rev 6788)
+++ trunk/sql/modules/Timecards.sql	2014-02-07 05:41:44 UTC (rev 6789)
@@ -134,17 +134,17 @@
        ee.employeenumber, e.name AS employee, j.parts_id, j.sellprice
   FROM jcitems j
   JOIN parts p ON p.id = j.parts_id
-  JOIN person ON person.id = j.person_id
-  JOIN entity_employee ee ON ee.entity_id = person.entity_id
+  JOIN entity_employee ee ON ee.entity_id = j.person_id
   JOIN entity e ON ee.entity_id = e.id
-  JOIN bu_tree bu ON bu.id = j.business_unit_id
+  LEFT JOIN bu_tree bu ON bu.id = j.business_unit_id 
  WHERE (p.partnumber = $2 OR $2 IS NULL)
        AND (ee.entity_id = $3 OR $3 IS NULL)
        AND (j.checkedin::date <= $4 OR $4 IS NULL)
        AND (j.checkedin::date >= $5 OR $5 IS NULL)
-       AND (j.qty > j.allocated AND $6)
-       AND (j.qty <= j.allocated AND $7)
-       AND (j.jctype = $8 OR $8 is null);
+       AND (((j.qty > j.allocated or j.allocated is null)  AND $6)
+            OR (j.qty <= j.allocated AND $7))
+       AND (j.jctype = $8 OR $8 is null)
+       AND (bu.path IS NOT NULL OR $1 = '{}' OR $1 IS NULL)
 $$;
 
 CREATE OR REPLACE FUNCTION timecard__allocate(in_id int, in_amount numeric)

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


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits