diff --git a/include/ListView/ListViewSession.php b/include/ListView/ListViewSession.php
index 790aab9424c8c73ab322a76ea79456dd431546aa..168b08b1ec21a9ec28009bed9af2b3a9c2674267 100644
--- a/include/ListView/ListViewSession.php
+++ b/include/ListView/ListViewSession.php
@@ -76,6 +76,7 @@ class ListViewSession {
 		$cv = new CustomView();
 		$viewId = $cv->getViewId($currentModule);
 		$recordNavigationInfo = array();
+		$searchKey = array();
 		if(!empty($_SESSION[$currentModule.'_DetailView_Navigation'.$viewId])){
 			$recordNavigationInfo = Zend_Json::decode($_SESSION[$currentModule.'_DetailView_Navigation'.$viewId]);
 			$pageNumber =0;
diff --git a/include/utils/EditViewUtils.php b/include/utils/EditViewUtils.php
index 48d0bb95b8f8b1ba389d49c642f600eb67469881..3b35f4924e1e1302d8b5b75febd8cbe6f2c91085 100755
--- a/include/utils/EditViewUtils.php
+++ b/include/utils/EditViewUtils.php
@@ -89,6 +89,7 @@ function getAssociatedProducts($module, $focus, $seid = '', $refModuleName = fal
 	$log->debug("Entering getAssociatedProducts(".$module.",".get_class($focus).",".$seid."='') method ...");
 	global $adb;
 	$output = '';
+	$taxtype = '';
 	global $theme,$current_user;
 
 	$no_of_decimal_places = getCurrencyDecimalPlaces();
@@ -468,8 +469,10 @@ function getAssociatedProducts($module, $focus, $seid = '', $refModuleName = fal
 		if($tax_percent == '' || $tax_percent == 'NULL')
 			$tax_percent = 0;
 		$taxamount = ($subTotal-$finalDiscount)*$tax_percent/100;
-        list($before_dot, $after_dot) = explode('.', $taxamount);
-        if($after_dot[$no_of_decimal_places] == 5) {
+		$split_taxamounts =explode('.', $taxamount);
+		$before_dot=isset($split_taxamounts[0]) ? $split_taxamounts[0] : '';
+		$after_dot=isset($split_taxamounts[1]) ? $split_taxamounts[1] : '';
+        if(isset($after_dot[$no_of_decimal_places]) && $after_dot[$no_of_decimal_places] == 5) {
             $taxamount = round($taxamount, $no_of_decimal_places, PHP_ROUND_HALF_UP); 
         } else {
             $taxamount = number_format($taxamount, $no_of_decimal_places,'.','');
diff --git a/layouts/v7/modules/Inventory/partials/LineItemsContent.tpl b/layouts/v7/modules/Inventory/partials/LineItemsContent.tpl
index 7f8a3dff92e6cb1388f8139a643b54405c14f7af..61abbcdd99369c1837dfb1a344e0f080575cc053 100644
--- a/layouts/v7/modules/Inventory/partials/LineItemsContent.tpl
+++ b/layouts/v7/modules/Inventory/partials/LineItemsContent.tpl
@@ -24,7 +24,7 @@
     {assign var="subprod_names" value="subprod_names"|cat:$row_no}
 	{assign var="subprod_qty_list" value="subprod_qty_list"|cat:$row_no}
     {assign var="entityIdentifier" value="entityType"|cat:$row_no}
-    {assign var="entityType" value=$data.$entityIdentifier}
+    {assign var="entityType" value=(isset($data.$entityIdentifier)) ? $data.$entityIdentifier : ""}
 
     {assign var="discount_type" value="discount_type"|cat:$row_no}
     {assign var="discount_percent" value="discount_percent"|cat:$row_no}
@@ -42,7 +42,7 @@
     {assign var="FINAL" value=$RELATED_PRODUCTS.1.final_details}
 
 	{assign var="productDeleted" value="productDeleted"|cat:$row_no}
-	{assign var="productId" value=$data[$hdnProductId]}
+	{assign var="productId" value=(isset($data[$hdnProductId])) ? $data[$hdnProductId] : ""}
 	{assign var="listPriceValues" value=Products_Record_Model::getListPriceValues($productId)}
 	{if $MODULE eq 'PurchaseOrder'}
 		{assign var="listPriceValues" value=array()}
@@ -57,7 +57,7 @@
 		&nbsp;<a><img src="{vimage_path('drag.png')}" border="0" title="{vtranslate('LBL_DRAG',$MODULE)}"/></a>
 		<input type="hidden" class="rowNumber" value="{$row_no}" />
 	</td>
-	{if $IMAGE_EDITABLE}
+	{if isset($IMAGE_EDITABLE) && $IMAGE_EDITABLE}
 		<td class='lineItemImage' style="text-align:center;">
 			<img src='{$data.$image}' height="42" width="42">
 		</td>
@@ -66,20 +66,20 @@
 	{if $PRODUCT_EDITABLE}
 		<td>
 			<!-- Product Re-Ordering Feature Code Addition Starts -->
-			<input type="hidden" name="hidtax_row_no{$row_no}" id="hidtax_row_no{$row_no}" value="{$tax_row_no}"/>
+			<input type="hidden" name="hidtax_row_no{$row_no}" id="hidtax_row_no{$row_no}" value="{(isset($tax_row_no)) ? $tax_row_no : ""}"/>
 			<!-- Product Re-Ordering Feature Code Addition ends -->
 			<div class="itemNameDiv form-inline">
 				<div class="row">
 					<div class="col-lg-10">
 						<div class="input-group" style="width:100%">
-							<input type="text" id="{$productName}" name="{$productName}" value="{$data.$productName}" class="productName form-control {if $row_no neq 0} autoComplete {/if} " placeholder="{vtranslate('LBL_TYPE_SEARCH',$MODULE)}"
+							<input type="text" id="{$productName}" name="{$productName}" value="{(isset($data.$productName)) ? $data.$productName : ""}" class="productName form-control {if $row_no neq 0} autoComplete {/if} " placeholder="{vtranslate('LBL_TYPE_SEARCH',$MODULE)}"
 								   data-rule-required=true {if !empty($data.$productName)} disabled="disabled" {/if}>
-							{if !$data.$productDeleted}
+							{if isset($data.$productDeleted) && !$data.$productDeleted}
 								<span class="input-group-addon cursorPointer clearLineItem" title="{vtranslate('LBL_CLEAR',$MODULE)}">
 									<i class="fa fa-times-circle"></i>
 								</span>
 							{/if}
-							<input type="hidden" id="{$hdnProductId}" name="{$hdnProductId}" value="{$data.$hdnProductId}" class="selectedModuleId"/>
+							<input type="hidden" id="{$hdnProductId}" name="{$hdnProductId}" value="{(isset($data.$hdnProductId)) ? $data.$hdnProductId : ""}" class="selectedModuleId"/>
 							<input type="hidden" id="lineItemType{$row_no}" name="lineItemType{$row_no}" value="{$entityType}" class="lineItemType"/>
 							<div class="col-lg-2">
 								{if $row_no eq 0}
@@ -101,7 +101,7 @@
 					</div>
 				</div>
 			</div>
-			<input type="hidden" value="{$data.$subproduct_ids}" id="{$subproduct_ids}" name="{$subproduct_ids}" class="subProductIds" />
+			<input type="hidden" value="{(isset($data.$subproduct_ids)) ? $data.$subproduct_ids : ""}" id="{$subproduct_ids}" name="{$subproduct_ids}" class="subProductIds" />
 			<div id="{$subprod_names}" name="{$subprod_names}" class="subInformation">
 				<span class="subProductsContainer">
 					{foreach key=SUB_PRODUCT_ID item=SUB_PRODUCT_INFO from=$data.$subprod_qty_list}
diff --git a/layouts/v7/modules/Inventory/partials/LineItemsEdit.tpl b/layouts/v7/modules/Inventory/partials/LineItemsEdit.tpl
index 6942eda2b40a250c0ee568a72f6fe5fd750abe87..a32fe88aaf4f39b23a1ead62ff07b470304a83ba 100644
--- a/layouts/v7/modules/Inventory/partials/LineItemsEdit.tpl
+++ b/layouts/v7/modules/Inventory/partials/LineItemsEdit.tpl
@@ -67,7 +67,7 @@
 {/if}
 
 <input type="hidden" class="numberOfCurrencyDecimal" value="{$USER_MODEL->get('no_of_currency_decimals')}" />
-<input type="hidden" name="totalProductCount" id="totalProductCount" value="{$row_no}" />
+<input type="hidden" name="totalProductCount" id="totalProductCount" value="{(isset($row_no)) ? $row_no : ""}" />
 <input type="hidden" name="subtotal" id="subtotal" value="" />
 <input type="hidden" name="total" id="total" value="" />
 
diff --git a/layouts/v7/modules/Vtiger/uitypes/Salutation.tpl b/layouts/v7/modules/Vtiger/uitypes/Salutation.tpl
index 537cf772c4a25425fe8e3cacd6ae004b7f388340..ed6a34b6d8b48c1c95ff3b6a6ac9d3d19c4bff6c 100644
--- a/layouts/v7/modules/Vtiger/uitypes/Salutation.tpl
+++ b/layouts/v7/modules/Vtiger/uitypes/Salutation.tpl
@@ -14,7 +14,7 @@
 		<select class="inputElement select2" style="width:78px;" name="{$SALUTATION_FIELD_MODEL->get('name')}" >
 			{if $SALUTATION_FIELD_MODEL->isEmptyPicklistOptionAllowed()}<option value="">{vtranslate('LBL_NONE', $MODULE)}</option>{/if}
 			{foreach item=PICKLIST_VALUE key=PICKLIST_NAME from=$PICKLIST_VALUES}
-				<option value="{Vtiger_Util_Helper::toSafeHTML($PICKLIST_NAME)}" {if trim(decode_html($SALUTATION_FIELD_MODEL->get('fieldvalue'))) eq trim($PICKLIST_NAME)} selected {/if}>{$PICKLIST_VALUE}</option>
+				<option value="{Vtiger_Util_Helper::toSafeHTML($PICKLIST_NAME)}" {if isset($SALUTATION_FIELD_MODEL->get('fieldvalue')) && trim(decode_html($SALUTATION_FIELD_MODEL->get('fieldvalue'))) eq trim($PICKLIST_NAME)} selected {/if}>{$PICKLIST_VALUE}</option>
 			{/foreach}
 		</select>&nbsp;
 	{/if}
diff --git a/modules/Accounts/Accounts.php b/modules/Accounts/Accounts.php
index 1076fcf2bf8ff991ec442748c651d93616f5db52..cb8fd9a84fce8cc90de02c7df90d83c4f05ef059 100644
--- a/modules/Accounts/Accounts.php
+++ b/modules/Accounts/Accounts.php
@@ -1646,6 +1646,7 @@ class Accounts extends CRMEntity {
 		$singular_modname = 'SINGLE_' . $related_module;
 
 		$button = '';
+		$query  = '';
 		if ($actions) {
 			if (is_string($actions))
 				$actions = explode(',', strtoupper($actions));
diff --git a/modules/Inventory/models/Record.php b/modules/Inventory/models/Record.php
index 8019e8a075f10375240099bce6816babfbf9b806..318244586ee1f6c3bd119ae166249af880a2cd18 100644
--- a/modules/Inventory/models/Record.php
+++ b/modules/Inventory/models/Record.php
@@ -349,8 +349,8 @@ class Inventory_Record_Model extends Vtiger_Record_Model {
 
 		$productIdsList = array();
 		foreach ($productDetails as $key => $lineItemDetail) {
-			$productId	= $lineItemDetail['hdnProductId'.$key];
-			$entityType = $lineItemDetail['entityType'.$key];
+			$productId	= isset($lineItemDetail['hdnProductId'.$key]) ? $lineItemDetail['hdnProductId'.$key] : "";
+			$entityType = isset($lineItemDetail['entityType'.$key]) ? $lineItemDetail['entityType'.$key] : "";
 			$productIdsList[$entityType][] = $productId;
 		}
 
@@ -362,19 +362,18 @@ class Inventory_Record_Model extends Vtiger_Record_Model {
 
 		//Getting image details of each product
 		$imageDetailsList = array();
-		if ($productIdsList['Products']) {
+		if (isset($productIdsList['Products']) && $productIdsList['Products']) {
 			$imageDetailsList = Products_Record_Model::getProductsImageDetails($productIdsList['Products']);
 		}
 
 		foreach ($productDetails as $key => $lineItemDetail) {
-			$productId = $lineItemDetail['hdnProductId'.$key];
-			$entityType = $lineItemDetail['entityType'.$key];
-
+			$productId = isset($lineItemDetail['hdnProductId'.$key]) ? $lineItemDetail['hdnProductId'.$key] : "";
+			$entityType = isset($lineItemDetail['entityType'.$key]) ? $lineItemDetail['entityType'.$key] : "";
+			
 			//updating list price details
-			$productDetails[$key]['listPrice'.$key] = number_format((float)$convertedPriceDetails[$entityType][$productId], $numOfCurrencyDecimals, '.', '');
-
+			$productDetails[$key]['listPrice'.$key] = isset($convertedPriceDetails[$entityType][$productId]) ? number_format((float)$convertedPriceDetails[$entityType][$productId], $numOfCurrencyDecimals, '.', ''):"";			
 			//updating cost price details
-			$purchaseCost = (float)$userCurrencyInfo['conversion_rate'] * (float)$lineItemDetail['purchaseCost'.$key];
+			$purchaseCost = isset($lineItemDetail['purchaseCost'.$key]) ? (float)$userCurrencyInfo['conversion_rate'] * (float)$lineItemDetail['purchaseCost'.$key] :0;
 			$productDetails[$key]['purchaseCost'.$key] = number_format($purchaseCost, $numOfCurrencyDecimals, '.', '');
 
 			if($moduleName === 'PurchaseOrder') {
@@ -382,7 +381,7 @@ class Inventory_Record_Model extends Vtiger_Record_Model {
 			}
 
 			//Image detail
-			if ($imageDetailsList[$productId]) {
+			if (isset($imageDetailsList[$productId]) && $imageDetailsList[$productId]) {
 				$imageDetails = $imageDetailsList[$productId];
 				$productDetails[$key]['productImage'.$key] = $imageDetails[0]['path'].'_'.$imageDetails[0]['orgname'];
 			}
diff --git a/modules/Inventory/views/Edit.php b/modules/Inventory/views/Edit.php
index ee927809fcc47ee641038a5ed2416c9385f147d8..f6762d408fc2f610c08b4737421b2bdabddd08e3 100644
--- a/modules/Inventory/views/Edit.php
+++ b/modules/Inventory/views/Edit.php
@@ -120,7 +120,7 @@ Class Inventory_Edit_View extends Vtiger_Edit_View {
 			}
 		}
 
-		$deductTaxes = $relatedProducts ? $relatedProducts[1]['final_details']['deductTaxes'] : null;
+		$deductTaxes = $relatedProducts && isset($relatedProducts[1]['final_details']['deductTaxes']) ? $relatedProducts[1]['final_details']['deductTaxes'] : null;
 		if (!$deductTaxes) {
 			$deductTaxes = Inventory_TaxRecord_Model::getDeductTaxesList();
 		}
diff --git a/modules/Vtiger/actions/GetData.php b/modules/Vtiger/actions/GetData.php
index 148a59b8384b5d4c550d739e5e750b9ad9b1784e..d36dd292f980da25d673a2e4d163b5476d14838a 100644
--- a/modules/Vtiger/actions/GetData.php
+++ b/modules/Vtiger/actions/GetData.php
@@ -11,7 +11,7 @@
 class Vtiger_GetData_Action extends Vtiger_IndexAjax_View {
 
 	public function requiresPermission(\Vtiger_Request $request) {
-		$permissions = array('module_parameter' => 'source_module', 'action' => 'DetailView', 'record_parameter' => 'record');
+		$permissions[] = array('module_parameter' => 'source_module', 'action' => 'DetailView', 'record_parameter' => 'record');
 		return $permissions;
 	}
 	
diff --git a/modules/Vtiger/uitypes/Reference.php b/modules/Vtiger/uitypes/Reference.php
index 2769a45538a146f81e2e7e45f613f42c03e5a84f..f18a14085c19550734405e65cebfbee708191dbd 100644
--- a/modules/Vtiger/uitypes/Reference.php
+++ b/modules/Vtiger/uitypes/Reference.php
@@ -68,6 +68,8 @@ class Vtiger_Reference_UIType extends Vtiger_Base_UIType {
 	 * @return link
 	 */
 	public function getEditViewDisplayValue($value) {
+		// file_put_contents("vtesting.log", sprintf("ENTRIES: %s\n", var_export($value, true)), FILE_APPEND);
+		if(!$value) return $value;
 		$referenceModule = $this->getReferenceModule($value);
 		if($referenceModule) {
 			$referenceModuleName = $referenceModule->get('name');