<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Lucida Grande";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Texto de globo Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.TextodegloboCar
        {mso-style-name:"Texto de globo Car";
        mso-style-priority:99;
        mso-style-link:"Texto de globo";
        font-family:"Tahoma","sans-serif";}
span.EstiloCorreo19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EstiloCorreo21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=ES link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>In addition my
get_dependents_lists is failing.<br>
<br>
In data\CRMEntity.php &#8211; line 1763 , I cant understand next algorithm:<br>
<br>
</span><span lang=EN-US style='font-family:"Courier New";color:#1F497D'>if
(!empty($other-&gt;related_tables)) {<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'>                     foreach ($other-&gt;related_tables as
$tname =&gt; $relmap) {<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'>                          $query .= &quot;, $tname.*&quot;;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'>                          // Setup the default JOIN conditions
if not specified<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'>                          if (empty($relmap[1]))<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'>                               $relmap[1] =
$other-&gt;table_name;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'>                          if (empty($relmap[2]))<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'>                               $relmap[2] = $relmap[0];<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'>                          $more_relation .= &quot; LEFT JOIN
$tname ON $tname.$relmap[0] = $relmap[1].$relmap[2]&quot;;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'>                     }<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'>                }<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Because NO ONE of the
modules have variable $related_tables. Can anyone give me some light?<br>
<br>
Thank you community.<o:p></o:p></span></p>

<div>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

</div>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> vtigercrm-developers-bounces@lists.vtigercrm.com
[mailto:vtigercrm-developers-bounces@lists.vtigercrm.com] <b>En nombre de </b>Adrián
Granado - Refineria Web<br>
<b>Enviado el:</b> lunes, 18 de febrero de 2013 12:17<br>
<b>Para:</b> vtigercrm-developers@lists.vtigercrm.com<br>
<b>Asunto:</b> [Vtigercrm-developers] Issue while generating Report<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span lang=EN-US>Hi all,<br>
<br>
I installed a fresh vTiger &nbsp;just for doing some tests and I noticed that
Reports are failing:<br>
<br>
I related Projects with Invoices. I did a field uitype = 10 in Invoice Module
and get_dependents_lists in Projects (from Invoices). So 1 Project has many
Invoices. And 1 Invoice has 1 Project.<br>
<br>
I tried to generate a Report listing all my invoices (which one field is
&#8220;Project Name&#8221;) and here is the result: &#8220;</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'>Report generation failed!</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F'><br>
</span><span style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'>Unknown column 'vtiger_invoicecf.cf_640' in
'on clause'</span><span lang=EN-US style='font-size:10.0pt;color:#323D4F;
background:#ECECEC'>&#8221;</span><span style='font-size:10.0pt;font-family:
"Lucida Grande","serif";color:#323D4F;background:#ECECEC'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>This is the SQL Query:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'>select DISTINCT<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt'><span
lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'>&nbsp;vtiger_invoice.invoicedate AS
'Invoice_Invoice_Date', <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt'><span
lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'>vtiger_invoice.duedate AS 'Invoice_Due_Date',
<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt'><span
lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'>concat(vtiger_invoice.currency_id,'::',vtiger_invoice.total)
as 'Invoice_Total',<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt'><span
lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'>&nbsp;(CASE WHEN vtiger_invoicecf.cf_640 NOT
LIKE '' THEN (CASE WHEN vtiger_project.projectname NOT LIKE '' THEN
vtiger_project.projectname ELSE '' END) ELSE '' END) AS Invoice_Proyecto, <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt'><span
lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'>vtiger_crmentity.crmid AS
&quot;LBL_ACTION&quot; <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt'><span
lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'>from vtiger_project <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>inner join vtiger_projectcf as vtiger_projectcf on
vtiger_projectcf.projectid=vtiger_project.projectid <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_project.projectid
<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_groups as vtiger_groupsProject on
vtiger_groupsProject.groupid = vtiger_crmentity.smownerid <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_users as vtiger_usersProject on
vtiger_usersProject.id = vtiger_crmentity.smownerid <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_users as vtiger_lastModifiedByProject on
vtiger_lastModifiedByProject.id = vtiger_crmentity.modifiedby <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_groups on vtiger_groups.groupid =
vtiger_crmentity.smownerid <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid
<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_crmentity as vtiger_crmentityRelProject624
on vtiger_crmentityRelProject624.crmid = vtiger_project.linktoaccountscontacts
and vtiger_crmentityRelProject624.deleted=0<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>&nbsp;left join vtiger_account as
vtiger_accountRelProject624 on vtiger_accountRelProject624.accountid =
vtiger_crmentityRelProject624.crmid<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>&nbsp;left join vtiger_contactdetails as
vtiger_contactdetailsRelProject624 on
vtiger_contactdetailsRelProject624.contactid =
vtiger_crmentityRelProject624.crmid <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join (select vtiger_invoice.* from vtiger_invoice
inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_invoice.invoiceid
and vtiger_crmentity.deleted=0) as vtiger_invoice on
vtiger_invoicecf.cf_640=vtiger_project.projectid <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_crmentity as vtiger_crmentityInvoice on
vtiger_crmentityInvoice.crmid=vtiger_invoice.invoiceid and
vtiger_crmentityInvoice.deleted=0 <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_invoicecf on vtiger_invoice.invoiceid =
vtiger_invoicecf.invoiceid <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_currency_info as vtiger_currency_infoInvoice
on vtiger_currency_infoInvoice.id = vtiger_invoice.currency_id <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_salesorder as vtiger_salesorderInvoice on
vtiger_salesorderInvoice.salesorderid=vtiger_invoice.salesorderid<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>&nbsp;left join vtiger_invoicebillads on
vtiger_invoice.invoiceid=vtiger_invoicebillads.invoicebilladdressid<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>&nbsp;left join vtiger_invoiceshipads on
vtiger_invoice.invoiceid=vtiger_invoiceshipads.invoiceshipaddressid<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>&nbsp;left join vtiger_inventoryproductrel as
vtiger_inventoryproductrelInvoice on vtiger_invoice.invoiceid = vtiger_inventoryproductrelInvoice.id
<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_products as vtiger_productsInvoice on
vtiger_productsInvoice.productid = vtiger_inventoryproductrelInvoice.productid <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_service as vtiger_serviceInvoice on
vtiger_serviceInvoice.serviceid = vtiger_inventoryproductrelInvoice.productid <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_groups as vtiger_groupsInvoice on
vtiger_groupsInvoice.groupid = vtiger_crmentityInvoice.smownerid <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_users as vtiger_usersInvoice on
vtiger_usersInvoice.id = vtiger_crmentityInvoice.smownerid <o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join vtiger_contactdetails as
vtiger_contactdetailsInvoice on vtiger_invoice.contactid =
vtiger_contactdetailsInvoice.contactid<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>&nbsp;left join vtiger_account as vtiger_accountInvoice on
vtiger_accountInvoice.accountid = vtiger_invoice.accountid<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:70.8pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>&nbsp;left join vtiger_users as
vtiger_lastModifiedByInvoice on vtiger_lastModifiedByInvoice.id =
vtiger_crmentityInvoice.modifiedby <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'>WHERE vtiger_project.projectid &gt; 0 AND
vtiger_crmentity.deleted=0<span class=apple-converted-space>&nbsp;</span></span><span
class=apple-converted-space><o:p></o:p></span></p>

<p class=MsoNormal><span class=apple-converted-space><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'><o:p>&nbsp;</o:p></span></span></p>

<p class=MsoNormal><span lang=EN-US>As you can see in the Query, it does:</span><o:p></o:p></p>

<p class=MsoNormal><span lang=EN-US>&nbsp;</span><span lang=EN-US
style='font-size:10.0pt;font-family:"Lucida Grande","serif";color:#323D4F;
background:#ECECEC'>left join (select vtiger_invoice.* from vtiger_invoice
inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_invoice.invoiceid
and vtiger_crmentity.deleted=0) as vtiger_invoice on
vtiger_invoicecf.cf_640=vtiger_project.projectid <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>before:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'>left join vtiger_invoicecf on
vtiger_invoice.invoiceid = vtiger_invoicecf.invoiceid <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Lucida Grande","serif";
color:#323D4F;background:#ECECEC'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>So, I think here is the problem.<br>
<br>
Did anyone experimented some of this? Can anyone bring me some light around
this?<br>
<br>
Thank you community.</span><span lang=EN-US style='font-size:10.0pt;font-family:
"Lucida Grande","serif";color:#323D4F;background:#ECECEC'><o:p></o:p></span></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

</div>

</body>

</html>