AnsweredAssumed Answered

alinea-sol-report Issue with AOS modules

Question asked by Manish Manish on Apr 11, 2014
Hi,

I am using purchased AOS version.I am trying to create following report but I am failed to generate it.

No.of products purchased by Account.It created two left join with same module...How I can remove this repeated left join..Please check bold area in query which cause an issue

SELECT accounts0.name AS 'billing account id => accounts name',aos_products_quotes3.name AS 'id aos invoices aos product quotes => aos products quotes name',
SUM(aos_products_quotes1.product_qty) AS 'id aos invoices aos product quotes => aos products quotes product qty'
FROM aos_invoices LEFT JOIN accounts accounts0 ON aos_invoices.billing_account_id=accounts0.id

LEFT JOIN aos_products_quotes aos_products_quotes1 ON (aos_invoices.id=aos_products_quotes1.parent_id
AND aos_invoices.deleted=0 AND aos_products_quotes1.deleted=0)

LEFT JOIN aos_products_quotes aos_products_quotes3 ON (aos_invoices.id=aos_products_quotes3.parent_id
AND aos_invoices.deleted=0  AND aos_products_quotes3.deleted=0)

WHERE aos_invoices.deleted = 0 AND aos_products_quotes3.name='fork'
GROUP BY accounts0.name

Please help me!

Regards,
Manish

Outcomes