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

SF.net SVN: ledger-smb: [1532] trunk/LedgerSMB/AM.pm



Revision: 1532
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1532&view=rev
Author:   einhverfr
Date:     2007-09-07 10:23:00 -0700 (Fri, 07 Sep 2007)

Log Message:
-----------
Fixing recurring transactions

Modified Paths:
--------------
    trunk/LedgerSMB/AM.pm

Modified: trunk/LedgerSMB/AM.pm
===================================================================
--- trunk/LedgerSMB/AM.pm	2007-09-07 17:09:37 UTC (rev 1531)
+++ trunk/LedgerSMB/AM.pm	2007-09-07 17:23:00 UTC (rev 1532)
@@ -1290,7 +1290,7 @@
 
     $query = qq|
 		   SELECT 'ar' AS module, 'ar' AS transaction, a.invoice,
-		          n.name AS description, a.amount,
+		          e.name AS description, a.amount,
 		          s.*, se.formname AS recurringemail,
 		          sp.formname AS recurringprint,
 		          s.nextdate - current_date AS overdue, 
@@ -1300,7 +1300,7 @@
                           AS expired
 		     FROM recurring s
 		     JOIN ar a ON (a.id = s.id)
-		     JOIN customer n USING (entity_id)
+		     JOIN entity e ON (a.entity_id = e.id)
 		LEFT JOIN recurringemail se ON (se.id = s.id)
 		LEFT JOIN recurringprint sp ON (sp.id = s.id)
 		LEFT JOIN exchangerate ex 
@@ -1309,7 +1309,7 @@
 		    UNION
 
 		  SELECT 'ap' AS module, 'ap' AS transaction, a.invoice,
-		          n.name AS description, a.amount,
+		          e.name AS description, a.amount,
 		          s.*, se.formname AS recurringemail,
 		          sp.formname AS recurringprint,
 		          s.nextdate - current_date AS overdue, 'vendor' AS vc,
@@ -1318,7 +1318,7 @@
 		          AS expired
 		     FROM recurring s
 		     JOIN ap a ON (a.id = s.id)
-		     JOIN vendor n ON (n.id = a.vendor_id)
+		     JOIN entity e ON (a.entity_id = e.id)
 		LEFT JOIN recurringemail se ON (se.id = s.id)
 		LEFT JOIN recurringprint sp ON (sp.id = s.id)
 		LEFT JOIN exchangerate ex ON 
@@ -1345,7 +1345,7 @@
 		    UNION
 
 		   SELECT 'oe' AS module, 'so' AS transaction, FALSE AS invoice,
-		          n.name AS description, a.amount,
+		          e.name AS description, a.amount,
 		          s.*, se.formname AS recurringemail,
 		          sp.formname AS recurringprint,
 		          s.nextdate - current_date AS overdue, 
@@ -1355,7 +1355,7 @@
 		          AS expired
 		     FROM recurring s
 		     JOIN oe a ON (a.id = s.id)
-		     JOIN customer USING (entity_id)
+		     JOIN entity e ON (a.entity_id = e.id)
 		LEFT JOIN recurringemail se ON (se.id = s.id)
 		LEFT JOIN recurringprint sp ON (sp.id = s.id)
 		LEFT JOIN exchangerate ex ON 
@@ -1365,7 +1365,7 @@
 		    UNION
 
 		   SELECT 'oe' AS module, 'po' AS transaction, FALSE AS invoice,
-		          n.name AS description, a.amount,
+		          e.name AS description, a.amount,
 		          s.*, se.formname AS recurringemail,
 		          sp.formname AS recurringprint,
 		          s.nextdate - current_date AS overdue, 'vendor' AS vc,
@@ -1374,7 +1374,7 @@
 		          AS expired
 		     FROM recurring s
 		     JOIN oe a ON (a.id = s.id)
-		     JOIN vendor n ON (n.id = a.vendor_id)
+		     JOIN entity e ON (a.entity_id = e.id)
 		LEFT JOIN recurringemail se ON (se.id = s.id)
 		LEFT JOIN recurringprint sp ON (sp.id = s.id)
 		LEFT JOIN exchangerate ex ON 


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