diff --git a/modules/Campaigns/Campaigns.php b/modules/Campaigns/Campaigns.php
index 1d910bcc36d591cc60a7027e182a8d34922a50e3..cc99d855fdbe03ec6a22a15fe0e655dc9634972b 100644
--- a/modules/Campaigns/Campaigns.php
+++ b/modules/Campaigns/Campaigns.php
@@ -563,37 +563,37 @@ class Campaigns extends CRMEntity {
 	 * @param - $secmodule secondary module name
 	 * returns the query string formed on fetching the related data for report for secondary module
 	 */
-	function generateReportsSecQuery($module,$secmodule,$queryplanner){
-		$matrix = $queryplanner->newDependencyMatrix();
+	function generateReportsSecQuery($module,$secmodule,$queryPlanner){
+		$matrix = $queryPlanner->newDependencyMatrix();
         $matrix->setDependency('vtiger_crmentityCampaigns',array('vtiger_groupsCampaigns','vtiger_usersCampaignss','vtiger_lastModifiedByCampaigns','vtiger_campaignscf'));
         
-		if (!$queryplanner->requireTable("vtiger_campaign",$matrix)){
+		if (!$queryPlanner->requireTable("vtiger_campaign",$matrix)){
 			return '';
 		}
 
         $matrix->setDependency('vtiger_campaign', array('vtiger_crmentityCampaigns','vtiger_productsCampaigns'));
 
-		$query = $this->getRelationQuery($module,$secmodule,"vtiger_campaign","campaignid", $queryplanner);
+		$query = $this->getRelationQuery($module,$secmodule,"vtiger_campaign","campaignid", $queryPlanner);
 
-		if ($queryplanner->requireTable("vtiger_crmentityCampaigns",$matrix)){
+		if ($queryPlanner->requireTable("vtiger_crmentityCampaigns",$matrix)){
 			$query .=" left join vtiger_crmentity as vtiger_crmentityCampaigns on vtiger_crmentityCampaigns.crmid=vtiger_campaign.campaignid and vtiger_crmentityCampaigns.deleted=0";
 		}
-		if ($queryplanner->requireTable("vtiger_productsCampaigns")){
+		if ($queryPlanner->requireTable("vtiger_productsCampaigns")){
 			$query .=" 	left join vtiger_products as vtiger_productsCampaigns on vtiger_campaign.product_id = vtiger_productsCampaigns.productid";
 		}
-		if ($queryplanner->requireTable("vtiger_campaignscf")){
+		if ($queryPlanner->requireTable("vtiger_campaignscf")){
 			$query .=" 	left join vtiger_campaignscf on vtiger_campaignscf.campaignid = vtiger_crmentityCampaigns.crmid";
 		}
-		if ($queryplanner->requireTable("vtiger_groupsCampaigns")){
+		if ($queryPlanner->requireTable("vtiger_groupsCampaigns")){
 			$query .=" left join vtiger_groups as vtiger_groupsCampaigns on vtiger_groupsCampaigns.groupid = vtiger_crmentityCampaigns.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_usersCampaigns")){
+		if ($queryPlanner->requireTable("vtiger_usersCampaigns")){
 			$query .=" left join vtiger_users as vtiger_usersCampaigns on vtiger_usersCampaigns.id = vtiger_crmentityCampaigns.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_lastModifiedByCampaigns")){
+		if ($queryPlanner->requireTable("vtiger_lastModifiedByCampaigns")){
 			$query .=" left join vtiger_users as vtiger_lastModifiedByCampaigns on vtiger_lastModifiedByCampaigns.id = vtiger_crmentityCampaigns.modifiedby ";
 		}
-        if ($queryplanner->requireTable("vtiger_createdbyCampaigns")){
+        if ($queryPlanner->requireTable("vtiger_createdbyCampaigns")){
 			$query .= " left join vtiger_users as vtiger_createdbyCampaigns on vtiger_createdbyCampaigns.id = vtiger_crmentityCampaigns.smcreatorid ";
 		}
 
diff --git a/modules/Contacts/Contacts.php b/modules/Contacts/Contacts.php
index 19f12b376a64ff278c7216795804ca35852527e8..2e33d8b7a454478ec00962d35a10b1d1053ec84c 100644
--- a/modules/Contacts/Contacts.php
+++ b/modules/Contacts/Contacts.php
@@ -1307,53 +1307,53 @@ function get_contactsforol($user_name)
 	 * @param - $secmodule secondary module name
 	 * returns the query string formed on fetching the related data for report for secondary module
 	 */
-	function generateReportsSecQuery($module,$secmodule,$queryplanner){
-		$matrix = $queryplanner->newDependencyMatrix();
+	function generateReportsSecQuery($module,$secmodule,$queryPlanner){
+		$matrix = $queryPlanner->newDependencyMatrix();
 		$matrix->setDependency('vtiger_crmentityContacts',array('vtiger_groupsContacts','vtiger_usersContacts','vtiger_lastModifiedByContacts'));
 		
-		if (!$queryplanner->requireTable('vtiger_contactdetails', $matrix)) {
+		if (!$queryPlanner->requireTable('vtiger_contactdetails', $matrix)) {
 			return '';
 		}
 
         $matrix->setDependency('vtiger_contactdetails', array('vtiger_crmentityContacts','vtiger_contactaddress',
 								'vtiger_customerdetails','vtiger_contactsubdetails','vtiger_contactscf'));
 
-		$query = $this->getRelationQuery($module,$secmodule,"vtiger_contactdetails","contactid", $queryplanner);
+		$query = $this->getRelationQuery($module,$secmodule,"vtiger_contactdetails","contactid", $queryPlanner);
 
-		if ($queryplanner->requireTable("vtiger_crmentityContacts",$matrix)){
+		if ($queryPlanner->requireTable("vtiger_crmentityContacts",$matrix)){
 			$query .= " left join vtiger_crmentity as vtiger_crmentityContacts on vtiger_crmentityContacts.crmid = vtiger_contactdetails.contactid  and vtiger_crmentityContacts.deleted=0";
 		}
-		if ($queryplanner->requireTable("vtiger_contactdetailsContacts")){
+		if ($queryPlanner->requireTable("vtiger_contactdetailsContacts")){
 			$query .= " left join vtiger_contactdetails as vtiger_contactdetailsContacts on vtiger_contactdetailsContacts.contactid = vtiger_contactdetails.reportsto";
 		}
-		if ($queryplanner->requireTable("vtiger_contactaddress")){
+		if ($queryPlanner->requireTable("vtiger_contactaddress")){
 			$query .= " left join vtiger_contactaddress on vtiger_contactdetails.contactid = vtiger_contactaddress.contactaddressid";
 		}
-		if ($queryplanner->requireTable("vtiger_customerdetails")){
+		if ($queryPlanner->requireTable("vtiger_customerdetails")){
 			$query .= " left join vtiger_customerdetails on vtiger_customerdetails.customerid = vtiger_contactdetails.contactid";
 		}
-		if ($queryplanner->requireTable("vtiger_contactsubdetails")){
+		if ($queryPlanner->requireTable("vtiger_contactsubdetails")){
 			$query .= " left join vtiger_contactsubdetails on vtiger_contactdetails.contactid = vtiger_contactsubdetails.contactsubscriptionid";
 		}
-		if ($queryplanner->requireTable("vtiger_accountContacts")){
+		if ($queryPlanner->requireTable("vtiger_accountContacts")){
 			$query .= " left join vtiger_account as vtiger_accountContacts on vtiger_accountContacts.accountid = vtiger_contactdetails.accountid";
 		}
-		if ($queryplanner->requireTable("vtiger_contactscf")){
+		if ($queryPlanner->requireTable("vtiger_contactscf")){
 			$query .= " left join vtiger_contactscf on vtiger_contactdetails.contactid = vtiger_contactscf.contactid";
 		}
-		if ($queryplanner->requireTable("vtiger_email_trackContacts")){
+		if ($queryPlanner->requireTable("vtiger_email_trackContacts")){
 			$query .= " LEFT JOIN vtiger_email_track AS vtiger_email_trackContacts ON vtiger_email_trackContacts.crmid = vtiger_contactdetails.contactid";
 		}
-		if ($queryplanner->requireTable("vtiger_groupsContacts")){
+		if ($queryPlanner->requireTable("vtiger_groupsContacts")){
 			$query .= " left join vtiger_groups as vtiger_groupsContacts on vtiger_groupsContacts.groupid = vtiger_crmentityContacts.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_usersContacts")){
+		if ($queryPlanner->requireTable("vtiger_usersContacts")){
 			$query .= " left join vtiger_users as vtiger_usersContacts on vtiger_usersContacts.id = vtiger_crmentityContacts.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_lastModifiedByContacts")){
+		if ($queryPlanner->requireTable("vtiger_lastModifiedByContacts")){
 			$query .= " left join vtiger_users as vtiger_lastModifiedByContacts on vtiger_lastModifiedByContacts.id = vtiger_crmentityContacts.modifiedby ";
 		}
-        if ($queryplanner->requireTable("vtiger_createdbyContacts")){
+        if ($queryPlanner->requireTable("vtiger_createdbyContacts")){
 			$query .= " left join vtiger_users as vtiger_createdbyContacts on vtiger_createdbyContacts.id = vtiger_crmentityContacts.smcreatorid ";
 		}
 
diff --git a/modules/Documents/Documents.php b/modules/Documents/Documents.php
index 72f07624ff881957cfd2650eb30b69dc8b12e1c6..1a615f67ef162e540b18f192fae1b5f290921a23 100644
--- a/modules/Documents/Documents.php
+++ b/modules/Documents/Documents.php
@@ -363,34 +363,34 @@ class Documents extends CRMEntity {
 	 * @param - $secmodule secondary module name
 	 * returns the query string formed on fetching the related data for report for secondary module
 	 */
-	function generateReportsSecQuery($module,$secmodule,$queryplanner) {
+	function generateReportsSecQuery($module,$secmodule,$queryPlanner) {
 
-		$matrix = $queryplanner->newDependencyMatrix();
+		$matrix = $queryPlanner->newDependencyMatrix();
 		$matrix->setDependency("vtiger_crmentityDocuments",array("vtiger_groupsDocuments","vtiger_usersDocuments","vtiger_lastModifiedByDocuments"));
 
-		if (!$queryplanner->requireTable('vtiger_notes', $matrix)) {
+		if (!$queryPlanner->requireTable('vtiger_notes', $matrix)) {
 			return '';
 		}
 		$matrix->setDependency("vtiger_notes",array("vtiger_crmentityDocuments","vtiger_attachmentsfolder"));
 		// TODO Support query planner
-		$query = $this->getRelationQuery($module,$secmodule,"vtiger_notes","notesid", $queryplanner);
+		$query = $this->getRelationQuery($module,$secmodule,"vtiger_notes","notesid", $queryPlanner);
 		$query .= " left join vtiger_notescf on vtiger_notes.notesid = vtiger_notescf.notesid";
-		if ($queryplanner->requireTable("vtiger_crmentityDocuments",$matrix)){
+		if ($queryPlanner->requireTable("vtiger_crmentityDocuments",$matrix)){
 			$query .=" left join vtiger_crmentity as vtiger_crmentityDocuments on vtiger_crmentityDocuments.crmid=vtiger_notes.notesid and vtiger_crmentityDocuments.deleted=0";
 		}
-		if ($queryplanner->requireTable("vtiger_attachmentsfolder")){
+		if ($queryPlanner->requireTable("vtiger_attachmentsfolder")){
 			$query .=" left join vtiger_attachmentsfolder on vtiger_attachmentsfolder.folderid=vtiger_notes.folderid";
 		}
-		if ($queryplanner->requireTable("vtiger_groupsDocuments")){
+		if ($queryPlanner->requireTable("vtiger_groupsDocuments")){
 			$query .=" left join vtiger_groups as vtiger_groupsDocuments on vtiger_groupsDocuments.groupid = vtiger_crmentityDocuments.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_usersDocuments")){
+		if ($queryPlanner->requireTable("vtiger_usersDocuments")){
 			$query .=" left join vtiger_users as vtiger_usersDocuments on vtiger_usersDocuments.id = vtiger_crmentityDocuments.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_lastModifiedByDocuments")){
+		if ($queryPlanner->requireTable("vtiger_lastModifiedByDocuments")){
 			$query .=" left join vtiger_users as vtiger_lastModifiedByDocuments on vtiger_lastModifiedByDocuments.id = vtiger_crmentityDocuments.modifiedby ";
 		}
-		if ($queryplanner->requireTable("vtiger_createdbyDocuments")){
+		if ($queryPlanner->requireTable("vtiger_createdbyDocuments")){
 			$query .= " left join vtiger_users as vtiger_createdbyDocuments on vtiger_createdbyDocuments.id = vtiger_crmentityDocuments.smcreatorid ";
 		}
 
diff --git a/modules/HelpDesk/HelpDesk.php b/modules/HelpDesk/HelpDesk.php
index e9a21606489c1915d61a2f0e74104e18ba4fdc30..9bd40d4b25ebf6650569aebb1df5269fcd8d1d63 100644
--- a/modules/HelpDesk/HelpDesk.php
+++ b/modules/HelpDesk/HelpDesk.php
@@ -590,48 +590,48 @@ case when (vtiger_users.user_name not like '') then $userNameSql else vtiger_gro
 	 * @param - $secmodule secondary module name
 	 * returns the query string formed on fetching the related data for report for secondary module
 	 */
-	function generateReportsSecQuery($module,$secmodule, $queryplanner) {
-		$matrix = $queryplanner->newDependencyMatrix();
+	function generateReportsSecQuery($module,$secmodule, $queryPlanner) {
+		$matrix = $queryPlanner->newDependencyMatrix();
 		$matrix->setDependency("vtiger_crmentityHelpDesk",array("vtiger_groupsHelpDesk","vtiger_usersHelpDesk","vtiger_lastModifiedByHelpDesk"));
 		$matrix->setDependency("vtiger_crmentityRelHelpDesk",array("vtiger_accountRelHelpDesk","vtiger_contactdetailsRelHelpDesk"));
 
-		if (!$queryplanner->requireTable('vtiger_troubletickets', $matrix)) {
+		if (!$queryPlanner->requireTable('vtiger_troubletickets', $matrix)) {
 			return '';
 		}
         
         $matrix->setDependency("vtiger_troubletickets",array("vtiger_crmentityHelpDesk","vtiger_ticketcf","vtiger_crmentityRelHelpDesk","vtiger_productsRel"));
 		
 		// TODO Support query planner
-		$query = $this->getRelationQuery($module,$secmodule,"vtiger_troubletickets","ticketid", $queryplanner);
+		$query = $this->getRelationQuery($module,$secmodule,"vtiger_troubletickets","ticketid", $queryPlanner);
 
-		if ($queryplanner->requireTable("vtiger_crmentityHelpDesk",$matrix)){
+		if ($queryPlanner->requireTable("vtiger_crmentityHelpDesk",$matrix)){
 		    $query .=" left join vtiger_crmentity as vtiger_crmentityHelpDesk on vtiger_crmentityHelpDesk.crmid=vtiger_troubletickets.ticketid and vtiger_crmentityHelpDesk.deleted=0";
 		}
-		if ($queryplanner->requireTable("vtiger_ticketcf")){
+		if ($queryPlanner->requireTable("vtiger_ticketcf")){
 		    $query .=" left join vtiger_ticketcf on vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid";
 		}
-		if ($queryplanner->requireTable("vtiger_crmentityRelHelpDesk",$matrix)){
+		if ($queryPlanner->requireTable("vtiger_crmentityRelHelpDesk",$matrix)){
 		    $query .=" left join vtiger_crmentity as vtiger_crmentityRelHelpDesk on vtiger_crmentityRelHelpDesk.crmid = vtiger_troubletickets.parent_id";
 		}
-		if ($queryplanner->requireTable("vtiger_accountRelHelpDesk")){
+		if ($queryPlanner->requireTable("vtiger_accountRelHelpDesk")){
 		    $query .=" left join vtiger_account as vtiger_accountRelHelpDesk on vtiger_accountRelHelpDesk.accountid=vtiger_crmentityRelHelpDesk.crmid";
 		}
-		if ($queryplanner->requireTable("vtiger_contactdetailsRelHelpDesk")){
+		if ($queryPlanner->requireTable("vtiger_contactdetailsRelHelpDesk")){
 		    $query .=" left join vtiger_contactdetails as vtiger_contactdetailsRelHelpDesk on vtiger_contactdetailsRelHelpDesk.contactid= vtiger_troubletickets.contact_id";
 		}
-		if ($queryplanner->requireTable("vtiger_productsRel")){
+		if ($queryPlanner->requireTable("vtiger_productsRel")){
 		    $query .=" left join vtiger_products as vtiger_productsRel on vtiger_productsRel.productid = vtiger_troubletickets.product_id";
 		}
-		if ($queryplanner->requireTable("vtiger_groupsHelpDesk")){
+		if ($queryPlanner->requireTable("vtiger_groupsHelpDesk")){
 		    $query .=" left join vtiger_groups as vtiger_groupsHelpDesk on vtiger_groupsHelpDesk.groupid = vtiger_crmentityHelpDesk.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_usersHelpDesk")){
+		if ($queryPlanner->requireTable("vtiger_usersHelpDesk")){
 		    $query .=" left join vtiger_users as vtiger_usersHelpDesk on vtiger_usersHelpDesk.id = vtiger_crmentityHelpDesk.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_lastModifiedByHelpDesk")){
+		if ($queryPlanner->requireTable("vtiger_lastModifiedByHelpDesk")){
 		    $query .=" left join vtiger_users as vtiger_lastModifiedByHelpDesk on vtiger_lastModifiedByHelpDesk.id = vtiger_crmentityHelpDesk.modifiedby ";
 		}
-        if ($queryplanner->requireTable("vtiger_createdbyHelpDesk")){
+        if ($queryPlanner->requireTable("vtiger_createdbyHelpDesk")){
 			$query .= " left join vtiger_users as vtiger_createdbyHelpDesk on vtiger_createdbyHelpDesk.id = vtiger_crmentityHelpDesk.smcreatorid ";
 		}
 
diff --git a/modules/Potentials/Potentials.php b/modules/Potentials/Potentials.php
index ef234d976d1dfe7c9252e0cd99904f201eb07f7f..b58308fa05847f9ba8e74e77872338f1ada689f4 100644
--- a/modules/Potentials/Potentials.php
+++ b/modules/Potentials/Potentials.php
@@ -648,43 +648,43 @@ class Potentials extends CRMEntity {
 	 * @param - $secmodule secondary module name
 	 * returns the query string formed on fetching the related data for report for secondary module
 	 */
-	function generateReportsSecQuery($module,$secmodule,$queryplanner){
-		$matrix = $queryplanner->newDependencyMatrix();
+	function generateReportsSecQuery($module,$secmodule,$queryPlanner){
+		$matrix = $queryPlanner->newDependencyMatrix();
 		$matrix->setDependency('vtiger_crmentityPotentials',array('vtiger_groupsPotentials','vtiger_usersPotentials','vtiger_lastModifiedByPotentials'));
 
-		if (!$queryplanner->requireTable("vtiger_potential",$matrix)){
+		if (!$queryPlanner->requireTable("vtiger_potential",$matrix)){
 			return '';
 		}
         $matrix->setDependency('vtiger_potential', array('vtiger_crmentityPotentials','vtiger_accountPotentials',
 											'vtiger_contactdetailsPotentials','vtiger_campaignPotentials','vtiger_potentialscf'));
 
-		$query = $this->getRelationQuery($module,$secmodule,"vtiger_potential","potentialid", $queryplanner);
+		$query = $this->getRelationQuery($module,$secmodule,"vtiger_potential","potentialid", $queryPlanner);
 
-		if ($queryplanner->requireTable("vtiger_crmentityPotentials",$matrix)){
+		if ($queryPlanner->requireTable("vtiger_crmentityPotentials",$matrix)){
 			$query .= " left join vtiger_crmentity as vtiger_crmentityPotentials on vtiger_crmentityPotentials.crmid=vtiger_potential.potentialid and vtiger_crmentityPotentials.deleted=0";
 		}
-		if ($queryplanner->requireTable("vtiger_accountPotentials")){
+		if ($queryPlanner->requireTable("vtiger_accountPotentials")){
 			$query .= " left join vtiger_account as vtiger_accountPotentials on vtiger_potential.related_to = vtiger_accountPotentials.accountid";
 		}
-		if ($queryplanner->requireTable("vtiger_contactdetailsPotentials")){
+		if ($queryPlanner->requireTable("vtiger_contactdetailsPotentials")){
 			$query .= " left join vtiger_contactdetails as vtiger_contactdetailsPotentials on vtiger_potential.contact_id = vtiger_contactdetailsPotentials.contactid";
 		}
-		if ($queryplanner->requireTable("vtiger_potentialscf")){
+		if ($queryPlanner->requireTable("vtiger_potentialscf")){
 			$query .= " left join vtiger_potentialscf on vtiger_potentialscf.potentialid = vtiger_potential.potentialid";
 		}
-		if ($queryplanner->requireTable("vtiger_groupsPotentials")){
+		if ($queryPlanner->requireTable("vtiger_groupsPotentials")){
 			$query .= " left join vtiger_groups vtiger_groupsPotentials on vtiger_groupsPotentials.groupid = vtiger_crmentityPotentials.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_usersPotentials")){
+		if ($queryPlanner->requireTable("vtiger_usersPotentials")){
 			$query .= " left join vtiger_users as vtiger_usersPotentials on vtiger_usersPotentials.id = vtiger_crmentityPotentials.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_campaignPotentials")){
+		if ($queryPlanner->requireTable("vtiger_campaignPotentials")){
 			$query .= " left join vtiger_campaign as vtiger_campaignPotentials on vtiger_potential.campaignid = vtiger_campaignPotentials.campaignid";
 		}
-		if ($queryplanner->requireTable("vtiger_lastModifiedByPotentials")){
+		if ($queryPlanner->requireTable("vtiger_lastModifiedByPotentials")){
 			$query .= " left join vtiger_users as vtiger_lastModifiedByPotentials on vtiger_lastModifiedByPotentials.id = vtiger_crmentityPotentials.modifiedby ";
 		}
-        if ($queryplanner->requireTable("vtiger_createdbyPotentials")){
+        if ($queryPlanner->requireTable("vtiger_createdbyPotentials")){
 			$query .= " left join vtiger_users as vtiger_createdbyPotentials on vtiger_createdbyPotentials.id = vtiger_crmentityPotentials.smcreatorid ";
 		}
 
diff --git a/modules/PriceBooks/PriceBooks.php b/modules/PriceBooks/PriceBooks.php
index 7cb40558626321714ea80cda5bf265470f0ce310..725c35611df5760e7ef36ca88ae772e5cb3361b4 100755
--- a/modules/PriceBooks/PriceBooks.php
+++ b/modules/PriceBooks/PriceBooks.php
@@ -286,34 +286,34 @@ class PriceBooks extends CRMEntity {
 	 * @param - $secmodule secondary module name
 	 * returns the query string formed on fetching the related data for report for secondary module
 	 */
-	function generateReportsSecQuery($module,$secmodule,$queryplanner) {
+	function generateReportsSecQuery($module,$secmodule,$queryPlanner) {
 
-		$matrix = $queryplanner->newDependencyMatrix();
+		$matrix = $queryPlanner->newDependencyMatrix();
 
 		$matrix->setDependency("vtiger_crmentityPriceBooks",array("vtiger_usersPriceBooks","vtiger_groupsPriceBooks"));
-		if (!$queryplanner->requireTable('vtiger_pricebook', $matrix)) {
+		if (!$queryPlanner->requireTable('vtiger_pricebook', $matrix)) {
 			return '';
 		}
         $matrix->setDependency("vtiger_pricebook",array("vtiger_crmentityPriceBooks","vtiger_currency_infoPriceBooks"));
 
-		$query = $this->getRelationQuery($module,$secmodule,"vtiger_pricebook","pricebookid", $queryplanner);
+		$query = $this->getRelationQuery($module,$secmodule,"vtiger_pricebook","pricebookid", $queryPlanner);
 		// TODO Support query planner
-		if ($queryplanner->requireTable("vtiger_crmentityPriceBooks",$matrix)){
+		if ($queryPlanner->requireTable("vtiger_crmentityPriceBooks",$matrix)){
 		$query .=" left join vtiger_crmentity as vtiger_crmentityPriceBooks on vtiger_crmentityPriceBooks.crmid=vtiger_pricebook.pricebookid and vtiger_crmentityPriceBooks.deleted=0";
 		}
-		if ($queryplanner->requireTable("vtiger_currency_infoPriceBooks")){
+		if ($queryPlanner->requireTable("vtiger_currency_infoPriceBooks")){
 		$query .=" left join vtiger_currency_info as vtiger_currency_infoPriceBooks on vtiger_currency_infoPriceBooks.id = vtiger_pricebook.currency_id";
 		}
-		if ($queryplanner->requireTable("vtiger_usersPriceBooks")){
+		if ($queryPlanner->requireTable("vtiger_usersPriceBooks")){
 		    $query .=" left join vtiger_users as vtiger_usersPriceBooks on vtiger_usersPriceBooks.id = vtiger_crmentityPriceBooks.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_groupsPriceBooks")){
+		if ($queryPlanner->requireTable("vtiger_groupsPriceBooks")){
 		    $query .=" left join vtiger_groups as vtiger_groupsPriceBooks on vtiger_groupsPriceBooks.groupid = vtiger_crmentityPriceBooks.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_lastModifiedByPriceBooks")){
+		if ($queryPlanner->requireTable("vtiger_lastModifiedByPriceBooks")){
 		    $query .=" left join vtiger_users as vtiger_lastModifiedByPriceBooks on vtiger_lastModifiedByPriceBooks.id = vtiger_crmentityPriceBooks.smownerid";
 		}
-        if ($queryplanner->requireTable("vtiger_createdbyPriceBooks")){
+        if ($queryPlanner->requireTable("vtiger_createdbyPriceBooks")){
 			$query .= " left join vtiger_users as vtiger_createdbyPriceBooks on vtiger_createdbyPriceBooks.id = vtiger_crmentityPriceBooks.smcreatorid ";
 		}
 
diff --git a/modules/Products/Products.php b/modules/Products/Products.php
index 93e328638c3680a3ecb31ed1724a54e4506d7df5..3d24496771876d84dc1b17190dadeb06bafd50bb 100755
--- a/modules/Products/Products.php
+++ b/modules/Products/Products.php
@@ -1183,19 +1183,19 @@ class Products extends CRMEntity {
 	 * @param - $secmodule secondary module name
 	 * returns the query string formed on fetching the related data for report for secondary module
 	 */
-	function generateReportsSecQuery($module,$secmodule,$queryplanner) {
+	function generateReportsSecQuery($module,$secmodule,$queryPlanner) {
 		global $current_user;
-		$matrix = $queryplanner->newDependencyMatrix();
+		$matrix = $queryPlanner->newDependencyMatrix();
 
 		$matrix->setDependency("vtiger_crmentityProducts",array("vtiger_groupsProducts","vtiger_usersProducts","vtiger_lastModifiedByProducts"));
 		//query planner Support  added
-		if (!$queryplanner->requireTable('vtiger_products', $matrix)) {
+		if (!$queryPlanner->requireTable('vtiger_products', $matrix)) {
 			return '';
 		}
 		$matrix->setDependency("vtiger_products",array("innerProduct","vtiger_crmentityProducts","vtiger_productcf","vtiger_vendorRelProducts"));
 
-		$query = $this->getRelationQuery($module,$secmodule,"vtiger_products","productid", $queryplanner);
-		if ($queryplanner->requireTable("innerProduct")){
+		$query = $this->getRelationQuery($module,$secmodule,"vtiger_products","productid", $queryPlanner);
+		if ($queryPlanner->requireTable("innerProduct")){
 			$query .= " LEFT JOIN (
 					SELECT vtiger_products.productid,
 							(CASE WHEN (vtiger_products.currency_id = 1 ) THEN vtiger_products.unit_price
@@ -1207,25 +1207,25 @@ class Products extends CRMEntity {
 					AND vtiger_productcurrencyrel.currencyid = ". $current_user->currency_id . "
 				) AS innerProduct ON innerProduct.productid = vtiger_products.productid";
 		}
-		if ($queryplanner->requireTable("vtiger_crmentityProducts")){
+		if ($queryPlanner->requireTable("vtiger_crmentityProducts")){
 			$query .= " left join vtiger_crmentity as vtiger_crmentityProducts on vtiger_crmentityProducts.crmid=vtiger_products.productid and vtiger_crmentityProducts.deleted=0";
 		}
-		if ($queryplanner->requireTable("vtiger_productcf")){
+		if ($queryPlanner->requireTable("vtiger_productcf")){
 			$query .= " left join vtiger_productcf on vtiger_products.productid = vtiger_productcf.productid";
 		}
-			if ($queryplanner->requireTable("vtiger_groupsProducts")){
+			if ($queryPlanner->requireTable("vtiger_groupsProducts")){
 			$query .= " left join vtiger_groups as vtiger_groupsProducts on vtiger_groupsProducts.groupid = vtiger_crmentityProducts.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_usersProducts")){
+		if ($queryPlanner->requireTable("vtiger_usersProducts")){
 			$query .= " left join vtiger_users as vtiger_usersProducts on vtiger_usersProducts.id = vtiger_crmentityProducts.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_vendorRelProducts")){
+		if ($queryPlanner->requireTable("vtiger_vendorRelProducts")){
 			$query .= " left join vtiger_vendor as vtiger_vendorRelProducts on vtiger_vendorRelProducts.vendorid = vtiger_products.vendor_id";
 		}
-		if ($queryplanner->requireTable("vtiger_lastModifiedByProducts")){
+		if ($queryPlanner->requireTable("vtiger_lastModifiedByProducts")){
 			$query .= " left join vtiger_users as vtiger_lastModifiedByProducts on vtiger_lastModifiedByProducts.id = vtiger_crmentityProducts.modifiedby ";
 		}
-		if ($queryplanner->requireTable("vtiger_createdbyProducts")){
+		if ($queryPlanner->requireTable("vtiger_createdbyProducts")){
 			$query .= " left join vtiger_users as vtiger_createdbyProducts on vtiger_createdbyProducts.id = vtiger_crmentityProducts.smcreatorid ";
 		}
 
diff --git a/modules/Vendors/Vendors.php b/modules/Vendors/Vendors.php
index d5d883e72a8064d3f1be19b45206b06d8dc6996c..d76741a1f6c8f7f6743ef30ded093b4968eab647 100755
--- a/modules/Vendors/Vendors.php
+++ b/modules/Vendors/Vendors.php
@@ -411,33 +411,33 @@ class Vendors extends CRMEntity {
 	 * @param - $secmodule secondary module name
 	 * returns the query string formed on fetching the related data for report for secondary module
 	 */
-	function generateReportsSecQuery($module,$secmodule, $queryplanner) {
+	function generateReportsSecQuery($module,$secmodule, $queryPlanner) {
 
-		$matrix = $queryplanner->newDependencyMatrix();
+		$matrix = $queryPlanner->newDependencyMatrix();
 
 		$matrix->setDependency("vtiger_crmentityVendors",array("vtiger_usersVendors","vtiger_lastModifiedByVendors"));
-		if (!$queryplanner->requireTable('vtiger_vendor', $matrix)) {
+		if (!$queryPlanner->requireTable('vtiger_vendor', $matrix)) {
 			return '';
 		}
         $matrix->setDependency("vtiger_vendor",array("vtiger_crmentityVendors","vtiger_vendorcf","vtiger_email_trackVendors"));
-		$query = $this->getRelationQuery($module,$secmodule,"vtiger_vendor","vendorid", $queryplanner);
+		$query = $this->getRelationQuery($module,$secmodule,"vtiger_vendor","vendorid", $queryPlanner);
 		// TODO Support query planner
-		if ($queryplanner->requireTable("vtiger_crmentityVendors",$matrix)){
+		if ($queryPlanner->requireTable("vtiger_crmentityVendors",$matrix)){
 		    $query .=" left join vtiger_crmentity as vtiger_crmentityVendors on vtiger_crmentityVendors.crmid=vtiger_vendor.vendorid and vtiger_crmentityVendors.deleted=0";
 		}
-		if ($queryplanner->requireTable("vtiger_vendorcf")){
+		if ($queryPlanner->requireTable("vtiger_vendorcf")){
 		    $query .=" left join vtiger_vendorcf on vtiger_vendorcf.vendorid = vtiger_crmentityVendors.crmid";
 		}
-		if ($queryplanner->requireTable("vtiger_email_trackVendors")){
+		if ($queryPlanner->requireTable("vtiger_email_trackVendors")){
 		    $query .=" LEFT JOIN vtiger_email_track AS vtiger_email_trackVendors ON vtiger_email_trackVendors.crmid = vtiger_vendor.vendorid";
 		}
-		if ($queryplanner->requireTable("vtiger_usersVendors")){
+		if ($queryPlanner->requireTable("vtiger_usersVendors")){
 		    $query .=" left join vtiger_users as vtiger_usersVendors on vtiger_usersVendors.id = vtiger_crmentityVendors.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_lastModifiedByVendors")){
+		if ($queryPlanner->requireTable("vtiger_lastModifiedByVendors")){
 		    $query .=" left join vtiger_users as vtiger_lastModifiedByVendors on vtiger_lastModifiedByVendors.id = vtiger_crmentityVendors.modifiedby ";
 		}
-        if ($queryplanner->requireTable("vtiger_createdbyVendors")){
+        if ($queryPlanner->requireTable("vtiger_createdbyVendors")){
 			$query .= " left join vtiger_users as vtiger_createdbyVendors on vtiger_createdbyVendors.id = vtiger_crmentityVendors.smcreatorid ";
 		}
 		//if secondary modules custom reference field is selected
diff --git a/packages/vtiger/mandatory/ServiceContracts.zip b/packages/vtiger/mandatory/ServiceContracts.zip
index 49852f288a30c456c3a1765ac85b7e19f8e2afc5..a1b53c07d50540611cdc1a5be5c707111424f86f 100644
Binary files a/packages/vtiger/mandatory/ServiceContracts.zip and b/packages/vtiger/mandatory/ServiceContracts.zip differ
diff --git a/packages/vtiger/optional/ModComments.zip b/packages/vtiger/optional/ModComments.zip
index eac2692f4b8c78380ad750be80130bd045871a5d..dd239896c29f55c2fb0845b170bd9246580ff2e6 100644
Binary files a/packages/vtiger/optional/ModComments.zip and b/packages/vtiger/optional/ModComments.zip differ
diff --git a/pkg/vtiger/modules/ModComments/modules/ModComments/ModCommentsCore.php b/pkg/vtiger/modules/ModComments/modules/ModComments/ModCommentsCore.php
index 50a62445758746a0f182c77f1de818a2fdac7bca..2bc9a16c44fbc6ce04d28b3f331fcd270235d840 100644
--- a/pkg/vtiger/modules/ModComments/modules/ModComments/ModCommentsCore.php
+++ b/pkg/vtiger/modules/ModComments/modules/ModComments/ModCommentsCore.php
@@ -356,31 +356,31 @@ class ModCommentsCore extends CRMEntity {
 	 * @param - $secmodule secondary module name
 	 * returns the query string formed on fetching the related data for report for secondary module
 	 */
-	function generateReportsSecQuery($module,$secmodule,$queryplanner){
-		$matrix = $queryplanner->newDependencyMatrix();
+	function generateReportsSecQuery($module,$secmodule,$queryPlanner){
+		$matrix = $queryPlanner->newDependencyMatrix();
 
 		$matrix->setDependency('vtiger_crmentityModComments',array('vtiger_groupsModComments','vtiger_usersModComments', 'vtiger_contactdetailsRelModComments', 'vtiger_modcommentsRelModComments'));
 
-		if (!$queryplanner->requireTable("vtiger_modcomments",$matrix)){
+		if (!$queryPlanner->requireTable("vtiger_modcomments",$matrix)){
 			return '';
 		}
 		$matrix->setDependency('vtiger_modcomments', array('vtiger_crmentityModComments'));
 
-		$query = $this->getRelationQuery($module,$secmodule,"vtiger_modcomments","modcommentsid", $queryplanner);
+		$query = $this->getRelationQuery($module,$secmodule,"vtiger_modcomments","modcommentsid", $queryPlanner);
 
-		if ($queryplanner->requireTable("vtiger_crmentityModComments",$matrix)){
+		if ($queryPlanner->requireTable("vtiger_crmentityModComments",$matrix)){
 			$query .= " left join vtiger_crmentity as vtiger_crmentityModComments on vtiger_crmentityModComments.crmid=vtiger_modcomments.modcommentsid and vtiger_crmentityModComments.deleted=0";
 		}
-		if ($queryplanner->requireTable("vtiger_groupsModComments")){
+		if ($queryPlanner->requireTable("vtiger_groupsModComments")){
 			$query .= " left join vtiger_groups vtiger_groupsModComments on vtiger_groupsModComments.groupid = vtiger_crmentityModComments.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_usersModComments")){
+		if ($queryPlanner->requireTable("vtiger_usersModComments")){
 			$query .= " left join vtiger_users as vtiger_usersModComments on vtiger_usersModComments.id = vtiger_crmentityModComments.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_contactdetailsRelModComments")){
+		if ($queryPlanner->requireTable("vtiger_contactdetailsRelModComments")){
 			$query .= " left join vtiger_contactdetails as vtiger_contactdetailsRelModComments on vtiger_contactdetailsRelModComments.contactid = vtiger_crmentityModComments.crmid";
 		}
-		if ($queryplanner->requireTable("vtiger_modcommentsRelModComments")){
+		if ($queryPlanner->requireTable("vtiger_modcommentsRelModComments")){
 			$query .= " left join vtiger_modcomments as vtiger_modcommentsRelModComments on vtiger_modcommentsRelModComments.modcommentsid = vtiger_crmentityModComments.crmid";
 		}
 
diff --git a/pkg/vtiger/modules/ServiceContracts/modules/ServiceContracts/ServiceContracts.php b/pkg/vtiger/modules/ServiceContracts/modules/ServiceContracts/ServiceContracts.php
index c799acc8298f2382d880eddb35ed1438721f9586..1f9225c0ecbe6f600d65c26460bbfc9eac012953 100644
--- a/pkg/vtiger/modules/ServiceContracts/modules/ServiceContracts/ServiceContracts.php
+++ b/pkg/vtiger/modules/ServiceContracts/modules/ServiceContracts/ServiceContracts.php
@@ -225,39 +225,39 @@ class ServiceContracts extends CRMEntity {
 	 * @param - $secmodule secondary module name
 	 * returns the query string formed on fetching the related data for report for secondary module
 	 */
-	function generateReportsSecQuery($module,$secmodule,$queryplanner) {
+	function generateReportsSecQuery($module,$secmodule,$queryPlanner) {
 
-		$matrix = $queryplanner->newDependencyMatrix();
+		$matrix = $queryPlanner->newDependencyMatrix();
 		$matrix->setDependency('vtiger_crmentityServiceContracts',array('vtiger_groupsServiceContracts','vtiger_usersServiceContracts'));
-		if (!$queryplanner->requireTable('vtiger_servicecontracts', $matrix)) {
+		if (!$queryPlanner->requireTable('vtiger_servicecontracts', $matrix)) {
 			return '';
 		}
 		$matrix->setDependency('vtiger_servicecontracts',array('vtiger_servicecontractscf','vtiger_crmentityServiceContracts'));
 
-		$query = $this->getRelationQuery($module,$secmodule,"vtiger_servicecontracts","servicecontractsid", $queryplanner);
+		$query = $this->getRelationQuery($module,$secmodule,"vtiger_servicecontracts","servicecontractsid", $queryPlanner);
 
-		if ($queryplanner->requireTable("vtiger_crmentityServiceContracts",$matrix)){
+		if ($queryPlanner->requireTable("vtiger_crmentityServiceContracts",$matrix)){
 			$query .= " left join vtiger_crmentity as vtiger_crmentityServiceContracts on vtiger_crmentityServiceContracts.crmid = vtiger_servicecontracts.servicecontractsid  and vtiger_crmentityServiceContracts.deleted=0";
 		}
-		if ($queryplanner->requireTable("vtiger_servicecontractscf")){
+		if ($queryPlanner->requireTable("vtiger_servicecontractscf")){
 			$query .= " left join vtiger_servicecontractscf on vtiger_servicecontractscf.servicecontractsid = vtiger_servicecontracts.servicecontractsid";
 		}
-		if ($queryplanner->requireTable("vtiger_groupsServiceContracts")){
+		if ($queryPlanner->requireTable("vtiger_groupsServiceContracts")){
 			$query .= " left join vtiger_groups as vtiger_groupsServiceContracts on vtiger_groupsServiceContracts.groupid = vtiger_crmentityServiceContracts.smownerid";
 		}
-		if ($queryplanner->requireTable("vtiger_usersServiceContracts")){
+		if ($queryPlanner->requireTable("vtiger_usersServiceContracts")){
 			$query .= " left join vtiger_users as vtiger_usersServiceContracts on vtiger_usersServiceContracts.id = vtiger_crmentityServiceContracts.smownerid";
 		}
-		if($queryplanner->requireTable("vtiger_contactdetailsRelServiceContracts")){
+		if($queryPlanner->requireTable("vtiger_contactdetailsRelServiceContracts")){
 			$query .= " left join vtiger_contactdetails as vtiger_contactdetailsRelServiceContracts on vtiger_contactdetailsRelServiceContracts.contactid = vtiger_servicecontracts.sc_related_to";
 		}
-		if($queryplanner->requireTable("vtiger_accountRelServiceContracts")){
+		if($queryPlanner->requireTable("vtiger_accountRelServiceContracts")){
 			$query .= " left join vtiger_account as vtiger_accountRelServiceContracts on vtiger_accountRelServiceContracts.accountid = vtiger_servicecontracts.sc_related_to";
 		}
-		 if ($queryplanner->requireTable("vtiger_lastModifiedByServiceContracts")){
+		 if ($queryPlanner->requireTable("vtiger_lastModifiedByServiceContracts")){
 			$query .= " left join vtiger_users as vtiger_lastModifiedByServiceContracts on vtiger_lastModifiedByServiceContracts.id = vtiger_crmentityServiceContracts.modifiedby ";
 		}
-		if ($queryplanner->requireTable("vtiger_createdbyServiceContracts")){
+		if ($queryPlanner->requireTable("vtiger_createdbyServiceContracts")){
 			$query .= " left join vtiger_users as vtiger_createdbyServiceContracts on vtiger_createdbyServiceContracts.id = vtiger_crmentityServiceContracts.smcreatorid ";
 		}
 		//if secondary modules custom reference field is selected