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

SF.net SVN: ledger-smb:[3840] branches/1.3/LedgerSMB



Revision: 3840
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3840&view=rev
Author:   einhverfr
Date:     2011-10-12 06:00:00 +0000 (Wed, 12 Oct 2011)
Log Message:
-----------
More timecard fixes

Modified Paths:
--------------
    branches/1.3/LedgerSMB/JC.pm
    branches/1.3/LedgerSMB/PE.pm

Modified: branches/1.3/LedgerSMB/JC.pm
===================================================================
--- branches/1.3/LedgerSMB/JC.pm	2011-10-12 00:24:08 UTC (rev 3839)
+++ branches/1.3/LedgerSMB/JC.pm	2011-10-12 06:00:00 UTC (rev 3840)
@@ -67,8 +67,8 @@
 			       pr.production, pr.completed, 
 			       pr.parts_id AS project
 			  FROM jcitems j
-                          JOIN person ps ON (j.person_id = p.id)
-			  JOIN entity e ON (e.id = ps.employee_id)
+                          JOIN person ps ON (j.person_id = ps.id)
+			  JOIN entity e ON (e.id = ps.entity_id)
 			  JOIN parts p ON (p.id = j.parts_id)
 			  JOIN project pr ON (pr.id = j.project_id)
 			 WHERE j.id = ?|;
@@ -491,7 +491,6 @@
                   JOIN entity_employee ee ON ee.entity_id = e.id
 		  JOIN parts p ON (p.id = j.parts_id)
 		  JOIN project pr ON (pr.id = j.project_id)
-		  JOIN employee e ON (e.entity_id = j.employee_id)
 		 WHERE $where
 		ORDER BY employee, employeenumber, $sortorder|;
 
@@ -603,8 +602,7 @@
 		       checkedin = ?::timestamp,
 		       checkedout = ?::timestamp,
 		       person_id = (SELECT id FROM person 
-                                     WHERE entity_id 
-                                           = person__get_my_entity_id()),
+                                     WHERE entity_id = ?),
 		       notes = ?
 		 WHERE id = ?|;
     $sth = $dbh->prepare($query);

Modified: branches/1.3/LedgerSMB/PE.pm
===================================================================
--- branches/1.3/LedgerSMB/PE.pm	2011-10-12 00:24:08 UTC (rev 3839)
+++ branches/1.3/LedgerSMB/PE.pm	2011-10-12 06:00:00 UTC (rev 3840)
@@ -200,7 +200,7 @@
 			   SELECT pr.*, e.name AS customer
 			     FROM project pr
 			LEFT JOIN entity_credit_account c 
-                                  ON (c.id = pr.customer_id)
+                                  ON (c.id = pr.credit_id)
 			LEFT JOIN entity e ON (c.entity_id = e.id)
 			    WHERE pr.id = ?|;
         $sth = $dbh->prepare($query);
@@ -1832,7 +1832,7 @@
 # future, this will be more generaly constructed.
     $query = qq|
 		   SELECT j.id, j.description, j.qty - j.allocated AS qty,
-		          j.sellprice, j.parts_id, pr.customer_id, 
+		          j.sellprice, j.parts_id, pr.credit_id as customer_id, 
 		          j.project_id, j.checkedin::date AS transdate, 
 		          j.notes, c.name AS customer, pr.projectnumber, 
 		          p.partnumber
@@ -1840,7 +1840,7 @@
 		     JOIN project pr ON (pr.id = j.project_id)
 		     JOIN employee e ON (e.id = j.employee_id)
 		     JOIN parts p ON (p.id = j.parts_id)
-		LEFT JOIN entity_credit_account eca ON (c.id = pr.customer_id)
+		LEFT JOIN entity_credit_account eca ON (c.id = pr.credit_id)
                 LEFT JOIN company c ON eca.entity_id = c.entity_id
 		    WHERE pr.parts_id IS NULL
 		          AND j.allocated != j.qty $where

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