[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[3381] trunk/LedgerSMB/PriceMatrix.pm
- Subject: SF.net SVN: ledger-smb:[3381] trunk/LedgerSMB/PriceMatrix.pm
- From: ..hidden..
- Date: Wed, 29 Jun 2011 11:07:36 +0000
Revision: 3381
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3381&view=rev
Author: einhverfr
Date: 2011-06-29 11:07:36 +0000 (Wed, 29 Jun 2011)
Log Message:
-----------
Pricematrix no longer dependant on dropped views
Modified Paths:
--------------
trunk/LedgerSMB/PriceMatrix.pm
Modified: trunk/LedgerSMB/PriceMatrix.pm
===================================================================
--- trunk/LedgerSMB/PriceMatrix.pm 2011-06-29 10:48:21 UTC (rev 3380)
+++ trunk/LedgerSMB/PriceMatrix.pm 2011-06-29 11:07:36 UTC (rev 3381)
@@ -42,7 +42,7 @@
my @queryargs;
my $transdate = $form->{dbh}->quote( $form->{transdate} );
- my $entity_id = $form->{dbh}->quote( $form->{entity_id} );
+ my $credit_id = $form->{dbh}->quote( $form->{credit_id} );
if ( $form->{customer_id} ) {
my $defaultcurrency = $form->{dbh}->quote( $form->{defaultcurrency} );
@@ -58,7 +58,7 @@
$transdate
AND coalesce(p.validto, $transdate) >=
$transdate
- AND p.credit_id = $entity_id
+ AND p.credit_id = $credit_id
UNION
@@ -68,13 +68,13 @@
p.validto, p.curr, g.pricegroup, 2 AS priority
FROM partscustomer p
JOIN pricegroup g ON (g.id = p.pricegroup_id)
- JOIN customer c ON (c.pricegroup_id = g.id)
+ JOIN entity_credit_account c ON (c.pricegroup_id = g.id)
WHERE p.parts_id = ?
AND coalesce(p.validfrom, $transdate) <=
$transdate
AND coalesce(p.validto, $transdate) >=
$transdate
- AND c.id = $entity_id
+ AND c.id = $credit_id
UNION
@@ -103,7 +103,7 @@
SELECT partnumber, lastcost
FROM partsvendor
WHERE parts_id = ?
- AND credit_id = $entity_id|;
+ AND credit_id = $credit_id|;
$sth = $dbh->prepare($query) || $form->dberror($query);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.