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

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



Revision: 1518
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1518&view=rev
Author:   einhverfr
Date:     2007-09-05 22:29:30 -0700 (Wed, 05 Sep 2007)

Log Message:
-----------
Sales order printing seems to kinda work

Modified Paths:
--------------
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB/IS.pm

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2007-09-06 04:12:34 UTC (rev 1517)
+++ trunk/LedgerSMB/Form.pm	2007-09-06 05:29:30 UTC (rev 1518)
@@ -2152,13 +2152,13 @@
 				a.intnotes, ce.name AS $vc, a.department_id, 
 				d.description AS department,
 				a.amount AS oldinvtotal, a.paid AS oldtotalpaid,
-				a.employee_id, e.name AS employee, 
+				a.person_id, e.name AS employee, 
 				c.language_code, a.ponumber, a.reverse
 			FROM $arap a
 			JOIN entity_credit_account c USING (entity_id)
-			JOIN entity ce ON (e.id = c.entity_id)
+			JOIN entity ce ON (ce.id = c.entity_id)
 			LEFT JOIN employee er ON (er.entity_id = a.person_id)
-			LEFT JOIN entity e ON (er.entity_id = e.entity_id)
+			LEFT JOIN entity e ON (er.entity_id = e.id)
 			LEFT JOIN department d ON (d.id = a.department_id)
 			WHERE a.id = ? AND c.entity_class = 
 				(select id FROM entity_class 

Modified: trunk/LedgerSMB/IS.pm
===================================================================
--- trunk/LedgerSMB/IS.pm	2007-09-06 04:12:34 UTC (rev 1517)
+++ trunk/LedgerSMB/IS.pm	2007-09-06 05:29:30 UTC (rev 1518)
@@ -785,13 +785,20 @@
 
     # get rest for the customer
     my $query = qq|
-		SELECT customernumber, name, address1, address2, city,
-		       state, zipcode, country,
-		       contact, phone as customerphone, fax as customerfax,
-		       taxnumber AS customertaxnumber, sic_code AS sic, iban, 
+		SELECT c.customernumber, e.name, l.line_one as address1, 
+		       l.line_two as address2, l.city_province AS city,
+		       '' as state, l.mail_code AS zipcode, 
+		       country.name as country,
+		       '' as contact, '' as customerphone, '' as customerfax,
+		       '' AS customertaxnumber, sic_code AS sic, iban, 
 		       bic, startdate, enddate
-		  FROM customer
-		 WHERE id = ?|;
+		  FROM customer c
+		  JOIN company cm ON c.entity_id = cm.entity_id
+		  JOIN entity e ON (c.entity_id = e.id)
+		  JOIN company_to_location cl ON cm.id = cl.company_id
+		  JOIN location l ON cl.location_id = l.id
+		  JOIN country ON l.country_id = country.id
+		 WHERE e.id = ?|;
     my $sth = $dbh->prepare($query);
     $sth->execute( $form->{customer_id} ) || $form->dberror($query);
 
@@ -1858,11 +1865,12 @@
 			          a.intnotes,
 			          a.duedate, a.taxincluded, a.curr AS currency,
 			          a.person_id, e.name AS employee, a.till, 
-			          a.entity_id, a.reverse
+			          a.entity_id, a.reverse,
 			          a.language_code, a.ponumber,
 			          a.on_hold
 			     FROM ar a
-			LEFT JOIN employee e ON (e.entity_id = a.person_id)
+			LEFT JOIN employee em ON (em.entity_id = a.person_id)
+			INNER JOIN entity e ON e.id = em.entity_id
 			    WHERE a.id = ?|;
 
         $sth = $dbh->prepare($query);


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