[Vtigercrm-developers] Reports still broken in 6.3.0 with UItype 10s

Alan Lord alanslists at gmail.com
Tue Jul 14 09:35:26 GMT 2015


I have two custom Modules "A" and "B".

"B" has a has a UI10 to "A" and two UI10s to Accounts.

If I create a report using "B" as the primary module the report runs 
fine. But if I want to use A as the Primary module and bring in "B" as 
the secondary report the Report fails because it generates two table 
aliases to vtiger_accounts with the same name...

> Tue Jul 14 09:22:14 2015,802 [16492] INFO VT - PearDatabase ->ADODB error  Query Failed:
> select
> sum(libertus_lstourdetailscf.cf_964) 'LSTourDetails_Sales_Volume_SUM',
> sum(libertus_lstourdetails.giftvalue) 'LSTourDetails_LSTOURDETAILS_GIFT_VALUE_SUM',
> sum(libertus_lstourdetails.depositamnt) 'LSTourDetails_LSTOURDETAILS_DEPOSIT_AMOUNT_SUM'
> from libertus_lstourfamilies
> inner join vtiger_crmentity
>     on vtiger_crmentity.crmid=libertus_lstourfamilies.lstourfamiliesid
> left join vtiger_groups
>     on vtiger_groups.groupid = vtiger_crmentity.smownerid
> left join vtiger_users
>     on vtiger_users.id = vtiger_crmentity.smownerid
> left join vtiger_reptmptbl_155a4d4c10fe3d6686545900 as libertus_lstourdetails
>     on libertus_lstourdetails.lstourfamiliesid=libertus_lstourfamilies.lstourfamiliesid
> left join vtiger_crmentity as vtiger_crmentityLSTourDetails
>     on vtiger_crmentityLSTourDetails.crmid = libertus_lstourdetails.lstourdetailsid AND vtiger_crmentityLSTourDetails.deleted=0
> left join libertus_lstourdetailscf as libertus_lstourdetailscf
>     on libertus_lstourdetailscf.lstourdetailsid=libertus_lstourdetails.lstourdetailsid
> left join vtiger_crmentity as vtiger_crmentityRelLSTourDetails1103
>     on vtiger_crmentityRelLSTourDetails1103.crmid = libertus_lstourdetails.resortid and vtiger_crmentityRelLSTourDetails1103.deleted=0
> left join *vtiger_account* as vtiger_accountRelLSTourDetails 						<<<<<< 1st Alias here
>     on vtiger_accountRelLSTourDetails.accountid = vtiger_crmentityRelLSTourDetails1103.crmid
> left join vtiger_crmentity as vtiger_crmentityRelLSTourDetails1105
>     on vtiger_crmentityRelLSTourDetails1105.crmid = libertus_lstourdetails.contactid and vtiger_crmentityRelLSTourDetails1105.deleted=0
> left join vtiger_contactdetails as vtiger_contactdetailsRelLSTourDetails
>     on vtiger_contactdetailsRelLSTourDetails.contactid = vtiger_crmentityRelLSTourDetails1105.crmid
> left join *vtiger_account* as vtiger_accountRelLSTourDetails 						<<<<< 2nd Alias here
>     on vtiger_accountRelLSTourDetails.accountid = vtiger_crmentityRelLSTourDetails1117.crmid
> WHERE libertus_lstourfamilies.lstourfamiliesid > 0  AND vtiger_crmentity.deleted=0 and (( libertus_lstourdetails.tourdate BETWEEN '2015-07-06' AND '2015-07-12' ) )  ::->[1066]Not unique table/alias: 'vtiger_accountRelLSTourDetails'

I will see if I can fix this in the ReportRun.php but just in case 
anyone has fixed this already patches welcome ;-)

Cheers

Al



More information about the vtigercrm-developers mailing list