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

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



Revision: 1542
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1542&view=rev
Author:   einhverfr
Date:     2007-09-07 22:06:24 -0700 (Fri, 07 Sep 2007)

Log Message:
-----------
Fixing payment/receipt screens

Modified Paths:
--------------
    trunk/LedgerSMB/CP.pm
    trunk/UI/menu/expanding.css

Modified: trunk/LedgerSMB/CP.pm
===================================================================
--- trunk/LedgerSMB/CP.pm	2007-09-08 05:04:50 UTC (rev 1541)
+++ trunk/LedgerSMB/CP.pm	2007-09-08 05:06:24 UTC (rev 1542)
@@ -127,10 +127,11 @@
     my $dbh = $form->{dbh};
 
     my $arap = ( $form->{vc} eq 'customer' ) ? 'ar' : 'ap';
-    my $query = qq|SELECT count(*)
-					 FROM $form->{vc} ct, $arap a
-					WHERE a.entity_id = ct.entity_id
-					  AND a.amount != a.paid|;
+    my $query = qq|
+		SELECT count(*)
+		  FROM entity_credit_account ct 
+		  JOIN $arap a USING (entity_id)
+		 WHERE a.amount != a.paid|;
 
     my ($count) = $dbh->selectrow_array($query);
 
@@ -138,8 +139,7 @@
     my $ref;
     my $i = 0;
 
-    my $where = qq|WHERE a.entity_id = ct.entity_id
-					 AND a.amount != a.paid|;
+    my $where = qq|WHERE a.amount != a.paid|;
 
     if ( $form->{ $form->{vc} } ) {
         my $var = $dbh->quote( $form->like( lc $form->{ $form->{vc} } ) );
@@ -147,10 +147,16 @@
     }
 
     # build selection list
-    $query = qq|SELECT DISTINCT ct.*
-				  FROM $form->{vc} ct, $arap a
-				$where
-			  ORDER BY name|;
+    $query = qq|
+	SELECT DISTINCT ct.*, e.name, c.*, l.*
+	  FROM entity_credit_account ct 
+	  JOIN $arap a USING (entity_id)
+	  JOIN company c USING (entity_id)
+	  JOIN entity e ON (e.id = a.entity_id)
+	  LEFT JOIN company_to_location c2l ON (c.id = c2l.company_id)
+	  LEFT JOIN location l ON (l.id = c2l.location_id)
+	$where
+	 ORDER BY name|;
 
     $sth = $dbh->prepare($query);
     $sth->execute || $form->dberror($query);

Modified: trunk/UI/menu/expanding.css
===================================================================
--- trunk/UI/menu/expanding.css	2007-09-08 05:04:50 UTC (rev 1541)
+++ trunk/UI/menu/expanding.css	2007-09-08 05:06:24 UTC (rev 1542)
@@ -2,10 +2,10 @@
 	display: none;
 }
 
-A.Menu_Closed::before {
+A.Menu_Closed:before {
 	content: '+';
 }
 
-A.Menu_Open::before {
+A.Menu_Open:before {
 	content: '-';
 }


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